upgrade drag n drop and clean up rescore logic
This commit is contained in:
@@ -246,7 +246,10 @@ def check_arguments_for_rescoring(usage_key):
|
||||
corresponding module doesn't support rescoring calls.
|
||||
"""
|
||||
descriptor = modulestore().get_item(usage_key)
|
||||
if not hasattr(descriptor, 'module_class') or not hasattr(descriptor.module_class, 'rescore_problem'):
|
||||
# TODO: Clean this up as part of TNL-6594 when CAPA uses the ScorableXBlockMixin
|
||||
if (
|
||||
not hasattr(descriptor, 'module_class') or not hasattr(descriptor.module_class, 'rescore_problem')
|
||||
) and not hasattr(descriptor, 'rescore'):
|
||||
msg = "Specified module does not support rescoring."
|
||||
raise NotImplementedError(msg)
|
||||
|
||||
|
||||
@@ -75,11 +75,7 @@ def rescore_problem(entry_id, xmodule_instance_args):
|
||||
action_name = ugettext_noop('rescored')
|
||||
update_fcn = partial(rescore_problem_module_state, xmodule_instance_args)
|
||||
|
||||
def filter_fcn(modules_to_update):
|
||||
"""Filter that matches problems which are marked as being done"""
|
||||
return modules_to_update.filter(state__contains='"done": true')
|
||||
|
||||
visit_fcn = partial(perform_module_state_update, update_fcn, filter_fcn)
|
||||
visit_fcn = partial(perform_module_state_update, update_fcn, None)
|
||||
return run_main_task(entry_id, visit_fcn, action_name)
|
||||
|
||||
|
||||
|
||||
@@ -536,6 +536,15 @@ def rescore_problem_module_state(xmodule_instance_args, module_descriptor, stude
|
||||
msg = "Specified problem does not support rescoring."
|
||||
raise UpdateProblemModuleStateError(msg)
|
||||
|
||||
# TODO: Remove the first part of this if-else with TNL-6594
|
||||
# We check here to see if the problem has any submissions. If it does not, we don't want to rescore it
|
||||
if hasattr(instance, "done"):
|
||||
if not instance.done:
|
||||
return UPDATE_STATUS_SKIPPED
|
||||
else:
|
||||
if instance.has_submitted_answer():
|
||||
return UPDATE_STATUS_SKIPPED
|
||||
|
||||
# Set the tracking info before this call, because it makes downstream
|
||||
# calls that create events. We retrieve and store the id here because
|
||||
# the request cache will be erased during downstream calls.
|
||||
|
||||
@@ -84,7 +84,7 @@ git+https://github.com/solashirai/crowdsourcehinter.git@518605f0a95190949fe77bd3
|
||||
-e git+https://github.com/pmitros/RateXBlock.git@367e19c0f6eac8a5f002fd0f1559555f8e74bfff#egg=rate-xblock
|
||||
-e git+https://github.com/pmitros/DoneXBlock.git@release-2016-08-10#egg=done-xblock
|
||||
git+https://github.com/edx/edx-milestones.git@v0.1.10#egg=edx-milestones==0.1.10
|
||||
git+https://github.com/edx/xblock-utils.git@v1.0.3#egg=xblock-utils==1.0.3
|
||||
git+https://github.com/edx/xblock-utils.git@v1.0.4#egg=xblock-utils==1.0.4
|
||||
-e git+https://github.com/edx-solutions/xblock-google-drive.git@138e6fa0bf3a2013e904a085b9fed77dab7f3f21#egg=xblock-google-drive
|
||||
-e git+https://github.com/edx/edx-reverification-block.git@0.0.5#egg=edx-reverification-block==0.0.5
|
||||
git+https://github.com/edx/edx-user-state-client.git@1.0.1#egg=edx-user-state-client==1.0.1
|
||||
@@ -93,4 +93,4 @@ git+https://github.com/edx/edx-proctoring.git@0.18.0#egg=edx-proctoring==0.18.0
|
||||
|
||||
# Third Party XBlocks
|
||||
git+https://github.com/open-craft/xblock-poll@v1.2.6#egg=xblock-poll==1.2.6
|
||||
git+https://github.com/edx-solutions/xblock-drag-and-drop-v2@v2.0.15#egg=xblock-drag-and-drop-v2==2.0.15
|
||||
git+https://github.com/edx-solutions/xblock-drag-and-drop-v2@v2.0.17#egg=xblock-drag-and-drop-v2==2.0.17
|
||||
|
||||
Reference in New Issue
Block a user