Skip to content

Commit

Permalink
Changed 'answer' property of AnswerItem model to 'answered'
Browse files Browse the repository at this point in the history
  • Loading branch information
labibramadhan committed Jan 28, 2017
1 parent 34a9be5 commit 2bca9b3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions app/components/controllers/grade/answer/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,21 +95,21 @@ angular.module('app')
let answer = _.find(vm.answer.answerItems, {
question_id: cell.id
});
if (answer.answer === null || answer.answer === '') {
if (answer.answered === null || answer.answered === '') {
return;
}
let directions = [];
switch (type) {
case 'down':
directions = _.range(cell.startRow, cell.endRow + 1);
_.each(directions, (d, idx) => {
vm.values[d][cell.startCol] = answer.answer[idx];
vm.values[d][cell.startCol] = answer.answered[idx];
});
break;
case 'across':
directions = _.range(cell.startCol, cell.endCol + 1);
_.each(directions, (d, idx) => {
vm.values[cell.startRow][d] = answer.answer[idx];
vm.values[cell.startRow][d] = answer.answered[idx];
});
break;
}
Expand All @@ -124,7 +124,7 @@ angular.module('app')
let answer = _.find(vm.answer.answerItems, {
question_id: cell.id
});
if (!answer.answer) {
if (!answer.answered) {
return -1;
}
return answer.remark;
Expand All @@ -137,7 +137,7 @@ angular.module('app')
if (_.isUndefined(answer) || !answer) {
return false;
}
return answer.answer === cell.word;
return answer.answered === cell.word;
};
},
]);
10 changes: 5 additions & 5 deletions app/components/controllers/test/finish.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,21 +88,21 @@ angular.module('app')
let answer = _.find(vm.answer.answerItems, {
question_id: cell.id
});
if (answer.answer === null || answer.answer === '') {
if (answer.answered === null || answer.answered === '') {
return;
}
let directions = [];
switch (type) {
case 'down':
directions = _.range(cell.startRow, cell.endRow + 1);
_.each(directions, (d, idx) => {
vm.values[d][cell.startCol] = answer.answer[idx];
vm.values[d][cell.startCol] = answer.answered[idx];
});
break;
case 'across':
directions = _.range(cell.startCol, cell.endCol + 1);
_.each(directions, (d, idx) => {
vm.values[cell.startRow][d] = answer.answer[idx];
vm.values[cell.startRow][d] = answer.answered[idx];
});
break;
}
Expand All @@ -117,7 +117,7 @@ angular.module('app')
let answer = _.find(vm.answer.answerItems, {
question_id: cell.id
});
if (!answer.answer) {
if (!answer.answered) {
return -1;
}
return answer.remark;
Expand All @@ -130,7 +130,7 @@ angular.module('app')
if (!_.get(answer)) {
return false;
}
return answer.answer === cell.word;
return answer.answered === cell.word;
};
},
]);

0 comments on commit 2bca9b3

Please sign in to comment.