INGInious icon indicating copy to clipboard operation
INGInious copied to clipboard

[frontend/task_edit] Subproblems are not shown in specified order.

Open anthonygego opened this issue 10 months ago • 2 comments

Describe the bug

The problem data dictionary exported to the template here :

https://github.com/UCL-INGI/INGInious/blob/6e14ae8edb65b0ce18059863655659ba9efea129/inginious/frontend/pages/course_admin/task_edit.py#L63

is a Python OrderedDict.

The Javascript JSON load method does not load the keys an an ordered dictionary anymore : https://github.com/UCL-INGI/INGInious/blob/6e14ae8edb65b0ce18059863655659ba9efea129/inginious/frontend/templates/course_admin/task_edit.html#L170

Therefore, the subproblems are shown in an unexpected order in the task edition interface.

INGInious installation details

  • Version: v0.8+

To Reproduce Steps to reproduce the behavior:

  1. Create a task with problem ids "01", "02", ..."10".
  2. The task editor may show "10" before all the others.

Expected behavior Subproblems should be displayed in the order specified in the YAML file.

anthonygego avatar Apr 09 '24 12:04 anthonygego

A workaround is to export the dict as a list (using OrdrerdDict.items()) and adapt the studio_load method for such a data format.

anthonygego avatar Apr 09 '24 12:04 anthonygego

I can't reproduce the bug, plus the project architecture seems to have been modified (but the two highlighted lines haven't been modified), perhaps this has been corrected?

thremilien avatar Aug 20 '24 15:08 thremilien