Commit 4c93f73b by Eric Fischer

examples

parent 78462545
......@@ -148,7 +148,8 @@ DEFAULT_STAFF_ASSESSMENT = {
DEFAULT_AI_ASSESSMENT = {
"name": "example-based-assessment",
"start": DEFAULT_START,
"due": DEFAULT_DUE
"due": DEFAULT_DUE,
"examples_xml": "",
}
DEFAULT_ASSESSMENT_MODULES = [
......
......@@ -171,14 +171,14 @@ class StudioMixin(object):
logger.exception('Editor context is invalid')
return {'success': False, 'msg': self._('Error updating XBlock configuration')}
# Check that the editor assessment order contains all the assessments. We are more flexible on example-based.
given_without_example_based = set(data['editor_assessments_order']) - {'example-based-assessment'}
if set(DEFAULT_EDITOR_ASSESSMENTS_ORDER) != given_without_example_based:
# Check that the editor assessment order contains all the assessments.
given = set(data['editor_assessments_order'])
if set(DEFAULT_EDITOR_ASSESSMENTS_ORDER) != given:
# Backwards compatibility: "staff-assessment" may not be present.
# If that is the only problem with this data, just add it manually and continue.
if set(DEFAULT_EDITOR_ASSESSMENTS_ORDER) == (
# Check the given set, minus example-based, plus staff
given_without_example_based | {'staff-assessment'}
given | {'staff-assessment'}
):
data['editor_assessments_order'].append('staff-assessment')
logger.info('Backwards compatibility: editor_assessments_order now contains staff-assessment')
......
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