Skip to content

Fix "List index out of range" for sorted_aligned_effectsΒ #506

@Svenstar74

Description

@Svenstar74

Describe the bug

The problem occurs when I complete the quiz as a userB. It doesn't happen always but very often for me.
The backend responds with a 500 error, which also breaks the frontend, because there are no alignment scores, etc. to display.

When I have the backend running locally, I get the error message, that the list index is out of range for sorted_aligned_effects[2] in line 44 below. If I print the sorted_aligned_effects list, I indeed can see that there are only two entries.

To Reproduce

Here's a video that shows me reproducing it.
Please note, that it also happens for other combinations of answers. Selecting always the first answer is just more reliable for me to get the error.

2023-12-13.21-44-15.mp4

Expected behavior

I would assume that the fix would involve to guarantee that the list always has three items, so that the api call doesn't fail.

Task

  • Investigate why the sorted_aligned_effects sometimes has only two values instead of the expected three?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions