Commit 87294f38 by gradyward

Merge pull request #491 from edx/grady/assessment-reorder

Render Assessment Templates in the order in which they are included
parents 0c026056 195dc62e
......@@ -58,13 +58,19 @@
{% trans "Select the steps that students must complete. All steps are optional, but every assignment must include at least one step. To change the order in which students will complete the steps, drag them into the desired order." %}
</p>
<ol id="openassessment_assessment_module_settings_editors">
{% include "openassessmentblock/edit/oa_edit_training.html" %}
{% include "openassessmentblock/edit/oa_edit_peer.html" %}
{% for assessment in used_assessments %}
{% with "openassessmentblock/edit/oa_edit_"|add:assessment|add:".html" as template %}
{% include template %}
{% endwith %}
{% endfor %}
{% include "openassessmentblock/edit/oa_edit_self.html" %}
{% for assessment in unused_assessments %}
{% with "openassessmentblock/edit/oa_edit_"|add:assessment|add:".html" as template %}
{% include template %}
{% endwith %}
{% endfor %}
{% include "openassessmentblock/edit/oa_edit_ai.html" %}
</ol>
</div>
</div>
......
......@@ -8,11 +8,9 @@
<label for="include_ai_assessment">{% trans "Step: Example-Based Assessment" %}</label>
</div>
<div class="openassessment_assessment_module_editor">
{% if not assessments.example_based_assessment %}
<p id="ai_assessment_description_closed" class="openassessment_description_closed">
{% trans "An algorithm assesses students' responses by comparing the responses to pre-assessed sample responses that the instructor provides."%}
</p>
{% endif %}
<p id="ai_assessment_description_closed" class="openassessment_description_closed {% if assessments.example_based_assessment %} is--hidden {% endif %}">
{% trans "An algorithm assesses students' responses by comparing the responses to pre-assessed sample responses that the instructor provides."%}
</p>
<div id="ai_assessment_settings_editor" class="assessment_settings_wrapper {% if not assessments.example_based_assessment %} is--hidden {% endif %}">
<p class="openassessment_description">
{% trans "Enter one or more sample responses that you've created, together with the scores you would give those responses. Be sure to format the responses and scores according to the placeholder text below. The algorithm assesses students' responses by comparing them to the sample responses and scores that you provide."%}
......
......@@ -8,11 +8,9 @@
<label for="include_peer_assessment">{% trans "Step: Peer Assessment" %}</label>
</div>
<div class = "openassessment_assessment_module_editor">
{% if not assessments.peer_assessment %}
<p id="peer_assessment_description_closed" class="openassessment_description_closed">
{% trans "Students assess a specified number of other students' responses using the rubric for the assignment." %}
</p>
{% endif %}
<p id="peer_assessment_description_closed" class="openassessment_description_closed {% if assessments.peer_assessment %} is--hidden {% endif %}">
{% trans "Students assess a specified number of other students' responses using the rubric for the assignment." %}
</p>
<div id="peer_assessment_settings_editor" class="assessment_settings_wrapper {% if not assessments.peer_assessment %} is--hidden {% endif %}">
<p class="openassessment_description">
{% trans "Specify the following values for the peer assessment step. The numeric grading requirements must be given a value." %}
......
......@@ -8,11 +8,9 @@
<label for="include_self_assessment">{% trans "Step: Self Assessment" %}</label>
</div>
<div class="openassessment_assessment_module_editor">
{% if not assessments.self_assessment %}
<p id="self_assessment_description_closed" class="openassessment_description_closed">
{% trans "Students assess their own responses using the rubric for the assignment." %}
</p>
{% endif %}
<p id="self_assessment_description_closed" class="openassessment_description_closed {% if assessments.self_assessment %} is--hidden {% endif %}">
{% trans "Students assess their own responses using the rubric for the assignment." %}
</p>
<div id="self_assessment_settings_editor" class="assessment_settings_wrapper {% if not assessments.self_assessment %} is--hidden {% endif %}">
<p class="openassessment_description">
{% trans "Specify start and due dates for the self assessment step. To allow self assessment to run as long as the assignment is open, leave both fields blank." %}
......
......@@ -8,11 +8,9 @@
<label for="include_student_training">{% trans "Step: Student Training" %}</label>
</div>
<div class = "openassessment_assessment_module_editor">
{% if not assessments.student_training %}
<p id="student_training_description_closed" class="openassessment_description_closed">
{% trans "Students learn to assess responses by scoring pre-assessed sample responses that the instructor provides. Students move to the next step when the scores they give match the instructor's scores. Note that Student Training Requires that the Peer Assessment module is also selected." %}
</p>
{% endif %}
<p id="student_training_description_closed" class="openassessment_description_closed {% if assessments.student_training %} is--hidden {% endif %}">
{% trans "Students learn to assess responses by scoring pre-assessed sample responses that the instructor provides. Students move to the next step when the scores they give match the instructor's scores. Note that Student Training Requires that the Peer Assessment module is also selected." %}
</p>
<div id="student_training_settings_editor" class="assessment_settings_wrapper {% if not assessments.student_training %} is--hidden {% endif %}">
<p class="openassessment_description">
{% trans "Enter one or more sample responses that you've created, together with the scores you would give those responses. Be sure to format the responses and scores according to the placeholder text below." %}
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -444,7 +444,15 @@
"self_assessment": {
"due": ""
}
}
},
"used_assessments": [
"peer_assessment",
"self_assessment"
],
"unused_assessments": [
"student_training",
"example_based_assessment"
]
},
"output": "oa_edit.html"
},
......
......@@ -126,6 +126,9 @@ describe("OpenAssessment.EditSettingsView", function() {
}
]);
// NOTE: Because the fixtures are generated with the context that only peer and self assessments
// are enabled, student training is placed at the end. Even when we enable it, we do not fundamentally
// change the order in the DOM, so peer assessment will come before student training.
// Enable Training and Peer assessments
assessmentViews[peerID].isEnabled(true);
assessmentViews[selfID].isEnabled(false);
......@@ -133,12 +136,12 @@ describe("OpenAssessment.EditSettingsView", function() {
assessmentViews[studentID].isEnabled(true);
expect(view.assessmentsDescription()).toEqual([
{
name: "student-training",
dummy: "Student Training description"
},
{
name: "peer-assessment",
dummy: "Peer assessment description"
},
{
name: "student-training",
dummy: "Student Training description"
}
]);
});
......
......@@ -37,13 +37,13 @@ OpenAssessment.ToggleControl.prototype = {
},
show: function() {
$(this.hiddenSelector, this.element).fadeOut('fast');
$(this.shownSelector, this.element).fadeIn();
$(this.hiddenSelector, this.element).addClass('is--hidden');
$(this.shownSelector, this.element).removeClass('is--hidden');
},
hide: function() {
$(this.hiddenSelector, this.element).fadeIn();
$(this.shownSelector, this.element).fadeOut();
$(this.hiddenSelector, this.element).removeClass('is--hidden');
$(this.shownSelector, this.element).addClass('is--hidden');
}
};
......
......@@ -660,6 +660,7 @@
padding: 10px;
margin: 10px, 0;
}
}
hr{
......
......@@ -67,12 +67,19 @@ class StudioMixin(object):
# the openassessmentblock definition.
# Django Templates cannot handle dict keys with dashes, so we'll convert
# the dashes to underscores.
# used_assessments (and its unused counterpart) are lists intended to indicate
# the order that settings editors should be rendered. Using lists allows a set order
# which django can easily convert into template names.
used_assessments = []
assessments = {}
for assessment in self.rubric_assessments:
name = assessment['name']
assessments[name.replace('-', '_')] = copy.deepcopy(
assessment
)
name = assessment['name'].replace('-', '_')
used_assessments.append(name)
assessments[name] = copy.deepcopy(assessment)
unused_assessments = {'student_training', 'peer_assessment', 'self_assessment', 'example_based_assessment'}
unused_assessments = unused_assessments - set(used_assessments)
student_training_module = self.get_assessment_module(
'student-training'
......@@ -108,6 +115,8 @@ class StudioMixin(object):
'assessments': assessments,
'criteria': criteria,
'feedbackprompt': unicode(self.rubric_feedback_prompt),
'unused_assessments': unused_assessments,
'used_assessments': used_assessments
}
@XBlock.json_handler
......
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