Skip to content

Fix the bug of get_course_members does not work when num_submissions_column is not 3 or 4#48

Open
yhzhao343 wants to merge 1 commit intonyuoss:mainfrom
yhzhao343:fix-get_course_members-num_submissions_column
Open

Fix the bug of get_course_members does not work when num_submissions_column is not 3 or 4#48
yhzhao343 wants to merge 1 commit intonyuoss:mainfrom
yhzhao343:fix-get_course_members-num_submissions_column

Conversation

@yhzhao343
Copy link

@yhzhao343 yhzhao343 commented Jun 17, 2025

Summary

Fix the problem of get_course_members does not work when num_submissions_column is not 3 or 4. Example failure case gradescope screenshot is shown below (the first & last name swap count as 2 columns):
Screenshot from 2025-06-16 23-20-45

Details

Instead of hard code num_submissions_column to 3 or 4, in get_course_members, I changed to iterate through the header text and search for text that starts with "submissions" to obtain num_submissions_column

Checks

  • Tested changes
  • Attached Logs

Team to Review

Anyone

Reference to the issue

I didn't crate one and I don't see one in issues that match.

…erate through the header text and search for startswith('submissions')
@yhzhao343 yhzhao343 closed this Jun 18, 2025
@yhzhao343 yhzhao343 deleted the fix-get_course_members-num_submissions_column branch June 18, 2025 15:03
@calvinatian
Copy link
Member

Hey, sorry for not getting back sooner. Are you still interested in contributing? I'd be happy to review.

@yhzhao343

@yhzhao343 yhzhao343 restored the fix-get_course_members-num_submissions_column branch June 26, 2025 22:15
@yhzhao343
Copy link
Author

Oops, I deleted the branch by mistake. Didn't realize that would close the pull request. Restoring and re-opening the branch now.

@yhzhao343 yhzhao343 reopened this Jun 26, 2025
Copy link
Member

@calvinatian calvinatian left a comment

Choose a reason for hiding this comment

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

Thanks for reporting an opening a PR! Sorry again for the slow response. I have a suggestion for searching to ideally remove the dependency on English..

Unfortunately the CI testing relies on GH secrets which don't propagate to forks. But, the changes seem fine to me so we can ignore them for this PR.

Comment on lines +142 to +146
num_submissions_column = -1
for i, h in enumerate(headers):
if h.text.lower().startswith("submissions"):
num_submissions_column = i
break
Copy link
Member

Choose a reason for hiding this comment

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

Thinking about this some more I think we could do a search for the Edit column and take the previous element as the Submissions column. I think the edit column has a unique aria-label. This way we can remove the language dependency on the English "Sections"/"Submissions" wording.

Another option could be searching the headers for the aria-controls="DataTables_Table_0" attribute and taking the last one as the submissions column.

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.

2 participants