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

Remove empty sections from quizzes on publish #12252

Merged
merged 4 commits into from
Jun 6, 2024

Conversation

rtibbles
Copy link
Member

@rtibbles rtibbles commented Jun 6, 2024

Summary

  • When saving a syncable exam, automatically remove any empty sections, in the save method.
  • Move question_count setting to the save method of the AbstractExam model rather than in the serializer to ensure consistency (this was apparent when I edited question_sources in a test, but the question_count didn't update)
  • Leave the data model version on the data passed to the frontend in the class summary API so that it can be used by the frontend
  • Add a warning to users in the start quiz confirmation modal that empty sections will be deleted.

References

Fixes #12217

Reviewer guidance

  1. Create a quiz, add some questions to one section, then create some blank sections.
  2. Save the quiz.
  3. Go back to edit it, and see that the empty sections are still there.
  4. Start the quiz
  5. See that the quiz only has one section after starting the quiz (this part might be trickier)

Testing checklist

  • Contributor has fully tested the PR manually
  • If there are any front-end changes, before/after screenshots are included
  • Critical user journeys are covered by Gherkin stories
  • Critical and brittle code paths are covered by unit tests

PR process

  • PR has the correct target branch and milestone
  • PR has 'needs review' or 'work-in-progress' label
  • If PR is ready for review, a reviewer has been added. (Don't use 'Assignees')
  • If this is an important user-facing change, PR or related issue has a 'changelog' label
  • If this includes an internal dependency change, a link to the diff is provided

Reviewer checklist

  • Automated test coverage is satisfactory
  • PR is fully functional
  • PR has been tested for accessibility regressions
  • External dependency files were updated if necessary (yarn and pip)
  • Documentation is updated
  • Contributor is in AUTHORS.md

@rtibbles rtibbles added the TODO: needs review Waiting for review label Jun 6, 2024
@github-actions github-actions bot added DEV: backend Python, databases, networking, filesystem... APP: Coach Re: Coach App (lessons, quizzes, groups, reports, etc.) DEV: frontend SIZE: medium labels Jun 6, 2024
@rtibbles rtibbles force-pushed the empty_sectionals branch from ba90494 to d0bd34a Compare June 6, 2024 14:40
@nucleogenesis nucleogenesis self-assigned this Jun 6, 2024
Copy link
Member

@nucleogenesis nucleogenesis left a comment

Choose a reason for hiding this comment

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

Chatted through on screenshare, all questions answered and the code & tests LGTM

@rtibbles rtibbles merged commit 470c490 into learningequality:develop Jun 6, 2024
31 checks passed
@rtibbles rtibbles deleted the empty_sectionals branch June 6, 2024 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
APP: Coach Re: Coach App (lessons, quizzes, groups, reports, etc.) DEV: backend Python, databases, networking, filesystem... DEV: frontend SIZE: medium TODO: needs review Waiting for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

EQM: Remove empty sections when publishing quiz
2 participants