Skip to content

[Feature:InstructorUI] Course Users Registration Type#7808

Merged
bmcutler merged 11 commits intoSubmitty:masterfrom
listeph:7474-users-reg-type-column
May 15, 2022
Merged

[Feature:InstructorUI] Course Users Registration Type#7808
bmcutler merged 11 commits intoSubmitty:masterfrom
listeph:7474-users-reg-type-column

Conversation

@listeph
Copy link
Copy Markdown
Contributor

@listeph listeph commented Apr 6, 2022

Please check if the PR fulfills these requirements:

  • Tests for the changes have been added/updated (if possible)
  • Documentation has been updated/added if relevant

What is the current behavior?

Progress on #7474

What is the new behavior?

  • Adds a registration_type column to course_db's users table, which is constrained to values 'graded' (default), 'audit', 'withdrawn', and 'staff'
  • Displays new registration type value in Managing Students tab (Instructor UI). Registration type is not displayed for Managing Graders because they would all just be "staff". sample
  • Allows editing of registration type on edit student form. If the user's group is changed to be a grader or instructor, then the dropdown disappears because the registration type will default to 'staff'. edit user form
  • Enables the bulk-upload of (optional) registration type column in Managing Students. If the column is left empty for a new user, the registration type will default to 'graded'. For the bulk-upload of Managing Graders, users are automatically defaulted to 'staff' registration type.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 6, 2022

Codecov Report

Merging #7808 (556e4b9) into master (819a55e) will decrease coverage by 0.00%.
The diff coverage is 11.11%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #7808      +/-   ##
============================================
- Coverage     22.08%   22.07%   -0.01%     
- Complexity     7496     7509      +13     
============================================
  Files           199      199              
  Lines         24519    24541      +22     
  Branches         54       54              
============================================
+ Hits           5414     5417       +3     
- Misses        19051    19070      +19     
  Partials         54       54              
Flag Coverage Δ
autograder 20.22% <ø> (ø)
js 32.79% <ø> (ø)
migrator 99.20% <ø> (ø)
php 20.15% <11.11%> (-0.01%) ⬇️
python_submitty_utils 71.65% <ø> (ø)

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

@listeph listeph changed the title Course Users Registration Type [Feature:InstructorUI] Course Users Registration Type Apr 6, 2022
@listeph listeph marked this pull request as draft April 6, 2022 21:03
@listeph listeph marked this pull request as ready for review April 20, 2022 20:35
@jportorreal00 jportorreal00 self-requested a review April 20, 2022 21:14
:param course: Code of course being migrated
:type course: str
"""
pass
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

may want to drop the row and revert the constraint changes here

Copy link
Copy Markdown
Contributor Author

@listeph listeph May 23, 2022

Choose a reason for hiding this comment

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

I was thinking about that too but it says in the migration documentation

In general, your down migration should only undo the necessary changes to make earlier versions of the Submitty software work. For example, if your migration is adding a column to an existing table in the database, it is probably not necessary or desirable to delete that data in the down function. We don’t want to lose any data since we likely plan to return to this state in the future. Your down function may be empty.

`

And then my up function drops the constraint for in case anyone changes it

{% for registration, students in sections %}
<tbody id="section-{{ registration }}">
<tr class="info">
<th class="section-break" colspan="10">Students Enrolled in Registration Section {{ registration }}</td>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

i feel like this value has been changed a few times. Is there any way to set it to a value? Like {{ header|length }} or something passed in from the View? Not necessary but could save someone from future grief.

<label for="registration_type" class="full-width">
Registration Type:
<select name="registration_type" id="registration_type">
<option value="graded">graded</option>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Also nitpicky, but we could possibly refactor this like the other input options to use something like {% for reg in reg_types %}

@bmcutler bmcutler merged commit 93723ef into Submitty:master May 15, 2022
@bmcutler bmcutler mentioned this pull request Aug 22, 2022
5 tasks
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.

3 participants