Commit ea2b9191 by Vik Paruchuri

Allow student to switch between rubrics, tell user once peer grading required amount is done

parent aa090062
......@@ -114,6 +114,8 @@ class @CombinedOpenEnded
grader_status_sel: '.grader-status'
info_rubric_elements_sel: '.rubric-elements-info'
rubric_collapse_sel: '.rubric-collapse'
next_rubric_sel: '.rubric-next-button'
previous_rubric_sel: '.rubric-previous-button'
constructor: (el) ->
@el=el
......@@ -240,6 +242,9 @@ class @CombinedOpenEnded
@toggle_rubric("")
@rubric_collapse = @$(@rubric_collapse_sel)
@rubric_collapse.click @toggle_rubric
@hide_rubrics()
@$(@previous_rubric_sel).click @previous_rubric
@$(@next_rubric_sel).click @next_rubric
show_status_current: () =>
data = {}
......@@ -570,8 +575,36 @@ class @CombinedOpenEnded
return false
hide_rubrics: () =>
@$(combined_rubric_sel + ' > [data-status="hidden"]').hide()
@$(combined_rubric_sel + ' > [data-status="shown"]').show()
rubrics = @$(@combined_rubric_sel)
for rub in rubrics
if @$(rub).data('status')=="shown"
@$(rub).show()
else
@$(rub).hide()
next_rubric: =>
@shift_rubric(1)
return false
previous_rubric: =>
@shift_rubric(-1)
return false
shift_rubric: (i) =>
rubrics = @$(@combined_rubric_sel)
number = 0
for rub in rubrics
if @$(rub).data('status')=="shown"
number = @$(rub).data('number')
@$(rub).data('status','hidden')
if i==1 and number < rubrics.length - 1
number = number + i
if i==-1 and number>0
number = number + i
@$(rubrics[number]).data('status', 'shown')
@hide_rubrics()
prompt_show: () =>
if @prompt_container.is(":hidden")==true
......
......@@ -344,7 +344,11 @@ class @PeerGradingProblem
if response.success
@is_calibrated_check()
@grading_message.fadeIn()
@grading_message.html("<p>Successfully saved your feedback. Fetched the next essay.</p>")
message = "<p>Successfully saved your feedback. Fetched the next essay."
if response.required_done
message = message + " You have completed the required number of gradings."
message = message + "</p>"
@grading_message.html(message)
else
if response.error
@render_error(response.error)
......
......@@ -327,6 +327,11 @@ class PeerGradingModule(PeerGradingFields, XModule):
try:
response = self.peer_gs.save_grade(location, grader_id, submission_id,
score, feedback, submission_key, rubric_scores, submission_flagged, answer_unknown)
success, location_data = self.query_data_for_location()
response.update({'required_done' : False})
if 'count_graded' in location_data and 'count_required' in location_data:
response['required_done'] = True
return response
except GradingServiceError:
# This is a dev_facing_error
......
......@@ -2,9 +2,9 @@
% if 'task_name' in result and 'result' in result:
<div class="combined-rubric-container"
%if i>0:
data-status="shown" data-number="${i}">
% else:
data-status="hidden" data-number="${i}">
% else:
data-status="shown" data-number="${i}">
% endif
<h4>${result['task_name']} from grader ${i+1} <a class="rubric-collapse" href="#">(Hide)</a></h4>
${result['result'] | n}
......
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