Skip to content

Commit 8f52639

Browse files
committed
Missed edge case in gifted node design #577
1 parent e9bd24e commit 8f52639

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

www/js/model.js

+10-1
Original file line numberDiff line numberDiff line change
@@ -1078,7 +1078,13 @@ define([
10781078
if( (nodeStatus === "correct" && score === 0 && completeness) || (nodeStatus === "correct" && score === 1 && tweaked && completeness))
10791079
nodeStatus = "perfect";
10801080
if(gifted){
1081-
nodeStatus = "gifted-"+nodeStatus;
1081+
//if a gifted node turns out to be not a perfect node, ungift it and let user solve it and regular badges follow
1082+
if(nodeStatus == "perfect"){
1083+
nodeStatus = "gifted-"+nodeStatus;
1084+
}
1085+
else{
1086+
this.unGiftNode(id);
1087+
}
10821088
}
10831089
return nodeStatus;
10841090
},
@@ -1326,6 +1332,9 @@ define([
13261332
isGifted: function(id){
13271333
return this.getNode(id).gifted ? true : false;
13281334
},
1335+
unGiftNode: function(id){
1336+
this.getNode(id).gifted = false;
1337+
},
13291338
getCorrectAnswer : function(/*string*/ studentID, /*string*/ part){
13301339
var id = this.getAuthoredID(studentID);
13311340
var node = obj.authored.getNode(id);

0 commit comments

Comments
 (0)