fic: Use user order to sort exercices in interface

This commit is contained in:
nemunaire 2022-07-11 23:16:08 +02:00
parent c78545c18b
commit 95aadffb2e
1 changed files with 2 additions and 2 deletions

View File

@ -86,7 +86,7 @@ func (t *Theme) GetExerciceByPath(epath string) (*Exercice, error) {
// GetExercices returns the list of all challenges present in the database.
func GetExercices() ([]*Exercice, error) {
if rows, err := DBQuery("SELECT id_exercice, id_theme, title, url_id, path, statement, overview, headline, issue, issue_kind, depend, gain, coefficient_cur, video_uri, resolution, seealso, finished FROM exercices"); err != nil {
if rows, err := DBQuery("SELECT id_exercice, id_theme, title, url_id, path, statement, overview, headline, issue, issue_kind, depend, gain, coefficient_cur, video_uri, resolution, seealso, finished FROM exercices ORDER BY path ASC"); err != nil {
return nil, err
} else {
defer rows.Close()
@ -109,7 +109,7 @@ func GetExercices() ([]*Exercice, error) {
// GetExercices returns the list of all challenges in the Theme.
func (t *Theme) GetExercices() ([]*Exercice, error) {
if rows, err := DBQuery("SELECT id_exercice, id_theme, title, url_id, path, statement, overview, headline, issue, issue_kind, depend, gain, coefficient_cur, video_uri, resolution, seealso, finished FROM exercices WHERE id_theme = ?", t.Id); err != nil {
if rows, err := DBQuery("SELECT id_exercice, id_theme, title, url_id, path, statement, overview, headline, issue, issue_kind, depend, gain, coefficient_cur, video_uri, resolution, seealso, finished FROM exercices WHERE id_theme = ? ORDER BY path ASC", t.Id); err != nil {
return nil, err
} else {
defer rows.Close()