Add new helper string related to justified MCQ flag
This commit is contained in:
parent
11e0b46034
commit
c5b65289d3
10 changed files with 122 additions and 70 deletions
|
@ -233,18 +233,20 @@ angular.module("FICApp", ["ngRoute", "ngSanitize"])
|
|||
angular.forEach(data.exercices, function(exercice, eid) {
|
||||
angular.forEach(exercice.mcqs, function(mcq, mid) {
|
||||
angular.forEach(mcq.choices, function(choice, cid) {
|
||||
this[cid] = {
|
||||
label: choice,
|
||||
value: mcq["checks_solved"] !== undefined && mcq["checks_solved"][cid] !== undefined && mcq["checks_solved"][cid] > 0
|
||||
};
|
||||
if (mcq["checks_solved"] !== undefined) {
|
||||
this[cid].disabled = mcq["checks_solved"][cid] === undefined || mcq["checks_solved"][cid] >= 0;
|
||||
this[cid].solved = mcq["checks_solved"][cid] !== undefined && mcq["checks_solved"][cid] >= 2;
|
||||
}
|
||||
if (!(choice instanceof Object))
|
||||
this[cid] = {
|
||||
label: choice,
|
||||
};
|
||||
|
||||
this[cid].disabled = mcq.solved || mcq.part_solved || this[cid].solved;
|
||||
|
||||
if (!this[cid].help)
|
||||
this[cid].help = "Flag correspondant";
|
||||
|
||||
if (!this[cid].disabled)
|
||||
this[cid].value = $scope.my && $scope.my.exercices[eid] && $scope.my.exercices[eid].mcqs[mid] && $scope.my.exercices[eid].mcqs[mid].choices[cid] && $scope.my.exercices[eid].mcqs[mid].choices[cid].value
|
||||
|
||||
if ($scope.my && $scope.my.exercices[eid] && $scope.my.exercices[eid].mcqs[mid] && $scope.my.exercices[eid].mcqs[mid].choices[cid]) {
|
||||
if ($scope.my.exercices[eid].mcqs[mid].choices[cid].value !== undefined)
|
||||
this[cid].value = $scope.my.exercices[eid].mcqs[mid].choices[cid].value;
|
||||
if ($scope.my.exercices[eid].mcqs[mid].choices[cid].justify !== undefined)
|
||||
this[cid].justify = $scope.my.exercices[eid].mcqs[mid].choices[cid].justify;
|
||||
}
|
||||
|
|
Reference in a new issue