settings: Save duration in challenge.json
This commit is contained in:
parent
58217d1d8a
commit
123467f3eb
@ -519,6 +519,10 @@ angular.module("FICApp")
|
|||||||
})
|
})
|
||||||
$scope.challenge = SettingsChallenge.get();
|
$scope.challenge = SettingsChallenge.get();
|
||||||
$scope.duration = 360;
|
$scope.duration = 360;
|
||||||
|
$scope.challenge.$promise.then(function(c) {
|
||||||
|
if (c.duration)
|
||||||
|
$scope.duration = c.duration;
|
||||||
|
});
|
||||||
|
|
||||||
$scope.exerciceDependChange = function() {
|
$scope.exerciceDependChange = function() {
|
||||||
if ($scope.config.enableExerciceDepend)
|
if ($scope.config.enableExerciceDepend)
|
||||||
@ -528,6 +532,7 @@ angular.module("FICApp")
|
|||||||
};
|
};
|
||||||
|
|
||||||
$scope.saveChallengeInfo = function() {
|
$scope.saveChallengeInfo = function() {
|
||||||
|
this.challenge.duration = $scope.duration;
|
||||||
this.challenge.$update(function(response) {
|
this.challenge.$update(function(response) {
|
||||||
$scope.addToast('success', 'Infos du challenge mises à jour avec succès !');
|
$scope.addToast('success', 'Infos du challenge mises à jour avec succès !');
|
||||||
}, function(response) {
|
}, function(response) {
|
||||||
|
@ -169,7 +169,7 @@
|
|||||||
<label class="custom-control custom-checkbox">
|
<label class="custom-control custom-checkbox">
|
||||||
<input class="custom-control-input" type="checkbox" ng-model="config.enableExerciceDepend" ng-change="exerciceDependChange()">
|
<input class="custom-control-input" type="checkbox" ng-model="config.enableExerciceDepend" ng-change="exerciceDependChange()">
|
||||||
<span class="custom-control-label">Activer les dépendances des exercices</span>
|
<span class="custom-control-label">Activer les dépendances des exercices</span>
|
||||||
<input type="number" class="form-control form-control-sm" id="duration" ng-model="config.unlockedChallengeDepth" ng-disabled="!config.enableExerciceDepend" title="-1 : Désactivé ; 0: activé ; 1,2,3 : débloque 1,2,3,... exercices supplémentaires après un challenge validé" min="0" integer>
|
<input type="number" class="form-control form-control-sm" ng-model="config.unlockedChallengeDepth" ng-disabled="!config.enableExerciceDepend" title="-1 : Désactivé ; 0: activé ; 1,2,3 : débloque 1,2,3,... exercices supplémentaires après un challenge validé" min="0" integer>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -17,6 +17,8 @@ type ChallengeInfo struct {
|
|||||||
SubTitle string `json:"subtitle"`
|
SubTitle string `json:"subtitle"`
|
||||||
// Authors is the group name of people making the challenge.
|
// Authors is the group name of people making the challenge.
|
||||||
Authors string `json:"authors"`
|
Authors string `json:"authors"`
|
||||||
|
// ExpectedDuration is the duration (in minutes) suggested when stating the challenge.
|
||||||
|
ExpectedDuration uint `json:"duration"`
|
||||||
// VideoLink is the link to explaination videos when the challenge is over.
|
// VideoLink is the link to explaination videos when the challenge is over.
|
||||||
VideosLink string `json:"videoslink"`
|
VideosLink string `json:"videoslink"`
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user