diff --git a/admin/api/exercice.go b/admin/api/exercice.go index 2a1fb275..a1ab5153 100644 --- a/admin/api/exercice.go +++ b/admin/api/exercice.go @@ -332,7 +332,15 @@ func updateExerciceFlag(flag fic.FlagKey, exercice fic.Exercice, body []byte) (i flag.Help = uk.Help flag.IgnoreCase = uk.IgnoreCase - flag.Checksum = uk.Value + if len(uk.Flag) > 0 { + var err error + flag.Checksum, err = flag.ComputeChecksum([]byte(uk.Flag)) + if err != nil { + return nil, err + } + } else { + flag.Checksum = uk.Value + } flag.ChoicesCost = uk.ChoicesCost if uk.ValidatorRe != nil && len(*uk.ValidatorRe) > 0 { diff --git a/admin/static/js/app.js b/admin/static/js/app.js index f9d06cc5..61967cae 100644 --- a/admin/static/js/app.js +++ b/admin/static/js/app.js @@ -1341,6 +1341,10 @@ angular.module("FICApp") .controller("ExerciceFlagsController", function($scope, ExerciceFlag, $routeParams, $rootScope, $http) { $scope.flags = ExerciceFlag.query({ exerciceId: $routeParams.exerciceId }); + $scope.changeValue = function(flag) { + flag.value = undefined; + flag.show_raw = true; + } $scope.addFlag = function() { $scope.flags.push(new ExerciceFlag()); } diff --git a/admin/static/views/exercice.html b/admin/static/views/exercice.html index e9438d29..ae4fd3c8 100644 --- a/admin/static/views/exercice.html +++ b/admin/static/views/exercice.html @@ -126,8 +126,13 @@