admin: add button to move to previous and next exercice

This commit is contained in:
nemunaire 2018-12-09 19:06:29 +01:00
parent aa3750bb68
commit 99ef5046db
2 changed files with 20 additions and 0 deletions

View file

@ -1055,6 +1055,21 @@ angular.module("FICApp")
} else {
$scope.exercice = Exercice.get({ exerciceId: $routeParams.exerciceId });
}
$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;
});
});
$scope.exercices = Exercice.query();
$scope.fields = ["title", "urlid", "statement", "headline", "overview", "finished", "depend", "gain", "coefficient", "videoURI", "issue", "issuekind"];