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 course access codes, fix breadcrumbs #2065

Merged
merged 52 commits into from
Feb 10, 2024
Merged

Add course access codes, fix breadcrumbs #2065

merged 52 commits into from
Feb 10, 2024

Conversation

damianhxy
Copy link
Member

@damianhxy damianhxy commented Jan 27, 2024

Description

  • Fix titles and breadcrumbs
  • Move contact page to home namespace
  • Add access code feature for courses
  • Add documentation
  • Simplify CUD edit js logic, implement proper mutual exclusion

Motivation and Context

At the start of the semester, there is a lot of churn in the user roster and (barring LTI integration) instructors do not wish to keep uploading new rosters. This PR enables instructors to generate and distribute an access code that students can use to join a course on their own.

Once the user roster is stable, instructors can disable the access code and upload the final roster to drop any unwanted students.

Access codes are disabled by default, and are generated when enabled. If an instructor wishes to regenerate the access code, they can disable then enable it.

Also adds missing breadcrumbs where applicable.

Close #865
Closes #1786

How Has This Been Tested?

Access code can be enabled via Course Settings

Access Code

Screenshot 2024-02-06 at 02 51 53
Clicking the "copy" button copies the access code
Clicking the "link" button copies the direct join link

Access Code disabled

Screenshot 2024-01-27 at 17 41 01

Join course page

Accessible via user dropdown
Screenshot 2024-02-03 at 15 15 28

Things to test for access code

  • Test copy to clipboard for direct join link
  • Direct join link works
  • Only valid codes accepted
  • Multiple courses can have no access code
  • Valid codes work, if not already in the course it brings you to set your nickname, else you see a success flash
  • Access code does not regenerate when saving course settings multiple times
  • Access code can be disabled

Other things to test

  • As an instructor, student, etc. navigate all features of Autolab and check that the breadcrumbs make sense
  • Navbar items still work (both on desktop and mobile view)
  • Check documentation for access code (mkdocs serve)
  • Check that a user can be at most one of instructor - ca - dropped (the other boxes will be disabled accordingly)

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

@reviewpad reviewpad bot added the medium Pull request is medium label Jan 27, 2024
@reviewpad reviewpad bot added large Pull request is large and removed medium Pull request is medium labels Jan 28, 2024
@damianhxy damianhxy changed the title Course access codes Add course access codes, fix breadcrumbs Jan 28, 2024
@damianhxy damianhxy marked this pull request as ready for review January 28, 2024 03:49
@reviewpad reviewpad bot requested a review from 20wildmanj January 28, 2024 03:49
Copy link
Contributor

coderabbitai bot commented Jan 28, 2024

Warning

Rate Limit Exceeded

@damianhxy has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 24 minutes and 12 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.
Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.
Please see our FAQ for further information.

Commits Files that changed from the base of the PR and between 44f58f0 and b105fe3.

Walkthrough

The updates focus on enhancing the user experience and system functionality across various controllers and views, with significant emphasis on breadcrumb consistency, self-enrollment via access codes, and UI improvements. Changes include the addition of breadcrumb management methods, the introduction of self-enrollment features for courses, updates to breadcrumb handling in multiple controllers, and adjustments to form handling and page titles. These modifications aim to streamline navigation, improve enrollment processes, and ensure a more intuitive interface for users.

Changes

File Path Change Summary
app/controllers/.../application_controller.rb
app/controllers/.../autograders_controller.rb
app/controllers/.../course_user_data_controller.rb
app/controllers/.../courses_controller.rb
app/controllers/.../device_flow_activation_controller.rb
app/controllers/.../scoreboards_controller.rb
app/controllers/.../users_controller.rb
app/controllers/.../assessments_controller.rb
app/controllers/.../attachments_controller.rb
app/controllers/.../home_controller.rb
app/controllers/.../submissions_controller.rb
app/controllers/.../problems_controller.rb
app/controllers/.../schedulers_controller.rb
app/controllers/.../announcements_controller.rb
Breadcrumb handling and redirection logic updates.
app/models/course.rb Added unique validation for access_code.
app/helpers/application_helper.rb Updated external_javascript_include_tag method and removed current_assessment_link.
app/views/layouts/_navbar.html.erb Added "Join Course" link and updated conditional rendering.
db/migrate/20240127172855_add_access_code_to_courses.rb Added access_code column to courses table.
app/assets/javascripts/course_user_data_edit.js
app/views/course_user_data/edit.html.erb
app/views/scoreboards/show.html.erb
app/views/assessments/index.html.erb
app/views/courses/export.html.erb
app/views/layouts/application.html.erb
UI and form handling improvements.

Assessment against linked issues

Objective Addressed Explanation
Consistency and presence of breadcrumbs across various sections (#865)
Implementation of self-enrollment using access code for courses (#1786)
Unique access code generation for courses and ability to disable it (#1786)

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.
  • 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 from git 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.

app/controllers/courses_controller.rb Outdated Show resolved Hide resolved
app/controllers/submissions_controller.rb Outdated Show resolved Hide resolved
db/schema.rb Outdated Show resolved Hide resolved
app/controllers/assessments_controller.rb Outdated Show resolved Hide resolved
@damianhxy
Copy link
Member Author

Note: need to call before_action :set_manage_course_breadcrumb in DockersController of #2013 too

Copy link
Contributor

@20wildmanj 20wildmanj left a comment

Choose a reason for hiding this comment

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

LGTM beside nits

@damianhxy damianhxy added this pull request to the merge queue Feb 10, 2024
Merged via the queue into master with commit eccc6a9 Feb 10, 2024
6 checks passed
@damianhxy damianhxy deleted the access-code branch February 10, 2024 18:24
@damianhxy damianhxy mentioned this pull request Feb 11, 2024
6 tasks
NicholasMy pushed a commit to UB-CSE-IT/Autolab that referenced this pull request Jan 9, 2025
* Fix titles

* Fix more titles

* Add join_course, move contact to Home controller

* Update documentation

* Properly configure analytics for development

* Remove TODO
The reason why it doesn't turn red on Act As User is because of the autocomplete method

* Don't regenerate if access code already exists

* Don't persist drop flash

* Add pattern to join course form

* Remove unnecessary defaults

* More missing titles

* Don't persist Tango error flash

* Fixup breadcrumbs

* More breadcrumbs fixes

* Revamp developer login page

* Make titles smaller

* Address nits

* Use nil to represent no access code

* Fix tests

* Simplify logic

* Exract set_edit_assessment_breadcrumb

* Update uniqueness condition to allow_nil

* More fixes to breadcrumbs, update test

* Decrease header sizes further

* Move join_course to courses controller

* Remove test

* Add basic tests

* Fix nits re: developer_login

* Guard breadcrumb methods

* Standardize naming of "View Gradehseet" and "View Submission"

* Guard breadcrumb helpers

* Guard breadcrumb helpers

* Standardize naming of add user to course page

* Add direct join link

* Add additional tests

* Extract nickname check

* Proper mutual exclusion for instructor - ca - dropped

* Add copy to clipboard button

* Correctly use content_for tags on export course page

* Bump cdn libraries (jquery-ui, semantic-ui), use jquery-migrate

* Fix breadcrumb for export course

* Fix breadcrumb for export course, reindent code

* Simplify mutual exclusion code, add backend check

* Use constants for regex, upcase strings

* Add manage course breadcrumb for docker controller

* Extract breadcrumb for device_flow_activation_controller

* Extract breadcrumb for course_user_data_controller.rb

* Remove redundant to_s

(cherry picked from commit eccc6a9)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
large Pull request is large
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Self-enrollment using access code Inconsistent and Missing Breadcrumbs
2 participants