libfic: new function to retrieve exercices from a hint
This commit is contained in:
parent
cc1e7f9e7a
commit
96c93e3d1a
@ -84,3 +84,12 @@ func (h EHint) Delete() (int64, error) {
|
|||||||
return nb, err
|
return nb, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (h EHint) GetExercice() (Exercice, error) {
|
||||||
|
var eid int64
|
||||||
|
if err := DBQueryRow("SELECT id_exercice FROM exercice_hints WHERE id_hint = ?", h.Id).Scan(&eid); err != nil {
|
||||||
|
return Exercice{}, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return GetExercice(eid)
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user