Skip to content

Random order of variables on every generation of the public version of a question #9

Open
@akshatpoddar

Description

@akshatpoddar

On running the process_question_md() function to generate a markdown file for the public version, the order in which the variables appear in the md file are always random. This is only happening with **symbolic questions. (questions 7a and 7b)

This causes an issue in testing since we compare the two files: the previously generated one and the currently generated one, and do not want to disregard this order in which variables appear.

We thought this is probably because the function is converting a dictionary to a YAML dump, and the order of dictionaries is not the same each time. But we tested this in a meeting with a dummy dictionary and this did not seem to be the problem. The dictionaries in Python 3.7 and above are also apparently always ordered, so that cannot be the problem.

Tests that fail due to this:
test_public()

Screenshot of the generated markdown where the order of variables is random:

Screenshot 2021-07-22 at 11 11 48 AM

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions