Skip to content

[Feature:InstructorUI] Registration date#13011

Merged
bmcutler merged 29 commits into
mainfrom
registration-date
Jul 15, 2026
Merged

[Feature:InstructorUI] Registration date#13011
bmcutler merged 29 commits into
mainfrom
registration-date

Conversation

@dandrecollins07-ctrl

@dandrecollins07-ctrl dandrecollins07-ctrl commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Why is this Change Important & Necessary?

Partially fixes Issue #11547

Submitty currently has no record of when a student self-registered or self-rejoined a course. Instructors have no way to see this information, which can be useful wondering if a student joined the course late or had dropped the course. This PR adds a date_registered timestamp that is recorded whenever a student registers or rejoins a course, and displays it to instructors in the Edit Student modal.

What is the New Behavior?

  • A new date_registered column is added to the per-course users table.
  • The timestamp is set (via NOW()) whenever a student self-registers
    for a course (CourseRegistrationController) or self-rejoins a
    course (SelfRejoinController).
  • Students added manually by an instructor, or added via the setup/
    import process, do not have this field set — it remains NULL/N/A,
    since no self-registration event occurred for them.
  • Instructors can view the registration date (or "N/A" if not
    applicable) as a new read-only field in the Edit Student modal
    under Manage Students.
image

What steps should a reviewer take to reproduce or test the bug or new feature?

  1. Run submitty_install
  2. Run the course migration run_migrator.py -e course --course <semester> <course> migrate).
  3. As a student, self-register for a course (or leave and self-rejoin
    an existing course).
  4. As an instructor, go to Manage Students and open the Edit Student
    modal for that student. Confirm "Registration Date" shows a
    timestamp.
  5. Open the Edit Student modal for a student who was added manually
    or via course setup/import (not self-registered). Confirm
    "Registration Date" shows "N/A".
  6. Optionally verify directly in the database:
    SELECT user_id, date_registered FROM users WHERE user_id=' ';

Automated Testing & Documentation

N/A

Other information

Possibly need to implement Cypress E2E testing for this.

Does this PR include migrations to update existing installations?
This PR includes a migration for course databases (users.date_registered) to update existing installations. This is not a breaking change as the new column defaults to NULL and existing functionality is unaffected.

@codecov

codecov Bot commented Jul 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 8.69565% with 21 lines in your changes missing coverage. Please review.
✅ Project coverage is 21.09%. Comparing base (16b67e9) to head (91f7df0).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##               main   #13011      +/-   ##
============================================
- Coverage     21.09%   21.09%   -0.01%     
- Complexity    10115    10119       +4     
============================================
  Files           279      279              
  Lines         38167    38180      +13     
  Branches        585      585              
============================================
+ Hits           8051     8053       +2     
- Misses        29544    29555      +11     
  Partials        572      572              
Flag Coverage Δ
autograder 21.16% <ø> (ø)
js 1.76% <ø> (ø)
migrator 100.00% <ø> (ø)
php 20.19% <8.69%> (-0.01%) ⬇️
python_submitty_utils 79.83% <ø> (ø)
submitty_daemon_jobs 91.13% <ø> (ø)
vue 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dagemcn dagemcn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I did mostly a code review to start off here, some of my comments could be worth opening up to the group at the meeting to see what their thoughts are. Most of the changes look very solid, I just left comments with a few nitpicks.

:param database: Object for interacting with given database for environment
:type database: migrator.db.Database
"""
database.execute("""

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is it necessary to store this data in the master and the course database? This provides opportunity for the data the become misaligned between the two databases, which can create bugs.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Changed it so that it would only fall under course, no longer needed for master.

Comment thread site/app/libraries/database/DatabaseQueries.php
Comment thread site/tests/app/models/UserTester.php Outdated
'manual_registration' => false,
'preferred_given_name' => "",
'preferred_family_name' => "",
'preferred_given_name' => null,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

These changes seem unrelated to this PR.

@github-project-automation github-project-automation Bot moved this from Seeking Reviewer to Work in Progress in Submitty Development Jul 9, 2026

/**
* Updates the date_registered timestamp for a user in a course to the current time.
* Used for self-registration and self-rejoin, NOT for manual adds/edits by an instructor.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

While I requested this feature to monitor students in self-registration courses, it is likely useful for all courses. Even if we don't use it for non-self registration in this PR, let's not restrict the future usage by including these comments. We should also open an issue for what future code changes are necessary to use this feature for non-self registration courses.

else {
$this->core->getUser()->setRegistrationSection($default_section);
$this->core->getQueries()->insertCourseUser($this->core->getUser(), $term, $course);
$this->core->getQueries()->updateRegistrationDate($user_id);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Would this be better to be put into updateUser() and insertCourseUser() instead of adding another query?

@dagemcn dagemcn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The code here is looking very good, I was able to verify the functionality works as intended. Course instructors are able to see the time students registered in the manage students page, the time remains accessible in the manage students page if the student drops the course, and also remains the accessible and consistent if the student picks up the course again. Also tested with instructor user registering as student and as a TA.

@github-project-automation github-project-automation Bot moved this from Work in Progress to Awaiting Maintainer Review in Submitty Development Jul 13, 2026
@bmcutler
bmcutler merged commit 5a0fd80 into main Jul 15, 2026
51 of 53 checks passed
@bmcutler
bmcutler deleted the registration-date branch July 15, 2026 15:44
@github-project-automation github-project-automation Bot moved this from Awaiting Maintainer Review to Done in Submitty Development Jul 15, 2026
bmcutler pushed a commit to Submitty/RainbowGrades that referenced this pull request Jul 15, 2026
When [PR#13011](Submitty/Submitty#13011) was
merged, a new field, `date_registered`, was added to the users table,
which rainbow grades parses. This field causes an unknown token error.
This PR adds handling for that field, however it is currently unused.

To test:
1. Navigate to rainbow grades
2. Check some options
3. Click build
4. Make sure that rainbow grades builds and can be viewed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants