admin: Fix move between exercices

This commit is contained in:
nemunaire 2023-04-04 01:49:38 +02:00
parent a585a6338e
commit 6bd23ee9f0
4 changed files with 16 additions and 18 deletions

View file

@ -1696,20 +1696,18 @@ angular.module("FICApp")
} else {
$scope.exercice = Exercice.get({ exerciceId: $routeParams.exerciceId });
}
$scope.my_ex_num = {};
$http({
url: "api/themes.json",
method: "GET"
}).then(function(response) {
$scope.themes = response.data
var last_exercice = null;
angular.forEach($scope.themes[$scope.exercice.id_theme].exercices, function(exercice, k) {
if (last_exercice != null) {
$scope.themes[$scope.exercice.id_theme].exercices[last_exercice].next = k;
exercice.previous = last_exercice;
}
last_exercice = k;
exercice.id = k;
});
for (var k in $scope.themes[$scope.exercice.id_theme].exercices) {
var exercice = $scope.themes[$scope.exercice.id_theme].exercices[k];
$scope.my_ex_num[exercice.id] = k;
}
});
$scope.exercices = Exercice.query();
$scope.fields = ["title", "urlid", "disabled", "statement", "headline", "overview", "finished", "depend", "gain", "coefficient", "videoURI", "resolution", "issue", "issuekind", "wip"];