sync: Allow free hint
This commit is contained in:
parent
43be59b97d
commit
57d351c6c1
@ -12,7 +12,7 @@ import (
|
|||||||
type ExerciceHintParams struct {
|
type ExerciceHintParams struct {
|
||||||
Filename string
|
Filename string
|
||||||
Content string
|
Content string
|
||||||
Cost int64
|
Cost *int64
|
||||||
Title string
|
Title string
|
||||||
NeedFlag []ExerciceDependency `toml:"need_flag,omitempty"`
|
NeedFlag []ExerciceDependency `toml:"need_flag,omitempty"`
|
||||||
}
|
}
|
||||||
|
@ -36,10 +36,10 @@ func buildExerciceHints(i Importer, exercice fic.Exercice) (hints []importHint,
|
|||||||
} else {
|
} else {
|
||||||
h.Title = fixnbsp(hint.Title)
|
h.Title = fixnbsp(hint.Title)
|
||||||
}
|
}
|
||||||
if hint.Cost <= 0 {
|
if hint.Cost == nil {
|
||||||
h.Cost = exercice.Gain / 4
|
h.Cost = exercice.Gain / 4
|
||||||
} else {
|
} else {
|
||||||
h.Cost = hint.Cost
|
h.Cost = *hint.Cost
|
||||||
}
|
}
|
||||||
|
|
||||||
if hint.Filename != "" {
|
if hint.Filename != "" {
|
||||||
|
Loading…
Reference in New Issue
Block a user