Add new helper string related to justified MCQ flag

This commit is contained in:
nemunaire 2018-12-02 04:52:15 +01:00
commit c5b65289d3
10 changed files with 121 additions and 69 deletions

View file

@ -1,6 +1,7 @@
package fic
import (
"fmt"
"time"
)
@ -175,8 +176,8 @@ func (e Exercice) WipeMCQs() (int64, error) {
}
// GetJustifiedFlag searchs for a flag in the scope of the given exercice.
func (m MCQ) GetJustifiedFlag(e Exercice, c MCQ_entry) (Flag, error) {
return e.GetFlagByLabel("%" + m.Title + "%" + c.Label)
func (c MCQ_entry) GetJustifiedFlag(e Exercice) (Flag, error) {
return e.GetFlagByLabel(fmt.Sprintf("\\%%%d\\%%%%", c.Id))
}
// Check if the given vals are the expected ones to validate this flag.