Commit 0f53585a by Sanford Student

for TNL-6825, fix rescore logic

parent 6431d0f6
......@@ -541,8 +541,7 @@ def rescore_problem_module_state(xmodule_instance_args, module_descriptor, stude
if hasattr(instance, "done"):
if not instance.done:
return UPDATE_STATUS_SKIPPED
else:
if instance.has_submitted_answer():
elif not instance.has_submitted_answer():
return UPDATE_STATUS_SKIPPED
# Set the tracking info before this call, because it makes downstream
......
......@@ -322,9 +322,14 @@ class TestRescoreInstructorTask(TestInstructorTasks):
getattr(mock_instance, rescore_method).return_value = rescore_result
delattr(mock_instance, other_method)
input_state = json.dumps({'done': True})
if rescore_method == 'rescore':
del mock_instance.done
mock_instance.has_submitted_answer.return_value = True
else:
mock_instance.done = True
num_students = 10
self._create_students_with_state(num_students, input_state)
self._create_students_with_state(num_students)
task_entry = self._create_input_entry()
with patch('lms.djangoapps.instructor_task.tasks_helper.get_module_for_descriptor_internal') as mock_get_module:
mock_get_module.return_value = mock_instance
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment