From 6715fb10a9b2e55ecfafcc4beed32fb9127e91f1 Mon Sep 17 00:00:00 2001 From: Pierre-Olivier Mercier Date: Sun, 3 Feb 2019 21:01:17 +0100 Subject: [PATCH] frontend: public interface: keep number of tries between refresh --- frontend/static/js/challenge.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontend/static/js/challenge.js b/frontend/static/js/challenge.js index 43410daf..2d360b2f 100644 --- a/frontend/static/js/challenge.js +++ b/frontend/static/js/challenge.js @@ -342,6 +342,10 @@ angular.module("FICApp", ["ngRoute", "ngSanitize"]) data.exercices[eid].timeouted = true; if ($scope.my && $scope.my.exercices[eid] && $scope.my.exercices[eid].solved !== undefined) data.exercices[eid].solved = $scope.my.exercices[eid].solved; + if ($scope.my && $scope.my.exercices[eid] && $scope.my.exercices[eid].solved_time !== undefined && data.exercices[eid].solved_time === undefined) + data.exercices[eid].solved_time = $scope.my.exercices[eid].solved_time; + if ($scope.my && $scope.my.exercices[eid] && $scope.my.exercices[eid].tries !== undefined && data.exercices[eid].tries === undefined) + data.exercices[eid].tries = $scope.my.exercices[eid].tries; angular.forEach(exercice.flags, function(flag, fid) { if ($scope.my && $scope.my.exercices[eid] && $scope.my.exercices[eid].flags && $scope.my.exercices[eid].flags[fid] && $scope.my.exercices[eid].flags[fid].found !== undefined) data.exercices[eid].flags[fid].found = $scope.my.exercices[eid].flags[fid].found;