Commit debccd19 by Stephen Sanchez

Cleaning up a bit further with the templates.

parent ddcf19c2
......@@ -227,8 +227,7 @@ class OpenAssessmentBlock(XBlock):
student_item_dict = self._get_student_item_dict()
points_possible = sum(
max(int(val) for val in criteria if val.isdigit())
for criteria in self.rubric_criteria
int(val) for val, _ in self.rubric_criteria["options"]
)
assessment_dict = {
"points_earned": map(int, data["points_earned"]),
......@@ -290,8 +289,13 @@ class OpenAssessmentBlock(XBlock):
crit = {'name': criterion.attrib.get('name', ''),
'instructions': criterion.text.strip(),
}
options = []
for option in criterion:
crit[option.attrib['val']] = option.text.strip()
options.append(
(option.attrib['val'], option.text.strip(),)
)
crit["options"] = sorted(options)
block.rubric_criteria.append(crit)
elif child.tag == 'evals':
block.rubric_evals = []
......@@ -320,18 +324,13 @@ class OpenAssessmentBlock(XBlock):
return [EXAMPLE_POVERTY_RUBRIC, EXAMPLE_CENSORSHIP_RUBRIC,]
def _get_grade_state(self, student_item):
peer_eval = self._hack_get_peer_eval()
submissions = api.get_submissions(student_item, 1)
has_finished_evaluating = peer_api.has_finished_required_evaluating(
student_item["student_id"], peer_eval.must_grade
)
score = api.get_score(student_item)
# TODO: Determine if we want to build out grade state right now.
grade_state = {
"style_class": "",
"value": "",
"title": "",
"message": "",
"style_class": "is--incomplete",
"value": "Incomplete",
"title": "Your Grade:",
"message": "You have not started this problem",
}
return grade_state
......
......@@ -7,21 +7,7 @@ function OpenAssessmentBlock(runtime, element) {
var click_msg = '<p class="clickhere">(click here to dismiss this message)</p>';
/* Sample Debug Console: http://localhost:8000/submissions/Joe_Bloggs/TestCourse/u_3 */
function displayStatus(result) {
status = result[0]
error_msg = result[2]
if (status) {
$('.openassessment_response_status_block', element).html(success_msg.concat(click_msg));
} else {
$('.openassessment_response_status_block', element).html(failure_msg.concat(error_msg).concat(click_msg));
}
$('.openassessment_response_status_block', element).css('display', 'block');
}
$('.openassessment_response_status_block', element).click(function(eventObject) {
$('.openassessment_response_status_block', element).css('display', 'none');
});
$('.openassessment_submit', element).click(function(eventObject) {
$('.action action--submit step--response__submit', element).click(function(eventObject) {
$.ajax({
type: "POST",
url: handlerUrl,
......@@ -29,10 +15,5 @@ function OpenAssessmentBlock(runtime, element) {
success: displayStatus
});
});
$(function ($) {
/* Here's where you'd do things on page load. */
$(element).css('background-color', 'LightBlue')
});
}
/* END Javascript for OpenassessmentComposeXBlock. */
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