Skip to content

Commit

Permalink
#20
Browse files Browse the repository at this point in the history
  • Loading branch information
moacirmoda committed Sep 5, 2016
1 parent 034f63b commit 020d946
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
<div ng-show="!changed && answer.correct" class="alert alert-success">
<i class="fa fa-smile-o"></i><span translate> Sua resposta está <strong>correta!</strong></span>
</div>
<div ng-show="!changed && answer.correct === false" class="alert alert-danger">
<div ng-show="!changed && answer.incomplete" class="alert alert-danger">
<i class="fa fa-frown-o"></i> <span translate>Sua resposta está <strong>incompleta</strong>.</span>
</div>
<div ng-show="!changed && answer.correct === false && !answer.incomplete" class="alert alert-danger">
<i class="fa fa-frown-o"></i> <span translate>Sua resposta está <strong>incorreta</strong>. Reveja o vídeo com mais atenção e tente novamente.</span>
</div>
<div ng-show="changed" class="alert">&nbsp;</div>
Expand Down
11 changes: 11 additions & 0 deletions core/static/js/lesson/controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,17 @@
ga('send', 'event', 'activity', 'result', '', answer.correct);
$scope.currentUnit.progress = Progress.get({unit: $scope.currentUnit.id});
answer.updated = true;

// checks if there empty answers in array
if($scope.currentActivity.type === 'trueorfalse') {
for(var item in $scope.answer.given) {
if($scope.answer.given[item] === null) {
$scope.answer.incomplete = true;
return $scope.answer;
}
}
}

return answer;
});
ga('send', 'event', 'activity', 'submit');
Expand Down

0 comments on commit 020d946

Please sign in to comment.