Skip to content

Feature/generate dev question responses#214

Merged
XanderVertegaal merged 9 commits intodevelopfrom
feature/generate-dev-question-responses
Apr 20, 2026
Merged

Feature/generate dev question responses#214
XanderVertegaal merged 9 commits intodevelopfrom
feature/generate-dev-question-responses

Conversation

@XanderVertegaal
Copy link
Copy Markdown
Contributor

@XanderVertegaal XanderVertegaal commented Mar 31, 2026

Closes #194

As discussed a few weeks ago, this adjusts the create_dev_dataset.py script. If create_dev_dataset is run without any flags, it will generate a random form with random steps and random questions. If you run create_dev_dataset --vwr, on the other hand, this will load the existing processing registry fixtures instead.

Regardless, the script will then take the generated form (random or procreg) and create 1-4 random studies and 1 submission for each study for each user in the database. This takes a while (2:20 mins when I ran it), which is why I opted for not generating more than 1 submission per study. We can perhaps make this a bit more performant in the future, but for now this will do.

@XanderVertegaal XanderVertegaal linked an issue Apr 1, 2026 that may be closed by this pull request
@XanderVertegaal XanderVertegaal marked this pull request as ready for review April 13, 2026 08:35
Copy link
Copy Markdown
Contributor

@EdoStorm96 EdoStorm96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Besides merge conflicts, this all seems to be working well. Nice!

This did lead me to discover (as I've discussed with you) that a fully loaded USF cannot (with my patience) be loaded in the admin interface due to the heaviness of loading all the QuestionResponseInline's for one USF ... If you would fix that in this PR, it would be nice, but it is not really related to this, so it is not a must for me.

I would appreciate if you could bring this up to date with develop, so I can see the generated responses in action. Would you notify me when you've done this so I can have a quick last look?

@XanderVertegaal
Copy link
Copy Markdown
Contributor Author

I would appreciate if you could bring this up to date with develop, so I can see the generated responses in action. Would you notify me when you've done this so I can have a quick last look?

Done! I have added a bit of prefetching to make the query fetching the UFS more performant. Now the Django Admin page loads within seconds. Have a look!

Copy link
Copy Markdown
Contributor

@EdoStorm96 EdoStorm96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, crazy how much time this saves! Nice one.

Comment thread backend/main/management/commands/create_dev_data.py Outdated
Thanks to @EdoStorm96!

Co-authored-by: Edo Storm <111129464+EdoStorm96@users.noreply.github.com>
@XanderVertegaal XanderVertegaal merged commit bc53ff2 into develop Apr 20, 2026
4 checks passed
@XanderVertegaal XanderVertegaal deleted the feature/generate-dev-question-responses branch April 20, 2026 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mock UserFormSubmission data

2 participants