-
Notifications
You must be signed in to change notification settings - Fork 251
Enable removal of a student from a course #7480
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
Enable removal of a student from a course #7480
Conversation
Pull Request Test Coverage Report for Build 14629824156Details
💛 - Coveralls |
david-yz-liu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@donny-wong excellent work! This PR is good, I just left a few stylistic comments.
Please also make an update to the MarkUs wiki.
david-yz-liu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@donny-wong make sure to link the Wiki PR to this one (there's a section for doing so in the PR description).
Also I realized that there should be one other restriction on student deletion: if there are associated grade_entry_students, and the grade_entry_student has an associated grade with a non-nil grade, then we should also prevent deletion. I expect the easiest way to implement this is to set the grade_entry_student association to dependent: :destroy and then in the grade entry student model, a check for non-nil grades.
@david-yz-liu, I am not able to delete the student I would like to get your thoughts if it would be ok to remove the DB foreign key constraint of |
|
@donny-wong you don't need to remove the foreign key constraint. The point of doing the destroy is that the associated records (i.e., grade entry forms) should be deleted as well. If this is not happening there may be something else going on that you need to investigate and fix. |
@david-yz-liu , you are correct. I was putting the |
9555528 to
f0d5516
Compare
david-yz-liu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@donny-wong please add a test case for when there is a grade entry form (and GradeEntryStudent) but all of the grades are nil.
Also I'm not sure where in the code you are checking for non-nil grades before deletion?
@david-yz-liu I am checking for non- |
|
@donny-wong ah yes I missed that (line 27), thanks for clarifying 👍 |
630c7c0 to
3d24ffc
Compare
…ut all of the grades are nil.
…udent) but all of the grades are nil." This reverts commit 75152991ed7f438d706734f1af98460d379c1a26.
…tudent) but all of the grades are nil.
3d24ffc to
d29c060
Compare
Proposed Changes
Bulk uploading students to a course with an incorrect CSV column order results in incorrect students being created. This is one reason why this feature was implemented, which is, enabling the deletion of a single student from a course.
In order to allow the deletion of a student, they would need to not be associated to any groups, meaning there should not be any records in the
membershipstable for this student for the course they are being deleted from....
Screenshots of your changes (if applicable)
For testing, I created a new course with a new student:Associated documentation repository pull request (if applicable)
Instructions to remove a student: https://github.com/MarkUsProject/Wiki/pull/232
Type of Change
(Write an
Xor a brief description next to the type or types that best describe your changes.)Checklist
(Complete each of the following items for your pull request. Indicate that you have completed an item by changing the
[ ]into a[x]in the raw text, or by clicking on the checkbox in the rendered description on GitHub.)Before opening your pull request:
After opening your pull request:
Questions and Comments
(Include any questions or comments you have regarding your changes.)