Implement label only flag
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
b98e23d060
commit
01b05aaed0
9 changed files with 311 additions and 11 deletions
|
@ -312,7 +312,10 @@ func (t *Team) GetSolvedRank(e *Exercice) (nb int64, err error) {
|
|||
|
||||
// HasPartiallySolved checks if the Team already has unlocked the given flag and returns the validation's timestamp.
|
||||
func (t *Team) HasPartiallySolved(f Flag) (tm *time.Time) {
|
||||
if k, ok := f.(*FlagKey); ok {
|
||||
if _, ok := f.(*FlagLabel); ok {
|
||||
now := time.Now()
|
||||
return &now
|
||||
} else if k, ok := f.(*FlagKey); ok {
|
||||
DBQueryRow("SELECT MIN(time) FROM flag_found WHERE id_team = ? AND id_flag = ?", t.Id, k.Id).Scan(&tm)
|
||||
} else if m, ok := f.(*MCQ); ok {
|
||||
DBQueryRow("SELECT MIN(time) FROM mcq_found WHERE id_team = ? AND id_mcq = ?", t.Id, m.Id).Scan(&tm)
|
||||
|
|
Reference in a new issue