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

Assessment groups improvements #2120

Merged
merged 18 commits into from
Mar 29, 2024
Merged

Assessment groups improvements #2120

merged 18 commits into from
Mar 29, 2024

Conversation

damianhxy
Copy link
Member

@damianhxy damianhxy commented Mar 16, 2024

Description

  1. Add missing breadcrumbs for groups (index, new, show)
  2. Replace links with path helpers where possible
  3. Remove deadcode re: @grouplessCUDs which is never shown on show or new pages
  4. For convenience, don't add instructor/CA to group when they create one (if self-assignment is disabled)
  5. Groups clear their members upon destruction
  6. Allow (only) instructors to boot students, i.e. even if they're already confirmed
  7. Disband groups if the only members left are those that require group confirmation
  8. UX improvements
  • Don't show "haven't confirmed group membership" message to instructors
  • Show names in addition to emails
  • Helper text to inform students when group is at max size or student assignment is not allowed
  • Flash when disbanding groups
  • Hide inapplicable UI elements (e.g. when student assignment is not allowed)
  • Improve explanation of behavior
  1. Allow students to leave group while waiting for group approval (this is the one that resolves Unable to leave group while a request is pending #2115)
  2. Allow members to "add themselves" - essentially no effect for students, but useful for instructors who might want to add themselves to groups

Motivation and Context

Closes #2115

How Has This Been Tested?

Create assessment with group size 3 and student self-assignment enabled

  • As student1, create a group with student2
  • As student3, request to join the group
  • (important) student3 can choose to leave the group
  • As student1, cancel invite to student2 and then leave the group. Group will be disbanded.
  • Verify that student3 is now without a group
  • As student1, create a new group with student2
  • As instructor, kick student1 - group not disbanded
  • As instructor, kick student2 - group disbanded

Create assessment with group size 3 and student self-assignment disabled

  • As student1, see message that you can't create or join groups
  • As instructor, create group with student1- observe that student1 is automatically confirmed and instructor is not added
  • As instructor, add yourself to the group successfully. Then kick yourself.
  • As student1 view group and see message that you can't add members to the group.

In general, test that behavior makes sense.

Screenshots

Instructor (in group), student-assignment allowed / not allowed

Note: when student-assignment allowed, need to self-approve. If not allowed, automatically approved.
Screenshot 2024-03-18 at 19 32 51

Instructor (not in group), student-assignment allowed / not allowed

Screenshot 2024-03-18 at 19 31 31

Confirmed student, student-assignment allowed

Screenshot 2024-03-18 at 19 29 26

Confirmed student, student-assignment not allowed

Screenshot 2024-03-18 at 19 29 33

Group-confirmed student, student-assignment allowed

Screenshot 2024-03-18 at 19 30 40

Group-confirmed student, student-assignment not allowed

Screenshot 2024-03-18 at 19 30 46

Member-confirmed student, student-assignment allowed

Screenshot 2024-03-18 at 19 31 08

Member-confirmed student, student-assignment not allowed

Screenshot 2024-03-18 at 19 31 15

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have run rubocop and erblint for style check. If you haven't, run overcommit --install && overcommit --sign to use pre-commit hook for linting
  • My change requires a change to the documentation, which is located at Autolab Docs
  • I have updated the documentation accordingly, included in this PR

@damianhxy damianhxy marked this pull request as ready for review March 16, 2024 20:42
Copy link
Contributor

coderabbitai bot commented Mar 16, 2024

Walkthrough

Walkthrough

The recent updates to the group handling system introduce enhanced breadcrumb navigation, refined group management logic, and improved user feedback mechanisms. These changes streamline the process of creating, joining, and leaving groups, alongside better error handling and user guidance. Additionally, the system now supports scenarios such as group disbanding and membership status updates, ensuring a smoother experience for users managing group memberships.

Changes

File(s) Change Summary
app/controllers/groups_controller.rb
app/helpers/groups_helper.rb
Enhanced breadcrumb handling, refactored redirection paths, and improved error messages for group management.
app/models/assessment_user_datum.rb
app/models/group.rb
Added methods for group member management and checks for group emptiness.
app/views/groups/new.html.erb
app/views/groups/show.html.erb
app/views/groups/_new_form.html.erb
app/views/groups/index.html.erb
Updated UI elements and conditional rendering logic for a better user experience in group creation and management.
app/assets/stylesheets/style.css.scss Simplified styling for checkboxes.
app/controllers/assessments_controller.rb Updated parameters handling for assessments.
app/views/assessments/_edit_penalties.html.erb
app/views/assessments/new.html.erb
Adjusted UI elements in assessment views.

Assessment against linked issues

Objective Addressed Explanation
Unable to leave group while a request is pending (#2115)

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit-tests for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit tests for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

@damianhxy damianhxy requested review from a team and KesterTan and removed request for a team March 16, 2024 20:42
Copy link
Contributor

@KesterTan KesterTan left a comment

Choose a reason for hiding this comment

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

Also self-assign groups is checked by default when creating a new assessment, only way to uncheck it is to do so in assessment settings. I think maybe it would be better to let instructors check/uncheck it before/while creating an assessment too?

@damianhxy
Copy link
Member Author

Also self-assign groups is checked by default when creating a new assessment, only way to uncheck it is to do so in assessment settings. I think maybe it would be better to let instructors check/uncheck it before/while creating an assessment too?

Done:
Screenshot 2024-03-28 at 03 21 28

I also took the liberty of fixing the breadcrumbs for the creation page
Screenshot 2024-03-28 at 03 21 38

Copy link
Contributor

@KesterTan KesterTan left a comment

Choose a reason for hiding this comment

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

Everything works as expected. LGTM

@damianhxy damianhxy added this pull request to the merge queue Mar 29, 2024
Merged via the queue into master with commit 7256b3c Mar 29, 2024
5 checks passed
@damianhxy damianhxy deleted the groups-improvements branch March 29, 2024 22:26
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.

Unable to leave group while a request is pending
2 participants