Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
anthonygego opened this issue Apr 9, 2024 · 2 comments
Open

Comments

@anthonygego
Copy link
Member

Describe the bug

The problem data dictionary exported to the template here :

problemdata=json.dumps(task_data.get('problems', {})),

is a Python OrderedDict.

The Javascript JSON load method does not load the keys an an ordered dictionary anymore :

$(function(){ studio_load(JSON.parse(problem_data)); });

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
Copy link
Member Author

anthonygego commented Apr 9, 2024

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
Copy link
Contributor

thremilien commented Aug 20, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants