From 3f9e5f887ad9cd1dc34551755e5619f63090f867 Mon Sep 17 00:00:00 2001 From: Pierre-Olivier Mercier Date: Wed, 5 Dec 2018 15:22:35 +0100 Subject: [PATCH] frontend: allow two defi in 2 differents themes to have the same name --- frontend/static/js/challenge.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/static/js/challenge.js b/frontend/static/js/challenge.js index 8c2b7bb3..7a670ddb 100644 --- a/frontend/static/js/challenge.js +++ b/frontend/static/js/challenge.js @@ -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;