diff --git a/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py b/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py index 8ea27ce867..a515ad2553 100644 --- a/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py +++ b/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py @@ -22,7 +22,7 @@ from .xml_module import XmlDescriptor from xmodule.modulestore import Location import self_assessment_module import open_ended_module -from combined_open_ended_rubric import CombinedOpenEndedRubric, RubricParsingError, GRADER_TYPE_IMAGE_DICT +from combined_open_ended_rubric import CombinedOpenEndedRubric, RubricParsingError, GRADER_TYPE_IMAGE_DICT, HUMAN_GRADER_TYPE from .stringify import stringify_children import dateutil import dateutil.parser @@ -467,6 +467,12 @@ class CombinedOpenEndedV1Module(): grader_type = grader_types[0] else: grader_type = "IN" + + if grader_type in HUMAN_GRADER_TYPE: + human_grader_name = HUMAN_GRADER_TYPE[grader_type] + else: + human_grader_name = grader_type + last_response_dict = { 'response': last_response, 'score': last_score, @@ -483,6 +489,7 @@ class CombinedOpenEndedV1Module(): 'grader_types' : grader_types, 'feedback_items' : feedback_items, 'grader_type' : grader_type, + 'human_grader_type' : human_grader_name, } return last_response_dict @@ -563,6 +570,15 @@ class CombinedOpenEndedV1Module(): html = self.system.render_template('combined_open_ended_results.html', context) return {'html': html, 'success': True} + def get_status_ajax(self, get): + """ + Gets the results of a given grader via ajax. + Input: AJAX get dictionary + Output: Dictionary to be rendered via ajax that contains the result html. + """ + html = self.get_status() + return {'html': html, 'success': True} + def handle_ajax(self, dispatch, get): """ This is called by courseware.module_render, to handle an AJAX call. @@ -579,6 +595,7 @@ class CombinedOpenEndedV1Module(): 'reset': self.reset, 'get_results': self.get_results, 'get_combined_rubric': self.get_rubric, + 'get_status' : self.get_status_ajax, } if dispatch not in handlers: diff --git a/common/lib/xmodule/xmodule/combined_open_ended_rubric.py b/common/lib/xmodule/xmodule/combined_open_ended_rubric.py index abb8945aee..4394e15f37 100644 --- a/common/lib/xmodule/xmodule/combined_open_ended_rubric.py +++ b/common/lib/xmodule/xmodule/combined_open_ended_rubric.py @@ -10,6 +10,13 @@ GRADER_TYPE_IMAGE_DICT = { 'IN' : '/static/images/peer_grading_icon.png', } +HUMAN_GRADER_TYPE = { + 'SA' : 'Self-Assessment', + 'PE' : 'Peer-Assessment', + 'IN' : 'Instructor-Assessment', + 'ML' : 'AI-Assessment', + } + class RubricParsingError(Exception): def __init__(self, msg): self.msg = msg @@ -184,6 +191,7 @@ class CombinedOpenEndedRubric(object): 'max_score': max_score, 'combined_rubric' : True, 'grader_type_image_dict' : GRADER_TYPE_IMAGE_DICT, + 'human_grader_types' : HUMAN_GRADER_TYPE, }) return html diff --git a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee index 4774ed5655..a710ecbd0c 100644 --- a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee @@ -51,6 +51,7 @@ class @CombinedOpenEnded @reset_button.click @reset @next_problem_button = @$('.next-step-button') @next_problem_button.click @next_problem + @status_container = @$('.status-elements') @show_results_button=@$('.show-results-button') @show_results_button.click @show_results @@ -130,6 +131,13 @@ class @CombinedOpenEnded @combined_rubric_container.after(response.html).remove() @combined_rubric_container= $('div.combined_rubric_container') + show_status_current: () => + data = {} + $.postWithPrefix "#{@ajax_url}/get_status", data, (response) => + if response.success + @status_container.after(response.html).remove() + @status_container= $('.status-elements') + message_post: (event)=> Logger.log 'message_post', @answers external_grader_message=$(event.target).parent().parent().parent() @@ -171,7 +179,7 @@ class @CombinedOpenEnded @next_problem_button.hide() @hide_file_upload() @hint_area.attr('disabled', false) - + @show_status_current() if @task_number>1 @show_combined_rubric_current() if @task_number==1 and @child_state=='assessing' diff --git a/lms/templates/combined_open_ended_status.html b/lms/templates/combined_open_ended_status.html index 7d803fc230..116bca87a4 100644 --- a/lms/templates/combined_open_ended_status.html +++ b/lms/templates/combined_open_ended_status.html @@ -9,8 +9,11 @@ %endif %if status['grader_type'] in grader_type_image_dict: <% grader_image = grader_type_image_dict[status['grader_type']]%> + + %else: + ${status['human_task']} %endif - ${status['human_task']}(${status['human_state']}) ${status['score']} / ${status['max_score']} + (${status['human_state']}) ${status['score']} / ${status['max_score']} %endfor diff --git a/lms/templates/open_ended_rubric.html b/lms/templates/open_ended_rubric.html index 372dc2230a..58e74a68da 100644 --- a/lms/templates/open_ended_rubric.html +++ b/lms/templates/open_ended_rubric.html @@ -29,8 +29,13 @@
%for grader_type in category['options'][j]['grader_types']: % if grader_type in grader_type_image_dict: - <% grader_image = grader_type_image_dict[grader_type]%> - + <% grader_image = grader_type_image_dict[grader_type] %> + % if grader_type in human_grader_types: + <% human_title = human_grader_types[grader_type] %> + % else: + <% human_title = grader_type %> + % endif + % endif %endfor ${option['points']} points : ${option['text']}