diff --git a/backend/main.go b/backend/main.go index 76caea84..44e44ee2 100644 --- a/backend/main.go +++ b/backend/main.go @@ -47,6 +47,7 @@ func main() { flag.StringVar(&TeamsDir, "teams", "../TEAMS", "Base directory where save teams JSON files") flag.StringVar(&fic.FilesDir, "files", "/files", "Request path prefix to reach files") var skipFullGeneration = flag.Bool("skipFullGeneration", false, "Skip initial full generation (safe to skip after start)") + flag.BoolVar(&fic.PartialValidation, "partialValidation", false, "Validates flags which are corrects, don't be binary") flag.BoolVar(&fic.UnlockedChallenges, "unlockedChallenges", false, "Make all challenges accessible without having to validate previous level") flag.Parse() diff --git a/frontend/static/js/app.js b/frontend/static/js/app.js index 21f8aee3..bdee2f12 100644 --- a/frontend/static/js/app.js +++ b/frontend/static/js/app.js @@ -197,7 +197,7 @@ angular.module("FICApp") }) .controller("SubmissionController", function($scope, $http, $rootScope, $timeout) { - $scope.flags = [] + $scope.flags = []; $rootScope.sberr = ""; var waitMy = function() { @@ -205,12 +205,16 @@ angular.module("FICApp") $timeout.cancel($scope.cbs); $scope.cbs = $timeout(waitMy, 420); } else { + $scope.flags = []; angular.forEach($scope.my.exercices[$rootScope.current_exercice].keys, function(key,kid) { - this.push({ + var o = { id: kid, name: key, value: "" - }); + }; + if ($scope.my.exercices[$rootScope.current_exercice].solved_matrix != null) + o.found = $scope.my.exercices[$rootScope.current_exercice].solved_matrix[kid]; + this.push(o); }, $scope.flags); } } @@ -219,23 +223,10 @@ angular.module("FICApp") $scope.ssubmit = function() { var flgs = {} - var filled = true; angular.forEach($scope.flags, function(flag,kid) { flgs[flag.name] = flag.value; - filled = filled && flag.value.length > 0; }); - if (!filled) { - $rootScope.messageClass = {"text-danger": true}; - $rootScope.sberr = "Tous les champs sont obligatoires."; - $timeout(function() { - if ($rootScope.sberr == "Tous les champs sont obligatoires.") { - $rootScope.sberr = ""; - } - }, 2345); - return; - } - $http({ url: "/submit/" + $rootScope.current_exercice, method: "POST", diff --git a/frontend/static/views/theme.html b/frontend/static/views/theme.html index 8dc8074b..e2bbec27 100644 --- a/frontend/static/views/theme.html +++ b/frontend/static/views/theme.html @@ -52,9 +52,10 @@