frontend: allow two defi in 2 differents themes to have the same name

This commit is contained in:
nemunaire 2018-12-05 15:22:35 +01:00
commit 3f9e5f887a

View file

@ -111,7 +111,7 @@ angular.module("FICApp", ["ngRoute", "ngSanitize"])
this[key].gain = 0;
this[key].solved = 0;
angular.forEach(theme.exercices, function(ex, k) {
$scope.exercicesUrl[ex.urlid] = k;
$scope.exercicesUrl[theme.urlid + "/" + ex.urlid] = k;
this.gain += ex.gain;
this.solved += ex.solved;
this.exercice_coeff_max = Math.max(this.exercice_coeff_max, ex.curcoeff);
@ -234,7 +234,7 @@ angular.module("FICApp", ["ngRoute", "ngSanitize"])
if ($routeParams.exercice) {
$scope.$watch("exercicesUrl", function(exercicesUrl) {
if (exercicesUrl != undefined)
$rootScope.current_exercice = exercicesUrl[$routeParams.exercice];
$rootScope.current_exercice = exercicesUrl[$routeParams.theme + "/" + $routeParams.exercice];
})
} else {
$rootScope.current_exercice = 0;