UCL-INGI / INGInious

INGInious is a secure and automated exercises assessment platform using your own tests, also providing a pluggable interface with your existing LMS.
http://www.inginious.org
Other
202 stars 139 forks source link

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

Open anthonygego opened 5 months ago

anthonygego commented 5 months ago

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

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 commented 5 months ago

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

thremilien commented 2 weeks ago

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?