frontend/public: minor fixes

This commit is contained in:
nemunaire 2018-01-26 12:01:05 +01:00
commit 0b2e61faef
2 changed files with 5 additions and 2 deletions

View file

@ -155,7 +155,10 @@ angular.module("FICApp")
$scope.themes = themes;
$scope.max_gain = 0;
angular.forEach(themes, function(theme, key) {
this[key].exercice_count = Object.keys(theme.exercices).length;
if (theme.exercices)
this[key].exercice_count = Object.keys(theme.exercices).length;
else
this[key].exercice_count = 0;
this[key].gain = 0;
angular.forEach(theme.exercices, function(ex, k) {
this.gain += ex.gain;