Then manual grading tool for quizzes does not filter responses and will include responses from users no longer enrolled in the course. If the instructor enters a grade for an unenrolled student, this will create new grades records in the gradebook.
If the student later needs to be re-enrolled in the course, Moodle will be unable to recovery the student's previous grades because the recovery process checks for any existing grades for the user and if any are found aborts the grade recovery process.
STEPS TO REPLICATE
1. Create a new course.
2. Enroll three users as students and one user as a teacher.
3. Create an assignment.
4. Create a quiz with a multiple choice question and an essay question.
5. Login as each of the three students in turn and complete the assignment and quiz.
6. Login as the teacher and grade Student1's submission to the assignment.
7. Go to the Grader report and confirm that Student1's grade is seen in the gradebook.
8. If you have backend access, run this query, entering the id of the course, to see all the grades in the gradebook.
9. Unenroll Student1 from the course.
10. Run the query again to confirm that Student1's grades are no longer in the gradebook.
11. Open the quiz and go to Quiz administration >Results > Manual grading.
12. Note that the page still indicates there are 3 responses to grade even though only two student remain enrolled in the course.
13. Click the "grade all" link.
Three responses are provided for grading, including the response from Student1 who is no longer enrolled.
Only the two responses from the remaining enrolled student are presented for grading.
14. Enter a grade for all three responses including the response from Student1.
15. Use the query to observe that a grade has been entered into the gradebook for Student1 even though he is no longer enrolled.
16. Re-enroll Student1 in the course ensuring that the option "Recover user's old grades if possible" is selected.
17. Go to the Grader report and observe the Student1's grade for the assignment has not been recovered.
3.4.3 and 3.5.2
ADDITIONAL INVESTIGATION NOTES
Assignments do not provide access to submissions from users no longer enrolled in the course.
From the Quiz administration > Results > Grades page, one can select "all users who have attempted the quiz" from the "Attempts from" drop-down menu to access attempts from un-enrolled users. Entering any grades on such an attempt will enter grades in the gradebook for the unenrolled user which will interfere with recovery of other grades during re-enrollment. However, this workflow at least requires quite a bit of intentional effort to grade a user no longer enrolled. Whereas with the manual grading workflow, an instructor working through a long list of responses may forget to skip over a student no longer enrolled.
As another variation, the unenrolled student's quiz attempt has already been graded prior to un-enrollment. After the student has been un-enrolled, the instructor returns to manually grade additional attempts. If the instructor where to use the "grade all" link to load all responses, versus just those in the "To grade" column, and grade another student's response, upon saving the unenrolled student's grade would be reentered in the gradebook.
Aside from potentially wasted effort on evaluating responses from users no longer enrolled in the course, the main impact is on the grade recovery process. Should the user need to be re-enrolled in the course their grades cannot be recovered because of the gradebook grade entered post-unenrollment from the quiz. It is possible to un-enroll the user a second time and then re-enroll the user once again which should restore all previous grades. However that is not a very scalable solution.