Skip to content

[Feature:InstructorUI] Parse CSV Headers in Classlist Upload#12601

Merged
bmcutler merged 16 commits into
mainfrom
improve-classlist-upload
Apr 10, 2026
Merged

[Feature:InstructorUI] Parse CSV Headers in Classlist Upload#12601
bmcutler merged 16 commits into
mainfrom
improve-classlist-upload

Conversation

@Eli-J-Schwartz

Copy link
Copy Markdown
Contributor

Why is this Change Important & Necessary?

Closes #12599 and #12424

What is the New Behavior?

Right now the classlist upload feature reads a .csv file without using column headers, and instead hard-codes the location of fields like First Name, User ID, Registration Section, ect.
The new behavior is that the first row of the .csv file is interpreted as column headers, which are used to determine how different fields are parsed.

Example of a correctly formatted file:
Screenshot_20260317_173617

The file format is compatible with the .csv files generated by the "Download Classlist" button on the same page, so the downloaded file can be edited and re-uploaded without any hassle.

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

  1. Go to the "Manage Students" tab.
  2. Use the "Download Users" button to download the classlist file.
  3. Modify the registration section for some of the users; add additional users with a similar format to those above; test multiple fields at the same time; ect.
  4. Check for any errors.

Automated Testing & Documentation

This feature need substantial testing, and the documentation on submitty.org needs to be updated to match the new behavior. Neither of these have been done yet.

Other information

Should probably add a warning about the change, in case instructors are used to the old format. Maybe check if all the column titles are invalid, then they are probably missing the headers altogether.

@codecov

codecov Bot commented Mar 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 1.66113% with 296 lines in your changes missing coverage. Please review.
✅ Project coverage is 21.55%. Comparing base (02638f6) to head (6a2f9cf).
⚠️ Report is 20 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##               main   #12601      +/-   ##
============================================
- Coverage     21.64%   21.55%   -0.09%     
- Complexity     9654     9733      +79     
============================================
  Files           268      268              
  Lines         36245    36413     +168     
  Branches        487      487              
============================================
+ Hits           7846     7850       +4     
- Misses        27916    28080     +164     
  Partials        483      483              
Flag Coverage Δ
autograder 21.32% <ø> (ø)
js 2.04% <ø> (ø)
migrator 100.00% <ø> (ø)
php 20.56% <1.66%> (-0.11%) ⬇️
python_submitty_utils 80.08% <ø> (ø)
submitty_daemon_jobs 91.13% <ø> (ø)

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.

@hyeenaa
hyeenaa self-requested a review March 27, 2026 21:33
@automateprojectmangement automateprojectmangement Bot moved this from Seeking Reviewer to In Review in Submitty Development Mar 27, 2026

@hyeenaa hyeenaa left a comment

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.

There's a few issues I found with the PR related to edge cases.

  1. when inserting with an invalid first name, it gets the row # wrong, (potentially starting index at 0 without correction).
Image Image
  1. When cascading issues arise, the error message only shows the first one.
  2. When the section number is negative, there is no catch, and it enters into the database
Image
  1. integers are allowed for user id's
Image

Take a look at these, and let me know if you have any questions about how I encountered them.

@github-project-automation github-project-automation Bot moved this from In Review to Work in Progress in Submitty Development Mar 27, 2026
@Eli-J-Schwartz

Copy link
Copy Markdown
Contributor Author

Hi @hyeenaa,
Thanks for the feedback!
Your first point was a simple off-by-one error, which I have just pushed a fix for.
Points 3 & 4 are actually intended behavior, as both section names and user ids are formatted as arbitrary strings which can contain letters, numbers, and some punctuation, including hyphens ("-").
Regarding point 2, it would be useful to know which cascading errors aren't displaying simultaneously. Most format errors cascade properly, which you can see here:
Screenshot_20260329_142520
Incorrect column titles don't cascade, because without knowing the column title it is impossible to check the format of the data. Additionally, errors that happen when the data is inserted into the database will not cascade, but this should never happen. Please let me know which type of error you are facing.
Thanks,
Eli

@hyeenaa

hyeenaa commented Mar 31, 2026

Copy link
Copy Markdown
Contributor

Cool, all good. Forgot that numbers are usually expected in user IDs. I am curious about negative section numbers, though, I don't necessarily see an instance where that would be used, but I might be missing something. I'll give it all another look-over tomorrow.

@hyeenaa
hyeenaa self-requested a review March 31, 2026 21:43
@automateprojectmangement automateprojectmangement Bot moved this from Work in Progress to In Review in Submitty Development Mar 31, 2026

@hyeenaa hyeenaa left a comment

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've pretty thoroughly tested the input filtering, and it seems to be responsive to all inputs in all fields. Everything else also looks good.

@github-project-automation github-project-automation Bot moved this from In Review to Awaiting Maintainer Review in Submitty Development Mar 31, 2026
@bmcutler
bmcutler merged commit 73eb5d5 into main Apr 10, 2026
25 checks passed
@bmcutler
bmcutler deleted the improve-classlist-upload branch April 10, 2026 19:57
@github-project-automation github-project-automation Bot moved this from Awaiting Maintainer Review to Done in Submitty Development Apr 10, 2026
GarvitKhandelwal31 pushed a commit to GarvitKhandelwal31/Submitty that referenced this pull request Apr 13, 2026
…y#12601)

<!-- ** Please remove all comment blocks in the description before
submitting this PR. ** -->

<!-- NOTE: Please ensure your title and description align with Submitty
conventions (see
https://submitty.org/developer/getting_started/make_a_pull_request for
more details).
Each title has a prefix, and a limit of 40 chars. A description template
has been
provided and must be completed in full. Please also ensure that all CI
tests
are passing. Pull requests that do not meet these requirements are
ineligible for
review and may be closed. -->

### Why is this Change Important & Necessary?
Closes Submitty#12599 and Submitty#12424 


### What is the New Behavior?
Right now the classlist upload feature reads a .csv file without using
column headers, and instead hard-codes the location of fields like First
Name, User ID, Registration Section, ect.
The new behavior is that the first row of the .csv file is interpreted
as column headers, which are used to determine how different fields are
parsed.

Example of a correctly formatted file:
<img width="1229" height="569" alt="Screenshot_20260317_173617"
src="https://github.com/user-attachments/assets/31264a1b-bdf6-440b-aecc-cc561733eeee"
/>

The file format is compatible with the .csv files generated by the
"Download Classlist" button on the same page, so the downloaded file can
be edited and re-uploaded without any hassle.

### What steps should a reviewer take to reproduce or test the bug or
new feature?
1. Go to the "Manage Students" tab.
2. Use the "Download Users" button to download the classlist file.
3. Modify the registration section for some of the users; add additional
users with a similar format to those above; test multiple fields at the
same time; ect.
4. Check for any errors.

### Automated Testing & Documentation
This feature need substantial testing, and the documentation on
submitty.org needs to be updated to match the new behavior. Neither of
these have been done yet.

### Other information
Should probably add a warning about the change, in case instructors are
used to the old format. Maybe check if all the column titles are
invalid, then they are probably missing the headers altogether.

---------

Co-authored-by: Justin Manion <[email protected]>
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.

Refactor Classlist / Graderlist Upload

4 participants