Compare commits
No commits in common. "08afde34a87f00f69bdccb0e6760231109ea20a8" and "4973f7ac4ab1966fe18c9f480e1a03d09f6026f9" have entirely different histories.
08afde34a8
...
4973f7ac4a
5 changed files with 9 additions and 19 deletions
|
@ -8,6 +8,7 @@ import (
|
|||
"net/http"
|
||||
"os"
|
||||
"path"
|
||||
"strings"
|
||||
"text/template"
|
||||
"unicode"
|
||||
|
||||
|
@ -241,7 +242,7 @@ func genDexConfig() ([]byte, error) {
|
|||
|
||||
logoPath := ""
|
||||
if len(challengeInfo.MainLogo) > 0 {
|
||||
logoPath = path.Join("../../files", "logo", path.Base(challengeInfo.MainLogo[len(challengeInfo.MainLogo)-1]))
|
||||
logoPath = strings.Replace(challengeInfo.MainLogo[len(challengeInfo.MainLogo)-1], "$FILES$", fic.FilesDir, -1)
|
||||
}
|
||||
|
||||
dexTmpl, err := template.New("dexcfg").Parse(dexcfgtpl)
|
||||
|
@ -285,11 +286,6 @@ func genDexConfig() ([]byte, error) {
|
|||
}
|
||||
|
||||
func genDexPasswordTpl() ([]byte, error) {
|
||||
challengeInfo, err := GetChallengeInfo()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Cannot create template: %w", err)
|
||||
}
|
||||
|
||||
if teams, err := fic.GetTeams(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
|
@ -299,7 +295,6 @@ func genDexPasswordTpl() ([]byte, error) {
|
|||
return nil, fmt.Errorf("Cannot create template: %w", err)
|
||||
} else if err = dexTmpl.Execute(b, dexConfig{
|
||||
Teams: teams,
|
||||
Name: challengeInfo.Title,
|
||||
}); err != nil {
|
||||
return nil, fmt.Errorf("An error occurs during template execution: %w", err)
|
||||
} else {
|
||||
|
|
|
@ -958,13 +958,12 @@ angular.module("FICApp")
|
|||
})
|
||||
|
||||
.controller("OAuthController", function ($scope, $http) {
|
||||
$scope.oauth_status = {};
|
||||
$scope.refreshOAuthStatus = function () {
|
||||
$http.get("api/oauth-status").then(function (res) {
|
||||
$scope.oauth_status = res.data;
|
||||
$scope.oauth_status = response.data;
|
||||
});
|
||||
|
||||
};
|
||||
$scope.refreshOAuthStatus();
|
||||
|
||||
$scope.genDexCfg = function () {
|
||||
$http.post("api/dex.yaml").then(function () {
|
||||
|
|
|
@ -58,6 +58,7 @@
|
|||
</button>
|
||||
<div class="dropdown-menu" ng-controller="ThemesListController" style="max-height: 45vh; overflow: auto">
|
||||
<a class="dropdown-item" ng-click="deepSync(theme)" ng-repeat="theme in themes" ng-bind="theme.name"></a>
|
||||
<a class="dropdown-item" ng-click="deepSync({name: 'Exercices indépendants', id: 0})">Exercices indépendants</a>
|
||||
</div>
|
||||
</div>
|
||||
<button type="button" class="btn btn-secondary" ng-click="speedyDeepSync()" ng-disabled="deepSyncInProgress"><span class="glyphicon glyphicon-import" aria-hidden="true"></span> Synchronisation sans fichiers</button>
|
||||
|
|
|
@ -363,7 +363,7 @@ func SyncExerciceFiles(i Importer, exercice *fic.Exercice, exceptions *CheckExce
|
|||
|
||||
var f interface{}
|
||||
|
||||
if pf, exists := paramsFiles[fname]; exists && pf.URL != "" && !i.Exists(path.Join(exercice.Path, "files", fname)) {
|
||||
if pf, exists := paramsFiles[fname]; exists && pf.URL != "" {
|
||||
dest := GetDestinationFilePath(pf.URL, &pf.Filename)
|
||||
|
||||
if _, err := os.Stat(dest); !os.IsNotExist(err) {
|
||||
|
|
|
@ -39,21 +39,16 @@
|
|||
|
||||
submissions.update((u) => {
|
||||
for (const k in last_submission.flags) {
|
||||
if (last_submission.flags[k])
|
||||
u.flags[k] = last_submission.flags[k];
|
||||
u.flags[k] = last_submission.flags[k];
|
||||
}
|
||||
|
||||
for (const k in last_submission.mcqs) {
|
||||
if (last_submission.mcqs[k])
|
||||
u.mcqs[k] = last_submission.mcqs[k];
|
||||
u.mcqs[k] = last_submission.mcqs[k];
|
||||
}
|
||||
|
||||
for (const k in last_submission.justifications) {
|
||||
if (last_submission.justifications[k])
|
||||
u.justifications[k] = last_submission.justifications[k];
|
||||
u.justifications[k] = last_submission.justifications[k];
|
||||
}
|
||||
|
||||
return u;
|
||||
})
|
||||
|
||||
if ($my && $my.team_id === 0) {
|
||||
|
|
Reference in a new issue