diff --git a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss index 78f0213c8d..951242ac6c 100644 --- a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss +++ b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss @@ -56,13 +56,16 @@ section.legend-container { section.combined-open-ended-status { + padding: 20px 20px 20px 0px; + .statusitem { color: #2C2C2C; background-color : #d4d4d4; font-size: .9em; - padding: 2px; + padding: 20px; display: inline; width: 20%; + margin-right: 20px; .show-results { margin-top: .3em; text-align:right; diff --git a/common/lib/xmodule/xmodule/open_ended_grading_classes/combined_open_ended_modulev1.py b/common/lib/xmodule/xmodule/open_ended_grading_classes/combined_open_ended_modulev1.py index 1fe62035e6..f5feb36ae6 100644 --- a/common/lib/xmodule/xmodule/open_ended_grading_classes/combined_open_ended_modulev1.py +++ b/common/lib/xmodule/xmodule/open_ended_grading_classes/combined_open_ended_modulev1.py @@ -33,6 +33,8 @@ TRUE_DICT = ["True", True, "TRUE", "true"] HUMAN_TASK_TYPE = { 'selfassessment': "Self Assessment", 'openended': "edX Assessment", + 'ml_grading.conf' : "AI Assessment", + 'peer_grading.conf' : "Peer Assessment", } # Default value that controls whether or not to skip basic spelling checks in the controller @@ -468,6 +470,19 @@ class CombinedOpenEndedV1Module(): } return last_response_dict + def extract_human_name_from_task(self, task_xml): + tree = etree.fromstring(task_xml) + log.info(etree.tostring(tree)) + payload = tree.xpath("/openended/openendedparam/grader_payload") + if len(payload)==0: + task_name = "selfassessment" + else: + inner_payload = json.loads(payload[0].text) + task_name = inner_payload['grader_settings'] + + human_task = HUMAN_TASK_TYPE[task_name] + return human_task + def update_task_states(self): """ Updates the task state of the combined open ended module with the task state of the current child module. @@ -689,9 +704,10 @@ class CombinedOpenEndedV1Module(): Output: The status html to be rendered """ status = [] - for i in xrange(0, self.current_task_number + 1): - task_data = self.get_last_response(i) - task_data.update({'task_number': i + 1}) + for i in xrange(0, len(self.task_xml)): + human_task_name = self.extract_human_name_from_task(self.task_xml[i]) + + task_data = {'task_number': i + 1, 'human_task' : human_task_name, 'current' : self.current_task_number==i} status.append(task_data) context = { diff --git a/lms/templates/combinedopenended/combined_open_ended_status.html b/lms/templates/combinedopenended/combined_open_ended_status.html index d13077737f..5495885044 100644 --- a/lms/templates/combinedopenended/combined_open_ended_status.html +++ b/lms/templates/combinedopenended/combined_open_ended_status.html @@ -1,22 +1,13 @@
-
- Status -
%for i in xrange(0,len(status_list)): <%status=status_list[i]%> - %if i==len(status_list)-1: + %if status['current']:
%else:
%endif - %if status['grader_type'] in grader_type_image_dict and render_via_ajax: - <% grader_image = grader_type_image_dict[status['grader_type']]%> - - %else: - ${status['human_task']} - %endif - (${status['human_state']}) + ${status['human_task']}
%endfor