def set_instructor_grading_item_back_to_preferred_grader(submission_id): """ Sets a submission from instructor grading to preferred_grader_type. Input: Submission id Output: Boolean success, submission or error message """ success, submission = check_submission_id(submission_id) if not success: return success, submission grader_dict = { 'feedback': 'Instructor skipped', 'status': GraderStatus.failure, 'grader_id': 1, 'grader_type': "IN", 'confidence': 1, 'score': 0, 'errors': "Instructor skipped the submission." } submission.next_grader_type = submission.preferred_grader_type submission.state = SubmissionState.waiting_to_be_graded submission.save() create_grader(grader_dict, submission) return True, submission
def set_instructor_grading_item_back_to_ml(submission_id): """ Sets a submission from instructor grading to ML. Input: Submission id Output: Boolean success, submission or error message """ success, sub=check_submission_id(submission_id) if not success: return success, sub grader_dict={ 'feedback' : 'Instructor skipped', 'status' : GraderStatus.failure, 'grader_id' : 1, 'grader_type' : "IN", 'confidence' : 1, 'score' : 0, 'errors' : "Instructor skipped the submission." } sub.next_grader_type="ML" sub.state=SubmissionState.waiting_to_be_graded sub.save() create_grader(grader_dict,sub) return True, sub
def set_instructor_grading_item_skipped(submission_id): """ Sets a submission to 'skipped' status, so it won't show up in lists until a task resets it back. Which should happen within ten minutes. """ success, sub=check_submission_id(submission_id) if not success: return success, sub grader_dict={ 'feedback' : 'Instructor skipped', 'status' : GraderStatus.failure, 'grader_id' : 1, 'grader_type' : sub.next_grader_type, 'confidence' : 1, 'score' : 0, 'errors' : "Instructor skipped the submission." } sub.state=SubmissionState.skipped sub.save() create_grader(grader_dict,sub) return True, sub