mitodl / micromasters

Portal for learners and course teams to access MITx Micromasters® programs
https://mm.mit.edu
BSD 3-Clause "New" or "Revised" License
29 stars 17 forks source link

management command for removing cheaters from a course #4196

Open pdpinch opened 5 years ago

pdpinch commented 5 years ago

From time to time, we discover a learner has been cheating. We have a process for dealing with these situations on edX, but we need to reflect some of these changes in the portal as well.

The flow starts with the learner being manually unenrolled from the course on edX. After that has happened, we should:

  1. Save and log the learner's final grade for the course, to add an item to the audit trail
  2. Delete the final grade. Since the learner is no longer enrolled, we don't have to worry about the final grade being created again.
  3. For FA courses, delete any exam authorizations. Again, because the final grade has been deleted, new exam authorizations won't be generated (unless the learner legitimately passed the course in another run).

Note that this process applies to the tuple of user and course_run.

There is a process for contesting the cheating determination. If the faculty agrees to reinstate the learner, we need a command to reverse this process:

  1. Enroll the learner in the course (if not enrolled already)
  2. Update the edX cache and recreate the final grade
  3. Create any necessary exam authorizations

The management command should take an email address or username, and an edX course key as parameters.

It's useful to have the output logged as well as returned to standard out, so we can copy and paste the details of the process into, for example, a ZenDesk ticket.

pdpinch commented 5 years ago

With the current postgres schema, creating a FinalGradeAudit object prevents the deletion of the FinalGrade. See the slack chat for more detail and a possible workaround.