admin: allow import of remote hint and partials remote parts
This commit is contained in:
parent
b8b1f14806
commit
d4177f6228
2 changed files with 42 additions and 15 deletions
|
@ -124,6 +124,7 @@ type uploadedHint struct {
|
|||
Title string
|
||||
Content string
|
||||
Cost int64
|
||||
URI string
|
||||
Path string
|
||||
}
|
||||
|
||||
|
@ -135,8 +136,8 @@ func createExerciceHint(exercice fic.Exercice, body []byte) (interface{}, error)
|
|||
|
||||
if len(uh.Content) != 0 {
|
||||
return exercice.AddHint(uh.Title, uh.Content, uh.Cost)
|
||||
} else if len(uh.Path) != 0 {
|
||||
return importFile(uploadedFile{Path: uh.Path},
|
||||
} else if len(uh.Path) != 0 || len(uh.URI) != 0 {
|
||||
return importFile(uploadedFile{Path: uh.Path, URI: uh.URI},
|
||||
func(filePath string, origin string, digest []byte) (interface{}, error) {
|
||||
return exercice.AddHint(uh.Title, "$FILES" + strings.TrimPrefix(filePath, fic.FilesDir), uh.Cost)
|
||||
})
|
||||
|
|
Reference in a new issue