Commit 3667fe8b by marco

Merge branch 'feature/vik/oe-ui' of github.com:edx/edx-platform into feature/vik/oe-ui

parents 56dee211 ea2b9191
...@@ -114,6 +114,8 @@ class @CombinedOpenEnded ...@@ -114,6 +114,8 @@ class @CombinedOpenEnded
grader_status_sel: '.grader-status' grader_status_sel: '.grader-status'
info_rubric_elements_sel: '.rubric-elements-info' info_rubric_elements_sel: '.rubric-elements-info'
rubric_collapse_sel: '.rubric-collapse' rubric_collapse_sel: '.rubric-collapse'
next_rubric_sel: '.rubric-next-button'
previous_rubric_sel: '.rubric-previous-button'
constructor: (el) -> constructor: (el) ->
@el=el @el=el
...@@ -240,6 +242,9 @@ class @CombinedOpenEnded ...@@ -240,6 +242,9 @@ class @CombinedOpenEnded
@toggle_rubric("") @toggle_rubric("")
@rubric_collapse = @$(@rubric_collapse_sel) @rubric_collapse = @$(@rubric_collapse_sel)
@rubric_collapse.click @toggle_rubric @rubric_collapse.click @toggle_rubric
@hide_rubrics()
@$(@previous_rubric_sel).click @previous_rubric
@$(@next_rubric_sel).click @next_rubric
show_status_current: () => show_status_current: () =>
data = {} data = {}
...@@ -569,6 +574,38 @@ class @CombinedOpenEnded ...@@ -569,6 +574,38 @@ class @CombinedOpenEnded
@question_header.text(new_text) @question_header.text(new_text)
return false return false
hide_rubrics: () =>
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: () => prompt_show: () =>
if @prompt_container.is(":hidden")==true if @prompt_container.is(":hidden")==true
@prompt_container.slideToggle() @prompt_container.slideToggle()
......
...@@ -344,7 +344,11 @@ class @PeerGradingProblem ...@@ -344,7 +344,11 @@ class @PeerGradingProblem
if response.success if response.success
@is_calibrated_check() @is_calibrated_check()
@grading_message.fadeIn() @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 else
if response.error if response.error
@render_error(response.error) @render_error(response.error)
...@@ -482,7 +486,7 @@ class @PeerGradingProblem ...@@ -482,7 +486,7 @@ class @PeerGradingProblem
if response.actual_rubric != undefined if response.actual_rubric != undefined
calibration_wrapper.append("<div>Instructor Scored Rubric: #{response.actual_rubric}</div>") calibration_wrapper.append("<div>Instructor Scored Rubric: #{response.actual_rubric}</div>")
if response.actual_feedback!=undefined if response.actual_feedback.feedback!=undefined
calibration_wrapper.append("<div>Instructor Feedback: #{response.actual_feedback}</div>") calibration_wrapper.append("<div>Instructor Feedback: #{response.actual_feedback}</div>")
# disable score selection and submission from the grading interface # disable score selection and submission from the grading interface
......
...@@ -506,15 +506,13 @@ class CombinedOpenEndedV1Module(): ...@@ -506,15 +506,13 @@ class CombinedOpenEndedV1Module():
for i in xrange(0, loop_up_to_task): for i in xrange(0, loop_up_to_task):
response = self.get_last_response(i) response = self.get_last_response(i)
rubric_scores = None rubric_scores = None
if len(response['rubric_scores']) > 0 and response['grader_types'][0] in HUMAN_GRADER_TYPE.keys(): score_length = len(response['grader_types'])
rubric_scores = [response['rubric_scores']] log.info(response)
grader_types = None for z in xrange(0,score_length):
if len(response['grader_types']) > 0 and response['grader_types'][0] in HUMAN_GRADER_TYPE.keys(): if response['grader_types'][z] in HUMAN_GRADER_TYPE.keys():
grader_types = [response['grader_types']] rubric_scores = [[response['rubric_scores'][z]]]
feedback_items = None grader_types = [[response['grader_types'][z]]]
if len(response['feedback_items']) > 0 and response['grader_types'][0] in HUMAN_GRADER_TYPE.keys(): feedback_items = [[response['feedback_items'][z]]]
feedback_items = [response['feedback_items']]
if feedback_items is not None and grader_types is not None and rubric_scores is not None:
rubric_html = self.rubric_renderer.render_combined_rubric(stringify_children(self.static_data['rubric']), rubric_html = self.rubric_renderer.render_combined_rubric(stringify_children(self.static_data['rubric']),
rubric_scores, rubric_scores,
grader_types, feedback_items) grader_types, feedback_items)
......
...@@ -327,6 +327,11 @@ class PeerGradingModule(PeerGradingFields, XModule): ...@@ -327,6 +327,11 @@ class PeerGradingModule(PeerGradingFields, XModule):
try: try:
response = self.peer_gs.save_grade(location, grader_id, submission_id, response = self.peer_gs.save_grade(location, grader_id, submission_id,
score, feedback, submission_key, rubric_scores, submission_flagged, answer_unknown) 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 return response
except GradingServiceError: except GradingServiceError:
# This is a dev_facing_error # This is a dev_facing_error
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
% if 'task_name' in result and 'result' in result: % if 'task_name' in result and 'result' in result:
<div class="combined-rubric-container" <div class="combined-rubric-container"
%if i>0: %if i>0:
status="shown"> data-status="hidden" data-number="${i}">
% else: % else:
status="hidden"> data-status="shown" data-number="${i}">
% endif % endif
<div class="visibility-control visibility-control-rubric"> <div class="visibility-control visibility-control-rubric">
<div class="inner"> <div class="inner">
......
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