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

Add group_work_allowed boolean to CourseInstance to avoid expensive l… #1368

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

sayravai
Copy link
Contributor

…ookup on every page load

Fixes #1367

Description

What?

This PR replaces the automated logic for showing/hiding the "Form a group" menu item with a manual boolean setting, which is set at the course instance level. Note, that this PR requires a migration.

Why?

The previous implementation created way too many queries for each page load just to decide whether to show a menu item or not. The result should at least be cached if a manual setting is considered too much work for the course staff.

How?

A new boolean property group_work_allowed is added into the CourseInstance class. This is referenced in the course/templates/course/_course_menu.html template instead of checking whether the instance_max_group_size method returns a value greater than one.

Fixes #1367

This PR should be completed by adding checks to set the new boolean according to whether there are group-allowing assignments when data is imported via gitmanager. Also disabling the boolean could be prevented when an existing course has group-allowing assignments. User documentation would also need to be updated to include the new setting.

Testing

Remember to add or update unit tests for new features and changes.

What type of test did you run?

  • Accessibility test using the WAVE extension.
  • Django unit tests.
  • Selenium tests.
  • Other test. (Add a description below)
  • Manual testing.

Tested changing the "Students can form groups" setting in Edit course -> Course, and that the "Form a group" appears/disappears when clicking Save. Checked cloning the course instance, and that the setting from source instance persists.

Did you test the changes in

  • Chrome
  • Firefox
  • This pull request cannot be tested in the browser.

Think of what is affected by these changes and could become broken

Translation

Programming style

  • Did you follow our style guides?
  • Did you use Python type hinting in all functions that you added or edited? (type hints for function parameters and return values)

Have you updated the README or other relevant documentation?

  • documents inside the doc directory.
  • README.md.
  • Aplus Manual.
  • Other documentation (mention below which documentation).

Is it Done?

  • Reviewer has finished the code review
  • After the review, the developer has made changes accordingly
  • Customer/Teacher has accepted the implementation of the feature

Clean up your git commit history before submitting the pull request!

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

Successfully merging this pull request may close these issues.

Inefficient way of checking whether the "Form a group" menu item should be shown or not.
1 participant