From 0cadc8af36d088a57eddb550d73cdaeed2762e10 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Fri, 12 Jul 2013 14:13:53 -0400 Subject: [PATCH 01/75] Change status bar UI --- .../css/combinedopenended/display.scss | 5 ++++- .../combined_open_ended_modulev1.py | 22 ++++++++++++++++--- .../combined_open_ended_status.html | 13 ++--------- 3 files changed, 25 insertions(+), 15 deletions(-) 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
From ffad965536e75c427d4e79a72e1e68f5ed52ff1f Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Fri, 12 Jul 2013 15:06:11 -0400 Subject: [PATCH 02/75] fix some combinedopenended ui and data routing --- .../lib/xmodule/xmodule/css/combinedopenended/display.scss | 6 ++++++ .../open_ended_grading_classes/peer_grading_service.py | 6 ++++-- common/lib/xmodule/xmodule/peer_grading_module.py | 3 ++- .../combinedopenended/combined_open_ended_status.html | 4 ++++ 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss index 951242ac6c..86c028a8b0 100644 --- a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss +++ b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss @@ -108,6 +108,12 @@ section.combined-open-ended-status { float: right; } } + + .icon-caret-right { + display: inline-block; + vertical-align: baseline; + margin-right: ($baseline/4); + } } div.combined-rubric-container { diff --git a/common/lib/xmodule/xmodule/open_ended_grading_classes/peer_grading_service.py b/common/lib/xmodule/xmodule/open_ended_grading_classes/peer_grading_service.py index 56bd1ec0a8..f80aff610a 100644 --- a/common/lib/xmodule/xmodule/open_ended_grading_classes/peer_grading_service.py +++ b/common/lib/xmodule/xmodule/open_ended_grading_classes/peer_grading_service.py @@ -41,7 +41,7 @@ class PeerGradingService(GradingService): return self.try_to_decode(self._render_rubric(response)) def save_grade(self, location, grader_id, submission_id, score, feedback, submission_key, rubric_scores, - submission_flagged): + submission_flagged, answer_unknown): data = {'grader_id': grader_id, 'submission_id': submission_id, 'score': score, @@ -50,7 +50,9 @@ class PeerGradingService(GradingService): 'location': location, 'rubric_scores': rubric_scores, 'rubric_scores_complete': True, - 'submission_flagged': submission_flagged} + 'submission_flagged': submission_flagged, + 'answer_unknown' : answer_unknown, + } return self.try_to_decode(self.post(self.save_grade_url, data)) def is_student_calibrated(self, problem_location, grader_id): diff --git a/common/lib/xmodule/xmodule/peer_grading_module.py b/common/lib/xmodule/xmodule/peer_grading_module.py index 7df444a892..0dbdde836e 100644 --- a/common/lib/xmodule/xmodule/peer_grading_module.py +++ b/common/lib/xmodule/xmodule/peer_grading_module.py @@ -310,10 +310,11 @@ class PeerGradingModule(PeerGradingFields, XModule): submission_key = data.get('submission_key') rubric_scores = data.getlist('rubric_scores[]') submission_flagged = data.get('submission_flagged') + answer_unknown = data.get('answer_unknown', False) try: response = self.peer_gs.save_grade(location, grader_id, submission_id, - score, feedback, submission_key, rubric_scores, submission_flagged) + score, feedback, submission_key, rubric_scores, submission_flagged, answer_unknown) return response except GradingServiceError: # This is a dev_facing_error diff --git a/lms/templates/combinedopenended/combined_open_ended_status.html b/lms/templates/combinedopenended/combined_open_ended_status.html index 5495885044..66afb79021 100644 --- a/lms/templates/combinedopenended/combined_open_ended_status.html +++ b/lms/templates/combinedopenended/combined_open_ended_status.html @@ -8,7 +8,11 @@
%endif ${status['human_task']} +
+ %if i + %endif %endfor
From 59f639d9d2e1891ff6979c97d51d4005ee5021c4 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 18 Jul 2013 14:40:11 -0400 Subject: [PATCH 03/75] Change js around --- .../js/src/combinedopenended/display.coffee | 110 ++++++++++-------- 1 file changed, 62 insertions(+), 48 deletions(-) diff --git a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee index 5939fbcdd8..7eb4f06805 100644 --- a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee @@ -1,9 +1,11 @@ class @Rubric constructor: () -> - @initialize: (location) -> - $('.rubric').data("location", location) - $('input[class="score-selection"]').change @tracking_callback + @initialize: (location,el) -> + @el = el + @$el = $(el) + @$('.rubric').data("location", location) + @$('input[class="score-selection"]').change @tracking_callback # set up the hotkeys $(window).unbind('keydown', @keypress_callback) $(window).keydown @keypress_callback @@ -12,8 +14,11 @@ class @Rubric @category = $(@categories.first()) @category.prepend('> ') @category_index = 0 - - + + # locally scoped jquery. + $: (selector) -> + $(selector, @el) + @keypress_callback: (event) => # don't try to do this when user is typing in a text input if $(event.target).is('input, textarea') @@ -86,34 +91,48 @@ class @Rubric return true class @CombinedOpenEnded - constructor: (element) -> - @element=element - @reinitialize(element) + constructor: (el) -> + @el=el + @$el = $(el) + @reinitialize(el) $(window).keydown @keydown_handler $(window).keyup @keyup_handler + # locally scoped jquery. + $: (selector) -> + $(selector, @el) + reinitialize: (element) -> - @wrapper=$(element).find('section.xmodule_CombinedOpenEndedModule') - @el = $(element).find('section.combined-open-ended') - @combined_open_ended=$(element).find('section.combined-open-ended') - @id = @el.data('id') - @ajax_url = @el.data('ajax-url') - @state = @el.data('state') - @task_count = @el.data('task-count') - @task_number = @el.data('task-number') - @accept_file_upload = @el.data('accept-file-upload') - @location = @el.data('location') + @wrapper=@$('section.xmodule_CombinedOpenEndedModule') + @coe = @$('section.combined-open-ended') + + #Get data from combinedopenended + @allow_reset = @coe.data('allow_reset') + @id = @coe.data('id') + @ajax_url = @coe.data('ajax-url') + @state = @coe.data('state') + @task_count = @coe.data('task-count') + @task_number = @coe.data('task-number') + @accept_file_upload = @coe.data('accept-file-upload') + @location = @coe.data('location') + @child_state = @coe.data('state') + @child_type = @coe.data('child-type') + # set up handlers for click tracking Rubric.initialize(@location) @is_ctrl = false - @allow_reset = @el.data('allow_reset') + #Setup reset @reset_button = @$('.reset-button') @reset_button.click @reset + + #Setup next problem @next_problem_button = @$('.next-step-button') @next_problem_button.click @next_problem + @status_container = @$('.status-elements') + #setup show results @show_results_button=@$('.show-results-button') @show_results_button.click @show_results @@ -122,33 +141,32 @@ class @CombinedOpenEnded # valid states: 'initial', 'assessing', 'post_assessment', 'done' Collapsible.setCollapsibles(@el) - @submit_evaluation_button = $('.submit-evaluation-button') + @submit_evaluation_button = @$('.submit-evaluation-button') @submit_evaluation_button.click @message_post - @results_container = $('.result-container') - @combined_rubric_container = $('.combined-rubric-container') + @results_container = @$('.result-container') + @combined_rubric_container = @$('.combined-rubric-container') - @legend_container= $('.legend-container') + @legend_container= @$('.legend-container') @show_legend_current() # Where to put the rubric once we load it - @el = $(element).find('section.open-ended-child') - @errors_area = @$('.error') - @answer_area = @$('textarea.answer') - @prompt_container = @$('.prompt') - @rubric_wrapper = @$('.rubric-wrapper') - @hint_wrapper = @$('.hint-wrapper') - @message_wrapper = @$('.message-wrapper') - @submit_button = @$('.submit-button') - @child_state = @el.data('state') - @child_type = @el.data('child-type') + + @oe = @$('section.open-ended-child') + @errors_area = @$(@oe).find('.error') + @answer_area = @$(@oe).find('textarea.answer') + @prompt_container = @$(@oe).find('.prompt') + @rubric_wrapper = @$(@oe).find('.rubric-wrapper') + @hint_wrapper = @$(@oe).find('.hint-wrapper') + @message_wrapper = @$(@oe).find('.message-wrapper') + @submit_button = @$(@oe).find('.submit-button') if @child_type=="openended" - @skip_button = @$('.skip-button') + @skip_button = @$(@oe).find('.skip-button') @skip_button.click @skip_post_assessment - @file_upload_area = @$('.file-upload') + @file_upload_area = $(@oe).find('.file-upload') @can_upload_files = false - @open_ended_child= @$('.open-ended-child') + @open_ended_child= $(@oe).find('.open-ended-child') @out_of_sync_message = 'The problem state got out of sync. Try reloading the page.' @@ -166,10 +184,6 @@ class @CombinedOpenEnded @show_combined_rubric_current() @show_results_current() - # locally scoped jquery. - $: (selector) -> - $(selector, @el) - show_results_current: () => data = {'task_number' : @task_number-1} $.postWithPrefix "#{@ajax_url}/get_results", data, (response) => @@ -223,10 +237,10 @@ class @CombinedOpenEnded evaluation_scoring = $(event.target).parent() fd = new FormData() - feedback = evaluation_scoring.find('textarea.feedback-on-feedback')[0].value - submission_id = external_grader_message.find('input.submission_id')[0].value - grader_id = external_grader_message.find('input.grader_id')[0].value - score = evaluation_scoring.find("input:radio[name='evaluation-score']:checked").val() + feedback = @$(evaluation_scoring).find('textarea.feedback-on-feedback')[0].value + submission_id = @$(external_grader_message).find('input.submission_id')[0].value + grader_id = @$(external_grader_message).find('input.grader_id')[0].value + score = @$(evaluation_scoring).find("input:radio[name='evaluation-score']:checked").val() fd.append('feedback', feedback) fd.append('submission_id', submission_id) @@ -474,11 +488,11 @@ class @CombinedOpenEnded @errors_area.html(@out_of_sync_message) gentle_alert: (msg) => - if @el.find('.open-ended-alert').length - @el.find('.open-ended-alert').remove() + if @$el.find('.open-ended-alert').length + @$el.find('.open-ended-alert').remove() alert_elem = "
" + msg + "
" - @el.find('.open-ended-action').after(alert_elem) - @el.find('.open-ended-alert').css(opacity: 0).animate(opacity: 1, 700) + @$el.find('.open-ended-action').after(alert_elem) + @$el.find('.open-ended-alert').css(opacity: 0).animate(opacity: 1, 700) queueing: => if @child_state=="assessing" and @child_type=="openended" From 3509aea2b1578a42741485724581c17b8fa703ca Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Fri, 19 Jul 2013 14:21:01 -0400 Subject: [PATCH 04/75] Redo js --- .../js/src/combinedopenended/display.coffee | 175 +++++++++++------- .../peergrading/peer_grading_problem.coffee | 4 +- .../src/staff_grading/staff_grading.coffee | 4 +- 3 files changed, 107 insertions(+), 76 deletions(-) diff --git a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee index 7eb4f06805..bf569c984a 100644 --- a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee @@ -3,22 +3,17 @@ class @Rubric @initialize: (location,el) -> @el = el - @$el = $(el) - @$('.rubric').data("location", location) - @$('input[class="score-selection"]').change @tracking_callback + $('.rubric',@el).data("location", location) + $('input[class="score-selection"]',@el).change @tracking_callback # set up the hotkeys $(window).unbind('keydown', @keypress_callback) $(window).keydown @keypress_callback # display the 'current' carat - @categories = $('.rubric-category') - @category = $(@categories.first()) + @categories = $('.rubric-category',el) + @category = $(@categories.first(),el) @category.prepend('> ') @category_index = 0 - # locally scoped jquery. - $: (selector) -> - $(selector, @el) - @keypress_callback: (event) => # don't try to do this when user is typing in a text input if $(event.target).is('input, textarea') @@ -47,14 +42,14 @@ class @Rubric old_category_text = @category.html().substring(5) @category.html(old_category_text) @category_index++ - @category = $(@categories[@category_index]) + @category = $(@categories[@category_index],@el) @category.prepend('> ') @tracking_callback: (event) -> target_selection = $(event.target).val() # chop off the beginning of the name so that we can get the number of the category category = $(event.target).data("category") - location = $('.rubric').data('location') + location = $('.rubric',@el).data('location') # probably want the original problem location as well data = {location: location, selection: target_selection, category: category} @@ -64,7 +59,7 @@ class @Rubric # finds the scores for each rubric category @get_score_list: () => # find the number of categories: - num_categories = $('.rubric-category').length + num_categories = $('.rubric-category',@el).length score_lst = [] # get the score for each one @@ -83,14 +78,43 @@ class @Rubric @check_complete: () -> # check to see whether or not any categories have not been scored - num_categories = $('.rubric-category').length + num_categories = $('.rubric-category',@el).length for i in [0..(num_categories-1)] - score = $("input[name='score-selection-#{i}']:checked").val() + score = $("input[name='score-selection-#{i}']:checked",@el).val() if score == undefined return false return true class @CombinedOpenEnded + + wrapper_sel: 'section.xmodule_CombinedOpenEndedModule' + coe_sel: 'section.combined-open-ended' + reset_button_sel: '.reset-button' + next_step_sel: '.next-step-button' + status_container_sel: '.status-elements' + show_results_sel: '.show-results-button' + question_header_sel: '.question-header' + submit_evaluation_sel: '.submit-evaluation-button' + result_container_sel: 'div.result-container' + combined_rubric_sel: '.combined-rubric-container' + legend_sel: '.legend-container' + open_ended_child_sel: 'section.open-ended-child' + error_sel: '.error' + answer_area_sel: 'textarea.answer' + prompt_sel: '.prompt' + rubric_wrapper_sel: '.rubric-wrapper' + hint_wrapper_sel: '.hint-wrapper' + message_wrapper_sel: '.message-wrapper' + submit_button_sel: '.submit-button' + skip_button_sel: '.skip-button' + file_upload_sel: '.file-upload' + file_upload_box_sel: '.file-upload-box' + file_upload_preview_sel: '.file-upload-preview' + fof_sel: 'textarea.feedback-on-feedback' + sub_id_sel: 'input.submission_id' + grader_id_sel: 'input.grader_id' + grader_status_sel: '.grader-status' + constructor: (el) -> @el=el @$el = $(el) @@ -103,8 +127,8 @@ class @CombinedOpenEnded $(selector, @el) reinitialize: (element) -> - @wrapper=@$('section.xmodule_CombinedOpenEndedModule') - @coe = @$('section.combined-open-ended') + @wrapper=@$(@wrapper_sel) + @coe = @$(@coe_sel) #Get data from combinedopenended @allow_reset = @coe.data('allow_reset') @@ -118,55 +142,61 @@ class @CombinedOpenEnded @child_state = @coe.data('state') @child_type = @coe.data('child-type') + console.log(@child_state) + # set up handlers for click tracking - Rubric.initialize(@location) + Rubric.initialize(@location,@coe) @is_ctrl = false - + console.log("init rubric") #Setup reset - @reset_button = @$('.reset-button') + @reset_button = @$(@reset_button_sel) @reset_button.click @reset - + console.log("init reset") #Setup next problem - @next_problem_button = @$('.next-step-button') + @next_problem_button = @$(@next_step_sel) @next_problem_button.click @next_problem - @status_container = @$('.status-elements') + @status_container = @$(@status_container_sel) #setup show results - @show_results_button=@$('.show-results-button') + @show_results_button=@$(@show_results_sel) @show_results_button.click @show_results - @question_header = @$('.question-header') + @question_header = @$(@question_header_sel) @question_header.click @collapse_question # valid states: 'initial', 'assessing', 'post_assessment', 'done' - Collapsible.setCollapsibles(@el) - @submit_evaluation_button = @$('.submit-evaluation-button') + console.log("init collapse") + Collapsible.setCollapsibles(@$el) + console.log("finish collapse") + @submit_evaluation_button = @$(@submit_evaluation_sel) @submit_evaluation_button.click @message_post - @results_container = @$('.result-container') - @combined_rubric_container = @$('.combined-rubric-container') + @results_container = @$(@result_container_sel) + console.log(@results_container) + @combined_rubric_container = @$(@combined_rubric_sel) - @legend_container= @$('.legend-container') + @legend_container= @$(@legend_sel) @show_legend_current() # Where to put the rubric once we load it - - @oe = @$('section.open-ended-child') - @errors_area = @$(@oe).find('.error') - @answer_area = @$(@oe).find('textarea.answer') - @prompt_container = @$(@oe).find('.prompt') - @rubric_wrapper = @$(@oe).find('.rubric-wrapper') - @hint_wrapper = @$(@oe).find('.hint-wrapper') - @message_wrapper = @$(@oe).find('.message-wrapper') - @submit_button = @$(@oe).find('.submit-button') + console.log("started child") + @oe = @$(@open_ended_child_sel) + @errors_area = @$(@oe).find(@error_sel) + @answer_area = @$(@oe).find(@answer_area_sel) + @prompt_container = @$(@oe).find(@prompt_sel) + @rubric_wrapper = @$(@oe).find(@rubric_wrapper_sel) + @hint_wrapper = @$(@oe).find(@hint_wrapper_sel) + @message_wrapper = @$(@oe).find(@message_wrapper_sel) + @submit_button = @$(@oe).find(@submit_button_sel) if @child_type=="openended" - @skip_button = @$(@oe).find('.skip-button') + @skip_button = @$(@oe).find(@skip_button_sel) @skip_button.click @skip_post_assessment - @file_upload_area = $(@oe).find('.file-upload') + @file_upload_area = $(@oe).find(@file_upload_sel) @can_upload_files = false - @open_ended_child= $(@oe).find('.open-ended-child') + @open_ended_child= $(@oe).find(@open_ended_child_sel) + console.log("Passed child") @out_of_sync_message = 'The problem state got out of sync. Try reloading the page.' @@ -188,9 +218,10 @@ class @CombinedOpenEnded data = {'task_number' : @task_number-1} $.postWithPrefix "#{@ajax_url}/get_results", data, (response) => if response.success - @results_container.after(response.html).remove() - @results_container = $('div.result-container') - @submit_evaluation_button = $('.submit-evaluation-button') + if (results_container?) + @results_container.after(response.html).remove() + @results_container = @$(@result_container_sel) + @submit_evaluation_button = @$(@submit_evaluation_sel) @submit_evaluation_button.click @message_post Collapsible.setCollapsibles(@results_container) # make sure we still have click tracking @@ -204,8 +235,8 @@ class @CombinedOpenEnded $.postWithPrefix "#{@ajax_url}/get_results", data, (response) => if response.success @results_container.after(response.html).remove() - @results_container = $('div.result-container') - @submit_evaluation_button = $('.submit-evaluation-button') + @results_container = @$(@result_container_sel) + @submit_evaluation_button = @$(@submit_evaluation_sel) @submit_evaluation_button.click @message_post Collapsible.setCollapsibles(@results_container) else @@ -216,30 +247,30 @@ class @CombinedOpenEnded $.postWithPrefix "#{@ajax_url}/get_combined_rubric", data, (response) => if response.success @combined_rubric_container.after(response.html).remove() - @combined_rubric_container= $('div.combined_rubric_container') + @combined_rubric_container= $(@combined_rubric_sel) show_status_current: () => data = {} $.postWithPrefix "#{@ajax_url}/get_status", data, (response) => if response.success @status_container.after(response.html).remove() - @status_container= $('.status-elements') + @status_container= $(@status_container_sel) show_legend_current: () => data = {} $.postWithPrefix "#{@ajax_url}/get_legend", data, (response) => if response.success @legend_container.after(response.html).remove() - @legend_container= $('.legend-container') + @legend_container= $(@legend_sel) message_post: (event)=> external_grader_message=$(event.target).parent().parent().parent() evaluation_scoring = $(event.target).parent() fd = new FormData() - feedback = @$(evaluation_scoring).find('textarea.feedback-on-feedback')[0].value - submission_id = @$(external_grader_message).find('input.submission_id')[0].value - grader_id = @$(external_grader_message).find('input.grader_id')[0].value + feedback = @$(evaluation_scoring).find(@fof_sel)[0].value + submission_id = @$(external_grader_message).find(@sub_id_sel)[0].value + grader_id = @$(external_grader_message).find(@grader_id_sel)[0].value score = @$(evaluation_scoring).find("input:radio[name='evaluation-score']:checked").val() fd.append('feedback', feedback) @@ -304,7 +335,7 @@ class @CombinedOpenEnded @submit_button.hide() @queueing() if @task_number==1 and @task_count==1 - @grader_status = $('.grader-status') + @grader_status = @$(@grader_status_sel) @grader_status.html("

Response submitted for scoring.

") else if @child_state == 'post_assessment' if @child_type=="openended" @@ -347,7 +378,7 @@ class @CombinedOpenEnded if @child_state == 'initial' files = "" if @can_upload_files == true - files = $('.file-upload-box')[0].files[0] + files = @$(@file_upload_box_sel)[0].files[0] if files != undefined if files.size > max_filesize @can_upload_files = false @@ -369,7 +400,7 @@ class @CombinedOpenEnded if response.success @rubric_wrapper.html(response.rubric_html) @rubric_wrapper.show() - Rubric.initialize(@location) + Rubric.initialize(@location,@coe) @answer_area.html(response.student_response) @child_state = 'assessing' @find_assessment_elements() @@ -396,6 +427,7 @@ class @CombinedOpenEnded @is_ctrl=false save_assessment: (event) => + console.log("callback save assessment") event.preventDefault() if @child_state == 'assessing' && Rubric.check_complete() checked_assessment = Rubric.get_total_score() @@ -454,7 +486,7 @@ class @CombinedOpenEnded @hint_wrapper.html('') @message_wrapper.html('') @child_state = 'initial' - @combined_open_ended.after(response.html).remove() + @coe.after(response.html).remove() @allow_reset="False" @reinitialize(@element) @rebind() @@ -473,7 +505,7 @@ class @CombinedOpenEnded @hint_wrapper.html('') @message_wrapper.html('') @child_state = 'initial' - @combined_open_ended.after(response.html).remove() + @coe.after(response.html).remove() @reinitialize(@element) @rebind() @next_problem_button.hide() @@ -514,8 +546,8 @@ class @CombinedOpenEnded @can_upload_files = true @file_upload_area.html('Uploaded image') @file_upload_area.show() - $('.file-upload-preview').hide() - $('.file-upload-box').change @preview_image + @$(@file_upload_preview_sel).hide() + @$(@file_upload_box_sel).change @preview_image else @gentle_alert 'File uploads are required for this question, but are not supported in this browser. Try the newest version of google chrome. Alternatively, if you have uploaded the image to the web, you can paste a link to it into the answer box.' @@ -559,7 +591,7 @@ class @CombinedOpenEnded @question_header.text("(Show)") log_feedback_click: (event) -> - link_text = $(event.target).html() + link_text = @$(event.target).html() if link_text == 'See full feedback' Logger.log 'oe_show_full_feedback', {} else if link_text == 'Respond to Feedback' @@ -567,32 +599,31 @@ class @CombinedOpenEnded else generated_event_type = link_text.toLowerCase().replace(" ","_") Logger.log "oe_" + generated_event_type, {} - log_feedback_selection: (event) -> - target_selection = $(event.target).val() + target_selection = @$(event.target).val() Logger.log 'oe_feedback_response_selected', {value: target_selection} remove_attribute: (name) => - if $('.file-upload-preview').attr(name) - $('.file-upload-preview')[0].removeAttribute(name) + if @$(@file_upload_preview_sel).attr(name) + @$(@file_upload_preview_sel)[0].removeAttribute(name) preview_image: () => - if $('.file-upload-box')[0].files && $('.file-upload-box')[0].files[0] + if @$(@file_upload_box_sel)[0].files && @$(@file_upload_box_sel)[0].files[0] reader = new FileReader() reader.onload = (e) => max_dim = 150 @remove_attribute('src') @remove_attribute('height') @remove_attribute('width') - $('.file-upload-preview').attr('src', e.target.result) - height_px = $('.file-upload-preview')[0].height - width_px = $('.file-upload-preview')[0].width + @$(@file_upload_preview_sel).attr('src', e.target.result) + height_px = @$(@file_upload_preview_sel)[0].height + width_px = @$(@file_upload_preview_sel)[0].width scale_factor = 0 if height_px>width_px scale_factor = height_px/max_dim else scale_factor = width_px/max_dim - $('.file-upload-preview')[0].width = width_px/scale_factor - $('.file-upload-preview')[0].height = height_px/scale_factor - $('.file-upload-preview').show() - reader.readAsDataURL($('.file-upload-box')[0].files[0]) + @$(@file_upload_preview_sel)[0].width = width_px/scale_factor + @$(@file_upload_preview_sel)[0].height = height_px/scale_factor + @$(@file_upload_preview_sel).show() + reader.readAsDataURL(@$(@file_upload_box_sel)[0].files[0]) diff --git a/common/lib/xmodule/xmodule/js/src/peergrading/peer_grading_problem.coffee b/common/lib/xmodule/xmodule/js/src/peergrading/peer_grading_problem.coffee index 9483932f80..050d525a13 100644 --- a/common/lib/xmodule/xmodule/js/src/peergrading/peer_grading_problem.coffee +++ b/common/lib/xmodule/xmodule/js/src/peergrading/peer_grading_problem.coffee @@ -162,7 +162,7 @@ class @PeerGradingProblem @prompt_wrapper = $('.prompt-wrapper') @backend = backend @is_ctrl = false - + @el = $('.peer-grading-container') # get the location of the problem @location = $('.peer-grading').data('location') @@ -463,7 +463,7 @@ class @PeerGradingProblem @submit_button.hide() @action_button.hide() @calibration_feedback_panel.hide() - Rubric.initialize(@location) + Rubric.initialize(@location,@el) render_calibration_feedback: (response) => diff --git a/lms/static/coffee/src/staff_grading/staff_grading.coffee b/lms/static/coffee/src/staff_grading/staff_grading.coffee index f4a3360d1e..a57a8ebdb1 100644 --- a/lms/static/coffee/src/staff_grading/staff_grading.coffee +++ b/lms/static/coffee/src/staff_grading/staff_grading.coffee @@ -152,7 +152,7 @@ class @StaffGrading @backend = backend # all the jquery selectors - + @el = $('.staff-grading') @problem_list_container = $('.problem-list-container') @problem_list = $('.problem-list') @@ -224,7 +224,7 @@ class @StaffGrading setup_score_selection: => @score_selection_container.html(@rubric) $('input[class="score-selection"]').change => @graded_callback() - Rubric.initialize(@location) + Rubric.initialize(@location, @el) graded_callback: () => From e2326802106c7c88c69078ebf6c379aa918bc2f2 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Fri, 19 Jul 2013 15:15:10 -0400 Subject: [PATCH 05/75] Move child attributes --- .../xmodule/xmodule/js/src/combinedopenended/display.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee index bf569c984a..e7084d315b 100644 --- a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee @@ -139,8 +139,6 @@ class @CombinedOpenEnded @task_number = @coe.data('task-number') @accept_file_upload = @coe.data('accept-file-upload') @location = @coe.data('location') - @child_state = @coe.data('state') - @child_type = @coe.data('child-type') console.log(@child_state) @@ -189,6 +187,8 @@ class @CombinedOpenEnded @hint_wrapper = @$(@oe).find(@hint_wrapper_sel) @message_wrapper = @$(@oe).find(@message_wrapper_sel) @submit_button = @$(@oe).find(@submit_button_sel) + @child_state = @oe.data('state') + @child_type = @oe.data('child-type') if @child_type=="openended" @skip_button = @$(@oe).find(@skip_button_sel) @skip_button.click @skip_post_assessment From a47fe070583f5b41f22f57b0bde385f4699bc373 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Fri, 19 Jul 2013 15:50:28 -0400 Subject: [PATCH 06/75] Hide legend, move display name --- .../lib/xmodule/xmodule/js/src/combinedopenended/display.coffee | 2 ++ lms/templates/combinedopenended/combined_open_ended.html | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee index e7084d315b..e976b75828 100644 --- a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee @@ -303,6 +303,7 @@ class @CombinedOpenEnded @reset_button.hide() @next_problem_button.hide() @hide_file_upload() + @legend_container.show() @hint_area.attr('disabled', false) if @task_number>1 or @child_state!='initial' @show_status_current() @@ -325,6 +326,7 @@ class @CombinedOpenEnded @submit_button.prop('value', 'Submit') @submit_button.click @save_answer @setup_file_upload() + @legend_container.hide() else if @child_state == 'assessing' @answer_area.attr("disabled", true) @replace_text_inputs() diff --git a/lms/templates/combinedopenended/combined_open_ended.html b/lms/templates/combinedopenended/combined_open_ended.html index 5d8ef859aa..0dc5ec914f 100644 --- a/lms/templates/combinedopenended/combined_open_ended.html +++ b/lms/templates/combinedopenended/combined_open_ended.html @@ -1,8 +1,8 @@
+

${display_name}

${status|n}
-

${display_name}

Prompt (Hide)

From ca0cefd260d73cec70b73295e22ab4524a74ce7a Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Fri, 19 Jul 2013 16:26:23 -0400 Subject: [PATCH 07/75] Move legend, make status elements smaller --- .../lib/xmodule/xmodule/css/combinedopenended/display.scss | 2 +- lms/templates/combinedopenended/combined_open_ended.html | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss index 86c028a8b0..b6f78612f1 100644 --- a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss +++ b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss @@ -62,7 +62,7 @@ section.combined-open-ended-status { color: #2C2C2C; background-color : #d4d4d4; font-size: .9em; - padding: 20px; + padding: 10px; display: inline; width: 20%; margin-right: 20px; diff --git a/lms/templates/combinedopenended/combined_open_ended.html b/lms/templates/combinedopenended/combined_open_ended.html index 0dc5ec914f..89bfb9ebf7 100644 --- a/lms/templates/combinedopenended/combined_open_ended.html +++ b/lms/templates/combinedopenended/combined_open_ended.html @@ -16,11 +16,12 @@
-
-
+
+
+
From 2dd5338378d4cd0706434ddbdf185af5f2236992 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Fri, 19 Jul 2013 16:43:01 -0400 Subject: [PATCH 08/75] Add in progress text --- .../xmodule/css/combinedopenended/display.scss | 13 ++++++++++++- .../combined_open_ended_modulev1.py | 8 ++++++++ .../combinedopenended/combined_open_ended.html | 9 +++++++-- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss index b6f78612f1..f2d8e5c497 100644 --- a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss +++ b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss @@ -22,9 +22,20 @@ h2 { section.combined-open-ended { @include clearfix; - .status-container + .status-bar { + + .status-container + { padding-bottom: 5px; + display: inline-block; + padding-right: 20px + } + .progress-container + { + padding-bottom: 5px; + display: inline-block; + } } .item-container { 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 f7ae9af9d3..724c650cce 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 @@ -37,6 +37,13 @@ HUMAN_TASK_TYPE = { 'peer_grading.conf' : "Peer Assessment", } +HUMAN_STATES = { + 'intitial' : "Not started.", + 'assessing' : "Being scored.", + 'intermediate_done' : "Scoring finished.", + 'done' : "Complete." +} + # Default value that controls whether or not to skip basic spelling checks in the controller # Metadata overrides this SKIP_BASIC_CHECKS = False @@ -291,6 +298,7 @@ class CombinedOpenEndedV1Module(): 'accept_file_upload': self.accept_file_upload, 'location': self.location, 'legend_list': LEGEND_LIST, + 'human_state': HUMAN_STATES.get(self.state,"Not started.") } return context diff --git a/lms/templates/combinedopenended/combined_open_ended.html b/lms/templates/combinedopenended/combined_open_ended.html index 89bfb9ebf7..e09fb29482 100644 --- a/lms/templates/combinedopenended/combined_open_ended.html +++ b/lms/templates/combinedopenended/combined_open_ended.html @@ -1,7 +1,12 @@

${display_name}

-
- ${status|n} +
+
+ ${status|n} +
+
+ Progress: ${human_state} +
From 579b66d9dd641994aeaa99cdfd682e14fb302665 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 25 Jul 2013 11:44:42 -0400 Subject: [PATCH 09/75] Redesign header css --- .../css/combinedopenended/display.scss | 29 +++++++++++++++---- .../combined_open_ended.html | 15 ++++++---- .../combined_open_ended_status.html | 3 -- 3 files changed, 33 insertions(+), 14 deletions(-) diff --git a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss index f2d8e5c497..2b20943d8b 100644 --- a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss +++ b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss @@ -16,6 +16,21 @@ h2 { } } +div.name{ + padding-bottom: 15px; + h2{ + display: inline; + } + + .progress-container + { + display: inline; + float: right; + padding-top: 3px; + } + +} + .inline-error { color: darken($error-red, 10%); } @@ -24,6 +39,13 @@ section.combined-open-ended { @include clearfix; .status-bar { + float: right; + display: inline-block; + + .problemtype{ + display: inline; + margin-right: 140px; + } .status-container { @@ -31,15 +53,11 @@ section.combined-open-ended { display: inline-block; padding-right: 20px } - .progress-container - { - padding-bottom: 5px; - display: inline-block; - } } .item-container { padding-bottom: 10px; + display: inline-block; } .result-container @@ -76,7 +94,6 @@ section.combined-open-ended-status { padding: 10px; display: inline; width: 20%; - margin-right: 20px; .show-results { margin-top: .3em; text-align:right; diff --git a/lms/templates/combinedopenended/combined_open_ended.html b/lms/templates/combinedopenended/combined_open_ended.html index e09fb29482..c4623b781d 100644 --- a/lms/templates/combinedopenended/combined_open_ended.html +++ b/lms/templates/combinedopenended/combined_open_ended.html @@ -1,13 +1,18 @@
-

${display_name}

-
-
- ${status|n} -
+
+

${display_name}

Progress: ${human_state}
+
+
+ Open Response Assessment +
+ Assessments:
+ ${status|n} +
+

Prompt (Hide)

diff --git a/lms/templates/combinedopenended/combined_open_ended_status.html b/lms/templates/combinedopenended/combined_open_ended_status.html index 66afb79021..50c0459ce9 100644 --- a/lms/templates/combinedopenended/combined_open_ended_status.html +++ b/lms/templates/combinedopenended/combined_open_ended_status.html @@ -10,9 +10,6 @@ ${status['human_task']}
- %if i - %endif %endfor
From 5ae6ce9d47434c893e122f8e3790d0cd78cf61fd Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 25 Jul 2013 12:10:16 -0400 Subject: [PATCH 10/75] Add in css borders --- .../css/combinedopenended/display.scss | 26 +++++++--- .../js/src/combinedopenended/display.coffee | 9 ++-- .../combined_open_ended.html | 48 ++++++++++--------- 3 files changed, 49 insertions(+), 34 deletions(-) diff --git a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss index 2b20943d8b..f38d33d300 100644 --- a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss +++ b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss @@ -36,28 +36,40 @@ div.name{ } section.combined-open-ended { - @include clearfix; + @include clearfix; +} + +div.problemwrapper { + border: 1px solid; + border-color: lightgray; + -webkit-border-radius: 20px; + -moz-border-radius: 20px; + border-radius: 20px; + padding: 5px; .status-bar { float: right; display: inline-block; + padding: 5px; .problemtype{ display: inline; - margin-right: 140px; + margin-right: 135px; } .status-container { padding-bottom: 5px; display: inline-block; - padding-right: 20px } + border-bottom: 1px solid; + border-color: lightgray; } .item-container { padding-bottom: 10px; display: inline-block; + padding: 15px; } .result-container @@ -66,10 +78,6 @@ section.combined-open-ended { width: 100%; position:relative; } - h4 - { - margin-bottom:10px; - } } section.legend-container { @@ -694,4 +702,8 @@ section.open-ended-child { } } + div.prompt{ + padding: 10px; + background-color:white; + } } diff --git a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee index e976b75828..f89a124c09 100644 --- a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee @@ -140,8 +140,6 @@ class @CombinedOpenEnded @accept_file_upload = @coe.data('accept-file-upload') @location = @coe.data('location') - console.log(@child_state) - # set up handlers for click tracking Rubric.initialize(@location,@coe) @is_ctrl = false @@ -174,8 +172,6 @@ class @CombinedOpenEnded console.log(@results_container) @combined_rubric_container = @$(@combined_rubric_sel) - @legend_container= @$(@legend_sel) - @show_legend_current() # Where to put the rubric once we load it console.log("started child") @@ -205,6 +201,10 @@ class @CombinedOpenEnded else if @task_number==1 and @child_state!='initial' @prompt_hide() + if @child_state!="initial" + @show_legend_current() + @legend_container= @$(@legend_sel) + @find_assessment_elements() @find_hint_elements() @@ -339,6 +339,7 @@ class @CombinedOpenEnded if @task_number==1 and @task_count==1 @grader_status = @$(@grader_status_sel) @grader_status.html("

Response submitted for scoring.

") + @legend_container.hide() else if @child_state == 'post_assessment' if @child_type=="openended" @skip_button.show() diff --git a/lms/templates/combinedopenended/combined_open_ended.html b/lms/templates/combinedopenended/combined_open_ended.html index c4623b781d..ad96afc2df 100644 --- a/lms/templates/combinedopenended/combined_open_ended.html +++ b/lms/templates/combinedopenended/combined_open_ended.html @@ -5,34 +5,36 @@ Progress: ${human_state}
-
-
- Open Response Assessment -
- Assessments:
- ${status|n} -
-
- -
-

Prompt (Hide)

-
- % for item in items: -
${item['content'] | n}
- % endfor +
+
+
+ Open Response Assessment +
+ Assessments:
+ ${status|n} +
- - -
+
+

Prompt (Hide)

+
+ % for item in items: +
${item['content'] | n}
+ % endfor +
-
-
+ + +
-
-
+
+
-
+
+
+ +
+
From 9cb7d448c61a713aaf5e7cb38c04637a42164c9a Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 25 Jul 2013 12:15:05 -0400 Subject: [PATCH 11/75] Border between prompt element --- .../xmodule/xmodule/css/combinedopenended/display.scss | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss index f38d33d300..bb48b29996 100644 --- a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss +++ b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss @@ -702,8 +702,14 @@ section.open-ended-child { } } + div.prompt{ - padding: 10px; background-color:white; + border-bottom: 1px solid; + border-color: lightgray; + } + + h4{ + margin-top: 10px; } } From c059a31623b1c27368ca040f64149d1d46402301 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 25 Jul 2013 12:33:12 -0400 Subject: [PATCH 12/75] Fix border locations, remove open ended response text --- .../xmodule/css/combinedopenended/display.scss | 14 +++++++++----- .../combinedopenended/combined_open_ended.html | 3 --- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss index bb48b29996..2c53e51918 100644 --- a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss +++ b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss @@ -62,14 +62,18 @@ div.problemwrapper { padding-bottom: 5px; display: inline-block; } - border-bottom: 1px solid; - border-color: lightgray; } .item-container { padding-bottom: 10px; display: inline-block; padding: 15px; + + h4 { + padding-top: 10px; + border-top: 1px solid; + border-color: lightgray; + } } .result-container @@ -705,11 +709,11 @@ section.open-ended-child { div.prompt{ background-color:white; - border-bottom: 1px solid; - border-color: lightgray; } h4{ - margin-top: 10px; + padding-top: 10px; + border-top: 1px solid; + border-color: lightgray; } } diff --git a/lms/templates/combinedopenended/combined_open_ended.html b/lms/templates/combinedopenended/combined_open_ended.html index ad96afc2df..21008d83db 100644 --- a/lms/templates/combinedopenended/combined_open_ended.html +++ b/lms/templates/combinedopenended/combined_open_ended.html @@ -7,9 +7,6 @@
-
- Open Response Assessment -
Assessments:
${status|n}
From 172bc5cfa51989d7deeb66d3c811daf529792a00 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 25 Jul 2013 14:23:11 -0400 Subject: [PATCH 13/75] Change naming, edit border radius --- .../css/combinedopenended/display.scss | 24 +++++++++++++++---- .../combined_open_ended_modulev1.py | 8 +++---- .../combined_open_ended.html | 15 +++++++++--- 3 files changed, 35 insertions(+), 12 deletions(-) diff --git a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss index 2c53e51918..66b9c708c6 100644 --- a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss +++ b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss @@ -42,9 +42,9 @@ section.combined-open-ended { div.problemwrapper { border: 1px solid; border-color: lightgray; - -webkit-border-radius: 20px; - -moz-border-radius: 20px; - border-radius: 20px; + -webkit-border-radius: 10px; + -moz-border-radius: 10px; + border-radius: 10px; padding: 5px; .status-bar { @@ -54,7 +54,7 @@ div.problemwrapper { .problemtype{ display: inline; - margin-right: 135px; + float: left; } .status-container @@ -62,9 +62,18 @@ div.problemwrapper { padding-bottom: 5px; display: inline-block; } + + .problemtype-container{ + width: 40% + } + + .assessments-container{ + width: 30% + } } .item-container { + @clearfix padding-bottom: 10px; display: inline-block; padding: 15px; @@ -98,8 +107,13 @@ section.legend-container { section.combined-open-ended-status { padding: 20px 20px 20px 0px; - .statusitem { + &:first-child{ + border-bottom-right-radius: 10px; + } + &:last-child{ + border-top-left-radius: 10px; + } color: #2C2C2C; background-color : #d4d4d4; font-size: .9em; 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 724c650cce..2fc19fb6d7 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 @@ -31,10 +31,10 @@ ACCEPT_FILE_UPLOAD = False 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", + 'selfassessment': "Self", + 'openended': "edX", + 'ml_grading.conf' : "AI", + 'peer_grading.conf' : "Peer", } HUMAN_STATES = { diff --git a/lms/templates/combinedopenended/combined_open_ended.html b/lms/templates/combinedopenended/combined_open_ended.html index 21008d83db..799abf2711 100644 --- a/lms/templates/combinedopenended/combined_open_ended.html +++ b/lms/templates/combinedopenended/combined_open_ended.html @@ -7,9 +7,18 @@
- Assessments:
- ${status|n} -
+ + + +
+
+ Open Response Assessment +
+
+ Assessments:
+ ${status|n} +
+
From d23d354ab36202e34a63bd0ade416d5498e467f6 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 25 Jul 2013 14:41:54 -0400 Subject: [PATCH 14/75] Change top text --- .../css/combinedopenended/display.scss | 15 ++++++++--- .../combined_open_ended.html | 25 +++++++++++-------- 2 files changed, 26 insertions(+), 14 deletions(-) diff --git a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss index 66b9c708c6..0373ce1aa8 100644 --- a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss +++ b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss @@ -55,6 +55,9 @@ div.problemwrapper { .problemtype{ display: inline; float: left; + background-color: #d4d4d4; + padding: 10px; + border-radius: 5px; } .status-container @@ -64,11 +67,15 @@ div.problemwrapper { } .problemtype-container{ - width: 40% + width: 40%; + padding-top: 12px; } .assessments-container{ - width: 30% + width: 30%; + .assessment-text{ + display: inline-block; + } } } .item-container @@ -109,10 +116,10 @@ section.combined-open-ended-status { padding: 20px 20px 20px 0px; .statusitem { &:first-child{ - border-bottom-right-radius: 10px; + border-bottom-left-radius: 10px; } &:last-child{ - border-top-left-radius: 10px; + border-top-right-radius: 10px; } color: #2C2C2C; background-color : #d4d4d4; diff --git a/lms/templates/combinedopenended/combined_open_ended.html b/lms/templates/combinedopenended/combined_open_ended.html index 799abf2711..da9e8ab04f 100644 --- a/lms/templates/combinedopenended/combined_open_ended.html +++ b/lms/templates/combinedopenended/combined_open_ended.html @@ -8,16 +8,21 @@
- - + + + +
-
- Open Response Assessment -
-
- Assessments:
- ${status|n} -
-
+
+ Open Response Assessment +
+
+
+ Assessments: +
+
+ ${status|n} +
+
From b6ff513e335ac4031ff2c39178b0f871cc20126b Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 25 Jul 2013 15:06:40 -0400 Subject: [PATCH 15/75] Add in get last response functionality --- .../xmodule/js/src/combinedopenended/display.coffee | 9 +++++++++ .../combined_open_ended_modulev1.py | 6 ++++++ 2 files changed, 15 insertions(+) diff --git a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee index f89a124c09..730a9462c7 100644 --- a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee @@ -196,6 +196,8 @@ class @CombinedOpenEnded @out_of_sync_message = 'The problem state got out of sync. Try reloading the page.' + @get_last_response() + if @task_number>1 @prompt_hide() else if @task_number==1 and @child_state!='initial' @@ -263,6 +265,13 @@ class @CombinedOpenEnded @legend_container.after(response.html).remove() @legend_container= $(@legend_sel) + get_last_response: () => + data = {} + $.postWithPrefix "#{@ajax_url}/get_last_response", data, (response) => + if response.success + console.log(response) + console.log(response.response) + message_post: (event)=> external_grader_message=$(event.target).parent().parent().parent() evaluation_scoring = $(event.target).parent() 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 2fc19fb6d7..3ceafdca65 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 @@ -7,6 +7,7 @@ from xmodule.progress import Progress from xmodule.stringify import stringify_children import self_assessment_module import open_ended_module +from functools import partial from .combined_open_ended_rubric import CombinedOpenEndedRubric, GRADER_TYPE_IMAGE_DICT, HUMAN_GRADER_TYPE, LEGEND_LIST log = logging.getLogger("mitx.courseware") @@ -445,6 +446,7 @@ class CombinedOpenEndedV1Module(): 'feedback_dicts': feedback_dicts, 'grader_ids': grader_ids, 'submission_ids': submission_ids, + 'success' : True } return last_response_dict @@ -608,6 +610,7 @@ class CombinedOpenEndedV1Module(): 'get_combined_rubric': self.get_rubric, 'get_status': self.get_status_ajax, 'get_legend': self.get_legend, + 'get_last_response': self.get_last_response_ajax, } if dispatch not in handlers: @@ -617,6 +620,9 @@ class CombinedOpenEndedV1Module(): d = handlers[dispatch](data) return json.dumps(d, cls=ComplexEncoder) + def get_last_response_ajax(self,data): + return self.get_last_response(self.current_task_number) + def next_problem(self, _data): """ Called via ajax to advance to the next problem. From 29bd64555f55d534a7113d7c4910e9db75098d97 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 25 Jul 2013 15:30:11 -0400 Subject: [PATCH 16/75] Get table to take up the width of the page --- common/lib/xmodule/xmodule/css/combinedopenended/display.scss | 4 ++++ .../xmodule/xmodule/js/src/combinedopenended/display.coffee | 3 --- lms/templates/combinedopenended/combined_open_ended.html | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss index 0373ce1aa8..b1ac3d773c 100644 --- a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss +++ b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss @@ -60,6 +60,10 @@ div.problemwrapper { border-radius: 5px; } + .statustable{ + width: 750px; + } + .status-container { padding-bottom: 5px; diff --git a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee index 730a9462c7..dcb3cd24fc 100644 --- a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee @@ -196,8 +196,6 @@ class @CombinedOpenEnded @out_of_sync_message = 'The problem state got out of sync. Try reloading the page.' - @get_last_response() - if @task_number>1 @prompt_hide() else if @task_number==1 and @child_state!='initial' @@ -269,7 +267,6 @@ class @CombinedOpenEnded data = {} $.postWithPrefix "#{@ajax_url}/get_last_response", data, (response) => if response.success - console.log(response) console.log(response.response) message_post: (event)=> diff --git a/lms/templates/combinedopenended/combined_open_ended.html b/lms/templates/combinedopenended/combined_open_ended.html index da9e8ab04f..f66088be8a 100644 --- a/lms/templates/combinedopenended/combined_open_ended.html +++ b/lms/templates/combinedopenended/combined_open_ended.html @@ -7,7 +7,7 @@
- +
From 1a4be13d4c693dc002a53fc42fc16c4a873ded4c Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 25 Jul 2013 15:40:09 -0400 Subject: [PATCH 17/75] Improve rubric look and feel --- .../xmodule/css/combinedopenended/display.scss | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss index b1ac3d773c..e91765b50a 100644 --- a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss +++ b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss @@ -87,7 +87,7 @@ div.problemwrapper { @clearfix padding-bottom: 10px; display: inline-block; - padding: 15px; + margin: 0px 15px 0px 15px; h4 { padding-top: 10px; @@ -112,7 +112,7 @@ section.legend-container { display: inline; width: 20%; } - margin-bottom: 5px; + margin: 15px; } section.combined-open-ended-status { @@ -182,10 +182,11 @@ section.combined-open-ended-status { } div.combined-rubric-container { + margin:15px; ul.rubric-list{ list-style-type: none; padding:0; - margin:0; + margin:4px; li { &.rubric-list-item{ margin-bottom: 2px; @@ -194,6 +195,12 @@ div.combined-rubric-container { } } + h4{ + padding-top: 10px; + border-top: 1px solid; + border-color: lightgray; + } + span.rubric-category { font-size: .9em; font-weight: bold; From 2d966209f40935f9712ad9d27a4f4ab9a2615050 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 25 Jul 2013 15:55:34 -0400 Subject: [PATCH 18/75] fix test --- .../xmodule/open_ended_grading_classes/peer_grading_service.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/lib/xmodule/xmodule/open_ended_grading_classes/peer_grading_service.py b/common/lib/xmodule/xmodule/open_ended_grading_classes/peer_grading_service.py index f80aff610a..415298edf3 100644 --- a/common/lib/xmodule/xmodule/open_ended_grading_classes/peer_grading_service.py +++ b/common/lib/xmodule/xmodule/open_ended_grading_classes/peer_grading_service.py @@ -111,7 +111,7 @@ class MockPeerGradingService(object): 'max_score': 4} def save_grade(self, location, grader_id, submission_id, - score, feedback, submission_key, rubric_scores, submission_flagged): + score, feedback, submission_key, rubric_scores, submission_flagged, answer_unknown): return {'success': True} def is_student_calibrated(self, problem_location, grader_id): From 12a2c06fb13f53290e5bed53c3482c2e87c490e3 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 25 Jul 2013 15:57:21 -0400 Subject: [PATCH 19/75] Remove console.log statements --- .../xmodule/js/src/combinedopenended/display.coffee | 8 -------- lms/static/coffee/src/staff_grading/staff_grading.coffee | 1 - 2 files changed, 9 deletions(-) diff --git a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee index dcb3cd24fc..96ad75f088 100644 --- a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee @@ -143,11 +143,9 @@ class @CombinedOpenEnded # set up handlers for click tracking Rubric.initialize(@location,@coe) @is_ctrl = false - console.log("init rubric") #Setup reset @reset_button = @$(@reset_button_sel) @reset_button.click @reset - console.log("init reset") #Setup next problem @next_problem_button = @$(@next_step_sel) @next_problem_button.click @next_problem @@ -162,19 +160,15 @@ class @CombinedOpenEnded @question_header.click @collapse_question # valid states: 'initial', 'assessing', 'post_assessment', 'done' - console.log("init collapse") Collapsible.setCollapsibles(@$el) - console.log("finish collapse") @submit_evaluation_button = @$(@submit_evaluation_sel) @submit_evaluation_button.click @message_post @results_container = @$(@result_container_sel) - console.log(@results_container) @combined_rubric_container = @$(@combined_rubric_sel) # Where to put the rubric once we load it - console.log("started child") @oe = @$(@open_ended_child_sel) @errors_area = @$(@oe).find(@error_sel) @answer_area = @$(@oe).find(@answer_area_sel) @@ -192,7 +186,6 @@ class @CombinedOpenEnded @file_upload_area = $(@oe).find(@file_upload_sel) @can_upload_files = false @open_ended_child= $(@oe).find(@open_ended_child_sel) - console.log("Passed child") @out_of_sync_message = 'The problem state got out of sync. Try reloading the page.' @@ -436,7 +429,6 @@ class @CombinedOpenEnded @is_ctrl=false save_assessment: (event) => - console.log("callback save assessment") event.preventDefault() if @child_state == 'assessing' && Rubric.check_complete() checked_assessment = Rubric.get_total_score() diff --git a/lms/static/coffee/src/staff_grading/staff_grading.coffee b/lms/static/coffee/src/staff_grading/staff_grading.coffee index a57a8ebdb1..f22fe9c7fd 100644 --- a/lms/static/coffee/src/staff_grading/staff_grading.coffee +++ b/lms/static/coffee/src/staff_grading/staff_grading.coffee @@ -103,7 +103,6 @@ The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for t else if cmd == 'save_grade' - console.log("eval: #{data.score} pts, Feedback: #{data.feedback}") response = @mock('get_next', {location: data.location}) # get_problem_list From 77e57448b354f5d438e3b5fd61648eaa696b6adb Mon Sep 17 00:00:00 2001 From: marco Date: Thu, 1 Aug 2013 12:42:11 -0400 Subject: [PATCH 20/75] cleaned up sass document format and added baseline variable throughout capa and combined open ended problems. no style rule changes, simply whitespace, ordering of properties, and the addition of baseline over direct pixels for padding and margins. --- .../lib/xmodule/xmodule/css/capa/display.scss | 562 +++++++++--------- .../css/combinedopenended/display.scss | 494 ++++++++------- 2 files changed, 537 insertions(+), 519 deletions(-) diff --git a/common/lib/xmodule/xmodule/css/capa/display.scss b/common/lib/xmodule/xmodule/css/capa/display.scss index 48912795f0..a35dc01633 100644 --- a/common/lib/xmodule/xmodule/css/capa/display.scss +++ b/common/lib/xmodule/xmodule/css/capa/display.scss @@ -19,10 +19,10 @@ h2 { iframe[seamless]{ - background-color: transparent; - border: 0px none transparent; - padding: 0px; - overflow: hidden; + overflow: hidden; + padding: 0px; + border: 0px none transparent; + background-color: transparent; } .inline-error { @@ -31,17 +31,17 @@ iframe[seamless]{ section.problem-progress { display: inline-block; - color: #999; - font-size: em(16); - font-weight: 100; padding-left: 5px; + color: #999; + font-weight: 100; + font-size: em(16); } section.problem { @media print { display: block; - width: auto; padding: 0; + width: auto; canvas, img { page-break-inside: avoid; @@ -49,30 +49,29 @@ section.problem { } .inline { - display: inline; + display: inline; } .choicegroup { @include clearfix; - - label.choicegroup_correct{ - &:after{ - content: url('../images/correct-icon.png'); - margin-left:15px - } - } - - label.choicegroup_incorrect{ - &:after{ - content: url('../images/incorrect-icon.png'); - margin-left:15px; - } - } - - min-width:100px; + min-width: 100px; width: auto !important; width: 100px; + label.choicegroup_correct { + &:after { + margin-left: 15px; + content: url('../images/correct-icon.png'); + } + } + + label.choicegroup_incorrect { + &:after { + margin-left: 15px; + content: url('../images/incorrect-icon.png'); + } + } + .indicator_container { float: left; width: 25px; @@ -82,9 +81,9 @@ section.problem { fieldset { @include box-sizing(border-box); + margin: 0px 0px $baseline; + padding-left: $baseline; border-left: 1px solid #ddd; - padding-left: 20px; - margin: 0px 0px 20px; } input[type="radio"], @@ -102,21 +101,21 @@ section.problem { ol.enumerate { li { &:before { - content: " "; display: block; - height: 0; visibility: hidden; + height: 0; + content: " "; } } } .solution-span { > span { - margin: 20px 0; + margin: $baseline 0; display: block; border: 1px solid #ddd; - padding: 9px 15px 20px; - background: #FFF; + padding: 9px 15px $baseline; + background: #fff; position: relative; box-shadow: inset 0 0 0 1px #eee; border-radius: 3px; @@ -133,26 +132,26 @@ section.problem { margin-top: -2px; } &.status { + margin: 8px 0 0 $baseline/2; text-indent: -9999px; - margin: 8px 0 0 10px; } } &.unanswered { p.status { @include inline-block(); - background: url('../images/unanswered-icon.png') center center no-repeat; - height: 14px; width: 14px; + height: 14px; + background: url('../images/unanswered-icon.png') center center no-repeat; } } &.correct, &.ui-icon-check { p.status { @include inline-block(); - background: url('../images/correct-icon.png') center center no-repeat; - height: 20px; width: 25px; + height: 20px; + background: url('../images/correct-icon.png') center center no-repeat; } input { @@ -163,9 +162,9 @@ section.problem { &.processing { p.status { @include inline-block(); - background: url('../images/spinner.gif') center center no-repeat; - height: 20px; width: 20px; + height: 20px; + background: url('../images/spinner.gif') center center no-repeat; } input { @@ -176,9 +175,9 @@ section.problem { &.incorrect, &.ui-icon-close { p.status { @include inline-block(); - background: url('../images/incorrect-icon.png') center center no-repeat; - height: 20px; width: 20px; + height: 20px; + background: url('../images/incorrect-icon.png') center center no-repeat; text-indent: -9999px; } @@ -195,12 +194,12 @@ section.problem { p.answer { @include inline-block(); margin-bottom: 0; - margin-left: 10px; + margin-left: $baseline/2; &:before { + display: inline; content: "Answer: "; font-weight: bold; - display: inline; } &:empty { @@ -218,12 +217,12 @@ section.problem { margin-bottom: 0; &.math { - padding: 6px; - background: #f1f1f1; - border: 1px solid #e3e3e3; @include inline-block; - border-radius: 4px; + padding: 6px; min-width: 30px; + border: 1px solid #e3e3e3; + border-radius: 4px; + background: #f1f1f1; } } } @@ -231,98 +230,92 @@ section.problem { span { &.unanswered, &.ui-icon-bullet { @include inline-block(); - background: url('../images/unanswered-icon.png') center center no-repeat; - height: 14px; position: relative; top: 4px; width: 14px; + height: 14px; + background: url('../images/unanswered-icon.png') center center no-repeat; } &.processing, &.ui-icon-processing { @include inline-block(); - background: url('../images/spinner.gif') center center no-repeat; - height: 20px; position: relative; top: 6px; width: 25px; + height: 20px; + background: url('../images/spinner.gif') center center no-repeat; } &.correct, &.ui-icon-check { @include inline-block(); - background: url('../images/correct-icon.png') center center no-repeat; - height: 20px; position: relative; top: 3px; width: 25px; + height: 20px; + background: url('../images/correct-icon.png') center center no-repeat; } &.partially-correct { @include inline-block(); - background: url('../images/partially-correct-icon.png') center center no-repeat; - height: 20px; position: relative; top: 6px; width: 25px; + height: 20px; + background: url('../images/partially-correct-icon.png') center center no-repeat; } &.incorrect, &.ui-icon-close { @include inline-block(); - background: url('../images/incorrect-icon.png') center center no-repeat; - height: 20px; - width: 20px; position: relative; top: 3px; + width: 20px; + height: 20px; + background: url('../images/incorrect-icon.png') center center no-repeat; } } - .reload - { + .reload { float:right; - margin: 10px; + margin: $baseline/2; } .grader-status { + @include clearfix; + margin-bottom: $baseline; padding: 9px; - background: #F6F6F6; border: 1px solid #ddd; border-top: 0; - margin-bottom: 20px; - @include clearfix; + background: #F6F6F6; span { - text-indent: -9999px; - overflow: hidden; display: block; float: left; + overflow: hidden; margin: -7px 7px 0 0; + text-indent: -9999px; } .grading { - background: url('../images/info-icon.png') left center no-repeat; - padding-left: 25px; - text-indent: 0px; margin: 0px 7px 0 0; + padding-left: 25px; + background: url('../images/info-icon.png') left center no-repeat; + text-indent: 0px; } p { - line-height: 20px; - text-transform: capitalize; - margin-bottom: 0; float: left; + margin-bottom: 0; + text-transform: capitalize; + line-height: 20px; } &.file { - background: #FFF; - margin-top: 20px; - padding: 20px 0 0 0; - - border: { - top: 1px solid #eee; - right: 0; - bottom: 0; - left: 0; - } + background: #fff; + margin-top: $baseline; + padding: $baseline 0 0 0; + border: 0; + border-top: 1px solid #eee; p.debug { display: none; @@ -335,54 +328,54 @@ section.problem { } .evaluation { - p { - margin-bottom: 4px; - } + p { + margin-bottom: 4px; + } } .feedback-on-feedback { - height: 100px; - margin-right: 20px; + height: 100px; + margin-right: $baseline; } .evaluation-response { - header { - text-align: right; - a { - font-size: .85em; - } + header { + text-align: right; + a { + font-size: .85em; } + } } .evaluation-scoring { - .scoring-list { - list-style-type: none; - margin-left: 3px; + .scoring-list { + margin-left: 3px; + list-style-type: none; - li { - &:first-child { - margin-left: 0px; - } - display:inline; - margin-left: 50px; + li { + display:inline; + margin-left: 50px; + + &:first-child { + margin-left: 0px; + } - label { - font-size: .9em; - } - - } + label { + font-size: .9em; + } } - + } } + .submit-message-container { - margin: 10px 0px ; + margin: $baseline 0px ; } } form.option-input { - margin: -10px 0 20px; - padding-bottom: 20px; + margin: -$baseline/2 0 $baseline; + padding-bottom: $baseline; select { margin-right: flex-gutter(); @@ -390,17 +383,17 @@ section.problem { } ul { - list-style: disc outside none; margin-bottom: lh(); margin-left: .75em; margin-left: .75rem; + list-style: disc outside none; } ol { - list-style: decimal outside none; margin-bottom: lh(); margin-left: .75em; margin-left: .75rem; + list-style: decimal outside none; } dl { @@ -421,8 +414,8 @@ section.problem { } li { - line-height: 1.4em; margin-bottom: lh(.5); + line-height: 1.4em; &:last-child { margin-bottom: 0; @@ -439,8 +432,8 @@ section.problem { table-layout: auto; th { - font-weight: bold; text-align: left; + font-weight: bold; } td { @@ -453,44 +446,43 @@ section.problem { } caption { - background: #f1f1f1; margin-bottom: .75em; margin-bottom: .75rem; padding: .75em 0; padding: .75rem 0; + background: #f1f1f1; } tr, td, th { vertical-align: middle; } - } code { margin: 0 2px; padding: 0px 5px; - white-space: nowrap; - border: 1px solid #EAEAEA; - background-color: #F8F8F8; + border: 1px solid #eaeaea; border-radius: 3px; + background-color: #f8f8f8; + white-space: nowrap; font-size: .9em; } pre { - background-color: #F8F8F8; - border: 1px solid #CCC; + overflow: auto; + padding: 6px $baseline/2; + border: 1px solid #ccc; + border-radius: 3px; + background-color: #f8f8f8; font-size: .9em; line-height: 1.4; - overflow: auto; - padding: 6px 10px; - border-radius: 3px; > code { margin: 0; padding: 0; - white-space: pre; border: none; background: transparent; + white-space: pre; } } @@ -507,26 +499,25 @@ section.problem { } pre { - border-radius: 0; - border-radius: 0; - border-width: 0; + overflow: hidden; margin: 0; padding: 0; + border-width: 0; + border-radius: 0; background: transparent; - font-family: inherit; - font-size: inherit; white-space: pre; word-wrap: normal; - overflow: hidden; + font-size: inherit; + font-family: inherit; resize: none; &.CodeMirror-cursor { - z-index: 10; position: absolute; + z-index: 10; visibility: hidden; - border-left: 1px solid black; - border-right: none; width: 0; + border-right: none; + border-left: 1px solid black; } } } @@ -536,14 +527,14 @@ section.problem { } hr { - background: #ddd; - border: none; - clear: both; - color: #ddd; float: none; - height: 1px; + clear: both; margin: 0 0 .75rem; width: 100%; + height: 1px; + border: none; + background: #ddd; + color: #ddd; } .hidden { @@ -560,17 +551,17 @@ section.problem { center { display: block; margin: lh() 0; - border: 1px solid #ccc; padding: lh(); + border: 1px solid #ccc; } section.action { - margin-top: 20px; + margin-top: $baseline; .save, .check, .show { height: ($baseline*2); - font-weight: 600; vertical-align: middle; + font-weight: 600; } .save { @@ -580,8 +571,8 @@ section.problem { .show { .show-label { - font-size: 1.0em; font-weight: 600; + font-size: 1.0em; } } @@ -592,20 +583,20 @@ section.problem { // padding: 8px 12px; // margin-top: 10px; @include inline-block; - font-style: italic; - margin: 8px 0 0 10px; + margin: 8px 0 0 $baseline/2; color: #777; + font-style: italic; -webkit-font-smoothing: antialiased; } } .detailed-solution { > p:first-child { - font-size: 0.9em; + color: #aaa; + text-transform: uppercase; font-weight: bold; font-style: normal; - text-transform: uppercase; - color: #AAA; + font-size: 0.9em; } p:last-child { @@ -614,12 +605,12 @@ section.problem { } div.capa_alert { + margin-top: $baseline; padding: 8px 12px; - border: 1px solid #EBE8BF; + border: 1px solid #ebe8bf; border-radius: 3px; - background: #FFFCDD; + background: #fffcdd; font-size: 0.9em; - margin-top: 10px; } div.capa_reset { @@ -628,12 +619,14 @@ section.problem { background-color: lighten($error-red, 25%); border-radius: 3px; font-size: 1em; - margin-top: 10px; - margin-bottom: 10px; + margin-top: $baseline/2; + margin-bottom: $baseline/2; } + .capa_reset>h2 { - color: #AA0000; + color: #aa0000; } + .capa_reset li { font-size: 0.9em; } @@ -642,10 +635,10 @@ section.problem { border: 1px solid #ccc; h3 { - border-bottom: 1px solid #e3e3e3; - text-shadow: 0 1px 0 #fff; padding: 9px; + border-bottom: 1px solid #e3e3e3; background: #eee; + text-shadow: 0 1px 0 #fff; font-weight: bold; font-size: em(16); } @@ -665,7 +658,7 @@ section.problem { a { display: block; padding: 9px; - background: #F6F6F6; + background: #f6f6f6; box-shadow: inset 0 0 0 1px #fff; } } @@ -683,22 +676,22 @@ section.problem { margin-bottom: 12px; h3 { - font-size: 0.9em; + color: #aaa; + text-transform: uppercase; font-weight: bold; font-style: normal; - text-transform: uppercase; - color: #AAA; + font-size: 0.9em; } } > section { - border: 1px solid #ddd; - padding: 9px 9px 20px; - margin-bottom: 10px; - background: #FFF; position: relative; - box-shadow: inset 0 0 0 1px #eee; + margin-bottom: $baseline/2; + padding: 9px 9px $baseline; + border: 1px solid #ddd; border-radius: 3px; + background: #fff; + box-shadow: inset 0 0 0 1px #eee; p:last-of-type { margin-bottom: 0; @@ -709,28 +702,29 @@ section.problem { } a.full { - @include position(absolute, 0 0 1px 0px); - font-size: .8em; - padding: 4px; - text-align: right; - width: 100%; - display: block; - background: #F3F3F3; + @include position(absolute, 0 0 1px 0); @include box-sizing(border-box); + display: block; + padding: 4px; + width: 100%; + background: #f3f3f3; + text-align: right; + font-size: .8em; } } } .external-grader-message { section { - padding-left: 20px; - background-color: #FAFAFA; - color: #2C2C2C; - font-family: monospace; + padding-top: $baseline/2; + padding-left: $baseline; + background-color: #fafafa; + color: #2c2c2c; font-size: 1em; - padding-top: 10px; + font-family: monospace; + header { - font-size: 1.4em; + font-size: 1.4em; } .shortform { @@ -738,35 +732,36 @@ section.problem { } .longform { - padding: 0px; - margin: 0px; + margin: 0; + padding: 0; .result-errors { - margin: 5px; - padding: 10px 10px 10px 40px; + margin: $baseline/4; + padding: $baseline/2 $baseline/2 $baseline/2 $baseline*2; background: url('../images/incorrect-icon.png') center left no-repeat; + li { - color: #B00; - } + color: #b00; + } } .result-output { - margin: 5px; - padding: 20px 0px 15px 50px; - border-top: 1px solid #DDD; - border-left: 20px solid #FAFAFA; + margin: $baseline/4; + padding: $baseline 0 15px 50px; + border-top: 1px solid #ddd; + border-left: $baseline solid #fafafa; h4 { - font-family: monospace; font-size: 1em; + font-family: monospace; } dl { - margin: 0px; + margin: 0; } dt { - margin-top: 20px; + margin-top: $baseline; } dd { @@ -776,6 +771,7 @@ section.problem { .result-correct { background: url('../images/correct-icon.png') left 20px no-repeat; + .result-actual-output { color: #090; } @@ -783,6 +779,7 @@ section.problem { .result-incorrect { background: url('../images/incorrect-icon.png') left 20px no-repeat; + .result-actual-output { color: #B00; } @@ -790,16 +787,16 @@ section.problem { .markup-text{ margin: 5px; - padding: 20px 0px 15px 50px; - border-top: 1px solid #DDD; - border-left: 20px solid #FAFAFA; + padding: $baseline 0 15px 50px; + border-top: 1px solid #ddd; + border-left: 20px solid #fafafa; bs { - color: #BB0000; + color: #bb0000; } bg { - color: #BDA046; + color: #bda046; } } } @@ -807,96 +804,111 @@ section.problem { } .rubric { - tr { - margin:10px 0px; - height: 100%; - } - td { - padding: 20px 0px; - margin: 10px 0px; - height: 100%; - } - th { - padding: 5px; - margin: 5px; - } - label, - .view-only { - margin:3px; - position: relative; - padding: 15px; - width: 150px; - height:100%; - display: inline-block; - min-height: 50px; - min-width: 50px; - background-color: #CCC; - font-size: .9em; - } - .grade { - position: absolute; - bottom:0px; - right:0px; - margin:10px; - } - .selected-grade { - background: #666; - color: white; - } - input[type=radio]:checked + label { - background: #666; - color: white; } - input[class='score-selection'] { - display: none; - } + tr { + margin: $baseline/2 0; + height: 100%; + } + + td { + margin: $baseline/2 0; + padding: $baseline 0; + height: 100%; + } + + th { + margin: $baseline/4; + padding: $baseline/4; + } + + label, + .view-only { + position: relative; + display: inline-block; + margin: 3px; + padding: 15px; + min-width: 50px; + min-height: 50px; + width: 150px; + height: 100%; + background-color: #ccc; + font-size: .9em; + } + + .grade { + position: absolute; + right: 0; + bottom: 0; + margin: $baseline/2; + } + + .selected-grade { + background: #666; + color: white; + } + + input[type=radio]:checked + label { + background: #666; + color: white; + } + + input[class='score-selection'] { + display: none; + } } .annotation-input { $yellow: rgba(255,255,10,0.3); - + margin: 0 0 1em 0; border: 1px solid #ccc; border-radius: 1em; - margin: 0 0 1em 0; .annotation-header { - font-weight: bold; - border-bottom: 1px solid #ccc; padding: .5em 1em; + border-bottom: 1px solid #ccc; + font-weight: bold; } + .annotation-body { padding: .5em 1em; } + a.annotation-return { float: right; font: inherit; font-weight: normal; } + a.annotation-return:after { content: " \2191" } .block, ul.tags { margin: .5em 0; padding: 0; } + .block-highlight { padding: .5em; + border: 1px solid darken($yellow, 10%); + background-color: $yellow; color: #333; font-style: normal; - background-color: $yellow; - border: 1px solid darken($yellow, 10%); } + .block-comment { font-style: italic; } ul.tags { display: block; - list-style-type: none; margin-left: 1em; + list-style-type: none; + li { + position: relative; display: block; margin: 1em 0 0 0; - position: relative; + .tag { display: inline-block; - cursor: pointer; + margin-left: $baseline; border: 1px solid rgb(102,102,102); - margin-left: 40px; + cursor: pointer; + &.selected { background-color: $yellow; } @@ -908,42 +920,49 @@ section.problem { .tag-status, .tag { padding: .25em .5em; } } } + textarea.comment { $num-lines-to-show: 5; $line-height: 1.4em; $padding: .2em; - width: 100%; padding: $padding (2 * $padding); - line-height: $line-height; + width: 100%; height: ($num-lines-to-show * $line-height) + (2*$padding) - (($line-height - 1)/2); + line-height: $line-height; } + .answer-annotation { display: block; margin: 0; } /* for debugging the input value field. enable the debug flag on the inputtype */ .debug-value { - color: #fff; - padding: 1em; - margin: 1em 0; - background-color: #999; - border: 1px solid #000; - input[type="text"] { width: 100%; } - pre { background-color: #CCC; color: #000; } - &:before { - display: block; - content: "debug input value"; - text-transform: uppercase; - font-weight: bold; - font-size: 1.5em; - } + margin: 1em 0; + padding: 1em; + border: 1px solid #000; + background-color: #999; + color: #fff; + + input[type="text"] { width: 100%; } + + pre { background-color: #CCC; color: #000; } + + &:before { + display: block; + content: "debug input value"; + text-transform: uppercase; + font-weight: bold; + font-size: 1.5em; + } } } + .choicetextgroup{ + @extend .choicegroup; + input[type="text"]{ margin-bottom: 0.5em; } - @extend .choicegroup; - label.choicetextgroup_correct, section.choicetextgroup_correct{ + label.choicetextgroup_correct, section.choicetextgroup_correct { @extend label.choicegroup_correct; input[type="text"] { @@ -951,17 +970,18 @@ section.problem { } } - label.choicetextgroup_incorrect, section.choicetextgroup_incorrect{ + label.choicetextgroup_incorrect, section.choicetextgroup_incorrect { @extend label.choicegroup_incorrect; } - label.choicetextgroup_show_correct, section.choicetextgroup_show_correct{ - &:after{ - content: url('../images/correct-icon.png'); + label.choicetextgroup_show_correct, section.choicetextgroup_show_correct { + &:after { margin-left:15px; + content: url('../images/correct-icon.png'); } } - span.mock_label{ + + span.mock_label { cursor : default; } } diff --git a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss index e91765b50a..61b1901866 100644 --- a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss +++ b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss @@ -17,18 +17,17 @@ h2 { } div.name{ - padding-bottom: 15px; - h2{ - display: inline; - } - - .progress-container - { - display: inline; - float: right; - padding-top: 3px; - } + padding-bottom: 15px; + + h2{ + display: inline; + } + .progress-container { + display: inline; + float: right; + padding-top: 3px; + } } .inline-error { @@ -36,177 +35,178 @@ div.name{ } section.combined-open-ended { - @include clearfix; + @include clearfix; } div.problemwrapper { + padding: $baseline/4; border: 1px solid; border-color: lightgray; - -webkit-border-radius: 10px; - -moz-border-radius: 10px; - border-radius: 10px; - padding: 5px; - .status-bar - { - float: right; + border-radius: 10px; + + .status-bar { display: inline-block; + float: right; padding: 5px; .problemtype{ - display: inline; - float: left; - background-color: #d4d4d4; - padding: 10px; - border-radius: 5px; + display: inline; + float: left; + padding: $baseline/2; + border-radius: 5px; + background-color: #d4d4d4; } - .statustable{ - width: 750px; + .statustable { + width: 750px; } - .status-container - { - padding-bottom: 5px; + .status-container { display: inline-block; + padding-bottom: $baseline/4; } - .problemtype-container{ - width: 40%; - padding-top: 12px; + .problemtype-container { + width: 40%; + padding-top: 12px; } - .assessments-container{ - width: 30%; - .assessment-text{ - display: inline-block; - } - } - } - .item-container - { - @clearfix - padding-bottom: 10px; - display: inline-block; - margin: 0px 15px 0px 15px; + .assessments-container { + width: 30%; - h4 { - padding-top: 10px; - border-top: 1px solid; - border-color: lightgray; + .assessment-text { + display: inline-block; } + } + } + .item-container { + @clearfix + padding-bottom: 10px; + display: inline-block; + margin: 0px 15px 0px 15px; + + h4 { + padding-top: $baseline/2; + border-top: 1px solid; + border-color: lightgray; + } } - .result-container - { - float:left; - width: 100%; - position:relative; + .result-container { + float:left; + width: 100%; + position:relative; } } section.legend-container { + margin: 15px; + .legenditem { + display: inline; + padding: 2px; + width: 20%; background-color : #d4d4d4; font-size: .9em; - padding: 2px; - display: inline; - width: 20%; } - margin: 15px; } section.combined-open-ended-status { + padding: $baseline $baseline $baseline 0; - padding: 20px 20px 20px 0px; - .statusitem { - &:first-child{ - border-bottom-left-radius: 10px; - } - &:last-child{ - border-top-right-radius: 10px; - } - color: #2C2C2C; - background-color : #d4d4d4; - font-size: .9em; - padding: 10px; - display: inline; - width: 20%; - .show-results { - margin-top: .3em; - text-align:right; - } - .show-results-button { - font: 1em monospace; - } + .statusitem { + display: inline; + padding: $baseline/2; + width: 20%; + background-color : #d4d4d4; + color: #2c2c2c; + font-size: .9em; + + &:first-child { + border-bottom-left-radius: 10px; } - .statusitem-current { - background-color: #B2B2B2; - color: #222; - } - - span { - &.unanswered { - @include inline-block(); - background: url('../images/unanswered-icon.png') center center no-repeat; - height: 14px; - position: relative; - width: 14px; - float: right; - } - - &.correct { - @include inline-block(); - background: url('../images/correct-icon.png') center center no-repeat; - height: 20px; - position: relative; - width: 25px; - float: right; - } - - &.incorrect { - @include inline-block(); - background: url('../images/incorrect-icon.png') center center no-repeat; - height: 20px; - width: 20px; - position: relative; - float: right; - } + &:last-child { + border-top-right-radius: 10px; + } + + .show-results { + margin-top: .3em; + text-align:right; } - .icon-caret-right { - display: inline-block; - vertical-align: baseline; - margin-right: ($baseline/4); + .show-results-button { + font: 1em monospace; } + } + + .statusitem-current { + background-color: #B2B2B2; + color: #222; + } + + span { + &.unanswered { + @include inline-block(); + position: relative; + float: right; + width: 14px; + height: 14px; + background: url('../images/unanswered-icon.png') center center no-repeat; + } + + &.correct { + @include inline-block(); + position: relative; + float: right; + width: 25px; + height: 20px; + background: url('../images/correct-icon.png') center center no-repeat; + } + + &.incorrect { + @include inline-block(); + position: relative; + float: right; + width: 20px; + height: 20px; + background: url('../images/incorrect-icon.png') center center no-repeat; + } + } + + .icon-caret-right { + display: inline-block; + vertical-align: baseline; + margin-right: ($baseline/4); + } } div.combined-rubric-container { - margin:15px; - ul.rubric-list{ + margin: 15px; + padding-bottom: 5px; + padding-top: 10px; + + ul.rubric-list { + margin: 4px; + padding: 0; list-style-type: none; - padding:0; - margin:4px; li { - &.rubric-list-item{ + &.rubric-list-item { margin-bottom: 2px; padding: 0px; } } } - - h4{ - padding-top: 10px; - border-top: 1px solid; - border-color: lightgray; - } + h4 { + padding-top: 10px; + border-top: 1px solid; + border-color: lightgray; + } span.rubric-category { font-size: .9em; font-weight: bold; } - padding-bottom: 5px; - padding-top: 10px; } div.result-container { @@ -342,8 +342,8 @@ div.result-container { section.open-ended-child { @media print { display: block; - width: auto; padding: 0; + width: auto; canvas, img { page-break-inside: avoid; @@ -351,30 +351,30 @@ section.open-ended-child { } .inline { - display: inline; + display: inline; } ol.enumerate { li { &:before { - content: " "; display: block; - height: 0; visibility: hidden; + height: 0; + content: " "; } } } .solution-span { > span { - margin: 20px 0; - display: block; - border: 1px solid #ddd; - padding: 9px 15px 20px; - background: #FFF; position: relative; - box-shadow: inset 0 0 0 1px #eee; + display: block; + margin: $baseline 0; + padding: 9px 15px $baseline; + border: 1px solid #ddd; border-radius: 3px; + background: #fff; + box-shadow: inset 0 0 0 1px #eee; &:empty { display: none; @@ -387,8 +387,8 @@ section.open-ended-child { margin-top: -2px; } &.status { + margin: 8px 0 0 $baseline/2; text-indent: -9999px; - margin: 8px 0 0 10px; } } @@ -404,9 +404,9 @@ section.open-ended-child { div.correct, div.ui-icon-check { p.status { @include inline-block(); - background: url('../images/correct-icon.png') center center no-repeat; - height: 20px; width: 25px; + height: 20px; + background: url('../images/correct-icon.png') center center no-repeat; } input { @@ -417,9 +417,9 @@ section.open-ended-child { div.processing { p.status { @include inline-block(); - background: url('../images/spinner.gif') center center no-repeat; - height: 20px; width: 20px; + height: 20px; + background: url('../images/spinner.gif') center center no-repeat; } input { @@ -430,9 +430,9 @@ section.open-ended-child { div.incorrect, div.ui-icon-close { p.status { @include inline-block(); - background: url('../images/incorrect-icon.png') center center no-repeat; - height: 20px; width: 20px; + height: 20px; + background: url('../images/incorrect-icon.png') center center no-repeat; text-indent: -9999px; } @@ -467,96 +467,90 @@ section.open-ended-child { span { &.unanswered, &.ui-icon-bullet { @include inline-block(); - background: url('../images/unanswered-icon.png') center center no-repeat; - height: 14px; position: relative; top: 4px; width: 14px; + height: 14px; + background: url('../images/unanswered-icon.png') center center no-repeat; } &.processing, &.ui-icon-processing { @include inline-block(); - background: url('../images/spinner.gif') center center no-repeat; - height: 20px; position: relative; top: 6px; width: 25px; + height: 20px; + background: url('../images/spinner.gif') center center no-repeat; } &.correct, &.ui-icon-check { @include inline-block(); - background: url('../images/correct-icon.png') center center no-repeat; - height: 20px; position: relative; top: 6px; width: 25px; + height: 20px; + background: url('../images/correct-icon.png') center center no-repeat; } &.incorrect, &.ui-icon-close { @include inline-block(); - background: url('../images/incorrect-icon.png') center center no-repeat; - height: 20px; - width: 20px; position: relative; top: 6px; + width: 20px; + height: 20px; + background: url('../images/incorrect-icon.png') center center no-repeat; } } - .reload - { + .reload { float:right; margin: 10px; } div.short-form-response { - background: #F6F6F6; - border: 1px solid #ddd; - margin-bottom: 0px; - overflow-y: auto; - height: 200px; - @include clearfix; - } + @include clearfix; + overflow-y: auto; + margin-bottom: 0; + height: 200px; + border: 1px solid #ddd; + background: #f6f6f6; + } .grader-status { - padding: 9px; - background: #F6F6F6; - border: 1px solid #ddd; - border-top: 0; - margin-bottom: 20px; @include clearfix; + margin-bottom: $baseline; + padding: 9px; + border: 1px solid #ddd; + border-top: 0px; + background: #F6F6F6; span { - text-indent: -9999px; - overflow: hidden; display: block; float: left; + overflow: hidden; margin: -7px 7px 0 0; + text-indent: -9999px; } .grading { - background: url('../images/info-icon.png') left center no-repeat; + margin: 0 7px 0 0; padding-left: 25px; - text-indent: 0px; - margin: 0px 7px 0 0; + background: url('../images/info-icon.png') left center no-repeat; + text-indent: 0; } p { - line-height: 20px; - margin-bottom: 0; float: left; + margin-bottom: 0; + line-height: 20px; } &.file { - background: #FFF; - margin-top: 20px; - padding: 20px 0 0 0; - - border: { - top: 1px solid #eee; - right: 0; - bottom: 0; - left: 0; - } + margin-top: $baseline; + padding: $baseline 0 0 0; + border: 0; + border-top: 1px solid #eee; + background: #fff; p.debug { display: none; @@ -570,8 +564,8 @@ section.open-ended-child { } form.option-input { - margin: -10px 0 20px; - padding-bottom: 20px; + margin: -$baseline/2 0 $baseline; + padding-bottom: $baseline; select { margin-right: flex-gutter(); @@ -579,29 +573,30 @@ section.open-ended-child { } ul { - list-style: disc outside none; margin-bottom: lh(); margin-left: .75em; margin-left: .75rem; + list-style: disc outside none; } ul.rubric-list{ - list-style-type: none; - padding:0; - margin:0; - li { - &.rubric-list-item{ - margin-bottom: 0px; - padding: 0px; - } - } + margin: 0; + padding: 0; + list-style-type: none; + + li { + &.rubric-list-item { + margin-bottom: 0; + padding: 0; + } + } } ol { - list-style: decimal outside none; margin-bottom: lh(); margin-left: .75em; margin-left: .75rem; + list-style: decimal outside none; } dl { @@ -622,8 +617,9 @@ section.open-ended-child { } li { - margin-bottom: 0px; - padding: 0px; + margin-bottom: 0; + padding: 0; + &:last-child { margin-bottom: 0; } @@ -634,14 +630,14 @@ section.open-ended-child { } hr { - background: #ddd; - border: none; - clear: both; - color: #ddd; float: none; - height: 1px; + clear: both; margin: 0 0 .75rem; width: 100%; + height: 1px; + border: none; + background: #ddd; + color: #ddd; } .hidden { @@ -655,7 +651,7 @@ section.open-ended-child { } section.action { - margin-top: 20px; + margin-top: $baseline; input.save { @extend .blue-button !optional; @@ -663,20 +659,20 @@ section.open-ended-child { .submission_feedback { @include inline-block; - font-style: italic; - margin: 8px 0 0 10px; + margin: 8px 0 0 $baseline/2; color: #777; + font-style: italic; -webkit-font-smoothing: antialiased; } } .detailed-solution { > p:first-child { - font-size: 0.9em; + color: #aaa; + text-transform: uppercase; font-weight: bold; font-style: normal; - text-transform: uppercase; - color: #AAA; + font-size: 0.9em; } p:last-child { @@ -686,66 +682,68 @@ section.open-ended-child { div.open-ended-alert, .save_message { + margin-top: $baseline/2; + margin-bottom: $baseline/4; padding: 8px 12px; - border: 1px solid #EBE8BF; + border: 1px solid #ebe8bf; border-radius: 3px; - background: #FFFCDD; + background: #fffcdd; font-size: 0.9em; - margin-top: 10px; - margin-bottom:5px; } div.capa_reset { + margin-top: $baseline/2; + margin-bottom: $baseline/2; padding: 25px; border: 1px solid $error-red; - background-color: lighten($error-red, 25%); border-radius: 3px; + background-color: lighten($error-red, 25%); font-size: 1em; - margin-top: 10px; - margin-bottom: 10px; } - .capa_reset>h2 { - color: #AA0000; + + .capa_reset > h2 { + color: #aa0000; } + .capa_reset li { font-size: 0.9em; } .assessment-container { - margin: 40px 0px 30px 0px; - .scoring-container - { - p - { - margin-bottom: 1em; - } - label { - margin: 10px; - padding: 5px; - display: inline-block; - min-width: 50px; - background-color: #CCC; - text-size: 1.5em; - } - - input[type=radio]:checked + label { - background: #666; - color: white; - } - input[class='grade-selection'] { - display: none; - } + margin: $baseline*2 0px 30px 0px; + .scoring-container { + p { + margin-bottom: 1em; } + + label { + display: inline-block; + margin: $baseline/2; + padding: $baseline/4; + min-width: 50px; + background-color: #ccc; + text-size: 1.5em; + } + + input[type=radio]:checked + label { + background: #666; + color: white; + } + + input[class='grade-selection'] { + display: none; + } + } } - div.prompt{ - background-color:white; + div.prompt { + background-color: white; } - h4{ - padding-top: 10px; - border-top: 1px solid; + h4 { + padding-top: $baseline/2; border-color: lightgray; + border-top: 1px solid; } } From 178be44333659f4d2c178a6ce9b727ea9effe48d Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 1 Aug 2013 16:25:21 -0400 Subject: [PATCH 21/75] Remove legend, start to edit rubric --- .../css/combinedopenended/display.scss | 14 +++++++++ .../js/src/combinedopenended/display.coffee | 31 ++++++++----------- .../combined_open_ended_rubric.py | 10 ++++++ .../openendedchild.py | 6 ++-- .../combined_open_ended_results.html | 2 +- .../openended/open_ended_combined_rubric.html | 25 ++++++++------- 6 files changed, 54 insertions(+), 34 deletions(-) diff --git a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss index 61b1901866..5e217e5ee0 100644 --- a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss +++ b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss @@ -207,6 +207,20 @@ div.combined-rubric-container { font-size: .9em; font-weight: bold; } + + label.choicegroup_correct { + &:before { + margin-right: 15px; + content: url('../images/correct-icon.png'); + } + } + + label.choicegroup_incorrect { + &:before { + margin-right: 15px; + content: url('../images/incorrect-icon.png'); + } + } } div.result-container { diff --git a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee index 96ad75f088..6022bdd4cc 100644 --- a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee @@ -55,7 +55,6 @@ class @Rubric data = {location: location, selection: target_selection, category: category} Logger.log 'rubric_select', data - # finds the scores for each rubric category @get_score_list: () => # find the number of categories: @@ -97,7 +96,6 @@ class @CombinedOpenEnded submit_evaluation_sel: '.submit-evaluation-button' result_container_sel: 'div.result-container' combined_rubric_sel: '.combined-rubric-container' - legend_sel: '.legend-container' open_ended_child_sel: 'section.open-ended-child' error_sel: '.error' answer_area_sel: 'textarea.answer' @@ -114,6 +112,8 @@ class @CombinedOpenEnded sub_id_sel: 'input.submission_id' grader_id_sel: 'input.grader_id' grader_status_sel: '.grader-status' + info_rubric_elements_sel: '.rubric-elements-info' + rubric_collapse_sel: '.rubric-collapse' constructor: (el) -> @el=el @@ -194,10 +194,6 @@ class @CombinedOpenEnded else if @task_number==1 and @child_state!='initial' @prompt_hide() - if @child_state!="initial" - @show_legend_current() - @legend_container= @$(@legend_sel) - @find_assessment_elements() @find_hint_elements() @@ -240,7 +236,10 @@ class @CombinedOpenEnded $.postWithPrefix "#{@ajax_url}/get_combined_rubric", data, (response) => if response.success @combined_rubric_container.after(response.html).remove() - @combined_rubric_container= $(@combined_rubric_sel) + @combined_rubric_container= @$(@combined_rubric_sel) + @toggle_rubric("") + @rubric_collapse = @$(@rubric_collapse_sel) + @rubric_collapse.click @toggle_rubric show_status_current: () => data = {} @@ -249,13 +248,6 @@ class @CombinedOpenEnded @status_container.after(response.html).remove() @status_container= $(@status_container_sel) - show_legend_current: () => - data = {} - $.postWithPrefix "#{@ajax_url}/get_legend", data, (response) => - if response.success - @legend_container.after(response.html).remove() - @legend_container= $(@legend_sel) - get_last_response: () => data = {} $.postWithPrefix "#{@ajax_url}/get_last_response", data, (response) => @@ -302,7 +294,6 @@ class @CombinedOpenEnded @reset_button.hide() @next_problem_button.hide() @hide_file_upload() - @legend_container.show() @hint_area.attr('disabled', false) if @task_number>1 or @child_state!='initial' @show_status_current() @@ -325,7 +316,6 @@ class @CombinedOpenEnded @submit_button.prop('value', 'Submit') @submit_button.click @save_answer @setup_file_upload() - @legend_container.hide() else if @child_state == 'assessing' @answer_area.attr("disabled", true) @replace_text_inputs() @@ -338,7 +328,6 @@ class @CombinedOpenEnded if @task_number==1 and @task_count==1 @grader_status = @$(@grader_status_sel) @grader_status.html("

Response submitted for scoring.

") - @legend_container.hide() else if @child_state == 'post_assessment' if @child_type=="openended" @skip_button.show() @@ -568,7 +557,7 @@ class @CombinedOpenEnded reload: -> location.reload() - collapse_question: () => + collapse_question: (event) => @prompt_container.slideToggle() @prompt_container.toggleClass('open') if @question_header.text() == "(Hide)" @@ -578,6 +567,7 @@ class @CombinedOpenEnded Logger.log 'oe_show_question', {location: @location} new_text = "(Hide)" @question_header.text(new_text) + return false prompt_show: () => if @prompt_container.is(":hidden")==true @@ -628,3 +618,8 @@ class @CombinedOpenEnded @$(@file_upload_preview_sel)[0].height = height_px/scale_factor @$(@file_upload_preview_sel).show() reader.readAsDataURL(@$(@file_upload_box_sel)[0].files[0]) + + toggle_rubric: (event) => + info_rubric_elements = @$(@info_rubric_elements_sel) + info_rubric_elements.slideToggle() + return false diff --git a/common/lib/xmodule/xmodule/open_ended_grading_classes/combined_open_ended_rubric.py b/common/lib/xmodule/xmodule/open_ended_grading_classes/combined_open_ended_rubric.py index 6245d4d31c..0b2b0fdaec 100644 --- a/common/lib/xmodule/xmodule/open_ended_grading_classes/combined_open_ended_rubric.py +++ b/common/lib/xmodule/xmodule/open_ended_grading_classes/combined_open_ended_rubric.py @@ -208,6 +208,7 @@ class CombinedOpenEndedRubric(object): feedback_types) rubric_categories = self.extract_categories(rubric_xml) max_scores = map((lambda cat: cat['options'][-1]['points']), rubric_categories) + actual_scores = [] max_score = max(max_scores) for i in xrange(0, len(rubric_categories)): category = rubric_categories[i] @@ -217,9 +218,18 @@ class CombinedOpenEndedRubric(object): if tuple[1] == i and tuple[2] == j: for grader_type in tuple[3]: rubric_categories[i]['options'][j]['grader_types'].append(grader_type) + if len(actual_scores)<=i: + actual_scores.append([j]) + else: + actual_scores[i] += [j] + + actual_scores = [sum(i)/len(i) for i in actual_scores] + correct = [int(a>.66) for a in actual_scores] html = self.system.render_template('{0}/open_ended_combined_rubric.html'.format(self.TEMPLATE_DIR), {'categories': rubric_categories, + 'max_scores': max_scores, + 'correct' : correct, 'has_score': True, 'view_only': True, 'max_score': max_score, diff --git a/common/lib/xmodule/xmodule/open_ended_grading_classes/openendedchild.py b/common/lib/xmodule/xmodule/open_ended_grading_classes/openendedchild.py index 10f939b270..555505d611 100644 --- a/common/lib/xmodule/xmodule/open_ended_grading_classes/openendedchild.py +++ b/common/lib/xmodule/xmodule/open_ended_grading_classes/openendedchild.py @@ -58,7 +58,7 @@ class OpenEndedChild(object): 'assessing': 'In progress', 'post_assessment': 'Done', 'done': 'Done', - } + } def __init__(self, system, location, definition, descriptor, static_data, instance_state=None, shared_state=None, **kwargs): @@ -229,7 +229,7 @@ class OpenEndedChild(object): 'max_score': self._max_score, 'child_attempts': self.child_attempts, 'child_created': False, - } + } return json.dumps(state) def _allow_reset(self): @@ -485,4 +485,4 @@ class OpenEndedChild(object): else: eta_string = "" - return eta_string + return eta_string \ No newline at end of file diff --git a/lms/templates/combinedopenended/combined_open_ended_results.html b/lms/templates/combinedopenended/combined_open_ended_results.html index 0a03737b8f..f1e9289221 100644 --- a/lms/templates/combinedopenended/combined_open_ended_results.html +++ b/lms/templates/combinedopenended/combined_open_ended_results.html @@ -1,4 +1,4 @@
-

${task_name}

+

${task_name}

(Show) ${results | n}
diff --git a/lms/templates/combinedopenended/openended/open_ended_combined_rubric.html b/lms/templates/combinedopenended/openended/open_ended_combined_rubric.html index 61393cdc95..9ae148442f 100644 --- a/lms/templates/combinedopenended/openended/open_ended_combined_rubric.html +++ b/lms/templates/combinedopenended/openended/open_ended_combined_rubric.html @@ -7,18 +7,19 @@ <% option = category['options'][j] %>
  • - %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] %> - % 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']} + %if len(category['options'][j]['grader_types'])>0: + %if correct[i]==1: +
  • % endfor From 0e8c29989c8c4ddc95e06b03abf58a962d183621 Mon Sep 17 00:00:00 2001 From: marco Date: Fri, 2 Aug 2013 00:57:31 -0400 Subject: [PATCH 22/75] style cleanup for open ended assessments, cleaning up workflow header, style definitions for rubrics are commented out momentarily, and an open issue for unicode rendering on the show and hide prompt area still remains --- .../css/combinedopenended/display.scss | 128 ++++++++++++------ .../js/src/combinedopenended/display.coffee | 8 +- .../combined_open_ended.html | 8 +- 3 files changed, 93 insertions(+), 51 deletions(-) diff --git a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss index 61b1901866..32e88d23e2 100644 --- a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss +++ b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss @@ -39,56 +39,74 @@ section.combined-open-ended { } div.problemwrapper { - padding: $baseline/4; - border: 1px solid; - border-color: lightgray; - border-radius: 10px; + border: 1px solid lightgray; + border-radius: $baseline/2; .status-bar { - display: inline-block; - float: right; - padding: 5px; - - .problemtype{ - display: inline; - float: left; - padding: $baseline/2; - border-radius: 5px; - background-color: #d4d4d4; - } + background-color: #eee; + border-radius: $baseline/2 $baseline/2 0 0; + border-bottom: 1px solid lightgray; .statustable { - width: 750px; + width: 100%; + padding: $baseline; } .status-container { - display: inline-block; - padding-bottom: $baseline/4; + display: table-cell; + text-align: center; + + .status-elements { + border-radius: $baseline/4; + border: 1px solid lightgray; + } } .problemtype-container { - width: 40%; - padding-top: 12px; + padding: $baseline/2; + width: 60%; + } + + .problemtype{ + padding: $baseline/2; } .assessments-container { - width: 30%; + padding: $baseline/2 $baseline $baseline/2 $baseline/2; + float: right; .assessment-text { display: inline-block; + display: table-cell; + padding-right: $baseline/2; } } } .item-container { - @clearfix - padding-bottom: 10px; - display: inline-block; - margin: 0px 15px 0px 15px; + padding-bottom: $baseline/2; + margin: 15px; - h4 { + .visibility-control-prompt { + display: block; + height: 40px; + width: 100%; + + .inner { + float: left; + height: 5px; + margin-top: 17px; + border-top: 1px dotted #ddd; + width: 85%; + } + } + + a { + display: block; + text-align: center; + width: 15%; + float: right; padding-top: $baseline/2; - border-top: 1px solid; - border-color: lightgray; + font-size: .9em; } } @@ -101,33 +119,36 @@ div.problemwrapper { section.legend-container { margin: 15px; + border-radius: $baseline/4; .legenditem { display: inline; - padding: 2px; + padding: $baseline/2; width: 20%; - background-color : #d4d4d4; + background-color : #eee; font-size: .9em; } } section.combined-open-ended-status { - padding: $baseline $baseline $baseline 0; + vertical-align: center; .statusitem { - display: inline; + display: table-cell; padding: $baseline/2; - width: 20%; - background-color : #d4d4d4; + width: 30px; + background-color: #eee; color: #2c2c2c; font-size: .9em; + border-right: 1px solid lightgray; &:first-child { - border-bottom-left-radius: 10px; + border-radius: $baseline/4 0 0 $baseline/4; } &:last-child { - border-top-right-radius: 10px; + border-radius: 0 $baseline/4 $baseline/4 0; + border-right: 0px; } .show-results { @@ -141,8 +162,9 @@ section.combined-open-ended-status { } .statusitem-current { - background-color: #B2B2B2; - color: #222; + background-color: #fff; + box-shadow: inset 0 1px 1px gray; + color: #222; } span { @@ -187,15 +209,29 @@ div.combined-rubric-container { padding-top: 10px; ul.rubric-list { - margin: 4px; + margin: 0 $baseline $baseline/2 $baseline; padding: 0; list-style-type: none; + li { + &.rubric-list-item { margin-bottom: 2px; padding: 0px; } } + + .score-selection { + //display: inline-block; + //padding-right: $baseline/2; + //width: 5%; + //vertical-align: center; + } + + .wrappable { + //display: inline-block; + //width: 94%; + } } h4 { padding-top: 10px; @@ -204,8 +240,11 @@ div.combined-rubric-container { } span.rubric-category { - font-size: .9em; + display: block; + width: 100%; + border-bottom: 1px solid lightgray; font-weight: bold; + font-size: .9em; } } @@ -511,6 +550,7 @@ section.open-ended-child { @include clearfix; overflow-y: auto; margin-bottom: 0; + padding: $baseline/2; height: 200px; border: 1px solid #ddd; background: #f6f6f6; @@ -521,8 +561,8 @@ section.open-ended-child { margin-bottom: $baseline; padding: 9px; border: 1px solid #ddd; - border-top: 0px; - background: #F6F6F6; + border-top: 0; + background: #f6f6f6; span { display: block; @@ -742,8 +782,6 @@ section.open-ended-child { } h4 { - padding-top: $baseline/2; - border-color: lightgray; - border-top: 1px solid; + padding: $baseline/2 0; } } diff --git a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee index 96ad75f088..0a06c29d86 100644 --- a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee @@ -572,24 +572,24 @@ class @CombinedOpenEnded @prompt_container.slideToggle() @prompt_container.toggleClass('open') if @question_header.text() == "(Hide)" - new_text = "(Show)" + new_text = "↧ Show Prompt" Logger.log 'oe_hide_question', {location: @location} else Logger.log 'oe_show_question', {location: @location} - new_text = "(Hide)" + new_text = "↥ Hide Prompt" @question_header.text(new_text) prompt_show: () => if @prompt_container.is(":hidden")==true @prompt_container.slideToggle() @prompt_container.toggleClass('open') - @question_header.text("(Hide)") + @question_header.text("↥ Hide Prompt") prompt_hide: () => if @prompt_container.is(":visible")==true @prompt_container.slideToggle() @prompt_container.toggleClass('open') - @question_header.text("(Show)") + @question_header.text("↧ Show Prompt") log_feedback_click: (event) -> link_text = @$(event.target).html() diff --git a/lms/templates/combinedopenended/combined_open_ended.html b/lms/templates/combinedopenended/combined_open_ended.html index f66088be8a..5f1c80fc5f 100644 --- a/lms/templates/combinedopenended/combined_open_ended.html +++ b/lms/templates/combinedopenended/combined_open_ended.html @@ -11,7 +11,7 @@
    - Open Response Assessment + Open Response
    @@ -27,7 +27,11 @@
    -

    Prompt (Hide)

    +
    +
    +
    + ↥ Hide Prompt +
    % for item in items:
    ${item['content'] | n}
    From 30e506777efe6eb33c3989d1fe6950ae757eff1e Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Fri, 2 Aug 2013 12:12:38 -0400 Subject: [PATCH 23/75] Render multiple rubrics, collapse rubrics --- .../js/src/combinedopenended/display.coffee | 6 +++ .../combined_open_ended_modulev1.py | 42 +++++++++++-------- .../combined_open_ended_results.html | 11 +++-- 3 files changed, 38 insertions(+), 21 deletions(-) diff --git a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee index 6022bdd4cc..db41288324 100644 --- a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee @@ -622,4 +622,10 @@ class @CombinedOpenEnded toggle_rubric: (event) => info_rubric_elements = @$(@info_rubric_elements_sel) info_rubric_elements.slideToggle() + @rubric_header = @$(@rubric_collapse_sel) + if @rubric_header.text() == "(Hide)" + new_text = "(Show)" + else + new_text = "(Hide)" + @rubric_header.text(new_text) return false 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 3ceafdca65..d9d296175e 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 @@ -503,27 +503,35 @@ class CombinedOpenEndedV1Module(): """ all_responses = [] loop_up_to_task = self.current_task_number + 1 + contexts = [] for i in xrange(0, loop_up_to_task): - all_responses.append(self.get_last_response(i)) - rubric_scores = [all_responses[i]['rubric_scores'] for i in xrange(0, len(all_responses)) if - len(all_responses[i]['rubric_scores']) > 0 and all_responses[i]['grader_types'][ - 0] in HUMAN_GRADER_TYPE.keys()] - grader_types = [all_responses[i]['grader_types'] for i in xrange(0, len(all_responses)) if - len(all_responses[i]['grader_types']) > 0 and all_responses[i]['grader_types'][ - 0] in HUMAN_GRADER_TYPE.keys()] - feedback_items = [all_responses[i]['feedback_items'] for i in xrange(0, len(all_responses)) if - len(all_responses[i]['feedback_items']) > 0 and all_responses[i]['grader_types'][ - 0] in HUMAN_GRADER_TYPE.keys()] - rubric_html = self.rubric_renderer.render_combined_rubric(stringify_children(self.static_data['rubric']), - rubric_scores, - grader_types, feedback_items) + response = self.get_last_response(i) + rubric_scores = None + if len(response['rubric_scores']) > 0 and response['grader_types'][0] in HUMAN_GRADER_TYPE.keys(): + rubric_scores = [response['rubric_scores']] + grader_types = None + if len(response['grader_types']) > 0 and response['grader_types'][0] in HUMAN_GRADER_TYPE.keys(): + grader_types = [response['grader_types']] + feedback_items = None + if len(response['feedback_items']) > 0 and response['grader_types'][0] in HUMAN_GRADER_TYPE.keys(): + 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_scores, + grader_types, feedback_items) + contexts.append({ + 'result': rubric_html, + 'task_name': 'Scored Rubric', + 'class_name': 'combined-rubric-container' + }) - response_dict = all_responses[-1] context = { - 'results': rubric_html, - 'task_name': 'Scored Rubric', - 'class_name': 'combined-rubric-container' + 'results': contexts, + 'name' : 'name', } + + log.info(contexts) + html = self.system.render_template('{0}/combined_open_ended_results.html'.format(self.TEMPLATE_DIR), context) return {'html': html, 'success': True} diff --git a/lms/templates/combinedopenended/combined_open_ended_results.html b/lms/templates/combinedopenended/combined_open_ended_results.html index f1e9289221..90fca863b1 100644 --- a/lms/templates/combinedopenended/combined_open_ended_results.html +++ b/lms/templates/combinedopenended/combined_open_ended_results.html @@ -1,4 +1,7 @@ -
    -

    ${task_name}

    (Show) - ${results | n} -
    + +% for (i,result) in enumerate(results): +
    +

    ${result['task_name']}(Hide)

    + ${result['result'] | n} +
    +% endfor From a939c152c80a6d271cf2632ad24f745d296176cf Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Fri, 2 Aug 2013 12:56:31 -0400 Subject: [PATCH 24/75] Add in support for multiple rubrics --- .../combined_open_ended_modulev1.py | 4 +--- .../combined_open_ended_results.html | 22 ++++++++++++++----- 2 files changed, 18 insertions(+), 8 deletions(-) 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 d9d296175e..a943ccda49 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 @@ -521,13 +521,11 @@ class CombinedOpenEndedV1Module(): grader_types, feedback_items) contexts.append({ 'result': rubric_html, - 'task_name': 'Scored Rubric', - 'class_name': 'combined-rubric-container' + 'task_name': 'Scored Rubric' }) context = { 'results': contexts, - 'name' : 'name', } log.info(contexts) diff --git a/lms/templates/combinedopenended/combined_open_ended_results.html b/lms/templates/combinedopenended/combined_open_ended_results.html index 90fca863b1..84f186fbb6 100644 --- a/lms/templates/combinedopenended/combined_open_ended_results.html +++ b/lms/templates/combinedopenended/combined_open_ended_results.html @@ -1,7 +1,19 @@ - % for (i,result) in enumerate(results): -
    -

    ${result['task_name']}(Hide)

    - ${result['result'] | n} -
    + % if 'task_name' in result and 'result' in result: +
    0: + status="shown"> + % else: + status="hidden"> + % endif +

    ${result['task_name']} from grader ${i+1} (Hide)

    + ${result['result'] | n} +
    + %endif + % endfor +% if len(results)>1: + Previous + Next +% endif + From bca308e70efc312139a416d1c1d59ba8fd5b05ab Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Fri, 2 Aug 2013 13:10:03 -0400 Subject: [PATCH 25/75] No more log.info --- .../combined_open_ended_modulev1.py | 4 ---- 1 file changed, 4 deletions(-) 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 a943ccda49..dd88a23077 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 @@ -452,7 +452,6 @@ class CombinedOpenEndedV1Module(): 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" @@ -527,9 +526,6 @@ class CombinedOpenEndedV1Module(): context = { 'results': contexts, } - - log.info(contexts) - html = self.system.render_template('{0}/combined_open_ended_results.html'.format(self.TEMPLATE_DIR), context) return {'html': html, 'success': True} From 932bbd259247f5b69f2d39c0a1945951816fedeb Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Fri, 2 Aug 2013 13:23:03 -0400 Subject: [PATCH 26/75] Fix text issue --- .../xmodule/js/src/combinedopenended/display.coffee | 10 +++++----- .../combined_open_ended_modulev1.py | 2 +- .../combinedopenended/combined_open_ended.html | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee index e82ebeb4f5..b539c72554 100644 --- a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee @@ -560,12 +560,12 @@ class @CombinedOpenEnded collapse_question: (event) => @prompt_container.slideToggle() @prompt_container.toggleClass('open') - if @question_header.text() == "(Hide)" - new_text = "↧ Show Prompt" + if @question_header.text() == "Hide Prompt" + new_text = "Show Prompt" Logger.log 'oe_hide_question', {location: @location} else Logger.log 'oe_show_question', {location: @location} - new_text = "↥ Hide Prompt" + new_text = "Hide Prompt" @question_header.text(new_text) return false @@ -573,13 +573,13 @@ class @CombinedOpenEnded if @prompt_container.is(":hidden")==true @prompt_container.slideToggle() @prompt_container.toggleClass('open') - @question_header.text("↥ Hide Prompt") + @question_header.text("Hide Prompt") prompt_hide: () => if @prompt_container.is(":visible")==true @prompt_container.slideToggle() @prompt_container.toggleClass('open') - @question_header.text("↧ Show Prompt") + @question_header.text("Show Prompt") log_feedback_click: (event) -> link_text = @$(event.target).html() 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 dd88a23077..ae3d01c686 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 @@ -520,7 +520,7 @@ class CombinedOpenEndedV1Module(): grader_types, feedback_items) contexts.append({ 'result': rubric_html, - 'task_name': 'Scored Rubric' + 'task_name': 'Scored rubric' }) context = { diff --git a/lms/templates/combinedopenended/combined_open_ended.html b/lms/templates/combinedopenended/combined_open_ended.html index 5f1c80fc5f..b517e60976 100644 --- a/lms/templates/combinedopenended/combined_open_ended.html +++ b/lms/templates/combinedopenended/combined_open_ended.html @@ -30,7 +30,7 @@
    % for item in items: From ec99e20a356b778bb35674d05faf155448d6e8b3 Mon Sep 17 00:00:00 2001 From: marco Date: Fri, 2 Aug 2013 13:37:53 -0400 Subject: [PATCH 27/75] styled rubric, dividers between sections --- .../css/combinedopenended/display.scss | 100 +++++++++++------- .../js/src/combinedopenended/display.coffee | 8 +- .../src/staff_grading/test_grading.html | 6 +- .../combined_open_ended.html | 2 +- .../openended/open_ended.html | 6 +- .../openended/open_ended_rubric.html | 8 +- .../self_assessment_prompt.html | 7 +- 7 files changed, 88 insertions(+), 49 deletions(-) diff --git a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss index 224f554101..2873e37e73 100644 --- a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss +++ b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss @@ -1,3 +1,6 @@ +// lms - xmodule - combinedopenended +// ==================== + h2 { margin-top: 0; margin-bottom: 15px; @@ -16,6 +19,7 @@ h2 { } } + // Problem Header div.name{ padding-bottom: 15px; @@ -38,6 +42,7 @@ section.combined-open-ended { @include clearfix; } + div.problemwrapper { border: 1px solid lightgray; border-radius: $baseline/2; @@ -85,29 +90,6 @@ div.problemwrapper { .item-container { padding-bottom: $baseline/2; margin: 15px; - - .visibility-control-prompt { - display: block; - height: 40px; - width: 100%; - - .inner { - float: left; - height: 5px; - margin-top: 17px; - border-top: 1px dotted #ddd; - width: 85%; - } - } - - a { - display: block; - text-align: center; - width: 15%; - float: right; - padding-top: $baseline/2; - font-size: .9em; - } } .result-container { @@ -163,7 +145,6 @@ section.combined-open-ended-status { .statusitem-current { background-color: #fff; - box-shadow: inset 0 1px 1px gray; color: #222; } @@ -203,6 +184,63 @@ section.combined-open-ended-status { } } + // Problem Section Controls + +.visibility-control, .visibility-control-prompt { + display: block; + height: 40px; + width: 100%; + + .inner { + float: left; + height: 5px; + margin-top: $baseline; + border-top: 1px dotted #ddd; + width: 85%; + } +} + +.section-header { + display: block; + text-align: center; + width: 15%; + float: right; + padding-top: $baseline/2; + font-size: .9em; +} + + +// Rubric Styling + +.wrapper-score-selection { + display: table-cell; + padding: 0 $baseline/2; + width: 20px; + vertical-align: middle; + +} + +.wrappable { + display: table-cell; + padding: $baseline/4 0 ; +} + +.rubric-list-item { + margin-bottom: 2px; + padding: $baseline/2; + + &:hover { + background-color: #eee; + } +} + +span.rubric-category { + display: block; + width: 100%; + border-bottom: 1px solid lightgray; + font-size: .9em; +} + div.combined-rubric-container { margin: 15px; padding-bottom: 5px; @@ -217,21 +255,9 @@ div.combined-rubric-container { &.rubric-list-item { margin-bottom: 2px; - padding: 0px; + padding: $baseline/2; } } - - .score-selection { - //display: inline-block; - //padding-right: $baseline/2; - //width: 5%; - //vertical-align: center; - } - - .wrappable { - //display: inline-block; - //width: 94%; - } } h4 { padding-top: 10px; diff --git a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee index bbf4a0eacc..eded6b0391 100644 --- a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee @@ -561,11 +561,11 @@ class @CombinedOpenEnded @prompt_container.slideToggle() @prompt_container.toggleClass('open') if @question_header.text() == "(Hide)" - new_text = "↧ Show Prompt" + new_text = "Show Prompt" Logger.log 'oe_hide_question', {location: @location} else Logger.log 'oe_show_question', {location: @location} - new_text = "↥ Hide Prompt" + new_text = "Hide Prompt" @question_header.text(new_text) return false @@ -573,13 +573,13 @@ class @CombinedOpenEnded if @prompt_container.is(":hidden")==true @prompt_container.slideToggle() @prompt_container.toggleClass('open') - @question_header.text("↥ Hide Prompt") + @question_header.text("Hide Prompt") prompt_hide: () => if @prompt_container.is(":visible")==true @prompt_container.slideToggle() @prompt_container.toggleClass('open') - @question_header.text("↧ Show Prompt") + @question_header.text("Show Prompt") log_feedback_click: (event) -> link_text = @$(event.target).html() diff --git a/lms/static/coffee/src/staff_grading/test_grading.html b/lms/static/coffee/src/staff_grading/test_grading.html index 9b84d0703b..6d3a6e3637 100644 --- a/lms/static/coffee/src/staff_grading/test_grading.html +++ b/lms/static/coffee/src/staff_grading/test_grading.html @@ -23,7 +23,11 @@
    -

    Rubric

    +
    +
    +
    + Rubric +
    diff --git a/lms/templates/combinedopenended/combined_open_ended.html b/lms/templates/combinedopenended/combined_open_ended.html index 5f1c80fc5f..60bdd38a1b 100644 --- a/lms/templates/combinedopenended/combined_open_ended.html +++ b/lms/templates/combinedopenended/combined_open_ended.html @@ -30,7 +30,7 @@
    - ↥ Hide Prompt + Prompt
    % for item in items: diff --git a/lms/templates/combinedopenended/openended/open_ended.html b/lms/templates/combinedopenended/openended/open_ended.html index 909ef15838..f2d59c4049 100644 --- a/lms/templates/combinedopenended/openended/open_ended.html +++ b/lms/templates/combinedopenended/openended/open_ended.html @@ -3,7 +3,11 @@
    ${prompt|n}
    -

    Response

    +
    +
    +
    + Response +
    diff --git a/lms/templates/combinedopenended/openended/open_ended_rubric.html b/lms/templates/combinedopenended/openended/open_ended_rubric.html index 144cd829d9..c015a32d2d 100644 --- a/lms/templates/combinedopenended/openended/open_ended_rubric.html +++ b/lms/templates/combinedopenended/openended/open_ended_rubric.html @@ -1,5 +1,9 @@
    -

    Rubric

    +
    +
    +
    + Rubric +

    Select the criteria you feel best represents this submission in each category.

    % for i in range(len(categories)): @@ -14,7 +18,7 @@
  • % endif
  • diff --git a/lms/templates/combinedopenended/selfassessment/self_assessment_prompt.html b/lms/templates/combinedopenended/selfassessment/self_assessment_prompt.html index 5347e23844..5755eeec3a 100644 --- a/lms/templates/combinedopenended/selfassessment/self_assessment_prompt.html +++ b/lms/templates/combinedopenended/selfassessment/self_assessment_prompt.html @@ -3,10 +3,11 @@
    ${prompt} +
    +
    +
    + Response
    - -

    Response

    -
    From 5da5d556303f4d6fa86eedd5b11aa46431e00e75 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Fri, 2 Aug 2013 13:41:37 -0400 Subject: [PATCH 28/75] Fix peer grading feedback issue --- .../xmodule/js/src/peergrading/peer_grading_problem.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/lib/xmodule/xmodule/js/src/peergrading/peer_grading_problem.coffee b/common/lib/xmodule/xmodule/js/src/peergrading/peer_grading_problem.coffee index 050d525a13..47b2652020 100644 --- a/common/lib/xmodule/xmodule/js/src/peergrading/peer_grading_problem.coffee +++ b/common/lib/xmodule/xmodule/js/src/peergrading/peer_grading_problem.coffee @@ -482,7 +482,7 @@ class @PeerGradingProblem if response.actual_rubric != undefined calibration_wrapper.append("
    Instructor Scored Rubric: #{response.actual_rubric}
    ") - if response.actual_feedback!=undefined + if response.actual_feedback.feedback!=undefined calibration_wrapper.append("
    Instructor Feedback: #{response.actual_feedback}
    ") # disable score selection and submission from the grading interface From aa09006247210f73ea112e04861aca82cc5e9d6e Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Fri, 2 Aug 2013 13:53:07 -0400 Subject: [PATCH 29/75] Hide and show multiple rubrics --- .../js/src/combinedopenended/display.coffee | 4 +++ .../combined_open_ended_modulev1.py | 30 +++++++++---------- .../combined_open_ended_results.html | 4 +-- 3 files changed, 20 insertions(+), 18 deletions(-) diff --git a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee index b539c72554..0db6521d27 100644 --- a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee @@ -569,6 +569,10 @@ class @CombinedOpenEnded @question_header.text(new_text) return false + hide_rubrics: () => + @$(combined_rubric_sel + ' > [data-status="hidden"]').hide() + @$(combined_rubric_sel + ' > [data-status="shown"]').show() + prompt_show: () => if @prompt_container.is(":hidden")==true @prompt_container.slideToggle() 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 ae3d01c686..ad9d7a287f 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 @@ -506,22 +506,20 @@ class CombinedOpenEndedV1Module(): for i in xrange(0, loop_up_to_task): response = self.get_last_response(i) rubric_scores = None - if len(response['rubric_scores']) > 0 and response['grader_types'][0] in HUMAN_GRADER_TYPE.keys(): - rubric_scores = [response['rubric_scores']] - grader_types = None - if len(response['grader_types']) > 0 and response['grader_types'][0] in HUMAN_GRADER_TYPE.keys(): - grader_types = [response['grader_types']] - feedback_items = None - if len(response['feedback_items']) > 0 and response['grader_types'][0] in HUMAN_GRADER_TYPE.keys(): - 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_scores, - grader_types, feedback_items) - contexts.append({ - 'result': rubric_html, - 'task_name': 'Scored rubric' - }) + score_length = len(response['grader_types']) + log.info(response) + for z in xrange(0,score_length): + if response['grader_types'][z] in HUMAN_GRADER_TYPE.keys(): + rubric_scores = [[response['rubric_scores'][z]]] + grader_types = [[response['grader_types'][z]]] + feedback_items = [[response['feedback_items'][z]]] + rubric_html = self.rubric_renderer.render_combined_rubric(stringify_children(self.static_data['rubric']), + rubric_scores, + grader_types, feedback_items) + contexts.append({ + 'result': rubric_html, + 'task_name': 'Scored rubric' + }) context = { 'results': contexts, diff --git a/lms/templates/combinedopenended/combined_open_ended_results.html b/lms/templates/combinedopenended/combined_open_ended_results.html index 84f186fbb6..24934be3d2 100644 --- a/lms/templates/combinedopenended/combined_open_ended_results.html +++ b/lms/templates/combinedopenended/combined_open_ended_results.html @@ -2,9 +2,9 @@ % if 'task_name' in result and 'result' in result:
    0: - status="shown"> + data-status="shown" data-number="${i}"> % else: - status="hidden"> + data-status="hidden" data-number="${i}"> % endif

    ${result['task_name']} from grader ${i+1} (Hide)

    ${result['result'] | n} From ea2b9191c14b39f521d40fbfb33dc98ed2c26437 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Fri, 2 Aug 2013 15:30:17 -0400 Subject: [PATCH 30/75] Allow student to switch between rubrics, tell user once peer grading required amount is done --- .../js/src/combinedopenended/display.coffee | 37 ++++++++++++++++++- .../peergrading/peer_grading_problem.coffee | 6 ++- .../xmodule/xmodule/peer_grading_module.py | 5 +++ .../combined_open_ended_results.html | 4 +- 4 files changed, 47 insertions(+), 5 deletions(-) diff --git a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee index 0db6521d27..8aa1af96f6 100644 --- a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee @@ -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 diff --git a/common/lib/xmodule/xmodule/js/src/peergrading/peer_grading_problem.coffee b/common/lib/xmodule/xmodule/js/src/peergrading/peer_grading_problem.coffee index 47b2652020..c02fa3f390 100644 --- a/common/lib/xmodule/xmodule/js/src/peergrading/peer_grading_problem.coffee +++ b/common/lib/xmodule/xmodule/js/src/peergrading/peer_grading_problem.coffee @@ -344,7 +344,11 @@ class @PeerGradingProblem if response.success @is_calibrated_check() @grading_message.fadeIn() - @grading_message.html("

    Successfully saved your feedback. Fetched the next essay.

    ") + message = "

    Successfully saved your feedback. Fetched the next essay." + if response.required_done + message = message + " You have completed the required number of gradings." + message = message + "

    " + @grading_message.html(message) else if response.error @render_error(response.error) diff --git a/common/lib/xmodule/xmodule/peer_grading_module.py b/common/lib/xmodule/xmodule/peer_grading_module.py index 44114136aa..b21e4865ec 100644 --- a/common/lib/xmodule/xmodule/peer_grading_module.py +++ b/common/lib/xmodule/xmodule/peer_grading_module.py @@ -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 diff --git a/lms/templates/combinedopenended/combined_open_ended_results.html b/lms/templates/combinedopenended/combined_open_ended_results.html index 24934be3d2..71dbea4ec5 100644 --- a/lms/templates/combinedopenended/combined_open_ended_results.html +++ b/lms/templates/combinedopenended/combined_open_ended_results.html @@ -2,9 +2,9 @@ % if 'task_name' in result and 'result' in result:
    0: - data-status="shown" data-number="${i}"> - % else: data-status="hidden" data-number="${i}"> + % else: + data-status="shown" data-number="${i}"> % endif

    ${result['task_name']} from grader ${i+1} (Hide)

    ${result['result'] | n} From 56dee21142d6a453370983cc9373e9cb93b99523 Mon Sep 17 00:00:00 2001 From: marco Date: Wed, 7 Aug 2013 16:35:14 -0400 Subject: [PATCH 31/75] partial cleanup for submitted rubric state, along with sass format cleanup for rubric.scss --- .../css/combinedopenended/display.scss | 10 ++- .../js/src/combinedopenended/display.coffee | 6 +- lms/static/sass/course/_rubric.scss | 76 ++++++++++++------- .../combined_open_ended.html | 6 +- .../combined_open_ended_results.html | 10 ++- .../openended/open_ended_combined_rubric.html | 19 ++--- .../openended/open_ended_rubric.html | 2 +- 7 files changed, 80 insertions(+), 49 deletions(-) diff --git a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss index 2873e37e73..b63e04d20e 100644 --- a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss +++ b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss @@ -222,7 +222,7 @@ section.combined-open-ended-status { .wrappable { display: table-cell; - padding: $baseline/4 0 ; + padding: $baseline/4; } .rubric-list-item { @@ -238,7 +238,9 @@ span.rubric-category { display: block; width: 100%; border-bottom: 1px solid lightgray; - font-size: .9em; + font-size: 1.1em; + padding-top: $baseline/2; + margin-bottom: $baseline/2; } div.combined-rubric-container { @@ -591,7 +593,8 @@ section.open-ended-child { overflow-y: auto; margin-bottom: 0; padding: $baseline/2; - height: 200px; + height: auto; + min-height: 20px; border: 1px solid #ddd; background: #f6f6f6; } @@ -668,6 +671,7 @@ section.open-ended-child { &.rubric-list-item { margin-bottom: 0; padding: 0; + border-radius: $baseline/4; } } } diff --git a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee index b539c72554..4ae1f9156a 100644 --- a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee @@ -623,9 +623,9 @@ class @CombinedOpenEnded info_rubric_elements = @$(@info_rubric_elements_sel) info_rubric_elements.slideToggle() @rubric_header = @$(@rubric_collapse_sel) - if @rubric_header.text() == "(Hide)" - new_text = "(Show)" + if @rubric_header.text() == "Show Score Only" + new_text = "Show Full Rubric" else - new_text = "(Hide)" + new_text = "Show Score Only" @rubric_header.text(new_text) return false diff --git a/lms/static/sass/course/_rubric.scss b/lms/static/sass/course/_rubric.scss index 294ac86d78..6c1467bfb8 100644 --- a/lms/static/sass/course/_rubric.scss +++ b/lms/static/sass/course/_rubric.scss @@ -1,56 +1,78 @@ +.rubric-header { + .rubric-collapse { + float: right; + } +} + .rubric { - margin: 0px 0px; + margin: 0; color: #3C3C3C; + tr { - margin:0px 0px; - height: 100%; + margin: 0; + height: 100%; } + td { - height: 100%; - border: 1px black solid; - text-align: center; + height: 100%; + border: 1px black solid; + text-align: center; } + th { - padding: 5px; - margin: 5px; - text-align: center; + margin: $baseline/4; + padding: $baseline/4; + text-align: center; } + .points-header th { - padding: 0px; + padding: 0px; } - .rubric-label - { - position: relative; - font-size: .9em; - display: block; + + .rubric-label { + position: relative; + display: block; + font-size: .9em; + + .choicegroup-correct { + //nothing + } + + .choicegroup-incorrect { + display:none; + } } + .grade { position: absolute; - bottom:0px; - right:0px; + bottom: 0; + right: 0; } .selected-grade, .selected-grade .rubric-label { background: #666; color: white; } - input[type=radio]:checked + .rubric-label { + + input[type=radio]:checked + .rubric-label { background: white; color: $base-font-color; white-space:nowrap; - } + } + .wrappable { - white-space:normal; + white-space:normal; } + input[class='score-selection'] { - position: relative; - font-size: 16px; + position: relative; + font-size: 16px; } - ul.rubric-list - { - list-style-type: none; - padding:0; - margin:0; + + ul.rubric-list { + margin: 0; + padding: 0; + list-style-type: none; } } diff --git a/lms/templates/combinedopenended/combined_open_ended.html b/lms/templates/combinedopenended/combined_open_ended.html index 7668312e0e..ef73a09bcc 100644 --- a/lms/templates/combinedopenended/combined_open_ended.html +++ b/lms/templates/combinedopenended/combined_open_ended.html @@ -30,11 +30,7 @@
    -<<<<<<< HEAD - Prompt -======= - Hide Prompt ->>>>>>> 932bbd259247f5b69f2d39c0a1945951816fedeb + Hide Prompt
    % for item in items: diff --git a/lms/templates/combinedopenended/combined_open_ended_results.html b/lms/templates/combinedopenended/combined_open_ended_results.html index 84f186fbb6..125bab2444 100644 --- a/lms/templates/combinedopenended/combined_open_ended_results.html +++ b/lms/templates/combinedopenended/combined_open_ended_results.html @@ -6,7 +6,15 @@ % else: status="hidden"> % endif -

    ${result['task_name']} from grader ${i+1} (Hide)

    +
    +
    +
    + Submitted Rubric +
    +
    + ${result['task_name']} from grader ${i+1} + +
    ${result['result'] | n}
    %endif diff --git a/lms/templates/combinedopenended/openended/open_ended_combined_rubric.html b/lms/templates/combinedopenended/openended/open_ended_combined_rubric.html index 9ae148442f..ab9e751672 100644 --- a/lms/templates/combinedopenended/openended/open_ended_combined_rubric.html +++ b/lms/templates/combinedopenended/openended/open_ended_combined_rubric.html @@ -8,17 +8,18 @@
  • %if len(category['options'][j]['grader_types'])>0: - %if correct[i]==1: -
  • diff --git a/lms/templates/combinedopenended/openended/open_ended_rubric.html b/lms/templates/combinedopenended/openended/open_ended_rubric.html index c015a32d2d..df0704a263 100644 --- a/lms/templates/combinedopenended/openended/open_ended_rubric.html +++ b/lms/templates/combinedopenended/openended/open_ended_rubric.html @@ -8,7 +8,7 @@
    % for i in range(len(categories)): <% category = categories[i] %> - ${category['description']}
    + ${category['description']}
      % for j in range(len(category['options'])): <% option = category['options'][j] %> From 203b1176cdee75f4e1096db6d906d36cb082ce01 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 8 Aug 2013 12:14:57 -0400 Subject: [PATCH 32/75] Don't check for ETA, or check peer grading data in self assessment --- .../open_ended_grading_classes/open_ended_module.py | 3 +-- .../self_assessment_module.py | 11 +++-------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/common/lib/xmodule/xmodule/open_ended_grading_classes/open_ended_module.py b/common/lib/xmodule/xmodule/open_ended_grading_classes/open_ended_module.py index 2e7a3eaf89..bd873cb5ae 100644 --- a/common/lib/xmodule/xmodule/open_ended_grading_classes/open_ended_module.py +++ b/common/lib/xmodule/xmodule/open_ended_grading_classes/open_ended_module.py @@ -649,7 +649,6 @@ class OpenEndedModule(openendedchild.OpenEndedChild): # add new history element with answer and empty score and hint. success, data = self.append_image_to_student_answer(data) - error_message = "" if success: success, allowed_to_submit, error_message = self.check_if_student_can_submit() if allowed_to_submit: @@ -698,7 +697,7 @@ class OpenEndedModule(openendedchild.OpenEndedChild): score = self.latest_score() correct = 'correct' if self.is_submission_correct(score) else 'incorrect' if self.child_state == self.ASSESSING: - eta_string = self.get_eta() + eta_string = "" else: post_assessment = "" correct = "" diff --git a/common/lib/xmodule/xmodule/open_ended_grading_classes/self_assessment_module.py b/common/lib/xmodule/xmodule/open_ended_grading_classes/self_assessment_module.py index 1262e1f68f..baba66eb23 100644 --- a/common/lib/xmodule/xmodule/open_ended_grading_classes/self_assessment_module.py +++ b/common/lib/xmodule/xmodule/open_ended_grading_classes/self_assessment_module.py @@ -184,14 +184,9 @@ class SelfAssessmentModule(openendedchild.OpenEndedChild): # add new history element with answer and empty score and hint. success, data = self.append_image_to_student_answer(data) if success: - success, allowed_to_submit, error_message = self.check_if_student_can_submit() - if allowed_to_submit: - data['student_answer'] = SelfAssessmentModule.sanitize_html(data['student_answer']) - self.new_history_entry(data['student_answer']) - self.change_state(self.ASSESSING) - else: - # Error message already defined - success = False + data['student_answer'] = SelfAssessmentModule.sanitize_html(data['student_answer']) + self.new_history_entry(data['student_answer']) + self.change_state(self.ASSESSING) else: # This is a student_facing_error error_message = "There was a problem saving the image in your submission. Please try a different image, or try pasting a link to an image into the answer box." From 45d94c17f7d024c4717a2e593b2979d96be91037 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 8 Aug 2013 12:46:43 -0400 Subject: [PATCH 33/75] Add in next button, get rid of error with deleted peer grading module --- .../js/src/combinedopenended/display.coffee | 4 +- .../combined_open_ended_modulev1.py | 40 +++++++++++++++++++ .../open_ended_module.py | 13 ++---- .../openendedchild.py | 32 --------------- .../xmodule/xmodule/peer_grading_module.py | 9 ++++- 5 files changed, 53 insertions(+), 45 deletions(-) diff --git a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee index 68c1f17ef6..b67b6dca93 100644 --- a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee @@ -297,8 +297,8 @@ class @CombinedOpenEnded @submit_button.unbind('click') @submit_button.show() @reset_button.hide() - @next_problem_button.hide() @hide_file_upload() + @next_problem_button.hide() @hint_area.attr('disabled', false) if @task_number>1 or @child_state!='initial' @show_status_current() @@ -353,7 +353,7 @@ class @CombinedOpenEnded if @child_type=="openended" @skip_button.hide() if @task_number<@task_count - @next_problem() + @next_problem_button.show() else if @task_number==1 and @task_count==1 @show_combined_rubric_current() 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 ad9d7a287f..eee2e93312 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 @@ -9,6 +9,7 @@ import self_assessment_module import open_ended_module from functools import partial from .combined_open_ended_rubric import CombinedOpenEndedRubric, GRADER_TYPE_IMAGE_DICT, HUMAN_GRADER_TYPE, LEGEND_LIST +from peer_grading_service import PeerGradingService, MockPeerGradingService log = logging.getLogger("mitx.courseware") @@ -116,6 +117,11 @@ class CombinedOpenEndedV1Module(): self.accept_file_upload = instance_state.get('accept_file_upload', ACCEPT_FILE_UPLOAD) in TRUE_DICT self.skip_basic_checks = instance_state.get('skip_spelling_checks', SKIP_BASIC_CHECKS) in TRUE_DICT + if system.open_ended_grading_interface: + self.peer_gs = PeerGradingService(system.open_ended_grading_interface, system) + else: + self.peer_gs = MockPeerGradingService() + due_date = instance_state.get('due', None) grace_period_string = instance_state.get('graceperiod', None) @@ -147,6 +153,8 @@ class CombinedOpenEndedV1Module(): self.location = location self.setup_next_task() + + def get_tag_name(self, xml): """ Gets the tag name of a given xml block. @@ -494,6 +502,34 @@ class CombinedOpenEndedV1Module(): pass return return_html + def check_if_student_has_done_needed_grading(self): + student_id = self.system.anonymous_student_id + success = False + allowed_to_submit = True + error_string = ("You need to peer grade {0} more in order to make another submission. " + "You have graded {1}, and {2} are required. You have made {3} successful peer grading submissions.") + try: + response = self.peer_gs.get_data_for_location(self.location, student_id) + count_graded = response['count_graded'] + count_required = response['count_required'] + student_sub_count = response['student_sub_count'] + success = True + except: + # This is a dev_facing_error + log.error("Could not contact external open ended graders for location {0} and student {1}".format( + self.location, student_id)) + # This is a student_facing_error + error_message = "Could not contact the graders. Please notify course staff." + return success, allowed_to_submit, error_message + if count_graded >= count_required: + return success, allowed_to_submit, "" + else: + allowed_to_submit = False + # This is a student_facing_error + error_message = error_string.format(count_required - count_graded, count_graded, count_required, + student_sub_count) + return success, allowed_to_submit, error_message + def get_rubric(self, _data): """ Gets the results of a given grader via ajax. @@ -501,6 +537,7 @@ class CombinedOpenEndedV1Module(): Output: Dictionary to be rendered via ajax that contains the result html. """ all_responses = [] + loop_up_to_task = self.current_task_number + 1 contexts = [] for i in xrange(0, loop_up_to_task): @@ -546,6 +583,9 @@ class CombinedOpenEndedV1Module(): Output: Dictionary to be rendered via ajax that contains the result html. """ self.update_task_states() + success, can_see_rubric, error = self.check_if_student_has_done_needed_grading() + if not can_see_rubric: + return {'html' : error, 'success' : False} loop_up_to_task = self.current_task_number + 1 all_responses = [] for i in xrange(0, loop_up_to_task): diff --git a/common/lib/xmodule/xmodule/open_ended_grading_classes/open_ended_module.py b/common/lib/xmodule/xmodule/open_ended_grading_classes/open_ended_module.py index bd873cb5ae..ec3bebac7f 100644 --- a/common/lib/xmodule/xmodule/open_ended_grading_classes/open_ended_module.py +++ b/common/lib/xmodule/xmodule/open_ended_grading_classes/open_ended_module.py @@ -650,15 +650,10 @@ class OpenEndedModule(openendedchild.OpenEndedChild): # add new history element with answer and empty score and hint. success, data = self.append_image_to_student_answer(data) if success: - success, allowed_to_submit, error_message = self.check_if_student_can_submit() - if allowed_to_submit: - data['student_answer'] = OpenEndedModule.sanitize_html(data['student_answer']) - self.new_history_entry(data['student_answer']) - self.send_to_grader(data['student_answer'], system) - self.change_state(self.ASSESSING) - else: - # Error message already defined - success = False + data['student_answer'] = OpenEndedModule.sanitize_html(data['student_answer']) + self.new_history_entry(data['student_answer']) + self.send_to_grader(data['student_answer'], system) + self.change_state(self.ASSESSING) else: # This is a student_facing_error error_message = "There was a problem saving the image in your submission. Please try a different image, or try pasting a link to an image into the answer box." diff --git a/common/lib/xmodule/xmodule/open_ended_grading_classes/openendedchild.py b/common/lib/xmodule/xmodule/open_ended_grading_classes/openendedchild.py index 555505d611..71b48aed54 100644 --- a/common/lib/xmodule/xmodule/open_ended_grading_classes/openendedchild.py +++ b/common/lib/xmodule/xmodule/open_ended_grading_classes/openendedchild.py @@ -433,38 +433,6 @@ class OpenEndedChild(object): return success, string - def check_if_student_can_submit(self): - location = self.location_string - - student_id = self.system.anonymous_student_id - success = False - allowed_to_submit = True - response = {} - # This is a student_facing_error - error_string = ("You need to peer grade {0} more in order to make another submission. " - "You have graded {1}, and {2} are required. You have made {3} successful peer grading submissions.") - try: - response = self.peer_gs.get_data_for_location(self.location_string, student_id) - count_graded = response['count_graded'] - count_required = response['count_required'] - student_sub_count = response['student_sub_count'] - success = True - except: - # This is a dev_facing_error - log.error("Could not contact external open ended graders for location {0} and student {1}".format( - self.location_string, student_id)) - # This is a student_facing_error - error_message = "Could not contact the graders. Please notify course staff." - return success, allowed_to_submit, error_message - if count_graded >= count_required: - return success, allowed_to_submit, "" - else: - allowed_to_submit = False - # This is a student_facing_error - error_message = error_string.format(count_required - count_graded, count_graded, count_required, - student_sub_count) - return success, allowed_to_submit, error_message - def get_eta(self): if self.controller_qs: response = self.controller_qs.check_for_eta(self.location_string) diff --git a/common/lib/xmodule/xmodule/peer_grading_module.py b/common/lib/xmodule/xmodule/peer_grading_module.py index b21e4865ec..059b66b615 100644 --- a/common/lib/xmodule/xmodule/peer_grading_module.py +++ b/common/lib/xmodule/xmodule/peer_grading_module.py @@ -535,9 +535,13 @@ class PeerGradingModule(PeerGradingFields, XModule): log.error("Problem {0} does not exist in this course".format(location)) raise + good_problem_list = [] for problem in problem_list: problem_location = problem['location'] - descriptor = _find_corresponding_module_for_location(problem_location) + try: + descriptor = _find_corresponding_module_for_location(problem_location) + except: + continue if descriptor: problem['due'] = descriptor._model_data.get('due', None) grace_period_string = descriptor._model_data.get('graceperiod', None) @@ -554,13 +558,14 @@ class PeerGradingModule(PeerGradingFields, XModule): # if we can't find the due date, assume that it doesn't have one problem['due'] = None problem['closed'] = False + good_problem_list.append(problem) ajax_url = self.ajax_url html = self.system.render_template('peer_grading/peer_grading.html', { 'course_id': self.system.course_id, 'ajax_url': ajax_url, 'success': success, - 'problem_list': problem_list, + 'problem_list': good_problem_list, 'error_text': error_text, # Checked above 'staff_access': False, From bd9097596cac8085e3bc6cdb4e4956a68c7acd94 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 8 Aug 2013 13:16:32 -0400 Subject: [PATCH 34/75] Remove annoying rubric parsing error, redo how notifications work --- .../xmodule/xmodule/js/src/combinedopenended/display.coffee | 4 ---- .../open_ended_grading_classes/self_assessment_module.py | 2 -- lms/djangoapps/open_ended_grading/open_ended_notifications.py | 3 +-- 3 files changed, 1 insertion(+), 8 deletions(-) diff --git a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee index b67b6dca93..ee2c3589df 100644 --- a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee @@ -201,10 +201,6 @@ class @CombinedOpenEnded @rebind() - if @task_number>1 - @show_combined_rubric_current() - @show_results_current() - show_results_current: () => data = {'task_number' : @task_number-1} $.postWithPrefix "#{@ajax_url}/get_results", data, (response) => diff --git a/common/lib/xmodule/xmodule/open_ended_grading_classes/self_assessment_module.py b/common/lib/xmodule/xmodule/open_ended_grading_classes/self_assessment_module.py index baba66eb23..674fab0d30 100644 --- a/common/lib/xmodule/xmodule/open_ended_grading_classes/self_assessment_module.py +++ b/common/lib/xmodule/xmodule/open_ended_grading_classes/self_assessment_module.py @@ -267,8 +267,6 @@ class SelfAssessmentModule(openendedchild.OpenEndedChild): try: rubric_scores = json.loads(latest_post_assessment) except: - # This is a dev_facing_error - log.error("Cannot parse rubric scores in self assessment module from {0}".format(latest_post_assessment)) rubric_scores = [] return [rubric_scores] diff --git a/lms/djangoapps/open_ended_grading/open_ended_notifications.py b/lms/djangoapps/open_ended_grading/open_ended_notifications.py index 1d6fa22929..b1617bbe53 100644 --- a/lms/djangoapps/open_ended_grading/open_ended_notifications.py +++ b/lms/djangoapps/open_ended_grading/open_ended_notifications.py @@ -93,7 +93,6 @@ def peer_grading_notifications(course, user): log.info( "Problem with getting notifications from peer grading service for course {0} user {1}.".format(course_id, student_id)) - if pending_grading: img_path = "/static/images/grading_notification.png" @@ -166,7 +165,7 @@ def combined_notifications(course, user): last_time_viewed) notifications = json.loads(controller_response) if notifications['success']: - if notifications['overall_need_to_check']: + if notifications['staff_needs_to_grade'] or notifications['student_needs_to_peer_grade']: pending_grading = True except: #Non catastrophic error, so no real action From fd38223244056975ad5eea80067061ea4661277b Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 8 Aug 2013 13:31:43 -0400 Subject: [PATCH 35/75] Fix grading submitted messages --- .../xmodule/js/src/combinedopenended/display.coffee | 10 ++++------ .../open_ended_grading_classes/open_ended_module.py | 3 ++- .../combinedopenended/openended/open_ended.html | 10 +++++----- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee index ee2c3589df..8c29af2c0b 100644 --- a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee @@ -326,9 +326,8 @@ class @CombinedOpenEnded if @child_type == "openended" @submit_button.hide() @queueing() - if @task_number==1 and @task_count==1 - @grader_status = @$(@grader_status_sel) - @grader_status.html("

      Response submitted for scoring.

      ") + @grader_status = @$(@grader_status_sel) + @grader_status.html("Your response has been submitted. Please check back later for your grade. ") else if @child_state == 'post_assessment' if @child_type=="openended" @skip_button.show() @@ -341,6 +340,8 @@ class @CombinedOpenEnded else @submit_button.click @message_post else if @child_state == 'done' + @show_combined_rubric_current() + @show_results_current() @rubric_wrapper.hide() @answer_area.attr("disabled", true) @replace_text_inputs() @@ -351,9 +352,6 @@ class @CombinedOpenEnded if @task_number<@task_count @next_problem_button.show() else - if @task_number==1 and @task_count==1 - @show_combined_rubric_current() - @show_results_current() @reset_button.show() diff --git a/common/lib/xmodule/xmodule/open_ended_grading_classes/open_ended_module.py b/common/lib/xmodule/xmodule/open_ended_grading_classes/open_ended_module.py index ec3bebac7f..e1e4643afe 100644 --- a/common/lib/xmodule/xmodule/open_ended_grading_classes/open_ended_module.py +++ b/common/lib/xmodule/xmodule/open_ended_grading_classes/open_ended_module.py @@ -640,6 +640,7 @@ class OpenEndedModule(openendedchild.OpenEndedChild): """ # Once we close the problem, we should not allow students # to save answers + error_message = "" closed, msg = self.check_if_closed() if closed: return msg @@ -692,7 +693,7 @@ class OpenEndedModule(openendedchild.OpenEndedChild): score = self.latest_score() correct = 'correct' if self.is_submission_correct(score) else 'incorrect' if self.child_state == self.ASSESSING: - eta_string = "" + eta_string = "Your response has been submitted. Please check back later for your grade." else: post_assessment = "" correct = "" diff --git a/lms/templates/combinedopenended/openended/open_ended.html b/lms/templates/combinedopenended/openended/open_ended.html index f2d59c4049..b76db8cecf 100644 --- a/lms/templates/combinedopenended/openended/open_ended.html +++ b/lms/templates/combinedopenended/openended/open_ended.html @@ -3,11 +3,11 @@
      ${prompt|n}
      -
      -
      +
      +
      +
      + Response
      - Response -
      @@ -15,7 +15,7 @@ % if state == 'initial': Unanswered % elif state == 'assessing': - Submitted for grading. + % if eta_message is not None: ${eta_message} % endif From 15b0e120686179276110c08a095e4d2f7bce0879 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 8 Aug 2013 14:02:33 -0400 Subject: [PATCH 36/75] Remove progress indicators, make rubric display properly --- .../xmodule/xmodule/js/src/combinedopenended/display.coffee | 2 +- lms/templates/combinedopenended/combined_open_ended.html | 3 +-- .../openended/open_ended_combined_rubric.html | 6 +++++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee index 8c29af2c0b..49c056172a 100644 --- a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee @@ -112,7 +112,7 @@ class @CombinedOpenEnded sub_id_sel: 'input.submission_id' grader_id_sel: 'input.grader_id' grader_status_sel: '.grader-status' - info_rubric_elements_sel: '.rubric-elements-info' + info_rubric_elements_sel: '.rubric-info-item' rubric_collapse_sel: '.rubric-collapse' next_rubric_sel: '.rubric-next-button' previous_rubric_sel: '.rubric-previous-button' diff --git a/lms/templates/combinedopenended/combined_open_ended.html b/lms/templates/combinedopenended/combined_open_ended.html index ef73a09bcc..1a5c7e3c7d 100644 --- a/lms/templates/combinedopenended/combined_open_ended.html +++ b/lms/templates/combinedopenended/combined_open_ended.html @@ -2,7 +2,6 @@

      ${display_name}

      - Progress: ${human_state}
      @@ -30,7 +29,7 @@
      % for item in items: diff --git a/lms/templates/combinedopenended/openended/open_ended_combined_rubric.html b/lms/templates/combinedopenended/openended/open_ended_combined_rubric.html index ab9e751672..158ec1f981 100644 --- a/lms/templates/combinedopenended/openended/open_ended_combined_rubric.html +++ b/lms/templates/combinedopenended/openended/open_ended_combined_rubric.html @@ -5,7 +5,11 @@
        % for j in range(len(category['options'])): <% option = category['options'][j] %> -
      • + %if len(category['options'][j]['grader_types'])>0: +
      • + %else: +
      • + %endif
        %if len(category['options'][j]['grader_types'])>0: %if correct[i]==1: From 803b7eb2af4a833bf78c1c7b1164e2142575e1a2 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 8 Aug 2013 16:31:36 -0400 Subject: [PATCH 37/75] Fix peer grading rubric issue. Redo peer grading JS to scope locally --- .../css/combinedopenended/display.scss | 19 ++- .../js/src/peergrading/peer_grading.coffee | 32 +++-- .../peergrading/peer_grading_problem.coffee | 130 ++++++++++++------ 3 files changed, 125 insertions(+), 56 deletions(-) diff --git a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss index b63e04d20e..32558e32bb 100644 --- a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss +++ b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss @@ -419,6 +419,22 @@ div.result-container { } } +div.rubric { + ul.rubric-list{ + margin: 0; + padding: 0; + list-style-type: none; + list-style: none; + li { + &.rubric-list-item { + margin-bottom: 0; + padding: 0; + border-radius: $baseline/4; + } + } + } +} + section.open-ended-child { @media print { @@ -659,14 +675,13 @@ section.open-ended-child { margin-bottom: lh(); margin-left: .75em; margin-left: .75rem; - list-style: disc outside none; } ul.rubric-list{ margin: 0; padding: 0; list-style-type: none; - + list-style: none; li { &.rubric-list-item { margin-bottom: 0; diff --git a/common/lib/xmodule/xmodule/js/src/peergrading/peer_grading.coffee b/common/lib/xmodule/xmodule/js/src/peergrading/peer_grading.coffee index 48980c7d88..7196a5d7a6 100644 --- a/common/lib/xmodule/xmodule/js/src/peergrading/peer_grading.coffee +++ b/common/lib/xmodule/xmodule/js/src/peergrading/peer_grading.coffee @@ -3,10 +3,20 @@ # Can (and should be) expanded upon when our problem list # becomes more sophisticated class @PeerGrading + + peer_grading_sel: '.peer-grading' + peer_grading_container_sel: '.peer-grading-container' + error_container_sel: '.error-container' + message_container_sel: '.message-container' + problem_button_sel: '.problem-button' + problem_list_sel: '.problem-list' + progress_bar_sel: '.progress-bar' + constructor: (element) -> - @peer_grading_container = $('.peer-grading') + @el = element + @peer_grading_container = @$(@peer_grading_sel) @use_single_location = @peer_grading_container.data('use-single-location') - @peer_grading_outer_container = $('.peer-grading-container') + @peer_grading_outer_container = @$(@peer_grading_container_sel) @ajax_url = @peer_grading_container.data('ajax-url') if @use_single_location.toLowerCase() == "true" @@ -14,23 +24,27 @@ class @PeerGrading @activate_problem() else #Otherwise, activate the panel view. - @error_container = $('.error-container') + @error_container = @$(@error_container_sel) @error_container.toggle(not @error_container.is(':empty')) - @message_container = $('.message-container') + @message_container = @$(@message_container_sel) @message_container.toggle(not @message_container.is(':empty')) - @problem_button = $('.problem-button') + @problem_button = @$(@problem_button_sel) @problem_button.click @show_results - @problem_list = $('.problem-list') + @problem_list = @$(@problem_list_sel) @construct_progress_bar() + # locally scoped jquery. + $: (selector) -> + $(selector, @el) + construct_progress_bar: () => problems = @problem_list.find('tr').next() problems.each( (index, element) => problem = $(element) - progress_bar = problem.find('.progress-bar') + progress_bar = problem.find(@progress_bar_sel) bar_value = parseInt(problem.data('graded')) bar_max = parseInt(problem.data('required')) + bar_value progress_bar.progressbar({value: bar_value, max: bar_max}) @@ -43,10 +57,10 @@ class @PeerGrading if response.success @peer_grading_outer_container.after(response.html).remove() backend = new PeerGradingProblemBackend(@ajax_url, false) - new PeerGradingProblem(backend) + new PeerGradingProblem(backend, @el) else @gentle_alert response.error activate_problem: () => backend = new PeerGradingProblemBackend(@ajax_url, false) - new PeerGradingProblem(backend) \ No newline at end of file + new PeerGradingProblem(backend, @el) \ No newline at end of file diff --git a/common/lib/xmodule/xmodule/js/src/peergrading/peer_grading_problem.coffee b/common/lib/xmodule/xmodule/js/src/peergrading/peer_grading_problem.coffee index c02fa3f390..b60f363649 100644 --- a/common/lib/xmodule/xmodule/js/src/peergrading/peer_grading_problem.coffee +++ b/common/lib/xmodule/xmodule/js/src/peergrading/peer_grading_problem.coffee @@ -158,11 +158,47 @@ class @PeerGradingProblemBackend return response class @PeerGradingProblem - constructor: (backend) -> - @prompt_wrapper = $('.prompt-wrapper') + + prompt_wrapper_sel: '.prompt-wrapper' + peer_grading_container_sel: '.peer-grading-container' + submission_container_sel: '.submission-container' + prompt_container_sel: '.prompt-container' + rubric_container_sel: '.rubric-container' + flag_student_container_sel: '.flag-student-container' + answer_unknown_container_sel: '.answer-unknown-container' + calibration_panel_sel: '.calibration-panel' + grading_panel_sel: '.grading-panel' + content_panel_sel: '.content-panel' + grading_message_sel: '.grading-message' + question_header_sel: '.question-header' + flag_submission_confirmation_sel: '.flag-submission-confirmation' + flag_submission_confirmation_button_sel: '.flag-submission-confirmation-button' + flag_submission_removal_button_sel: '.flag-submission-removal-button' + grading_wrapper_sel: '.grading-wrapper' + calibration_feedback_sel: '.calibration-feedback' + interstitial_page_sel: '.interstitial-page' + calibration_interstitial_page_sel: '.calibration-interstitial-page' + error_container_sel: '.error-container' + feedback_area_sel: '.feedback-area' + score_selection_container_sel: '.score-selection-container' + rubric_selection_container_sel: '.rubric-selection-container' + submit_button_sel: '.submit-button' + action_button_sel: '.action-button' + calibration_feedback_button_sel: '.calibration-feedback-button' + interstitial_page_button_sel: '.interstitial-page-button' + calibration_interstitial_page_button_sel: '.calibration-interstitial-page-button' + flag_checkbox_sel: '.flag-checkbox' + answer_unknown_checkbox_sel: '.answer-unknown-checkbox' + calibration_text_sel: '.calibration-text' + grading_text_sel: '.grading-text' + calibration_feedback_wrapper_sel: '.calibration-feedback-wrapper' + + constructor: (backend, el) -> + @el = el + @prompt_wrapper = $(@prompt_wrapper_sel) @backend = backend @is_ctrl = false - @el = $('.peer-grading-container') + @el = $(@peer_grading_container_sel) # get the location of the problem @location = $('.peer-grading').data('location') @@ -172,51 +208,51 @@ class @PeerGradingProblem return # get the other elements we want to fill in - @submission_container = $('.submission-container') - @prompt_container = $('.prompt-container') - @rubric_container = $('.rubric-container') - @flag_student_container = $('.flag-student-container') - @answer_unknown_container = $('.answer-unknown-container') - @calibration_panel = $('.calibration-panel') - @grading_panel = $('.grading-panel') - @content_panel = $('.content-panel') - @grading_message = $('.grading-message') + @submission_container = @$(@submission_container_sel) + @prompt_container = @$(@prompt_container_sel) + @rubric_container = @$(@rubric_container_sel) + @flag_student_container = @$(@flag_student_container_sel) + @answer_unknown_container = @$(@answer_unknown_container_sel) + @calibration_panel = @$(@calibration_panel_sel) + @grading_panel = @$(@grading_panel_sel) + @content_panel = @$(@content_panel_sel) + @grading_message = @$(@grading_message_sel) @grading_message.hide() - @question_header = $('.question-header') + @question_header = @$(@question_header_sel) @question_header.click @collapse_question - @flag_submission_confirmation = $('.flag-submission-confirmation') - @flag_submission_confirmation_button = $('.flag-submission-confirmation-button') - @flag_submission_removal_button = $('.flag-submission-removal-button') + @flag_submission_confirmation = @$(@flag_submission_confirmation_sel) + @flag_submission_confirmation_button = @$(@flag_submission_confirmation_button_sel) + @flag_submission_removal_button = @$(@flag_submission_removal_button_sel) @flag_submission_confirmation_button.click @close_dialog_box @flag_submission_removal_button.click @remove_flag - @grading_wrapper =$('.grading-wrapper') - @calibration_feedback_panel = $('.calibration-feedback') - @interstitial_page = $('.interstitial-page') + @grading_wrapper = @$(@grading_wrapper_sel) + @calibration_feedback_panel = @$(@calibration_feedback_sel) + @interstitial_page = @$(@interstitial_page_sel) @interstitial_page.hide() - @calibration_interstitial_page = $('.calibration-interstitial-page') + @calibration_interstitial_page = @$(@calibration_interstitial_page_sel) @calibration_interstitial_page.hide() - @error_container = $('.error-container') + @error_container = @$(@error_container_sel) @submission_key_input = $("input[name='submission-key']") - @essay_id_input = $("input[name='essay-id']") - @feedback_area = $('.feedback-area') + @essay_id_input = @$("input[name='essay-id']") + @feedback_area = @$(@feedback_area_sel) - @score_selection_container = $('.score-selection-container') - @rubric_selection_container = $('.rubric-selection-container') + @score_selection_container = @$(@score_selection_container_sel) + @rubric_selection_container = @$(@rubric_selection_container_sel) @grade = null @calibration = null - @submit_button = $('.submit-button') - @action_button = $('.action-button') - @calibration_feedback_button = $('.calibration-feedback-button') - @interstitial_page_button = $('.interstitial-page-button') - @calibration_interstitial_page_button = $('.calibration-interstitial-page-button') - @flag_student_checkbox = $('.flag-checkbox') - @answer_unknown_checkbox = $('.answer-unknown-checkbox') + @submit_button = @$(@submit_button_sel) + @action_button = @$(@action_button_sel) + @calibration_feedback_button = @$(@calibration_feedback_button_sel) + @interstitial_page_button = @$(@interstitial_page_button_sel) + @calibration_interstitial_page_button = @$(@calibration_interstitial_page_button_sel) + @flag_student_checkbox = @$(@flag_checkbox_sel) + @answer_unknown_checkbox = @$(@answer_unknown_checkbox_sel) $(window).keydown @keydown_handler $(window).keyup @keyup_handler @@ -251,6 +287,10 @@ class @PeerGradingProblem @is_calibrated_check() + # locally scoped jquery. + $: (selector) -> + $(selector, @el) + ########## # @@ -300,11 +340,11 @@ class @PeerGradingProblem @close_dialog_box() close_dialog_box: () => - $( ".flag-submission-confirmation" ).dialog('close') + @$(@flag_submission_confirmation_sel).dialog('close') flag_box_checked: () => if @flag_student_checkbox.is(':checked') - $( ".flag-submission-confirmation" ).dialog({ height: 400, width: 400 }) + @$(@flag_submission_confirmation_sel).dialog({ height: 400, width: 400 }) # called after we perform an is_student_calibrated check calibration_check_callback: (response) => @@ -399,10 +439,10 @@ class @PeerGradingProblem # Display the right text # both versions of the text are written into the template itself # we only need to show/hide the correct ones at the correct time - @calibration_panel.find('.calibration-text').show() - @grading_panel.find('.calibration-text').show() - @calibration_panel.find('.grading-text').hide() - @grading_panel.find('.grading-text').hide() + @calibration_panel.find(@calibration_text_sel).show() + @grading_panel.find(@calibration_text_sel).show() + @calibration_panel.find(@grading_text_sel).hide() + @grading_panel.find(@grading_text_sel).hide() @flag_student_container.hide() @answer_unknown_container.hide() @@ -429,10 +469,10 @@ class @PeerGradingProblem # Display the correct text # both versions of the text are written into the template itself # we only need to show/hide the correct ones at the correct time - @calibration_panel.find('.calibration-text').hide() - @grading_panel.find('.calibration-text').hide() - @calibration_panel.find('.grading-text').show() - @grading_panel.find('.grading-text').show() + @calibration_panel.find(@calibration_text_sel).hide() + @grading_panel.find(@calibration_text_sel).hide() + @calibration_panel.find(@grading_text_sel).show() + @grading_panel.find(@grading_text_sel).show() @flag_student_container.show() @answer_unknown_container.show() @feedback_area.val("") @@ -473,7 +513,7 @@ class @PeerGradingProblem render_calibration_feedback: (response) => # display correct grade @calibration_feedback_panel.slideDown() - calibration_wrapper = $('.calibration-feedback-wrapper') + calibration_wrapper = @$(@calibration_feedback_wrapper_sel) calibration_wrapper.html("

        The score you gave was: #{@grade}. The actual score is: #{response.actual_score}

        ") score = parseInt(@grade) @@ -490,7 +530,7 @@ class @PeerGradingProblem calibration_wrapper.append("
        Instructor Feedback: #{response.actual_feedback}
        ") # disable score selection and submission from the grading interface - $("input[name='score-selection']").attr('disabled', true) + @$("input[name='score-selection']").attr('disabled', true) @submit_button.hide() @calibration_feedback_button.show() @@ -516,7 +556,7 @@ class @PeerGradingProblem setup_score_selection: (max_score) => # And now hook up an event handler again - $("input[class='score-selection']").change @graded_callback + @$("input[class='score-selection']").change @graded_callback gentle_alert: (msg) => @grading_message.fadeIn() From f59045c3f9cc81365a3c521f0ee1fa7252968a96 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 8 Aug 2013 16:54:39 -0400 Subject: [PATCH 38/75] Scope rubrics locally, make them into classes --- .../js/src/combinedopenended/display.coffee | 58 +++++++++++-------- .../peergrading/peer_grading_problem.coffee | 11 ++-- 2 files changed, 40 insertions(+), 29 deletions(-) diff --git a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee index 49c056172a..7d299b5f68 100644 --- a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee @@ -1,20 +1,28 @@ class @Rubric - constructor: () -> - @initialize: (location,el) -> + rubric_category_sel: '.rubric-category' + rubric_sel: '.rubric' + + constructor: (el) -> @el = el - $('.rubric',@el).data("location", location) - $('input[class="score-selection"]',@el).change @tracking_callback + + initialize: (location) -> + @$(@rubric_sel).data("location", location) + @$('input[class="score-selection"]').change @tracking_callback # set up the hotkeys $(window).unbind('keydown', @keypress_callback) $(window).keydown @keypress_callback # display the 'current' carat - @categories = $('.rubric-category',el) - @category = $(@categories.first(),el) + @categories = @$(@rubric_category_sel) + @category = @$(@categories.first()) @category.prepend('> ') @category_index = 0 - @keypress_callback: (event) => + # locally scoped jquery. + $: (selector) -> + $(selector, @el) + + keypress_callback: (event) => # don't try to do this when user is typing in a text input if $(event.target).is('input, textarea') return @@ -31,7 +39,7 @@ class @Rubric # if we actually have a current category (not past the end) if(@category_index <= @categories.length) # find the valid selections for this category - inputs = $("input[name='score-selection-#{@category_index}']") + inputs = @$("input[name='score-selection-#{@category_index}']") max_score = inputs.length - 1 if selected > max_score or selected < 0 @@ -42,44 +50,44 @@ class @Rubric old_category_text = @category.html().substring(5) @category.html(old_category_text) @category_index++ - @category = $(@categories[@category_index],@el) + @category = @$(@categories[@category_index]) @category.prepend('> ') - @tracking_callback: (event) -> + tracking_callback: (event) -> target_selection = $(event.target).val() # chop off the beginning of the name so that we can get the number of the category category = $(event.target).data("category") - location = $('.rubric',@el).data('location') + location = @$(@rubric_sel).data('location') # probably want the original problem location as well data = {location: location, selection: target_selection, category: category} Logger.log 'rubric_select', data # finds the scores for each rubric category - @get_score_list: () => + get_score_list: () => # find the number of categories: - num_categories = $('.rubric-category',@el).length + num_categories = @$(@rubric_category_sel).length score_lst = [] # get the score for each one for i in [0..(num_categories-1)] - score = $("input[name='score-selection-#{i}']:checked").val() + score = @$("input[name='score-selection-#{i}']:checked").val() score_lst.push(score) return score_lst - @get_total_score: () -> + get_total_score: () -> score_lst = @get_score_list() tot = 0 for score in score_lst tot += parseInt(score) return tot - @check_complete: () -> + check_complete: () -> # check to see whether or not any categories have not been scored - num_categories = $('.rubric-category',@el).length + num_categories = @$(@rubric_category_sel).length for i in [0..(num_categories-1)] - score = $("input[name='score-selection-#{i}']:checked",@el).val() + score = @$("input[name='score-selection-#{i}']:checked").val() if score == undefined return false return true @@ -143,7 +151,8 @@ class @CombinedOpenEnded @location = @coe.data('location') # set up handlers for click tracking - Rubric.initialize(@location,@coe) + @rub = new Rubric(@coe) + @rub.initialize(@location) @is_ctrl = false #Setup reset @reset_button = @$(@reset_button_sel) @@ -390,7 +399,8 @@ class @CombinedOpenEnded if response.success @rubric_wrapper.html(response.rubric_html) @rubric_wrapper.show() - Rubric.initialize(@location,@coe) + @rub = new Rubric(@coe) + @rub.initialize(@location) @answer_area.html(response.student_response) @child_state = 'assessing' @find_assessment_elements() @@ -408,7 +418,7 @@ class @CombinedOpenEnded #Previously, responses were submitted when hitting enter. Add in a modifier that ensures that ctrl+enter is needed. if event.which == 17 && @is_ctrl==false @is_ctrl=true - else if @is_ctrl==true && event.which == 13 && @child_state == 'assessing' && Rubric.check_complete() + else if @is_ctrl==true && event.which == 13 && @child_state == 'assessing' && @rub.check_complete() @save_assessment(event) keyup_handler: (event) => @@ -418,9 +428,9 @@ class @CombinedOpenEnded save_assessment: (event) => event.preventDefault() - if @child_state == 'assessing' && Rubric.check_complete() - checked_assessment = Rubric.get_total_score() - score_list = Rubric.get_score_list() + if @child_state == 'assessing' && @rub.check_complete() + checked_assessment = @rub.get_total_score() + score_list = @rub.get_score_list() data = {'assessment' : checked_assessment, 'score_list' : score_list} $.postWithPrefix "#{@ajax_url}/save_assessment", data, (response) => if response.success diff --git a/common/lib/xmodule/xmodule/js/src/peergrading/peer_grading_problem.coffee b/common/lib/xmodule/xmodule/js/src/peergrading/peer_grading_problem.coffee index b60f363649..4f644a4ec1 100644 --- a/common/lib/xmodule/xmodule/js/src/peergrading/peer_grading_problem.coffee +++ b/common/lib/xmodule/xmodule/js/src/peergrading/peer_grading_problem.coffee @@ -309,8 +309,8 @@ class @PeerGradingProblem construct_data: () -> data = - rubric_scores: Rubric.get_score_list() - score: Rubric.get_total_score() + rubric_scores: @rub.get_score_list() + score: @rub.get_total_score() location: @location submission_id: @essay_id_input.val() submission_key: @submission_key_input.val() @@ -398,11 +398,11 @@ class @PeerGradingProblem # called after a grade is selected on the interface graded_callback: (event) => # check to see whether or not any categories have not been scored - if Rubric.check_complete() + if @rub.check_complete() # show button if we have scores for all categories @grading_message.hide() @show_submit_button() - @grade = Rubric.get_total_score() + @grade = @rub.get_total_score() keydown_handler: (event) => #Previously, responses were submitted when hitting enter. Add in a modifier that ensures that ctrl+enter is needed. @@ -507,7 +507,8 @@ class @PeerGradingProblem @submit_button.hide() @action_button.hide() @calibration_feedback_panel.hide() - Rubric.initialize(@location,@el) + @rub = new Rubric(@el) + @rub.initialize(@location) render_calibration_feedback: (response) => From d44b2e62a00f20bd01b42bf4a16571dbb65f0f30 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 8 Aug 2013 17:19:06 -0400 Subject: [PATCH 39/75] Proper partial credit checks --- .../xmodule/xmodule/css/combinedopenended/display.scss | 7 +++++++ .../combined_open_ended_rubric.py | 9 ++++++++- .../open_ended_grading_classes/open_ended_module.py | 2 +- .../openended/open_ended_combined_rubric.html | 2 ++ 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss index 32558e32bb..8c49417af9 100644 --- a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss +++ b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss @@ -282,6 +282,13 @@ div.combined-rubric-container { } } + label.choicegroup_partialcorrect { + &:before { + margin-right: 15px; + content: url('../images/partially-correct-icon.png'); + } + } + label.choicegroup_incorrect { &:before { margin-right: 15px; diff --git a/common/lib/xmodule/xmodule/open_ended_grading_classes/combined_open_ended_rubric.py b/common/lib/xmodule/xmodule/open_ended_grading_classes/combined_open_ended_rubric.py index 0b2b0fdaec..a072d5ad5e 100644 --- a/common/lib/xmodule/xmodule/open_ended_grading_classes/combined_open_ended_rubric.py +++ b/common/lib/xmodule/xmodule/open_ended_grading_classes/combined_open_ended_rubric.py @@ -224,7 +224,14 @@ class CombinedOpenEndedRubric(object): actual_scores[i] += [j] actual_scores = [sum(i)/len(i) for i in actual_scores] - correct = [int(a>.66) for a in actual_scores] + correct = [] + for (i,a) in enumerate(actual_scores): + if int(a)/max_scores[i]==1: + correct.append(1) + elif int(a)==0: + correct.append(0) + else: + correct.append(.5) html = self.system.render_template('{0}/open_ended_combined_rubric.html'.format(self.TEMPLATE_DIR), {'categories': rubric_categories, diff --git a/common/lib/xmodule/xmodule/open_ended_grading_classes/open_ended_module.py b/common/lib/xmodule/xmodule/open_ended_grading_classes/open_ended_module.py index e1e4643afe..afaa657937 100644 --- a/common/lib/xmodule/xmodule/open_ended_grading_classes/open_ended_module.py +++ b/common/lib/xmodule/xmodule/open_ended_grading_classes/open_ended_module.py @@ -697,7 +697,7 @@ class OpenEndedModule(openendedchild.OpenEndedChild): else: post_assessment = "" correct = "" - previous_answer = self.initial_display + previous_answer = "" context = { 'prompt': self.child_prompt, diff --git a/lms/templates/combinedopenended/openended/open_ended_combined_rubric.html b/lms/templates/combinedopenended/openended/open_ended_combined_rubric.html index 158ec1f981..1ad11be024 100644 --- a/lms/templates/combinedopenended/openended/open_ended_combined_rubric.html +++ b/lms/templates/combinedopenended/openended/open_ended_combined_rubric.html @@ -14,6 +14,8 @@ %if len(category['options'][j]['grader_types'])>0: %if correct[i]==1: + %elif correct[i]==.5: + %else: %endif From 900377e4eecea5520b7c886a431e3c0ef7e5c616 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 8 Aug 2013 17:53:29 -0400 Subject: [PATCH 40/75] Return written feedback --- .../combined_open_ended_modulev1.py | 9 ++++++--- .../combinedopenended/combined_open_ended_results.html | 3 +++ 2 files changed, 9 insertions(+), 3 deletions(-) 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 eee2e93312..54cfda514c 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 @@ -537,15 +537,17 @@ class CombinedOpenEndedV1Module(): Output: Dictionary to be rendered via ajax that contains the result html. """ all_responses = [] + success, can_see_rubric, error = self.check_if_student_has_done_needed_grading() + if not can_see_rubric: + return {'html' : error, 'success' : False} loop_up_to_task = self.current_task_number + 1 contexts = [] for i in xrange(0, loop_up_to_task): response = self.get_last_response(i) - rubric_scores = None score_length = len(response['grader_types']) - log.info(response) for z in xrange(0,score_length): + feedback = response['feedback_dicts'][z].get('feedback', '') if response['grader_types'][z] in HUMAN_GRADER_TYPE.keys(): rubric_scores = [[response['rubric_scores'][z]]] grader_types = [[response['grader_types'][z]]] @@ -555,7 +557,8 @@ class CombinedOpenEndedV1Module(): grader_types, feedback_items) contexts.append({ 'result': rubric_html, - 'task_name': 'Scored rubric' + 'task_name': 'Scored rubric', + 'feedback' : feedback }) context = { diff --git a/lms/templates/combinedopenended/combined_open_ended_results.html b/lms/templates/combinedopenended/combined_open_ended_results.html index 688354ff4c..7bbf992137 100644 --- a/lms/templates/combinedopenended/combined_open_ended_results.html +++ b/lms/templates/combinedopenended/combined_open_ended_results.html @@ -16,6 +16,9 @@
        ${result['result'] | n} +
        + ${result['feedback'] | n} +
      %endif From a9926f04604c4dc1f4d1ab141a0eab50594976ee Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 8 Aug 2013 18:43:54 -0400 Subject: [PATCH 41/75] Display message to student when they cannot see their peer grading feedback yet. --- .../xmodule/js/src/combinedopenended/display.coffee | 3 +++ .../combined_open_ended_modulev1.py | 13 ++++++++----- .../combined_open_ended_hidden_results.html | 10 ++++++++++ 3 files changed, 21 insertions(+), 5 deletions(-) create mode 100644 lms/templates/combinedopenended/combined_open_ended_hidden_results.html diff --git a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee index 7d299b5f68..dc6cd57730 100644 --- a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee @@ -250,6 +250,9 @@ class @CombinedOpenEnded @hide_rubrics() @$(@previous_rubric_sel).click @previous_rubric @$(@next_rubric_sel).click @next_rubric + if response.hide_reset + @reset_button.hide() + show_status_current: () => data = {} 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 54cfda514c..19c9aeb6df 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 @@ -506,10 +506,13 @@ class CombinedOpenEndedV1Module(): student_id = self.system.anonymous_student_id success = False allowed_to_submit = True - error_string = ("You need to peer grade {0} more in order to make another submission. " - "You have graded {1}, and {2} are required. You have made {3} successful peer grading submissions.") + error_string = ("

      Feedback not available yet

      " + "

      You need to peer grade {0} more submissions in order to see your feedback.

      " + "

      You have graded responses from {1} students, and {2} students have graded your submissions.

      " + "

      You have made {3} submissions.

      ") try: - response = self.peer_gs.get_data_for_location(self.location, student_id) + response = self.peer_gs.get_data_for_location(self.location.url(), student_id) + log.info(response) count_graded = response['count_graded'] count_required = response['count_required'] student_sub_count = response['student_sub_count'] @@ -539,7 +542,7 @@ class CombinedOpenEndedV1Module(): all_responses = [] success, can_see_rubric, error = self.check_if_student_has_done_needed_grading() if not can_see_rubric: - return {'html' : error, 'success' : False} + return {'html' : self.system.render_template('{0}/combined_open_ended_hidden_results.html'.format(self.TEMPLATE_DIR), {'error' : error}), 'success' : True, 'hide_reset' : True} loop_up_to_task = self.current_task_number + 1 contexts = [] @@ -565,7 +568,7 @@ class CombinedOpenEndedV1Module(): 'results': contexts, } html = self.system.render_template('{0}/combined_open_ended_results.html'.format(self.TEMPLATE_DIR), context) - return {'html': html, 'success': True} + return {'html': html, 'success': True, 'hide_reset' : False} def get_legend(self, _data): """ diff --git a/lms/templates/combinedopenended/combined_open_ended_hidden_results.html b/lms/templates/combinedopenended/combined_open_ended_hidden_results.html new file mode 100644 index 0000000000..396a657273 --- /dev/null +++ b/lms/templates/combinedopenended/combined_open_ended_hidden_results.html @@ -0,0 +1,10 @@ +
      +
      +
      +
      + Submitted Rubric +
      +
      + ${error} +
      +
      From e4bcfa5c219eb2270eaea15754e82e3103245c60 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 8 Aug 2013 19:31:34 -0400 Subject: [PATCH 42/75] Fix indents and copy behavior --- common/lib/xmodule/xmodule/combined_open_ended_module.py | 6 ++---- common/lib/xmodule/xmodule/peer_grading_module.py | 9 ++++----- lms/djangoapps/courseware/model_data.py | 3 ++- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/common/lib/xmodule/xmodule/combined_open_ended_module.py b/common/lib/xmodule/xmodule/combined_open_ended_module.py index e01ae49149..256f96a3a7 100644 --- a/common/lib/xmodule/xmodule/combined_open_ended_module.py +++ b/common/lib/xmodule/xmodule/combined_open_ended_module.py @@ -8,7 +8,7 @@ from .x_module import XModule from xblock.core import Integer, Scope, String, List, Float, Boolean from xmodule.open_ended_grading_classes.combined_open_ended_modulev1 import CombinedOpenEndedV1Module, CombinedOpenEndedV1Descriptor from collections import namedtuple -from .fields import Date +from .fields import Date, Timedelta import textwrap log = logging.getLogger("mitx.courseware") @@ -226,12 +226,10 @@ class CombinedOpenEndedFields(object): ) due = Date( help="Date that this problem is due by", - default=None, scope=Scope.settings ) - graceperiod = String( + graceperiod = Timedelta( help="Amount of time after the due date that submissions will be accepted", - default=None, scope=Scope.settings ) version = VersionInteger(help="Current version number", default=DEFAULT_VERSION, scope=Scope.settings) diff --git a/common/lib/xmodule/xmodule/peer_grading_module.py b/common/lib/xmodule/xmodule/peer_grading_module.py index c29b6a8069..aa742f6a0b 100644 --- a/common/lib/xmodule/xmodule/peer_grading_module.py +++ b/common/lib/xmodule/xmodule/peer_grading_module.py @@ -46,7 +46,6 @@ class PeerGradingFields(object): ) due = Date( help="Due date that should be displayed.", - default=None, scope=Scope.settings) graceperiod = Timedelta( help="Amount of grace to give on the due date.", @@ -525,10 +524,10 @@ class PeerGradingModule(PeerGradingFields, XModule): good_problem_list = [] for problem in problem_list: problem_location = problem['location'] - try: - descriptor = _find_corresponding_module_for_location(problem_location) - except: - continue + try: + descriptor = _find_corresponding_module_for_location(problem_location) + except: + continue if descriptor: problem['due'] = descriptor.lms.due grace_period = descriptor.lms.graceperiod diff --git a/lms/djangoapps/courseware/model_data.py b/lms/djangoapps/courseware/model_data.py index 44be16e441..b72c0e90c6 100644 --- a/lms/djangoapps/courseware/model_data.py +++ b/lms/djangoapps/courseware/model_data.py @@ -353,7 +353,8 @@ class LmsKeyValueStore(KeyValueStore): for field in kv_dict: # Check field for validity if field.field_name in self._descriptor_model_data: - raise InvalidWriteError("Not allowed to overwrite descriptor model data", field.field_name) + if field.field_name not in ["due","graceperiod"]: + raise InvalidWriteError("Not allowed to overwrite descriptor model data", field.field_name) if field.scope not in self._allowed_scopes: raise InvalidScopeError(field.scope) From e39abe11db79440d3cb0ace2c6abec98b95bf998 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 8 Aug 2013 19:50:55 -0400 Subject: [PATCH 43/75] Fix rubric with staff grading --- .../js/src/combinedopenended/display.coffee | 8 ++++---- .../src/staff_grading/staff_grading.coffee | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee index dc6cd57730..6b79ec9e3b 100644 --- a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee @@ -6,7 +6,7 @@ class @Rubric constructor: (el) -> @el = el - initialize: (location) -> + initialize: (location) => @$(@rubric_sel).data("location", location) @$('input[class="score-selection"]').change @tracking_callback # set up the hotkeys @@ -53,7 +53,7 @@ class @Rubric @category = @$(@categories[@category_index]) @category.prepend('> ') - tracking_callback: (event) -> + tracking_callback: (event) => target_selection = $(event.target).val() # chop off the beginning of the name so that we can get the number of the category category = $(event.target).data("category") @@ -76,14 +76,14 @@ class @Rubric return score_lst - get_total_score: () -> + get_total_score: () => score_lst = @get_score_list() tot = 0 for score in score_lst tot += parseInt(score) return tot - check_complete: () -> + check_complete: () => # check to see whether or not any categories have not been scored num_categories = @$(@rubric_category_sel).length for i in [0..(num_categories-1)] diff --git a/lms/static/coffee/src/staff_grading/staff_grading.coffee b/lms/static/coffee/src/staff_grading/staff_grading.coffee index f22fe9c7fd..e7e7c189ac 100644 --- a/lms/static/coffee/src/staff_grading/staff_grading.coffee +++ b/lms/static/coffee/src/staff_grading/staff_grading.coffee @@ -223,12 +223,12 @@ class @StaffGrading setup_score_selection: => @score_selection_container.html(@rubric) $('input[class="score-selection"]').change => @graded_callback() - Rubric.initialize(@location, @el) - + @rub = new Rubric(@el) + @rub.initialize(@location) graded_callback: () => # show button if we have scores for all categories - if Rubric.check_complete() + if @rub.check_complete() @state = state_graded @submit_button.show() @@ -236,7 +236,7 @@ class @StaffGrading #Previously, responses were submitted when hitting enter. Add in a modifier that ensures that ctrl+enter is needed. if event.which == 17 && @is_ctrl==false @is_ctrl=true - else if @is_ctrl==true && event.which == 13 && !@list_view && Rubric.check_complete() + else if @is_ctrl==true && event.which == 13 && !@list_view && @rub.check_complete() @submit_and_get_next() keyup_handler: (event) => @@ -271,8 +271,8 @@ class @StaffGrading skip_and_get_next: () => data = - score: Rubric.get_total_score() - rubric_scores: Rubric.get_score_list() + score: @rub.get_total_score() + rubric_scores: @rub.get_score_list() feedback: @feedback_area.val() submission_id: @submission_id location: @location @@ -286,8 +286,8 @@ class @StaffGrading submit_and_get_next: () -> data = - score: Rubric.get_total_score() - rubric_scores: Rubric.get_score_list() + score: @rub.get_total_score() + rubric_scores: @rub.get_score_list() feedback: @feedback_area.val() submission_id: @submission_id location: @location From adbfdccee8cdb7127600eefe4ae7f2ace37a1c6e Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Fri, 9 Aug 2013 08:18:23 -0400 Subject: [PATCH 44/75] Prevent student from resetting problem unless they have completed required peer grading. Grant an exemption if there is no available peer grading. --- .../combined_open_ended_modulev1.py | 7 +++++-- .../open_ended_grading_classes/peer_grading_service.py | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) 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 19c9aeb6df..c0a19ae2ab 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 @@ -516,6 +516,7 @@ class CombinedOpenEndedV1Module(): count_graded = response['count_graded'] count_required = response['count_required'] student_sub_count = response['student_sub_count'] + count_available = response['count_available'] success = True except: # This is a dev_facing_error @@ -524,7 +525,7 @@ class CombinedOpenEndedV1Module(): # This is a student_facing_error error_message = "Could not contact the graders. Please notify course staff." return success, allowed_to_submit, error_message - if count_graded >= count_required: + if count_graded >= count_required or count_available==0: return success, allowed_to_submit, "" else: allowed_to_submit = False @@ -687,7 +688,9 @@ class CombinedOpenEndedV1Module(): if self.state != self.DONE: if not self.ready_to_reset: return self.out_of_sync_error(data) - + success, can_reset, error = self.check_if_student_has_done_needed_grading() + if not can_reset: + return {'error' : error, 'success' : False} if self.student_attempts >= self.max_attempts-1: if self.student_attempts==self.max_attempts-1: self.student_attempts +=1 diff --git a/common/lib/xmodule/xmodule/open_ended_grading_classes/peer_grading_service.py b/common/lib/xmodule/xmodule/open_ended_grading_classes/peer_grading_service.py index 3c25b301ab..0e5c9cdda1 100644 --- a/common/lib/xmodule/xmodule/open_ended_grading_classes/peer_grading_service.py +++ b/common/lib/xmodule/xmodule/open_ended_grading_classes/peer_grading_service.py @@ -124,4 +124,4 @@ class MockPeerGradingService(object): ]} def get_data_for_location(self, problem_location, student_id): - return {"version": 1, "count_graded": 3, "count_required": 3, "success": True, "student_sub_count": 1} + return {"version": 1, "count_graded": 3, "count_required": 3, "success": True, "student_sub_count": 1, 'submissions_available' : 0} From f929b4930acbdc72adf6d3128bc65535275134d8 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Fri, 9 Aug 2013 08:42:02 -0400 Subject: [PATCH 45/75] Add in jasmine test for rubric, fix combinedopenended jasmine failures --- .../xmodule/xmodule/js/fixtures/rubric.html | 325 ++++++++++++++++++ .../combinedopenended/display_spec.coffee | 33 +- 2 files changed, 356 insertions(+), 2 deletions(-) create mode 100644 common/lib/xmodule/xmodule/js/fixtures/rubric.html diff --git a/common/lib/xmodule/xmodule/js/fixtures/rubric.html b/common/lib/xmodule/xmodule/js/fixtures/rubric.html new file mode 100644 index 0000000000..9802e3bf8d --- /dev/null +++ b/common/lib/xmodule/xmodule/js/fixtures/rubric.html @@ -0,0 +1,325 @@ +
      +
      +

      Open Response Assessment

      +
      +
      +
      +
      +
      + + + + + +
      +
      + Open Response +
      +
      +
      + Assessments: +
      +
      + + + +
      +
      + +
      + Peer +
      +
      +
      + + + +
      +
      +
      + +
      +
      +
      +
      + Show Prompt +
      +
      +
      +
      +
      + +
      +
      +
      + Response +
      +
      + +
      +
      + +
      + +
      + + + + +
      + + +
      +
      +
      + + + +
      + +
      +
      +
      +
      + Submitted Rubric +
      +
      + Scored rubric from grader 1 + +
      +
      + + +Ideas +
      +
        + +
      • +
        + + 0 points : +Difficult for the reader to discern the main idea. Too brief or too repetitive to establish or maintain a focus. + + +
        +
      • + + + + + + +
      + + +Content +
      +
        + +
      • +
        + + 0 points : +Includes little information with few or no details or unrelated details. Unsuccessful in attempts to explore any facets of the topic. + + +
        +
      • + + + + + + +
      + + +Organization +
      +
        + +
      • +
        + + 0 points : +Ideas organized illogically, transitions weak, and response difficult to follow. + + +
        +
      • + + + + +
      + + +Style +
      +
        + +
      • +
        + + 0 points : +Contains limited vocabulary, with many words used incorrectly. Demonstrates problems with sentence patterns. + + +
        +
      • + + + + +
      + + +Voice +
      +
        + +
      • +
        + + 0 points : +Demonstrates language and tone that may be inappropriate to task and reader. + + +
        +
      • + + + + +
      +
      + + +
      + +
      +
      + + + + +
      +
      + +
      +
      +
      +
      \ No newline at end of file diff --git a/common/lib/xmodule/xmodule/js/spec/combinedopenended/display_spec.coffee b/common/lib/xmodule/xmodule/js/spec/combinedopenended/display_spec.coffee index f2e8da7990..293d6405ad 100644 --- a/common/lib/xmodule/xmodule/js/spec/combinedopenended/display_spec.coffee +++ b/common/lib/xmodule/xmodule/js/spec/combinedopenended/display_spec.coffee @@ -1,3 +1,30 @@ +describe 'Rubric', -> + beforeEach -> + spyOn Logger, 'log' + # load up some fixtures + loadFixtures 'rubric.html' + jasmine.Clock.useMock() + @element = $('.combined-open-ended') + @location = @element.data('location') + + describe 'constructor', -> + beforeEach -> + @rub = new Rubric @element + + it 'rubric should properly grab the element', -> + expect(@rub.el).toEqual @element + + describe 'initialize', -> + beforeEach -> + @rub = new Rubric @element + @rub.initialize @location + + it 'rubric correctly sets location', -> + expect($(@rub.rubric_sel).data('location')).toEqual @location + + it 'rubric correctly read', -> + expect(@rub.categories.length).toEqual 5 + describe 'CombinedOpenEnded', -> beforeEach -> spyOn Logger, 'log' @@ -13,7 +40,7 @@ describe 'CombinedOpenEnded', -> @combined = new CombinedOpenEnded @element it 'set the element', -> - expect(@combined.element).toEqual @element + expect(@combined.el).toEqual @element it 'get the correct values from data fields', -> expect(@combined.ajax_url).toEqual '/courses/MITx/6.002x/2012_Fall/modx/i4x://MITx/6.002x/combinedopenended/CombinedOE' @@ -77,7 +104,7 @@ describe 'CombinedOpenEnded', -> @combined.child_state = 'done' @combined.rebind() expect(@combined.answer_area.attr("disabled")).toBe("disabled") - expect(@combined.next_problem).toHaveBeenCalled() + expect(@combined.next_problem_button).toBe(":visible") describe 'next_problem', -> beforeEach -> @@ -109,3 +136,5 @@ describe 'CombinedOpenEnded', -> + + From 5d16bc9eb613a4f268eeb4ca7824b5394cc051a7 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Fri, 9 Aug 2013 11:24:07 -0400 Subject: [PATCH 46/75] Remove ad-hoc patch for xblock issue --- lms/djangoapps/courseware/model_data.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lms/djangoapps/courseware/model_data.py b/lms/djangoapps/courseware/model_data.py index b72c0e90c6..44be16e441 100644 --- a/lms/djangoapps/courseware/model_data.py +++ b/lms/djangoapps/courseware/model_data.py @@ -353,8 +353,7 @@ class LmsKeyValueStore(KeyValueStore): for field in kv_dict: # Check field for validity if field.field_name in self._descriptor_model_data: - if field.field_name not in ["due","graceperiod"]: - raise InvalidWriteError("Not allowed to overwrite descriptor model data", field.field_name) + raise InvalidWriteError("Not allowed to overwrite descriptor model data", field.field_name) if field.scope not in self._allowed_scopes: raise InvalidScopeError(field.scope) From e1cba4b0b4927ad7b44876d472135cb191371976 Mon Sep 17 00:00:00 2001 From: marco Date: Fri, 9 Aug 2013 11:26:59 -0400 Subject: [PATCH 47/75] cleaned up html structure for various pages, style fixed for show/hide prompt item --- .../css/combinedopenended/display.scss | 4 + .../js/fixtures/combined-open-ended.html | 121 +++++++++--------- lms/static/sass/course/_rubric.scss | 1 + .../combined_open_ended.html | 3 +- .../combined_open_ended_results.html | 10 +- .../openended/open_ended_combined_rubric.html | 2 +- 6 files changed, 77 insertions(+), 64 deletions(-) diff --git a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss index b63e04d20e..4565f73bc8 100644 --- a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss +++ b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss @@ -132,6 +132,10 @@ section.combined-open-ended-status { border-radius: 0 $baseline/4 $baseline/4 0; border-right: 0px; } + + &:only-child { + border-radius: $baseline/4; + } .show-results { margin-top: .3em; diff --git a/common/lib/xmodule/xmodule/js/fixtures/combined-open-ended.html b/common/lib/xmodule/xmodule/js/fixtures/combined-open-ended.html index abea783ae8..5cd1113103 100644 --- a/common/lib/xmodule/xmodule/js/fixtures/combined-open-ended.html +++ b/common/lib/xmodule/xmodule/js/fixtures/combined-open-ended.html @@ -1,75 +1,78 @@
      -
      +
      - -

      Problem 1

      -
      -

      Status

      -
      -
      - -
      - - Step 1 (Problem complete) : 1 / 1 +

      Problem 1

      +
      +

      Status

      +
      +
      +
      + Step 1 (Problem complete) : 1 / 1 - -
      - -
      - - Step 2 (Being scored) : None / 1 +
      +
      + Step 2 (Being scored) : None / 1 - +
      +
      +
      -
      -
      - -
      - -
      -

      Problem

      +
      +

      Problem

      -
      -
      - - Some prompt. - -
      -
      -
      - Submitted for grading. - -
      - -
      - - -
      +
      +
      +
      +
      +
      + Some prompt. +
      + +
      +
      + Submitted for grading. +
      + + +
      + +
      - - - - +
      + +
      - -
      -
      -
      - - -
      - - + +
      + + +
      + + + - + })" id="i4x_MITx_6_002x_combinedopenended_CombinedOE_xqa_log">QA + +
      +
      Submitted Rubric
    -
    - ${result['task_name']} from grader ${i+1} +
    + % if len(results)>1: + Previous + % endif + ${result['task_name']} from grader ${i+1} + % if len(results)>1: + Next + % endif
    ${result['result'] | n} diff --git a/lms/templates/combinedopenended/openended/open_ended_combined_rubric.html b/lms/templates/combinedopenended/openended/open_ended_combined_rubric.html index 158ec1f981..5f763f371d 100644 --- a/lms/templates/combinedopenended/openended/open_ended_combined_rubric.html +++ b/lms/templates/combinedopenended/openended/open_ended_combined_rubric.html @@ -1,7 +1,7 @@
    % for i in range(len(categories)): <% category = categories[i] %> - ${category['description']}
    + ${category['description']}
      % for j in range(len(category['options'])): <% option = category['options'][j] %> From 33da3ec1cfa5080250bf70a5b10f41c7ccc8e069 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Fri, 9 Aug 2013 14:50:57 -0400 Subject: [PATCH 48/75] Fix self assessment template --- .../openended/open_ended.html | 4 ++-- .../selfassessment/self_assessment_prompt.html | 18 ++++++++---------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/lms/templates/combinedopenended/openended/open_ended.html b/lms/templates/combinedopenended/openended/open_ended.html index 6e2de66823..c6a8cb2253 100644 --- a/lms/templates/combinedopenended/openended/open_ended.html +++ b/lms/templates/combinedopenended/openended/open_ended.html @@ -31,8 +31,8 @@
      - - + +
      diff --git a/lms/templates/combinedopenended/selfassessment/self_assessment_prompt.html b/lms/templates/combinedopenended/selfassessment/self_assessment_prompt.html index 99782e3185..ee2dd643df 100644 --- a/lms/templates/combinedopenended/selfassessment/self_assessment_prompt.html +++ b/lms/templates/combinedopenended/selfassessment/self_assessment_prompt.html @@ -4,25 +4,23 @@
      ${prompt} +
      - Response + ${_("Response")}
      -

      ${_("Response")}

      -
      -
      -
      +
      +
      ${initial_rubric}
      -
      - -
      -
      - + + +
      +
    From 68199da821410205ef3c9741b8329555695caa4f Mon Sep 17 00:00:00 2001 From: marco Date: Fri, 9 Aug 2013 18:44:15 -0400 Subject: [PATCH 49/75] added oe-tools header areas to eventually consolitate all messaging --- .../css/combinedopenended/display.scss | 20 +++++++++++++++++++ .../js/fixtures/combined-open-ended.html | 8 +++++--- .../xmodule/xmodule/js/fixtures/rubric.html | 12 +++++------ lms/static/sass/course/_rubric.scss | 10 ++++++++-- .../combined_open_ended.html | 10 ++++++++-- .../combined_open_ended_results.html | 9 +++------ .../self_assessment_prompt.html | 2 -- 7 files changed, 50 insertions(+), 21 deletions(-) diff --git a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss index 3500e6e47d..d4a79ff825 100644 --- a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss +++ b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss @@ -855,3 +855,23 @@ section.open-ended-child { padding: $baseline/2 0; } } + +//OE Tool Area Styling + +.oe-tools { + display: inline-block; + width: 100%; + border-radius: 5px; + + .oe-tools-label { + font-size: 0.8em; + display: inline-block; + vertical-align: middle; + padding: 10px; + } + + .reset-button { + vertical-align: middle; + } +} + diff --git a/common/lib/xmodule/xmodule/js/fixtures/combined-open-ended.html b/common/lib/xmodule/xmodule/js/fixtures/combined-open-ended.html index 5cd1113103..91d09f7922 100644 --- a/common/lib/xmodule/xmodule/js/fixtures/combined-open-ended.html +++ b/common/lib/xmodule/xmodule/js/fixtures/combined-open-ended.html @@ -41,7 +41,10 @@
    - +
    + Response: + +
    @@ -65,8 +68,7 @@ 'xqa_key': 'KUBrWtK3RAaBALLbccHrXeD3RHOpmZ2A', 'category': 'CombinedOpenEndedModule', 'user': 'blah' - })" id="i4x_MITx_6_002x_combinedopenended_CombinedOE_xqa_log">QA - + })" id="i4x_MITx_6_002x_combinedopenended_CombinedOE_xqa_log">QA - - - +
    + Response: + +
    @@ -89,8 +90,8 @@ Submitted Rubric
    - Scored rubric from grader 1 + Scored rubric from grader 1
    @@ -313,8 +314,7 @@ Demonstrates effective adjustment of language and tone to task and reader.
    - - +
    diff --git a/lms/static/sass/course/_rubric.scss b/lms/static/sass/course/_rubric.scss index 59aabdb917..b97eea5cd3 100644 --- a/lms/static/sass/course/_rubric.scss +++ b/lms/static/sass/course/_rubric.scss @@ -1,10 +1,16 @@ .rubric-header { - padding: $baseline/2 0; + background-color: #fafafa; + border-radius: 5px; + .rubric-collapse { - float: right; + margin-right: $baseline/2; } } +.button { + display: inline-block; +} + .rubric { margin: 0; color: #3C3C3C; diff --git a/lms/templates/combinedopenended/combined_open_ended.html b/lms/templates/combinedopenended/combined_open_ended.html index 7d46df806e..84ac00fab3 100644 --- a/lms/templates/combinedopenended/combined_open_ended.html +++ b/lms/templates/combinedopenended/combined_open_ended.html @@ -37,12 +37,18 @@
    ${item['content'] | n}
    % endfor - - +
    + Response: + +
    +
    + + +
    diff --git a/lms/templates/combinedopenended/combined_open_ended_results.html b/lms/templates/combinedopenended/combined_open_ended_results.html index 5dc79ed5d7..99ea6dc46d 100644 --- a/lms/templates/combinedopenended/combined_open_ended_results.html +++ b/lms/templates/combinedopenended/combined_open_ended_results.html @@ -11,7 +11,9 @@ Submitted Rubric -
    +
    + Assessment Tools: + % if len(results)>1: Previous % endif @@ -19,7 +21,6 @@ % if len(results)>1: Next % endif -
    ${result['result'] | n}
    @@ -29,8 +30,4 @@ %endif % endfor -% if len(results)>1: - Previous - Next -% endif diff --git a/lms/templates/combinedopenended/selfassessment/self_assessment_prompt.html b/lms/templates/combinedopenended/selfassessment/self_assessment_prompt.html index 99782e3185..543b8899f5 100644 --- a/lms/templates/combinedopenended/selfassessment/self_assessment_prompt.html +++ b/lms/templates/combinedopenended/selfassessment/self_assessment_prompt.html @@ -9,8 +9,6 @@
    Response
    - -

    ${_("Response")}

    From ab810006651a03cc9500a4d5bc376ba27cb65c7e Mon Sep 17 00:00:00 2001 From: marco Date: Tue, 13 Aug 2013 14:42:34 -0400 Subject: [PATCH 50/75] visual styling changes to staff grading and peer grading, along with additional instances of the use of the baseline variable instead of pixel definitions for padding and margins. --- .../lib/xmodule/xmodule/css/capa/display.scss | 11 +- .../css/combinedopenended/display.scss | 693 ++++++++++-------- lms/static/sass/course/_staff_grading.scss | 200 +++-- .../combined_open_ended_results.html | 2 +- .../peer_grading/peer_grading_problem.html | 6 +- 5 files changed, 483 insertions(+), 429 deletions(-) diff --git a/common/lib/xmodule/xmodule/css/capa/display.scss b/common/lib/xmodule/xmodule/css/capa/display.scss index a35dc01633..4bc8fb3f55 100644 --- a/common/lib/xmodule/xmodule/css/capa/display.scss +++ b/common/lib/xmodule/xmodule/css/capa/display.scss @@ -282,10 +282,9 @@ section.problem { .grader-status { @include clearfix; - margin-bottom: $baseline; - padding: 9px; - border: 1px solid #ddd; - border-top: 0; + margin: $baseline/2 0; + padding: $baseline/2; + border-radius: 5px; background: #F6F6F6; span { @@ -311,11 +310,11 @@ section.problem { } &.file { - background: #fff; margin-top: $baseline; padding: $baseline 0 0 0; border: 0; border-top: 1px solid #eee; + background: #fff; p.debug { display: none; @@ -335,8 +334,8 @@ section.problem { .feedback-on-feedback { - height: 100px; margin-right: $baseline; + height: 100px; } .evaluation-response { diff --git a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss index d4a79ff825..c0235d5df9 100644 --- a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss +++ b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss @@ -23,8 +23,8 @@ h2 { div.name{ padding-bottom: 15px; - h2{ - display: inline; + h2 { + display: inline; } .progress-container { @@ -77,8 +77,8 @@ div.problemwrapper { } .assessments-container { - padding: $baseline/2 $baseline $baseline/2 $baseline/2; float: right; + padding: $baseline/2 $baseline $baseline/2 $baseline/2; .assessment-text { display: inline-block; @@ -93,9 +93,9 @@ div.problemwrapper { } .result-container { - float:left; + float: left; width: 100%; - position:relative; + position: relative; } } @@ -107,7 +107,7 @@ section.legend-container { display: inline; padding: $baseline/2; width: 20%; - background-color : #eee; + background-color: #eee; font-size: .9em; } } @@ -119,18 +119,18 @@ section.combined-open-ended-status { display: table-cell; padding: $baseline/2; width: 30px; + border-right: 1px solid lightgray; background-color: #eee; color: #2c2c2c; font-size: .9em; - border-right: 1px solid lightgray; &:first-child { border-radius: $baseline/4 0 0 $baseline/4; } &:last-child { - border-radius: 0 $baseline/4 $baseline/4 0; border-right: 0px; + border-radius: 0 $baseline/4 $baseline/4 0; } &:only-child { @@ -183,37 +183,36 @@ section.combined-open-ended-status { .icon-caret-right { display: inline-block; - vertical-align: baseline; margin-right: ($baseline/4); + vertical-align: baseline; } } - // Problem Section Controls +// Problem Section Controls .visibility-control, .visibility-control-prompt { display: block; - height: 40px; - width: 100%; + width: 100%; + height: 40px; .inner { float: left; - height: 5px; margin-top: $baseline; - border-top: 1px dotted #ddd; - width: 85%; + width: 85%; + height: 5px; + border-top: 1px dotted #ddd; } } .section-header { display: block; - text-align: center; - width: 15%; float: right; padding-top: $baseline/2; + width: 15%; + text-align: center; font-size: .9em; } - // Rubric Styling .wrapper-score-selection { @@ -221,7 +220,6 @@ section.combined-open-ended-status { padding: 0 $baseline/2; width: 20px; vertical-align: middle; - } .wrappable { @@ -240,17 +238,17 @@ section.combined-open-ended-status { span.rubric-category { display: block; + margin-bottom: $baseline/2; + padding-top: $baseline/2; width: 100%; border-bottom: 1px solid lightgray; font-size: 1.1em; - padding-top: $baseline/2; - margin-bottom: $baseline/2; } div.combined-rubric-container { margin: 15px; - padding-bottom: 5px; - padding-top: 10px; + padding-top: $baseline/2; + padding-bottom: $baseline/4; ul.rubric-list { margin: 0 $baseline $baseline/2 $baseline; @@ -265,10 +263,11 @@ div.combined-rubric-container { } } } + h4 { - padding-top: 10px; - border-top: 1px solid; + padding-top: $baseline/2; border-color: lightgray; + border-top: 1px solid; } span.rubric-category { @@ -286,12 +285,12 @@ div.combined-rubric-container { } } - label.choicegroup_partialcorrect { - &:before { - margin-right: 15px; - content: url('../images/partially-correct-icon.png'); - } + label.choicegroup_partialcorrect { + &:before { + margin-right: 15px; + content: url('../images/partially-correct-icon.png'); } + } label.choicegroup_incorrect { &:before { @@ -300,150 +299,184 @@ div.combined-rubric-container { } } } - + div.result-container { - padding-top: 10px; - padding-bottom: 5px; - .evaluation { + padding-top: $baseline/2; + padding-bottom: $baseline/4; - p { - margin-bottom: 1px; + .evaluation { + p { + margin-bottom: 1px; + } + } + + .feedback-on-feedback { + height: 100px; + margin-right: 0; + } + + .evaluation-response { + margin-bottom: 2px; + + header { + a { + font-size: .85em; + } + } + } + + .evaluation-scoring { + .scoring-list { + margin-left: 3px; + list-style-type: none; + + li { + display:inline; + margin-left: 0; + + &:first-child { + margin-left: 0; } - } - .feedback-on-feedback { - height: 100px; - margin-right: 0px; - } - - .evaluation-response { - margin-bottom: 2px; - header { - a { - font-size: .85em; - } + label { + font-size: .9em; } + } } - .evaluation-scoring { - .scoring-list { - list-style-type: none; - margin-left: 3px; + } - li { - &:first-child { - margin-left: 0px; - } - display:inline; - margin-left: 0px; + .submit-message-container { + margin: $baseline/2 0; + } - label { - font-size: .9em; - } - } + .external-grader-message { + margin-bottom: $baseline/4; + + section { + padding-left: $baseline; + background-color: #fafafa; + color: #2c2c2c; + font-family: monospace; + font-size: 1em; + padding-top: $baseline/2; + padding-bottom:30px; + + header { + font-size: 1.4em; + } + + .shortform { + font-weight: bold; + } + + .longform { + padding: 0; + margin: 0; + + .result-errors { + margin: $baseline/4; + padding: $baseline/2 $baseline/2 $baseline/2 $baseline*2; + background: url('../images/incorrect-icon.png') center left no-repeat; + + li { + color: #B00; + } } - } - .submit-message-container { - margin: 10px 0px ; - } - .external-grader-message { - margin-bottom: 5px; - section { - padding-left: 20px; - background-color: #FAFAFA; - color: #2C2C2C; - font-family: monospace; - font-size: 1em; - padding-top: 10px; - padding-bottom:30px; - header { - font-size: 1.4em; + .result-output { + margin: $baseline/4; + padding: $baseline 0 15px 50px; + border-top: 1px solid #ddd; + border-left: 20px solid #fafafa; + + h4 { + font-size: 1em; + font-family: monospace; } - .shortform { - font-weight: bold; + dl { + margin: 0; } - .longform { - padding: 0px; - margin: 0px; + dt { + margin-top: $baseline; + } - .result-errors { - margin: 5px; - padding: 10px 10px 10px 40px; - background: url('../images/incorrect-icon.png') center left no-repeat; - li { - color: #B00; - } - } + dd { + margin-left: 24pt; + } + } - .result-output { - margin: 5px; - padding: 20px 0px 15px 50px; - border-top: 1px solid #DDD; - border-left: 20px solid #FAFAFA; + .markup-text{ + margin: $baseline/4; + padding: $baseline 0 15px 50px; + border-top: 1px solid #ddd; + border-left: 20px solid #fafafa; - h4 { - font-family: monospace; - font-size: 1em; - } + bs { + color: #bb0000; + } - dl { - margin: 0px; - } - - dt { - margin-top: 20px; - } - - dd { - margin-left: 24pt; - } - } - - .markup-text{ - margin: 5px; - padding: 20px 0px 15px 50px; - border-top: 1px solid #DDD; - border-left: 20px solid #FAFAFA; - - bs { - color: #BB0000; - } - - bg { - color: #BDA046; - } - } + bg { + color: #bda046; } } } + } + } + .rubric-result-container { + padding: 2px; + margin: 0px; + display : inline; + .rubric-result { font-size: .9em; padding: 2px; display: inline-table; } - padding: 2px; - margin: 0px; - display : inline; } } div.rubric { - ul.rubric-list{ - margin: 0; - padding: 0; - list-style-type: none; - list-style: none; - li { - &.rubric-list-item { - margin-bottom: 0; - padding: 0; - border-radius: $baseline/4; - } + ul.rubric-list{ + margin: 0 $baseline $baseline/2 $baseline; + padding: 0; + list-style: none; + list-style-type: none; + + li { + &.rubric-list-item { + margin-bottom: 2px; + padding: $baseline/2; + border-radius: $baseline/4; + + &:hover { + background-color: #eee; + } + + .wrapper-score-selection { + display: table-cell; + padding: 0 $baseline/2; + width: 20px; + vertical-align: middle; + } + + .wrappable { + display: table-cell; + padding: $baseline/4; + } } } + } + + span.rubric-category { + display: block; + width: 100%; + border-bottom: 1px solid lightgray; + font-weight: bold; + font-size: .9em; + } } @@ -490,188 +523,186 @@ section.open-ended-child { } } - p { - &.answer { - margin-top: -2px; - } - &.status { - margin: 8px 0 0 $baseline/2; - text-indent: -9999px; - } + p { + &.answer { + margin-top: -2px; } - - div.unanswered { - p.status { - @include inline-block(); - background: url('../images/unanswered-icon.png') center center no-repeat; - height: 14px; - width: 14px; - } + &.status { + margin: 8px 0 0 $baseline/2; + text-indent: -9999px; } + } - div.correct, div.ui-icon-check { - p.status { - @include inline-block(); - width: 25px; - height: 20px; - background: url('../images/correct-icon.png') center center no-repeat; - } - - input { - border-color: green; - } - } - - div.processing { - p.status { - @include inline-block(); - width: 20px; - height: 20px; - background: url('../images/spinner.gif') center center no-repeat; - } - - input { - border-color: #aaa; - } - } - - div.incorrect, div.ui-icon-close { - p.status { - @include inline-block(); - width: 20px; - height: 20px; - background: url('../images/incorrect-icon.png') center center no-repeat; - text-indent: -9999px; - } - - input { - border-color: red; - } - } - - > span { - display: block; - margin-bottom: lh(.5); - } - - p.answer { + div.unanswered { + p.status { @include inline-block(); - margin-bottom: 0; - margin-left: 10px; + width: 14px; + height: 14px; + background: url('../images/unanswered-icon.png') center center no-repeat; + } + } + div.correct, div.ui-icon-check { + p.status { + @include inline-block(); + width: 25px; + height: 20px; + background: url('../images/correct-icon.png') center center no-repeat; + } + + input { + border-color: green; + } + } + + div.processing { + p.status { + @include inline-block(); + width: 20px; + height: 20px; + background: url('../images/spinner.gif') center center no-repeat; + } + + input { + border-color: #aaa; + } + } + + div.incorrect, div.ui-icon-close { + p.status { + @include inline-block(); + width: 20px; + height: 20px; + background: url('../images/incorrect-icon.png') center center no-repeat; + text-indent: -9999px; + } + + input { + border-color: red; + } + } + + > span { + display: block; + margin-bottom: lh(.5); + } + + p.answer { + @include inline-block(); + margin-bottom: 0; + margin-left: $baseline/2; + + &:before { + content: "Answer: "; + font-weight: bold; + display: inline; + + } + &:empty { &:before { - content: "Answer: "; - font-weight: bold; - display: inline; - - } - &:empty { - &:before { - display: none; - } + display: none; } } + } + + span { + &.unanswered, &.ui-icon-bullet { + @include inline-block(); + position: relative; + top: 4px; + width: 14px; + height: 14px; + background: url('../images/unanswered-icon.png') center center no-repeat; + } + + &.processing, &.ui-icon-processing { + @include inline-block(); + position: relative; + top: 6px; + width: 25px; + height: 20px; + background: url('../images/spinner.gif') center center no-repeat; + } + + &.correct, &.ui-icon-check { + @include inline-block(); + position: relative; + top: 6px; + width: 25px; + height: 20px; + background: url('../images/correct-icon.png') center center no-repeat; + } + + &.incorrect, &.ui-icon-close { + @include inline-block(); + position: relative; + top: 6px; + width: 20px; + height: 20px; + background: url('../images/incorrect-icon.png') center center no-repeat; + } + } + + .reload { + float:right; + margin: $baseline/2; + } + + div.short-form-response { + @include clearfix; + overflow-y: auto; + margin-bottom: 0; + padding: $baseline/2; + min-height: 20px; + height: auto; + border: 1px solid #ddd; + background: #f6f6f6; + } + + .grader-status { + @include clearfix; + margin: $baseline/2 0; + padding: $baseline/2; + border-radius: 5px; + background: #f6f6f6; span { - &.unanswered, &.ui-icon-bullet { - @include inline-block(); - position: relative; - top: 4px; - width: 14px; - height: 14px; - background: url('../images/unanswered-icon.png') center center no-repeat; - } - - &.processing, &.ui-icon-processing { - @include inline-block(); - position: relative; - top: 6px; - width: 25px; - height: 20px; - background: url('../images/spinner.gif') center center no-repeat; - } - - &.correct, &.ui-icon-check { - @include inline-block(); - position: relative; - top: 6px; - width: 25px; - height: 20px; - background: url('../images/correct-icon.png') center center no-repeat; - } - - &.incorrect, &.ui-icon-close { - @include inline-block(); - position: relative; - top: 6px; - width: 20px; - height: 20px; - background: url('../images/incorrect-icon.png') center center no-repeat; - } + display: block; + float: left; + overflow: hidden; + margin: -7px 7px 0 0; + text-indent: -9999px; } - .reload { - float:right; - margin: 10px; + .grading { + margin: 0 7px 0 0; + padding-left: 25px; + background: url('../images/info-icon.png') left center no-repeat; + text-indent: 0; } - div.short-form-response { - @include clearfix; - overflow-y: auto; + p { + float: left; margin-bottom: 0; - padding: $baseline/2; - height: auto; - min-height: 20px; - border: 1px solid #ddd; - background: #f6f6f6; + line-height: 20px; } - .grader-status { - @include clearfix; - margin-bottom: $baseline; - padding: 9px; - border: 1px solid #ddd; - border-top: 0; - background: #f6f6f6; + &.file { + margin-top: $baseline; + padding: $baseline 0 0 0; + border: 0; + border-top: 1px solid #eee; + background: #fff; - span { - display: block; + p.debug { + display: none; + } + + input { float: left; - overflow: hidden; - margin: -7px 7px 0 0; - text-indent: -9999px; } - - .grading { - margin: 0 7px 0 0; - padding-left: 25px; - background: url('../images/info-icon.png') left center no-repeat; - text-indent: 0; - } - - p { - float: left; - margin-bottom: 0; - line-height: 20px; - } - - &.file { - margin-top: $baseline; - padding: $baseline 0 0 0; - border: 0; - border-top: 1px solid #eee; - background: #fff; - - p.debug { - display: none; - } - - input { - float: left; - } - } - } + } form.option-input { margin: -$baseline/2 0 $baseline; @@ -688,19 +719,20 @@ section.open-ended-child { margin-left: .75rem; } - ul.rubric-list{ - margin: 0; - padding: 0; - list-style-type: none; - list-style: none; - li { - &.rubric-list-item { - margin-bottom: 0; - padding: 0; - border-radius: $baseline/4; - } + ul.rubric-list{ + margin: 0; + padding: 0; + list-style-type: none; + list-style: none; + + li { + &.rubric-list-item { + margin-bottom: 0; + padding: 0; + border-radius: $baseline/4; } } + } ol { margin-bottom: lh(); @@ -860,18 +892,49 @@ section.open-ended-child { .oe-tools { display: inline-block; + padding-left: $baseline; width: 100%; border-radius: 5px; .oe-tools-label { - font-size: 0.8em; display: inline-block; + padding: $baseline/2; vertical-align: middle; - padding: 10px; + font-size: 0.8em; } + .next-step-button { + margin: $baseline/2; + } .reset-button { vertical-align: middle; } } +// Staff Grading +.problem-list-container { + margin: $baseline/2; + + .instructions { + padding-bottom: $baseline/2; + } +} + +.staff-grading { + + .breadcrumbs { + padding: $baseline/10; + background-color: #f6f6f6; + border-radius: 5px; + margin-bottom: $baseline/2; + } + + .prompt-wrapper { + padding-top: $baseline/2; + + .meta-info-wrapper { + padding: $baseline/2; + border-radius: $baseline/4; + } + } +} diff --git a/lms/static/sass/course/_staff_grading.scss b/lms/static/sass/course/_staff_grading.scss index b387d753d1..4dd225199c 100644 --- a/lms/static/sass/course/_staff_grading.scss +++ b/lms/static/sass/course/_staff_grading.scss @@ -1,46 +1,50 @@ div.staff-grading, div.peer-grading{ + padding: $baseline; + border: none; + textarea.feedback-area { + margin: 0; height: 75px; - margin: 0px; } ul.rubric-list{ + margin: 0; + padding: 0; list-style-type: none; - padding:0; - margin:0; + li { - &.rubric-list-item{ - margin-bottom: 0px; - padding: 0px; - } + &.rubric-list-item{ + margin-bottom: 0; + padding: 0; + } } } h1 { - margin : 0 0 0 10px; + margin: 0 0 0 $baseline/2; } - h2{ - a - { + h2 { + a { text-size: .5em; } } div { - margin: 0px; + margin: 0; + &.submission-container{ - overflow-y: auto; - height: 150px; - background: #F6F6F6; - border: 1px solid #ddd; - @include clearfix; + @include clearfix; + overflow-y: auto; + height: 150px; + border: 1px solid #ddd; + background: #F6F6F6; } } label { - margin: 0px; + margin: 0; padding: 2px; min-width: 50px; background-color: white; @@ -58,143 +62,127 @@ div.peer-grading{ display: none; } - .problem-list - { - text-align: center; - table-layout: auto; + .problem-list { width:100%; - th - { + table-layout: auto; + text-align: center; + + th { padding: 2px; } - td - { - padding:2px; + + td { + padding: 2px; } - td.problem-name - { - text-align:left; + + td.problem-name { + text-align: left; } - .ui-progressbar - { - height:1em; - margin:0px; - padding:0px; + + .ui-progressbar { + margin: 0; + padding: 0; + height: 1em; } } .prompt-information-container, .rubric-wrapper, .calibration-feedback-wrapper, - .grading-container - { - padding: 2px; + .grading-container { + padding: $baseline/2 0; } - .error-container - { - background-color: #FFCCCC; + + .error-container { + margin-left: 0; padding: 2px; - margin-left: 0px; + background-color: #ffcccc; } - .submission-wrapper - { - h3 - { - margin-bottom: 2px; - } - p - { - margin-left:2px; - } + + .submission-wrapper { padding: 2px; padding-bottom: 15px; + + h3 { + margin-bottom: 2px; + } + + p { + margin-left: 2px; + } } - .meta-info-wrapper - { - background-color: #eee; + .meta-info-wrapper { padding:2px; - div - { - display : inline; + background-color: #eee; + + div { + display: inline; } } .message-container, - .grading-message - { - background-color: $yellow; + .grading-message { + margin-left: 0; padding: 2px; - margin-left:0px; + background-color: $yellow; } - .breadcrumbs - { - margin-top:2px; - margin-left:0px; - margin-bottom:2px; + .breadcrumbs { + margin: $baseline/2 $baseline/4; font-size: .8em; } - .instructions-panel - { - + .instructions-panel { + @include clearfix; margin-right:2px; - > div - { - padding: 2px; + + > div { margin-bottom: 5px; + padding: 2px; + width: 47.6%; background: #eee; - width:47.6%; - h3 - { - text-align:center; - text-transform:uppercase; + + h3 { color: #777; + text-align: center; + text-transform: uppercase; } - p - { + + p{ color: #777; } } - .calibration-panel - { - float:left; + .calibration-panel { + float: left; } - .grading-panel - { - float:right; + + .grading-panel { + float: right; } - .current-state - { - background: #1D9DD9; - h3, p - { + .current-state { + background: #1d9dd9; + + h3, p { color: white; } } - @include clearfix; } + .collapsible { + margin-left: 0; - .collapsible - { - margin-left: 0px; - header - { - margin-top:2px; - margin-bottom:2px; + header { + margin-top: 2px; + margin-bottom: 2px; font-size: 1.2em; } } - .interstitial-page - { + .interstitial-page { text-align: center; - input[type=button] - { - margin-top: 20px; + + input[type=button] { + margin-top: $baseline; } } - padding: 15px; - border: none; } diff --git a/lms/templates/combinedopenended/combined_open_ended_results.html b/lms/templates/combinedopenended/combined_open_ended_results.html index 99ea6dc46d..95817e4588 100644 --- a/lms/templates/combinedopenended/combined_open_ended_results.html +++ b/lms/templates/combinedopenended/combined_open_ended_results.html @@ -12,7 +12,7 @@ Submitted Rubric
    - Assessment Tools: + % if len(results)>1: Previous diff --git a/lms/templates/peer_grading/peer_grading_problem.html b/lms/templates/peer_grading/peer_grading_problem.html index d99e14c706..a46f9135a0 100644 --- a/lms/templates/peer_grading/peer_grading_problem.html +++ b/lms/templates/peer_grading/peer_grading_problem.html @@ -14,7 +14,11 @@
    -

    ${_('Prompt')} ${_('(Hide)')}

    +
    +
    +
    + ${_('Hide Prompt')} +
    From 3a970d14904c831fe6727e4ae6966361cf707deb Mon Sep 17 00:00:00 2001 From: marco Date: Tue, 13 Aug 2013 20:56:53 -0400 Subject: [PATCH 51/75] restyled controls area for motion through multiple scored peer reviews --- .../css/combinedopenended/display.scss | 14 +++++++++++++- .../combined_open_ended_results.html | 19 +++++++++++-------- 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss index c0235d5df9..ef39d8a1b6 100644 --- a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss +++ b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss @@ -896,13 +896,25 @@ section.open-ended-child { width: 100%; border-radius: 5px; - .oe-tools-label { + .oe-tools-label, .oe-tools-scores-label { display: inline-block; padding: $baseline/2; vertical-align: middle; font-size: 0.8em; } + .rubric-button { + padding: 8px $baseline/4; + } + + .rubric-previous-button { + margin-right: $baseline/4; + } + + .rubric-next-button { + margin-left: $baseline/4; + } + .next-step-button { margin: $baseline/2; } diff --git a/lms/templates/combinedopenended/combined_open_ended_results.html b/lms/templates/combinedopenended/combined_open_ended_results.html index 95817e4588..b013586d4f 100644 --- a/lms/templates/combinedopenended/combined_open_ended_results.html +++ b/lms/templates/combinedopenended/combined_open_ended_results.html @@ -12,15 +12,18 @@ Submitted Rubric
    - + Rubric: - % if len(results)>1: - Previous - % endif - ${result['task_name']} from grader ${i+1} - % if len(results)>1: - Next - % endif + + Scores: + % if len(results)>1: + + % endif + ${result['task_name']} from grader ${i+1} + % if len(results)>1: + + % endif +
    ${result['result'] | n}
    From c9807db308fa7f17d8eb77564cc916ccf53e8ab6 Mon Sep 17 00:00:00 2001 From: marco Date: Wed, 14 Aug 2013 14:12:04 -0400 Subject: [PATCH 52/75] styling of peer review interface for students along with minimal adjustments to the staff grading interface as well. added internationalization of peer grading strings. --- lms/static/sass/course/_staff_grading.scss | 44 +++-- .../combined_open_ended.html | 8 +- .../combined_open_ended_results.html | 8 +- lms/templates/instructor/staff_grading.html | 98 +++++----- .../peer_grading/peer_grading_problem.html | 167 +++++++++--------- 5 files changed, 166 insertions(+), 159 deletions(-) diff --git a/lms/static/sass/course/_staff_grading.scss b/lms/static/sass/course/_staff_grading.scss index 4dd225199c..739cdc6ca5 100644 --- a/lms/static/sass/course/_staff_grading.scss +++ b/lms/static/sass/course/_staff_grading.scss @@ -1,7 +1,6 @@ div.staff-grading, div.peer-grading{ - padding: $baseline; - border: none; + border: 1px solid lightgray; textarea.feedback-area { margin: 0; @@ -37,7 +36,8 @@ div.peer-grading{ &.submission-container{ @include clearfix; overflow-y: auto; - height: 150px; + height: auto; + max-height: 300px; border: 1px solid #ddd; background: #F6F6F6; } @@ -133,12 +133,14 @@ div.peer-grading{ .instructions-panel { @include clearfix; - margin-right:2px; + padding: $baseline/2; + background-color: #eee; + font-size: .8em; > div { margin-bottom: 5px; - padding: 2px; - width: 47.6%; + padding: $baseline/2; + width: 49%; background: #eee; h3 { @@ -152,18 +154,19 @@ div.peer-grading{ } } .calibration-panel { - float: left; + display: inline-block; + width: 20%; + border-radius: 3px; } .grading-panel { - float: right; + display: inline-block; + width: 20%; + border-radius: 3px; } .current-state { - background: #1d9dd9; + background: #fff; - h3, p { - color: white; - } } } @@ -186,3 +189,20 @@ div.peer-grading{ } } +div.peer-grading { + border-radius: $baseline/2; + padding: 0; + + .prompt-wrapper { + padding: $baseline; + } + + .grading-wrapper { + padding: $baseline; + } +} + +div.staff-grading { + padding: $baseline; +} + diff --git a/lms/templates/combinedopenended/combined_open_ended.html b/lms/templates/combinedopenended/combined_open_ended.html index 84ac00fab3..098f6d456a 100644 --- a/lms/templates/combinedopenended/combined_open_ended.html +++ b/lms/templates/combinedopenended/combined_open_ended.html @@ -11,12 +11,12 @@
    - Open Response + ${_("Open Response")}
    - Assessments: + ${_("Assessments:")}
    ${status|n} @@ -30,7 +30,7 @@
    % for item in items: @@ -38,7 +38,7 @@ % endfor
    - Response: + ${_("Response: ")}
    diff --git a/lms/templates/combinedopenended/combined_open_ended_results.html b/lms/templates/combinedopenended/combined_open_ended_results.html index b013586d4f..94208d43dc 100644 --- a/lms/templates/combinedopenended/combined_open_ended_results.html +++ b/lms/templates/combinedopenended/combined_open_ended_results.html @@ -9,13 +9,13 @@
    - Submitted Rubric + ${_("Submitted Rubric")}
    - Rubric: - + ${_("Rubric: ")} + - Scores: + ${_("Scores:")} % if len(results)>1: % endif diff --git a/lms/templates/instructor/staff_grading.html b/lms/templates/instructor/staff_grading.html index 40e80de11e..8595b0d722 100644 --- a/lms/templates/instructor/staff_grading.html +++ b/lms/templates/instructor/staff_grading.html @@ -19,75 +19,69 @@

    ${_("Staff grading")}

    - -
    -
    -
    -
    + +
    +
    -

    ${_("Instructions")}

    -
    -

    ${_("This is the list of problems that currently need to be graded in order to train the machine learning models. Each problem needs to be trained separately, and we have indicated the number of student submissions that need to be graded in order for a model to be generated. You can grade more than the minimum required number of submissions--this will improve the accuracy of machine learning, though with diminishing returns. You can see the current accuracy of machine learning while grading.")}

    -
    +

    ${_("Instructions")}

    +
    +

    ${_("This is the list of problems that currently need to be graded in order to train the machine learning models. Each problem needs to be trained separately, and we have indicated the number of student submissions that need to be graded in order for a model to be generated. You can grade more than the minimum required number of submissions--this will improve the accuracy of machine learning, though with diminishing returns. You can see the current accuracy of machine learning while grading.")}

    +
    -

    ${_("Problem List")}

    - -
    +

    ${_("Problem List")}

    + +
    -

    -
    -
    -
    -
    -
    -
    -
    +

    +

    +
    +
    +
    +
    +
    +
    +

    ${_('Prompt')} ${_("(Hide)")}

    -
    -
    +
    - +
    - +
    +
    +
    +

    ${_("Student Response")}

    +
    +
    +
    +
    +

    +

    +

    +

    +

    ${_("Written Feedback")}

    + +

    + ${_("Flag as inappropriate content for later review")} +

    +
    +
    + + +
    -
    -
    -

    ${_("Student Response")}

    -
    -
    -
    -
    -

    -

    -

    -

    -

    ${_("Written Feedback")}

    - -

    - ${_("Flag as inappropriate content for later review")} -

    -
    +
    - -
    - - -
    - -
    - -
    +
    diff --git a/lms/templates/peer_grading/peer_grading_problem.html b/lms/templates/peer_grading/peer_grading_problem.html index a46f9135a0..a0078b8868 100644 --- a/lms/templates/peer_grading/peer_grading_problem.html +++ b/lms/templates/peer_grading/peer_grading_problem.html @@ -4,102 +4,95 @@
    -
    -
    -

    ${_("Learning to Grade")}

    -
    -
    -

    ${_("Peer Grading")}

    -
    -
    - -
    -
    -
    +
    +
    +

    ${_("Learning to Grade")}

    +
    +
    +

    ${_("Peer Grading")}

    - ${_('Hide Prompt')}
    -
    -
    -
    + +
    +
    +
    +
    + ${_('Hide Prompt')} +
    +
    +
    +
    +
    +
    +
    +
    +
    +

    ${_("Student Response")}

    +
    +
    +

    +
    +
    + + +
    +
    +

    +

    +

    ${_("Written Feedback")}

    +

    ${_("Please include some written feedback as well.")}

    + +
    ${_("This submission has explicit or pornographic content : ")} + +
    +
    ${_("I do not know how to grade this question : ")} + +
    +
    +
    + +
    +
    +
    +
    + +
    +

    ${_("How did I do?")}

    +
    + +
    -
    + +
    +

    ${_("Ready to grade!")}

    +

    ${_("You have finished learning to grade, which means that you are now ready to start grading.")}

    + +
    + +
    +

    ${_("Learning to grade")}

    +

    ${_("You have not yet finished learning to grade this problem.")}

    +

    ${_("You will now be shown a series of instructor-scored essays, and will be asked to score them yourself.")}

    +

    ${_("Once you can score the essays similarly to an instructor, you will be ready to grade your peers.")}

    + +
    -
    -

    ${_("Student Response")}

    - -
    -
    -

    -
    + +
    +

    ${_("Are you sure that you want to flag this submission?")}

    +

    + ${_("You are about to flag a submission. You should only flag a submission that contains explicit or offensive content. If the submission is not addressed to the question or is incorrect, you should give it a score of zero and accompanying feedback instead of flagging it.")} +

    +
    + +
    - - -
    -
    -

    -

    -

    -

    ${_("Written Feedback")}

    -

    ${_("Please include some written feedback as well.")}

    - -
    ${_("This submission has explicit or pornographic content : ")}
    -
    ${_("I do not know how to grade this question : ")}
    -
    +
    - -
    - -
    - -
    -
    -
    - -
    - - -
    -

    ${_("How did I do?")}

    -
    -
    - -
    - - -
    -

    ${_("Ready to grade!")}

    -

    ${_("You have finished learning to grade, which means that you are now ready to start grading.")}

    - -
    - - -
    -

    ${_("Learning to grade")}

    -

    ${_("You have not yet finished learning to grade this problem.")}

    -

    ${_("You will now be shown a series of instructor-scored essays, and will be asked to score them yourself.")}

    -

    ${_("Once you can score the essays similarly to an instructor, you will be ready to grade your peers.")}

    - -
    - - -
    -

    ${_("Are you sure that you want to flag this submission?")}

    -

    - ${_("You are about to flag a submission. You should only flag a submission that contains explicit or offensive content. If the submission is not addressed to the question or is incorrect, you should give it a score of zero and accompanying feedback instead of flagging it.")} -

    -
    - - -
    -
    - - - + From 6f657c1124190ab388f24f93b156d6b217344007 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 15 Aug 2013 10:30:16 -0400 Subject: [PATCH 53/75] Import to fix internationalization --- lms/templates/combinedopenended/combined_open_ended_results.html | 1 + 1 file changed, 1 insertion(+) diff --git a/lms/templates/combinedopenended/combined_open_ended_results.html b/lms/templates/combinedopenended/combined_open_ended_results.html index 94208d43dc..3fa4d32e8d 100644 --- a/lms/templates/combinedopenended/combined_open_ended_results.html +++ b/lms/templates/combinedopenended/combined_open_ended_results.html @@ -1,3 +1,4 @@ +<%! from django.utils.translation import ugettext as _ %> % for (i,result) in enumerate(results): % if 'task_name' in result and 'result' in result:
    Date: Thu, 15 Aug 2013 13:56:17 -0400 Subject: [PATCH 54/75] cleaned up padding for peer review training and grading states, removed extraneous response label,fixed style issue on rubric for peer grading where rubric items had a background color overridding the intended style --- .../css/combinedopenended/display.scss | 5 +- .../js/fixtures/combined-open-ended.html | 2 +- .../xmodule/xmodule/js/fixtures/rubric.html | 2 +- lms/static/sass/course/_staff_grading.scss | 21 +++- .../combined_open_ended.html | 2 +- lms/templates/peer_grading/peer_grading.html | 106 +++++++++--------- 6 files changed, 75 insertions(+), 63 deletions(-) diff --git a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss index ef39d8a1b6..704b00812a 100644 --- a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss +++ b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss @@ -266,8 +266,6 @@ div.combined-rubric-container { h4 { padding-top: $baseline/2; - border-color: lightgray; - border-top: 1px solid; } span.rubric-category { @@ -892,7 +890,6 @@ section.open-ended-child { .oe-tools { display: inline-block; - padding-left: $baseline; width: 100%; border-radius: 5px; @@ -910,7 +907,7 @@ section.open-ended-child { .rubric-previous-button { margin-right: $baseline/4; } - + .rubric-next-button { margin-left: $baseline/4; } diff --git a/common/lib/xmodule/xmodule/js/fixtures/combined-open-ended.html b/common/lib/xmodule/xmodule/js/fixtures/combined-open-ended.html index 91d09f7922..e5eb0858f7 100644 --- a/common/lib/xmodule/xmodule/js/fixtures/combined-open-ended.html +++ b/common/lib/xmodule/xmodule/js/fixtures/combined-open-ended.html @@ -42,7 +42,7 @@
    - Response: +
    diff --git a/common/lib/xmodule/xmodule/js/fixtures/rubric.html b/common/lib/xmodule/xmodule/js/fixtures/rubric.html index 6b867cc52b..bdb572d11b 100644 --- a/common/lib/xmodule/xmodule/js/fixtures/rubric.html +++ b/common/lib/xmodule/xmodule/js/fixtures/rubric.html @@ -78,7 +78,7 @@
    - Response: +
    diff --git a/lms/static/sass/course/_staff_grading.scss b/lms/static/sass/course/_staff_grading.scss index 739cdc6ca5..1087aae67a 100644 --- a/lms/static/sass/course/_staff_grading.scss +++ b/lms/static/sass/course/_staff_grading.scss @@ -36,10 +36,10 @@ div.peer-grading{ &.submission-container{ @include clearfix; overflow-y: auto; - height: auto; max-height: 300px; + height: auto; border: 1px solid #ddd; - background: #F6F6F6; + background: #f6f6f6; } } @@ -47,7 +47,6 @@ div.peer-grading{ margin: 0; padding: 2px; min-width: 50px; - background-color: white; text-size: 1.5em; } @@ -63,7 +62,7 @@ div.peer-grading{ } .problem-list { - width:100%; + width: 100%; table-layout: auto; text-align: center; @@ -193,6 +192,20 @@ div.peer-grading { border-radius: $baseline/2; padding: 0; + .peer-grading-tools { + padding: $baseline; + } + + .error-container { + margin: $baseline; + border-radius: $baseline/4; + padding: $baseline/2; + } + + .interstitial-page, .calibration -feedback, .calibration-interstitial-page { + padding: $baseline; + } + .prompt-wrapper { padding: $baseline; } diff --git a/lms/templates/combinedopenended/combined_open_ended.html b/lms/templates/combinedopenended/combined_open_ended.html index 098f6d456a..65b44b0aa1 100644 --- a/lms/templates/combinedopenended/combined_open_ended.html +++ b/lms/templates/combinedopenended/combined_open_ended.html @@ -38,7 +38,7 @@ % endfor
    - ${_("Response: ")} +
    diff --git a/lms/templates/peer_grading/peer_grading.html b/lms/templates/peer_grading/peer_grading.html index f423de1c6b..468c2f300f 100644 --- a/lms/templates/peer_grading/peer_grading.html +++ b/lms/templates/peer_grading/peer_grading.html @@ -2,59 +2,61 @@
    ${error_text}
    -

    ${_("Peer Grading")}

    -

    ${_("Instructions")}

    -

    ${_("Here are a list of problems that need to be peer graded for this course.")}

    - % if success: - % if len(problem_list) == 0: -
    - ${_("Nothing to grade!")} -
    - %else: -
    - - - - - - - - +
    +

    ${_("Peer Grading")}

    +

    ${_("Instructions")}

    +

    ${_("Here are a list of problems that need to be peer graded for this course.")}

    + % if success: + % if len(problem_list) == 0: +
    + ${_("Nothing to grade!")} +
    + %else: +
    +
    ${_("Problem Name")}${_("Due date")}${_("Graded")}${_("Available")}${_("Required")}${_("Progress")}
    + + + + + + + + + %for problem in problem_list: + + + + + + + - %for problem in problem_list: - - - - - - - - - %endfor -
    ${_("Problem Name")}${_("Due date")}${_("Graded")}${_("Available")}${_("Required")}${_("Progress")}
    + %if problem['closed']: + ${problem['problem_name']} + %else: + ${problem['problem_name']} + %endif + + % if problem['due']: + ${problem['due']} + % else: + ${_("No due date")} + % endif + + ${problem['num_graded']} + + ${problem['num_pending']} + + ${problem['num_required']} + +
    +
    +
    - %if problem['closed']: - ${problem['problem_name']} - %else: - ${problem['problem_name']} - %endif - - % if problem['due']: - ${problem['due']} - % else: - ${_("No due date")} - % endif - - ${problem['num_graded']} - - ${problem['num_pending']} - - ${problem['num_required']} - -
    -
    -
    -
    + %endfor +
    +
    + %endif %endif - %endif +
    From f8dab92ba62f81ad68d9719fd2e8db0b4026af19 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 15 Aug 2013 14:15:19 -0400 Subject: [PATCH 55/75] Hide submit button after student submits --- .../lib/xmodule/xmodule/js/src/combinedopenended/display.coffee | 1 + .../xmodule/open_ended_grading_classes/openendedchild.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee index 6b79ec9e3b..64401b647b 100644 --- a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee @@ -375,6 +375,7 @@ class @CombinedOpenEnded save_answer: (event) => event.preventDefault() + @submit_button.hide() max_filesize = 2*1000*1000 #2MB pre_can_upload_files = @can_upload_files if @child_state == 'initial' diff --git a/common/lib/xmodule/xmodule/open_ended_grading_classes/openendedchild.py b/common/lib/xmodule/xmodule/open_ended_grading_classes/openendedchild.py index 8635f75db6..3e12b4656d 100644 --- a/common/lib/xmodule/xmodule/open_ended_grading_classes/openendedchild.py +++ b/common/lib/xmodule/xmodule/open_ended_grading_classes/openendedchild.py @@ -182,7 +182,7 @@ class OpenEndedChild(object): whitelist_tags=set(['embed', 'iframe', 'a', 'img'])) clean_html = cleaner.clean_html(answer) clean_html = re.sub(r'

    $', '', re.sub(r'^

    ', '', clean_html)) - except: + except Exception: clean_html = answer return clean_html From ac4d3124151a3c3d34cf07f833ee988a134a5246 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 15 Aug 2013 14:26:42 -0400 Subject: [PATCH 56/75] Make rubric text generic, fix right arrow --- .../xmodule/xmodule/js/src/combinedopenended/display.coffee | 6 ------ .../combinedopenended/combined_open_ended_results.html | 4 ++-- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee index 64401b647b..f2888c0144 100644 --- a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee @@ -667,10 +667,4 @@ class @CombinedOpenEnded toggle_rubric: (event) => info_rubric_elements = @$(@info_rubric_elements_sel) info_rubric_elements.slideToggle() - @rubric_header = @$(@rubric_collapse_sel) - if @rubric_header.text() == "Show Score Only" - new_text = "Show Full Rubric" - else - new_text = "Show Score Only" - @rubric_header.text(new_text) return false diff --git a/lms/templates/combinedopenended/combined_open_ended_results.html b/lms/templates/combinedopenended/combined_open_ended_results.html index 3fa4d32e8d..8b0a7d3b48 100644 --- a/lms/templates/combinedopenended/combined_open_ended_results.html +++ b/lms/templates/combinedopenended/combined_open_ended_results.html @@ -14,7 +14,7 @@

    ${_("Rubric: ")} - + ${_("Scores:")} % if len(results)>1: @@ -22,7 +22,7 @@ % endif ${result['task_name']} from grader ${i+1} % if len(results)>1: - + % endif
    From a084d4486d6985e1560911c1df7699af323e6e0a Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 15 Aug 2013 14:28:52 -0400 Subject: [PATCH 57/75] Get rid of labels --- .../combinedopenended/combined_open_ended_results.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lms/templates/combinedopenended/combined_open_ended_results.html b/lms/templates/combinedopenended/combined_open_ended_results.html index 8b0a7d3b48..c1b79bca95 100644 --- a/lms/templates/combinedopenended/combined_open_ended_results.html +++ b/lms/templates/combinedopenended/combined_open_ended_results.html @@ -13,10 +13,10 @@ ${_("Submitted Rubric")}
    - ${_("Rubric: ")} + - ${_("Scores:")} + % if len(results)>1: % endif From f8b5e6736323795d92d8646048329a07b45f476b Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 15 Aug 2013 14:52:51 -0400 Subject: [PATCH 58/75] Text and styling cleanup --- .../lib/xmodule/xmodule/css/combinedopenended/display.scss | 5 +++++ .../xmodule/js/src/peergrading/peer_grading_problem.coffee | 4 ++-- .../combinedopenended/combined_open_ended_results.html | 2 +- lms/templates/peer_grading/peer_grading.html | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss index 704b00812a..120ea0c52d 100644 --- a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss +++ b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss @@ -296,6 +296,11 @@ div.combined-rubric-container { content: url('../images/incorrect-icon.png'); } } + + div.written-feedback { + background: #f6f6f6; + padding: 15px; + } } div.result-container { diff --git a/common/lib/xmodule/xmodule/js/src/peergrading/peer_grading_problem.coffee b/common/lib/xmodule/xmodule/js/src/peergrading/peer_grading_problem.coffee index 4f644a4ec1..a026cafd61 100644 --- a/common/lib/xmodule/xmodule/js/src/peergrading/peer_grading_problem.coffee +++ b/common/lib/xmodule/xmodule/js/src/peergrading/peer_grading_problem.coffee @@ -266,7 +266,7 @@ class @PeerGradingProblem @calibration_feedback_button.click => @calibration_feedback_panel.hide() @grading_wrapper.show() - @gentle_alert "Calibration essay saved. Fetched the next essay." + @gentle_alert "Calibration essay saved. Fetching the next essay." @is_calibrated_check() @interstitial_page_button.click => @@ -384,7 +384,7 @@ class @PeerGradingProblem if response.success @is_calibrated_check() @grading_message.fadeIn() - message = "

    Successfully saved your feedback. Fetched the next essay." + message = "

    Successfully saved your feedback. Fetching the next essay." if response.required_done message = message + " You have completed the required number of gradings." message = message + "

    " diff --git a/lms/templates/combinedopenended/combined_open_ended_results.html b/lms/templates/combinedopenended/combined_open_ended_results.html index c1b79bca95..5e5294bf60 100644 --- a/lms/templates/combinedopenended/combined_open_ended_results.html +++ b/lms/templates/combinedopenended/combined_open_ended_results.html @@ -14,7 +14,7 @@
    - + % if len(results)>1: diff --git a/lms/templates/peer_grading/peer_grading.html b/lms/templates/peer_grading/peer_grading.html index 468c2f300f..162c9273b0 100644 --- a/lms/templates/peer_grading/peer_grading.html +++ b/lms/templates/peer_grading/peer_grading.html @@ -9,7 +9,7 @@ % if success: % if len(problem_list) == 0:
    - ${_("Nothing to grade!")} + ${_("You currently do not having any peer grading to do. In order to have peer grading to do, you need to have submitted a response to a peer grading problem. The instructor also needs to score the essays that are used in the 'learning to grade' process.")}
    %else:
    From 35a540a0f64b2fb26cdb82a5585cc9a15e2ac87d Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 15 Aug 2013 17:25:04 -0400 Subject: [PATCH 59/75] Fix bug with leaving open ended response page and coming back --- .../js/src/combinedopenended/display.coffee | 43 ++++++++++++++----- 1 file changed, 33 insertions(+), 10 deletions(-) diff --git a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee index f2888c0144..a1792a3a3d 100644 --- a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee @@ -124,6 +124,7 @@ class @CombinedOpenEnded rubric_collapse_sel: '.rubric-collapse' next_rubric_sel: '.rubric-next-button' previous_rubric_sel: '.rubric-previous-button' + oe_alert_sel: '.open-ended-alert' constructor: (el) -> @el=el @@ -137,6 +138,7 @@ class @CombinedOpenEnded $(selector, @el) reinitialize: (element) -> + @has_been_reset = false @wrapper=@$(@wrapper_sel) @coe = @$(@coe_sel) @@ -253,6 +255,30 @@ class @CombinedOpenEnded if response.hide_reset @reset_button.hide() + get_last_response: () => + @submit_button.hide() + @answer_area.attr("disabled", true) + data = {} + $.postWithPrefix "#{@ajax_url}/get_last_response", data, (response) => + if response.success && response.response != "" + @answer_area.html(response.response) + if response.state!='initial' + @submit_button.hide() + @answer_area.attr("disabled", true) + if @has_been_reset + @submit_button.show() + @answer_area.attr("disabled", false) + @gentle_alert "Here is your previous answer to this qu + estion." + else if @allow_reset=="True" + @reset_button.show() + @gentle_alert "You may reset and answer this question again." + else + @gentle_alert "You have answered this question." + else + @submit_button.show() + @answer_area.attr("disabled", false) + @$(@oe_alert_sel).animate(opacity: 0, 700) show_status_current: () => data = {} @@ -261,12 +287,6 @@ class @CombinedOpenEnded @status_container.after(response.html).remove() @status_container= $(@status_container_sel) - get_last_response: () => - data = {} - $.postWithPrefix "#{@ajax_url}/get_last_response", data, (response) => - if response.success - console.log(response.response) - message_post: (event)=> external_grader_message=$(event.target).parent().parent().parent() evaluation_scoring = $(event.target).parent() @@ -301,6 +321,7 @@ class @CombinedOpenEnded rebind: () => + @get_last_response() # rebind to the appropriate function for the current state @submit_button.unbind('click') @submit_button.show() @@ -308,6 +329,7 @@ class @CombinedOpenEnded @hide_file_upload() @next_problem_button.hide() @hint_area.attr('disabled', false) + if @task_number>1 or @child_state!='initial' @show_status_current() @@ -376,6 +398,7 @@ class @CombinedOpenEnded save_answer: (event) => event.preventDefault() @submit_button.hide() + @answer_area.attr("disabled", true) max_filesize = 2*1000*1000 #2MB pre_can_upload_files = @can_upload_files if @child_state == 'initial' @@ -414,7 +437,6 @@ class @CombinedOpenEnded @gentle_alert response.error $.ajaxWithPrefix("#{@ajax_url}/save_answer",settings) - else @errors_area.html(@out_of_sync_message) @@ -492,6 +514,7 @@ class @CombinedOpenEnded @coe.after(response.html).remove() @allow_reset="False" @reinitialize(@element) + @has_been_reset = true @rebind() @reset_button.hide() else @@ -523,11 +546,11 @@ class @CombinedOpenEnded @errors_area.html(@out_of_sync_message) gentle_alert: (msg) => - if @$el.find('.open-ended-alert').length - @$el.find('.open-ended-alert').remove() + if @$el.find(@oe_alert_sel).length + @$el.find(@oe_alert_sel).remove() alert_elem = "
    " + msg + "
    " @$el.find('.open-ended-action').after(alert_elem) - @$el.find('.open-ended-alert').css(opacity: 0).animate(opacity: 1, 700) + @$el.find(@oe_alert_sel).css(opacity: 0).animate(opacity: 1, 700) queueing: => if @child_state=="assessing" and @child_type=="openended" From b6a58085484216ab810f9c2095b7cdd699ff63f3 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 15 Aug 2013 17:50:36 -0400 Subject: [PATCH 60/75] Show submit button correctly for self assessment --- .../xmodule/js/src/combinedopenended/display.coffee | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee index a1792a3a3d..fc1e2243bc 100644 --- a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee @@ -273,8 +273,6 @@ class @CombinedOpenEnded else if @allow_reset=="True" @reset_button.show() @gentle_alert "You may reset and answer this question again." - else - @gentle_alert "You have answered this question." else @submit_button.show() @answer_area.attr("disabled", false) @@ -362,6 +360,8 @@ class @CombinedOpenEnded @queueing() @grader_status = @$(@grader_status_sel) @grader_status.html("Your response has been submitted. Please check back later for your grade. ") + else if @child_type == "selfassessment" + @setup_score_selection() else if @child_state == 'post_assessment' if @child_type=="openended" @skip_button.show() @@ -691,3 +691,10 @@ class @CombinedOpenEnded info_rubric_elements = @$(@info_rubric_elements_sel) info_rubric_elements.slideToggle() return false + + setup_score_selection: () => + @$("input[class='score-selection']").change @graded_callback + + graded_callback: () => + if @rub.check_complete() + @submit_button.show() From a49da5d530ccd0e61ac17358362ad9b918908723 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 15 Aug 2013 18:55:42 -0400 Subject: [PATCH 61/75] Fix rubrics, strip out get results --- .../js/src/combinedopenended/display.coffee | 94 ++++--------------- .../combined_open_ended_modulev1.py | 57 ++--------- 2 files changed, 28 insertions(+), 123 deletions(-) diff --git a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee index fc1e2243bc..8be83acd23 100644 --- a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee @@ -15,7 +15,6 @@ class @Rubric # display the 'current' carat @categories = @$(@rubric_category_sel) @category = @$(@categories.first()) - @category.prepend('> ') @category_index = 0 # locally scoped jquery. @@ -46,12 +45,8 @@ class @Rubric return inputs.filter("input[value=#{selected}]").click() - # move to the next category - old_category_text = @category.html().substring(5) - @category.html(old_category_text) @category_index++ @category = @$(@categories[@category_index]) - @category.prepend('> ') tracking_callback: (event) => target_selection = $(event.target).val() @@ -98,7 +93,6 @@ class @CombinedOpenEnded coe_sel: 'section.combined-open-ended' reset_button_sel: '.reset-button' next_step_sel: '.next-step-button' - status_container_sel: '.status-elements' show_results_sel: '.show-results-button' question_header_sel: '.question-header' submit_evaluation_sel: '.submit-evaluation-button' @@ -137,15 +131,18 @@ class @CombinedOpenEnded $: (selector) -> $(selector, @el) - reinitialize: (element) -> + reinitialize: () -> @has_been_reset = false @wrapper=@$(@wrapper_sel) @coe = @$(@coe_sel) + @ajax_url = @coe.data('ajax-url') + @get_html() + @coe = @$(@coe_sel) + #Get data from combinedopenended @allow_reset = @coe.data('allow_reset') @id = @coe.data('id') - @ajax_url = @coe.data('ajax-url') @state = @coe.data('state') @task_count = @coe.data('task-count') @task_number = @coe.data('task-number') @@ -163,8 +160,6 @@ class @CombinedOpenEnded @next_problem_button = @$(@next_step_sel) @next_problem_button.click @next_problem - @status_container = @$(@status_container_sel) - #setup show results @show_results_button=@$(@show_results_sel) @show_results_button.click @show_results @@ -183,6 +178,7 @@ class @CombinedOpenEnded # Where to put the rubric once we load it @oe = @$(@open_ended_child_sel) + @errors_area = @$(@oe).find(@error_sel) @answer_area = @$(@oe).find(@answer_area_sel) @prompt_container = @$(@oe).find(@prompt_sel) @@ -212,33 +208,18 @@ class @CombinedOpenEnded @rebind() - show_results_current: () => - data = {'task_number' : @task_number-1} - $.postWithPrefix "#{@ajax_url}/get_results", data, (response) => - if response.success - if (results_container?) - @results_container.after(response.html).remove() - @results_container = @$(@result_container_sel) - @submit_evaluation_button = @$(@submit_evaluation_sel) - @submit_evaluation_button.click @message_post - Collapsible.setCollapsibles(@results_container) - # make sure we still have click tracking - $('.evaluation-response a').click @log_feedback_click - $('input[name="evaluation-score"]').change @log_feedback_selection + get_html_callback: (response) => + @coe.replaceWith(response.html) - show_results: (event) => - status_item = $(event.target).parent() - status_number = status_item.data('status-number') - data = {'task_number' : status_number} - $.postWithPrefix "#{@ajax_url}/get_results", data, (response) => - if response.success - @results_container.after(response.html).remove() - @results_container = @$(@result_container_sel) - @submit_evaluation_button = @$(@submit_evaluation_sel) - @submit_evaluation_button.click @message_post - Collapsible.setCollapsibles(@results_container) - else - @gentle_alert response.error + get_html: () => + url = "#{@ajax_url}/get_html" + $.ajaxWithPrefix({ + type: 'POST', + url: url, + data: {}, + success: @get_html_callback, + async:false + }); show_combined_rubric_current: () => data = {} @@ -255,36 +236,6 @@ class @CombinedOpenEnded if response.hide_reset @reset_button.hide() - get_last_response: () => - @submit_button.hide() - @answer_area.attr("disabled", true) - data = {} - $.postWithPrefix "#{@ajax_url}/get_last_response", data, (response) => - if response.success && response.response != "" - @answer_area.html(response.response) - if response.state!='initial' - @submit_button.hide() - @answer_area.attr("disabled", true) - if @has_been_reset - @submit_button.show() - @answer_area.attr("disabled", false) - @gentle_alert "Here is your previous answer to this qu - estion." - else if @allow_reset=="True" - @reset_button.show() - @gentle_alert "You may reset and answer this question again." - else - @submit_button.show() - @answer_area.attr("disabled", false) - @$(@oe_alert_sel).animate(opacity: 0, 700) - - show_status_current: () => - data = {} - $.postWithPrefix "#{@ajax_url}/get_status", data, (response) => - if response.success - @status_container.after(response.html).remove() - @status_container= $(@status_container_sel) - message_post: (event)=> external_grader_message=$(event.target).parent().parent().parent() evaluation_scoring = $(event.target).parent() @@ -319,7 +270,6 @@ class @CombinedOpenEnded rebind: () => - @get_last_response() # rebind to the appropriate function for the current state @submit_button.unbind('click') @submit_button.show() @@ -328,9 +278,6 @@ class @CombinedOpenEnded @next_problem_button.hide() @hint_area.attr('disabled', false) - if @task_number>1 or @child_state!='initial' - @show_status_current() - if @task_number==1 and @child_state=='assessing' @prompt_hide() if @child_state == 'done' @@ -338,7 +285,7 @@ class @CombinedOpenEnded if @child_type=="openended" @skip_button.hide() if @allow_reset=="True" - @show_results_current + @show_combined_rubric_current() @reset_button.show() @submit_button.hide() @answer_area.attr("disabled", true) @@ -375,7 +322,6 @@ class @CombinedOpenEnded @submit_button.click @message_post else if @child_state == 'done' @show_combined_rubric_current() - @show_results_current() @rubric_wrapper.hide() @answer_area.attr("disabled", true) @replace_text_inputs() @@ -539,7 +485,7 @@ class @CombinedOpenEnded @gentle_alert "Moved to next step." else @gentle_alert "Your score did not meet the criteria to move to the next step." - @show_results_current() + @show_combined_rubric_current() else @errors_area.html(response.error) else @@ -591,7 +537,7 @@ class @CombinedOpenEnded # wrap this so that it can be mocked reload: -> - location.reload() + @reinitialize() collapse_question: (event) => @prompt_container.slideToggle() 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 0294a022b9..7e95e27089 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 @@ -67,7 +67,6 @@ class CombinedOpenEndedV1Module(): ajax actions implemented by combined open ended module are: 'reset' -- resets the whole combined open ended module and returns to the first child moduleresource_string 'next_problem' -- moves to the next child module - 'get_results' -- gets results from a given child module Types of children. Task is synonymous with child module, so each combined open ended module incorporates multiple children (tasks): @@ -351,6 +350,9 @@ class CombinedOpenEndedV1Module(): self.update_task_states() return self.current_task.get_html(self.system) + def get_html_ajax(self, data): + return {'html' : self.get_html()} + def get_current_attributes(self, task_number): """ Gets the min and max score to attempt attributes of the specified task. @@ -592,53 +594,6 @@ class CombinedOpenEndedV1Module(): html = self.system.render_template('{0}/combined_open_ended_legend.html'.format(self.TEMPLATE_DIR), context) return {'html': html, 'success': True} - def get_results(self, _data): - """ - Gets the results of a given grader via ajax. - Input: AJAX data dictionary - Output: Dictionary to be rendered via ajax that contains the result html. - """ - self.update_task_states() - success, can_see_rubric, error = self.check_if_student_has_done_needed_grading() - if not can_see_rubric: - return {'html' : error, 'success' : False} - loop_up_to_task = self.current_task_number + 1 - all_responses = [] - for i in xrange(0, loop_up_to_task): - all_responses.append(self.get_last_response(i)) - context_list = [] - for ri in all_responses: - for i in xrange(0, len(ri['rubric_scores'])): - feedback = ri['feedback_dicts'][i].get('feedback', '') - rubric_data = self.rubric_renderer.render_rubric(stringify_children(self.static_data['rubric']), - ri['rubric_scores'][i]) - if rubric_data['success']: - rubric_html = rubric_data['html'] - else: - rubric_html = '' - context = { - 'rubric_html': rubric_html, - 'grader_type': ri['grader_type'], - 'feedback': feedback, - 'grader_id': ri['grader_ids'][i], - 'submission_id': ri['submission_ids'][i], - } - context_list.append(context) - feedback_table = self.system.render_template('{0}/open_ended_result_table.html'.format(self.TEMPLATE_DIR), { - 'context_list': context_list, - 'grader_type_image_dict': GRADER_TYPE_IMAGE_DICT, - 'human_grader_types': HUMAN_GRADER_TYPE, - 'rows': 50, - 'cols': 50, - }) - context = { - 'results': feedback_table, - 'task_name': "Feedback", - 'class_name': "result-container", - } - html = self.system.render_template('{0}/combined_open_ended_results.html'.format(self.TEMPLATE_DIR), context) - return {'html': html, 'success': True} - def get_status_ajax(self, _data): """ Gets the results of a given grader via ajax. @@ -662,11 +617,12 @@ class CombinedOpenEndedV1Module(): handlers = { 'next_problem': self.next_problem, 'reset': self.reset, - 'get_results': self.get_results, 'get_combined_rubric': self.get_rubric, 'get_status': self.get_status_ajax, 'get_legend': self.get_legend, 'get_last_response': self.get_last_response_ajax, + 'get_current_state': self.get_current_state, + 'get_html': self.get_html_ajax, } if dispatch not in handlers: @@ -676,6 +632,9 @@ class CombinedOpenEndedV1Module(): d = handlers[dispatch](data) return json.dumps(d, cls=ComplexEncoder) + def get_current_state(self, data): + return self.get_context() + def get_last_response_ajax(self,data): return self.get_last_response(self.current_task_number) From b97dbc37a6d10e43bc48efe4694f202c4c648834 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 15 Aug 2013 18:57:32 -0400 Subject: [PATCH 62/75] Fix test, strip out more of show results --- .../xmodule/xmodule/js/src/combinedopenended/display.coffee | 5 ----- common/lib/xmodule/xmodule/tests/test_combined_open_ended.py | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee index 8be83acd23..ec9ddb1329 100644 --- a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee @@ -93,7 +93,6 @@ class @CombinedOpenEnded coe_sel: 'section.combined-open-ended' reset_button_sel: '.reset-button' next_step_sel: '.next-step-button' - show_results_sel: '.show-results-button' question_header_sel: '.question-header' submit_evaluation_sel: '.submit-evaluation-button' result_container_sel: 'div.result-container' @@ -160,10 +159,6 @@ class @CombinedOpenEnded @next_problem_button = @$(@next_step_sel) @next_problem_button.click @next_problem - #setup show results - @show_results_button=@$(@show_results_sel) - @show_results_button.click @show_results - @question_header = @$(@question_header_sel) @question_header.click @collapse_question diff --git a/common/lib/xmodule/xmodule/tests/test_combined_open_ended.py b/common/lib/xmodule/xmodule/tests/test_combined_open_ended.py index 05e8df0ad8..83f6dc6833 100644 --- a/common/lib/xmodule/xmodule/tests/test_combined_open_ended.py +++ b/common/lib/xmodule/xmodule/tests/test_combined_open_ended.py @@ -636,7 +636,7 @@ class OpenEndedModuleXmlTest(unittest.TestCase, DummyModulestore): self.assertTrue(isinstance(legend, basestring)) #Get all results - module.handle_ajax("get_results", {}) + module.handle_ajax("get_combined_rubric", {}) #reset the problem module.handle_ajax("reset", {}) From 8218a4a220bbdaae1eaddafdca08557166be11c6 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 15 Aug 2013 19:09:09 -0400 Subject: [PATCH 63/75] Show the right rubric, be more explicit about "next step" --- .../js/src/combinedopenended/display.coffee | 2 + .../combined_open_ended_modulev1.py | 44 +++++++------------ 2 files changed, 18 insertions(+), 28 deletions(-) diff --git a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee index ec9ddb1329..2fe8979652 100644 --- a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee @@ -286,6 +286,8 @@ class @CombinedOpenEnded @answer_area.attr("disabled", true) @replace_text_inputs() @hint_area.attr('disabled', true) + if @task_number<@task_count + @gentle_alert "Your score did not meet the criteria to move to the next step." else if @child_state == 'initial' @answer_area.attr("disabled", false) @submit_button.prop('value', 'Submit') 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 7e95e27089..bdcbc7054c 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 @@ -556,25 +556,23 @@ class CombinedOpenEndedV1Module(): if not can_see_rubric: return {'html' : self.system.render_template('{0}/combined_open_ended_hidden_results.html'.format(self.TEMPLATE_DIR), {'error' : error}), 'success' : True, 'hide_reset' : True} - loop_up_to_task = self.current_task_number + 1 contexts = [] - for i in xrange(0, loop_up_to_task): - response = self.get_last_response(i) - score_length = len(response['grader_types']) - for z in xrange(0,score_length): - feedback = response['feedback_dicts'][z].get('feedback', '') - if response['grader_types'][z] in HUMAN_GRADER_TYPE.keys(): - rubric_scores = [[response['rubric_scores'][z]]] - grader_types = [[response['grader_types'][z]]] - feedback_items = [[response['feedback_items'][z]]] - rubric_html = self.rubric_renderer.render_combined_rubric(stringify_children(self.static_data['rubric']), - rubric_scores, - grader_types, feedback_items) - contexts.append({ - 'result': rubric_html, - 'task_name': 'Scored rubric', - 'feedback' : feedback - }) + response = self.get_last_response(self.current_task_number + 1) + score_length = len(response['grader_types']) + for z in xrange(0,score_length): + feedback = response['feedback_dicts'][z].get('feedback', '') + if response['grader_types'][z] in HUMAN_GRADER_TYPE.keys(): + rubric_scores = [[response['rubric_scores'][z]]] + grader_types = [[response['grader_types'][z]]] + feedback_items = [[response['feedback_items'][z]]] + rubric_html = self.rubric_renderer.render_combined_rubric(stringify_children(self.static_data['rubric']), + rubric_scores, + grader_types, feedback_items) + contexts.append({ + 'result': rubric_html, + 'task_name': 'Scored rubric', + 'feedback' : feedback + }) context = { 'results': contexts, @@ -594,15 +592,6 @@ class CombinedOpenEndedV1Module(): html = self.system.render_template('{0}/combined_open_ended_legend.html'.format(self.TEMPLATE_DIR), context) return {'html': html, 'success': True} - def get_status_ajax(self, _data): - """ - Gets the results of a given grader via ajax. - Input: AJAX data dictionary - Output: Dictionary to be rendered via ajax that contains the result html. - """ - html = self.get_status(True) - return {'html': html, 'success': True} - def handle_ajax(self, dispatch, data): """ This is called by courseware.module_render, to handle an AJAX call. @@ -618,7 +607,6 @@ class CombinedOpenEndedV1Module(): 'next_problem': self.next_problem, 'reset': self.reset, 'get_combined_rubric': self.get_rubric, - 'get_status': self.get_status_ajax, 'get_legend': self.get_legend, 'get_last_response': self.get_last_response_ajax, 'get_current_state': self.get_current_state, From 7b9dde78fec860dfd26195aae5c6391e0d800406 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 15 Aug 2013 19:21:28 -0400 Subject: [PATCH 64/75] Fetch the correct rubric --- .../combined_open_ended_modulev1.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 bdcbc7054c..23fa9c28c8 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 @@ -557,7 +557,10 @@ class CombinedOpenEndedV1Module(): return {'html' : self.system.render_template('{0}/combined_open_ended_hidden_results.html'.format(self.TEMPLATE_DIR), {'error' : error}), 'success' : True, 'hide_reset' : True} contexts = [] - response = self.get_last_response(self.current_task_number + 1) + rubric_number = self.current_task_number + if self.ready_to_reset: + rubric_number+=1 + response = self.get_last_response(rubric_number) score_length = len(response['grader_types']) for z in xrange(0,score_length): feedback = response['feedback_dicts'][z].get('feedback', '') From be3291eeb075e574de689c95814aa503b47b79f4 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Fri, 16 Aug 2013 13:22:34 -0400 Subject: [PATCH 65/75] Proper scoping, show status to staff, fix line break issues, multiple self assessments on one page work --- .../js/src/combinedopenended/display.coffee | 15 +++++++++------ .../open_ended_module.py | 2 +- .../self_assessment_module.py | 1 + .../coffee/src/staff_grading/staff_grading.coffee | 11 ++++++++++- .../openended/open_ended_rubric.html | 6 ++++-- lms/templates/instructor/staff_grading.html | 4 ++-- 6 files changed, 27 insertions(+), 12 deletions(-) diff --git a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee index 2fe8979652..e846717030 100644 --- a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee @@ -23,7 +23,7 @@ class @Rubric keypress_callback: (event) => # don't try to do this when user is typing in a text input - if $(event.target).is('input, textarea') + if @$(event.target).is('input, textarea') return # for when we select via top row if event.which >= 48 and event.which <= 57 @@ -49,9 +49,9 @@ class @Rubric @category = @$(@categories[@category_index]) tracking_callback: (event) => - target_selection = $(event.target).val() + target_selection = @$(event.target).val() # chop off the beginning of the name so that we can get the number of the category - category = $(event.target).data("category") + category = @$(event.target).data("category") location = @$(@rubric_sel).data('location') # probably want the original problem location as well @@ -187,9 +187,9 @@ class @CombinedOpenEnded @skip_button = @$(@oe).find(@skip_button_sel) @skip_button.click @skip_post_assessment - @file_upload_area = $(@oe).find(@file_upload_sel) + @file_upload_area = @$(@oe).find(@file_upload_sel) @can_upload_files = false - @open_ended_child= $(@oe).find(@open_ended_child_sel) + @open_ended_child= @$(@oe).find(@open_ended_child_sel) @out_of_sync_message = 'The problem state got out of sync. Try reloading the page.' @@ -257,7 +257,7 @@ class @CombinedOpenEnded contentType: false success: (response) => @gentle_alert response.msg - $('section.evaluation').slideToggle() + @$('section.evaluation').slideToggle() @message_wrapper.html(response.message_html) @@ -299,6 +299,7 @@ class @CombinedOpenEnded @hide_file_upload() @submit_button.prop('value', 'Submit assessment') @submit_button.click @save_assessment + @submit_button.attr("disabled",false) if @child_type == "openended" @submit_button.hide() @queueing() @@ -339,6 +340,7 @@ class @CombinedOpenEnded @hint_area = @$('textarea.post_assessment') save_answer: (event) => + @submit_button.attr("disabled",true) event.preventDefault() @submit_button.hide() @answer_area.attr("disabled", true) @@ -640,4 +642,5 @@ class @CombinedOpenEnded graded_callback: () => if @rub.check_complete() + @submit_button.attr("disabled",false) @submit_button.show() diff --git a/common/lib/xmodule/xmodule/open_ended_grading_classes/open_ended_module.py b/common/lib/xmodule/xmodule/open_ended_grading_classes/open_ended_module.py index 04eff33159..dc2c3fb01b 100644 --- a/common/lib/xmodule/xmodule/open_ended_grading_classes/open_ended_module.py +++ b/common/lib/xmodule/xmodule/open_ended_grading_classes/open_ended_module.py @@ -699,7 +699,7 @@ class OpenEndedModule(openendedchild.OpenEndedChild): post_assessment = "" correct = "" previous_answer = "" - + previous_answer = previous_answer.replace("\n","
    ") context = { 'prompt': self.child_prompt, 'previous_answer': previous_answer, diff --git a/common/lib/xmodule/xmodule/open_ended_grading_classes/self_assessment_module.py b/common/lib/xmodule/xmodule/open_ended_grading_classes/self_assessment_module.py index 674fab0d30..5c40aca116 100644 --- a/common/lib/xmodule/xmodule/open_ended_grading_classes/self_assessment_module.py +++ b/common/lib/xmodule/xmodule/open_ended_grading_classes/self_assessment_module.py @@ -61,6 +61,7 @@ class SelfAssessmentModule(openendedchild.OpenEndedChild): else: previous_answer = '' + previous_answer = previous_answer.replace("\n","
    ") context = { 'prompt': self.child_prompt, 'previous_answer': previous_answer, diff --git a/lms/static/coffee/src/staff_grading/staff_grading.coffee b/lms/static/coffee/src/staff_grading/staff_grading.coffee index e7e7c189ac..e8cee60001 100644 --- a/lms/static/coffee/src/staff_grading/staff_grading.coffee +++ b/lms/static/coffee/src/staff_grading/staff_grading.coffee @@ -146,6 +146,8 @@ The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for t class @StaffGrading + grading_message_sel: '.grading-message' + constructor: (backend) -> AjaxPrefix.addAjaxPrefix(jQuery, -> "") @backend = backend @@ -278,6 +280,7 @@ class @StaffGrading location: @location skipped: true submission_flagged: false + @gentle_alert "Skipped the submission." @backend.post('save_grade', data, @ajax_callback) get_problem_list: () -> @@ -292,9 +295,15 @@ class @StaffGrading submission_id: @submission_id location: @location submission_flagged: @flag_submission_checkbox.is(':checked') - + @gentle_alert "Grades saved. Fetching the next submission to grade." @backend.post('save_grade', data, @ajax_callback) + gentle_alert: (msg) => + @grading_message = $(@grading_message_sel) + @grading_message.html("") + @grading_message.fadeIn() + @grading_message.html("

    " + msg + "

    ") + error: (msg) -> @error_msg = msg @state = state_error diff --git a/lms/templates/combinedopenended/openended/open_ended_rubric.html b/lms/templates/combinedopenended/openended/open_ended_rubric.html index ea374c5173..55194a9318 100644 --- a/lms/templates/combinedopenended/openended/open_ended_rubric.html +++ b/lms/templates/combinedopenended/openended/open_ended_rubric.html @@ -1,4 +1,5 @@ <%! from django.utils.translation import ugettext as _ %> +<% from random import randint %>
    @@ -9,6 +10,7 @@
    % for i in range(len(categories)): <% category = categories[i] %> + <% m = randint(0,1000) %> ${category['description']}
      % for j in range(len(category['options'])): @@ -18,8 +20,8 @@ %else:
    • % endif -
    • diff --git a/lms/templates/instructor/staff_grading.html b/lms/templates/instructor/staff_grading.html index 8595b0d722..bb60bddeb0 100644 --- a/lms/templates/instructor/staff_grading.html +++ b/lms/templates/instructor/staff_grading.html @@ -80,8 +80,8 @@
    - -
    +
    +
    \ No newline at end of file From 4f3ec68fb744565af929da3eae5f9dc2c5262bf7 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Fri, 16 Aug 2013 14:12:37 -0400 Subject: [PATCH 66/75] Scroll to top in peer and staff grading, preserve line breaks in submissions --- .../js/src/combinedopenended/display.coffee | 30 +++++++++++-------- .../peergrading/peer_grading_problem.coffee | 8 ++++- .../open_ended_module.py | 2 +- .../openendedchild.py | 3 +- .../self_assessment_module.py | 2 +- .../src/staff_grading/staff_grading.coffee | 8 ++++- lms/templates/instructor/staff_grading.html | 6 ++-- lms/templates/peer_grading/peer_grading.html | 2 +- .../peer_grading/peer_grading_problem.html | 4 +-- 9 files changed, 43 insertions(+), 22 deletions(-) diff --git a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee index e846717030..b4f72a3e1d 100644 --- a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee @@ -100,6 +100,7 @@ class @CombinedOpenEnded open_ended_child_sel: 'section.open-ended-child' error_sel: '.error' answer_area_sel: 'textarea.answer' + answer_area_div_sel : 'div.answer' prompt_sel: '.prompt' rubric_wrapper_sel: '.rubric-wrapper' hint_wrapper_sel: '.hint-wrapper' @@ -339,6 +340,21 @@ class @CombinedOpenEnded find_hint_elements: -> @hint_area = @$('textarea.post_assessment') + replace_answer: (response) => + if response.success + @rubric_wrapper.html(response.rubric_html) + @rubric_wrapper.show() + @rub = new Rubric(@coe) + @rub.initialize(@location) + @child_state = 'assessing' + @find_assessment_elements() + @rebind() + answer_area_div = @$(@answer_area_div_sel) + answer_area_div.html(response.student_response) + else + @can_upload_files = pre_can_upload_files + @gentle_alert response.error + save_answer: (event) => @submit_button.attr("disabled",true) event.preventDefault() @@ -367,19 +383,9 @@ class @CombinedOpenEnded data: fd processData: false contentType: false + async: false success: (response) => - if response.success - @rubric_wrapper.html(response.rubric_html) - @rubric_wrapper.show() - @rub = new Rubric(@coe) - @rub.initialize(@location) - @answer_area.html(response.student_response) - @child_state = 'assessing' - @find_assessment_elements() - @rebind() - else - @can_upload_files = pre_can_upload_files - @gentle_alert response.error + @replace_answer(response) $.ajaxWithPrefix("#{@ajax_url}/save_answer",settings) else diff --git a/common/lib/xmodule/xmodule/js/src/peergrading/peer_grading_problem.coffee b/common/lib/xmodule/xmodule/js/src/peergrading/peer_grading_problem.coffee index a026cafd61..f96704037e 100644 --- a/common/lib/xmodule/xmodule/js/src/peergrading/peer_grading_problem.coffee +++ b/common/lib/xmodule/xmodule/js/src/peergrading/peer_grading_problem.coffee @@ -450,7 +450,7 @@ class @PeerGradingProblem @submit_button.unbind('click') @submit_button.click @submit_calibration_essay - + @scroll_to_top() else if response.error @render_error(response.error) else @@ -479,6 +479,7 @@ class @PeerGradingProblem @submit_button.unbind('click') @submit_button.click @submit_grade + @scroll_to_top() else if response.error @render_error(response.error) else @@ -573,3 +574,8 @@ class @PeerGradingProblem Logger.log 'peer_grading_show_question', {location: @location} new_text = "(Hide)" @question_header.text(new_text) + + scroll_to_top: () => + $('html, body').animate({ + scrollTop: $(".peer-grading").offset().top + }, 200) diff --git a/common/lib/xmodule/xmodule/open_ended_grading_classes/open_ended_module.py b/common/lib/xmodule/xmodule/open_ended_grading_classes/open_ended_module.py index dc2c3fb01b..800789b56a 100644 --- a/common/lib/xmodule/xmodule/open_ended_grading_classes/open_ended_module.py +++ b/common/lib/xmodule/xmodule/open_ended_grading_classes/open_ended_module.py @@ -663,7 +663,7 @@ class OpenEndedModule(openendedchild.OpenEndedChild): return { 'success': success, 'error': error_message, - 'student_response': data['student_answer'] + 'student_response': data['student_answer'].replace("\n","
    ") } def update_score(self, data, system): diff --git a/common/lib/xmodule/xmodule/open_ended_grading_classes/openendedchild.py b/common/lib/xmodule/xmodule/open_ended_grading_classes/openendedchild.py index 3e12b4656d..d99e466886 100644 --- a/common/lib/xmodule/xmodule/open_ended_grading_classes/openendedchild.py +++ b/common/lib/xmodule/xmodule/open_ended_grading_classes/openendedchild.py @@ -179,9 +179,10 @@ class OpenEndedChild(object): answer = autolink_html(answer) cleaner = Cleaner(style=True, links=True, add_nofollow=False, page_structure=True, safe_attrs_only=True, host_whitelist=open_ended_image_submission.TRUSTED_IMAGE_DOMAINS, - whitelist_tags=set(['embed', 'iframe', 'a', 'img'])) + whitelist_tags=set(['embed', 'iframe', 'a', 'img', 'br'])) clean_html = cleaner.clean_html(answer) clean_html = re.sub(r'

    $', '', re.sub(r'^

    ', '', clean_html)) + clean_html = re.sub("\n","
    ", clean_html) except Exception: clean_html = answer return clean_html diff --git a/common/lib/xmodule/xmodule/open_ended_grading_classes/self_assessment_module.py b/common/lib/xmodule/xmodule/open_ended_grading_classes/self_assessment_module.py index 5c40aca116..2485fc77ea 100644 --- a/common/lib/xmodule/xmodule/open_ended_grading_classes/self_assessment_module.py +++ b/common/lib/xmodule/xmodule/open_ended_grading_classes/self_assessment_module.py @@ -196,7 +196,7 @@ class SelfAssessmentModule(openendedchild.OpenEndedChild): 'success': success, 'rubric_html': self.get_rubric_html(system), 'error': error_message, - 'student_response': data['student_answer'], + 'student_response': data['student_answer'].replace("\n","
    ") } def save_assessment(self, data, _system): diff --git a/lms/static/coffee/src/staff_grading/staff_grading.coffee b/lms/static/coffee/src/staff_grading/staff_grading.coffee index e8cee60001..31c084ffd0 100644 --- a/lms/static/coffee/src/staff_grading/staff_grading.coffee +++ b/lms/static/coffee/src/staff_grading/staff_grading.coffee @@ -253,7 +253,7 @@ class @StaffGrading # always clear out errors and messages on transition. @error_msg = '' @message = '' - + if response.success if response.problem_list @problems = response.problem_list @@ -265,6 +265,7 @@ class @StaffGrading @error(response.error) @render_view() + @scroll_to_top() get_next_submission: (location) -> @location = location @@ -474,6 +475,11 @@ class @StaffGrading new_text = "(Hide)" @question_header.text(new_text) + scroll_to_top: () => + $('html, body').animate({ + scrollTop: $(".staff-grading").offset().top + }, 200) + # for now, just create an instance and load it... diff --git a/lms/templates/instructor/staff_grading.html b/lms/templates/instructor/staff_grading.html index bb60bddeb0..15ea97332a 100644 --- a/lms/templates/instructor/staff_grading.html +++ b/lms/templates/instructor/staff_grading.html @@ -38,6 +38,7 @@

    +

    @@ -80,8 +81,9 @@
    -
    - \ No newline at end of file + + + diff --git a/lms/templates/peer_grading/peer_grading.html b/lms/templates/peer_grading/peer_grading.html index 162c9273b0..b0dffe8f9d 100644 --- a/lms/templates/peer_grading/peer_grading.html +++ b/lms/templates/peer_grading/peer_grading.html @@ -9,7 +9,7 @@ % if success: % if len(problem_list) == 0:
    - ${_("You currently do not having any peer grading to do. In order to have peer grading to do, you need to have submitted a response to a peer grading problem. The instructor also needs to score the essays that are used in the 'learning to grade' process.")} + ${_("You currently do not having any peer grading to do. In order to have peer grading to do, you need to have submitted a response to a peer grading problem. The instructor also needs to score the essays that are used to help you better understand the grading criteria.")}
    %else:
    diff --git a/lms/templates/peer_grading/peer_grading_problem.html b/lms/templates/peer_grading/peer_grading_problem.html index a0078b8868..b945e030cb 100644 --- a/lms/templates/peer_grading/peer_grading_problem.html +++ b/lms/templates/peer_grading/peer_grading_problem.html @@ -27,6 +27,8 @@
    +
    +

    ${_("Student Response")}

    @@ -53,8 +55,6 @@
    -
    -
    From bc8244b70950e651088e083fc45a06df14cc6f24 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Fri, 16 Aug 2013 14:43:37 -0400 Subject: [PATCH 67/75] Rename reset to try again, hide and disable submit buttons --- .../xmodule/xmodule/js/src/combinedopenended/display.coffee | 4 +++- .../xmodule/js/src/peergrading/peer_grading_problem.coffee | 6 +++++- lms/templates/combinedopenended/combined_open_ended.html | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee index b4f72a3e1d..7065a54d55 100644 --- a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee @@ -357,8 +357,8 @@ class @CombinedOpenEnded save_answer: (event) => @submit_button.attr("disabled",true) - event.preventDefault() @submit_button.hide() + event.preventDefault() @answer_area.attr("disabled", true) max_filesize = 2*1000*1000 #2MB pre_can_upload_files = @can_upload_files @@ -404,6 +404,8 @@ class @CombinedOpenEnded @is_ctrl=false save_assessment: (event) => + @submit_button.attr("disabled",true) + @submit_button.hide() event.preventDefault() if @child_state == 'assessing' && @rub.check_complete() checked_assessment = @rub.get_total_score() diff --git a/common/lib/xmodule/xmodule/js/src/peergrading/peer_grading_problem.coffee b/common/lib/xmodule/xmodule/js/src/peergrading/peer_grading_problem.coffee index f96704037e..bdb02c44b9 100644 --- a/common/lib/xmodule/xmodule/js/src/peergrading/peer_grading_problem.coffee +++ b/common/lib/xmodule/xmodule/js/src/peergrading/peer_grading_problem.coffee @@ -322,10 +322,12 @@ class @PeerGradingProblem submit_calibration_essay: ()=> data = @construct_data() + @submit_button.hide() @backend.post('save_calibration_essay', data, @calibration_callback) submit_grade: () => data = @construct_data() + @submit_button.hide() @backend.post('save_grade', data, @submission_callback) @@ -448,6 +450,7 @@ class @PeerGradingProblem @feedback_area.val("") + @submit_button.show() @submit_button.unbind('click') @submit_button.click @submit_calibration_essay @scroll_to_top() @@ -476,7 +479,8 @@ class @PeerGradingProblem @flag_student_container.show() @answer_unknown_container.show() @feedback_area.val("") - + + @submit_button.show() @submit_button.unbind('click') @submit_button.click @submit_grade @scroll_to_top() diff --git a/lms/templates/combinedopenended/combined_open_ended.html b/lms/templates/combinedopenended/combined_open_ended.html index 65b44b0aa1..5f088265a2 100644 --- a/lms/templates/combinedopenended/combined_open_ended.html +++ b/lms/templates/combinedopenended/combined_open_ended.html @@ -39,7 +39,7 @@
    - +
    From 8248c331386708100c94247387729fb0a45a3f74 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Fri, 16 Aug 2013 14:48:11 -0400 Subject: [PATCH 68/75] Grab the correct location to report data for --- common/lib/xmodule/xmodule/peer_grading_module.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/common/lib/xmodule/xmodule/peer_grading_module.py b/common/lib/xmodule/xmodule/peer_grading_module.py index aa742f6a0b..e8409948e9 100644 --- a/common/lib/xmodule/xmodule/peer_grading_module.py +++ b/common/lib/xmodule/xmodule/peer_grading_module.py @@ -188,9 +188,8 @@ class PeerGradingModule(PeerGradingFields, XModule): return json.dumps(d, cls=ComplexEncoder) - def query_data_for_location(self): + def query_data_for_location(self, location): student_id = self.system.anonymous_student_id - location = self.link_to_location success = False response = {} @@ -322,7 +321,7 @@ class PeerGradingModule(PeerGradingFields, XModule): try: response = self.peer_gs.save_grade(**data_dict) - success, location_data = self.query_data_for_location() + success, location_data = self.query_data_for_location(data_dict['location']) response.update({'required_done' : False}) if 'count_graded' in location_data and 'count_required' in location_data and int(location_data['count_graded'])>=int(location_data['count_required']): response['required_done'] = True From 48b0e570bc131e60647b543d7965061dc9dd3b5e Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Fri, 16 Aug 2013 15:10:55 -0400 Subject: [PATCH 69/75] Disable submit buttons until rubric totally filled out --- .../xmodule/xmodule/js/src/combinedopenended/display.coffee | 2 +- .../xmodule/js/src/peergrading/peer_grading_problem.coffee | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee index 7065a54d55..1732bfbe71 100644 --- a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee @@ -300,7 +300,7 @@ class @CombinedOpenEnded @hide_file_upload() @submit_button.prop('value', 'Submit assessment') @submit_button.click @save_assessment - @submit_button.attr("disabled",false) + @submit_button.attr("disabled",true) if @child_type == "openended" @submit_button.hide() @queueing() diff --git a/common/lib/xmodule/xmodule/js/src/peergrading/peer_grading_problem.coffee b/common/lib/xmodule/xmodule/js/src/peergrading/peer_grading_problem.coffee index bdb02c44b9..0cbccad548 100644 --- a/common/lib/xmodule/xmodule/js/src/peergrading/peer_grading_problem.coffee +++ b/common/lib/xmodule/xmodule/js/src/peergrading/peer_grading_problem.coffee @@ -453,6 +453,7 @@ class @PeerGradingProblem @submit_button.show() @submit_button.unbind('click') @submit_button.click @submit_calibration_essay + @submit_button.attr('disabled', true) @scroll_to_top() else if response.error @render_error(response.error) @@ -479,10 +480,11 @@ class @PeerGradingProblem @flag_student_container.show() @answer_unknown_container.show() @feedback_area.val("") - + @submit_button.show() @submit_button.unbind('click') @submit_button.click @submit_grade + @submit_button.attr('disabled', true) @scroll_to_top() else if response.error @render_error(response.error) @@ -558,6 +560,7 @@ class @PeerGradingProblem @action_button.show() show_submit_button: () => + @submit_button.attr('disabled', false) @submit_button.show() setup_score_selection: (max_score) => From 59336ee03caab6d398cd72eebc1666d466510ed1 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Fri, 16 Aug 2013 15:24:38 -0400 Subject: [PATCH 70/75] Fix prompt hiding issue in peer grading --- .../src/peergrading/peer_grading_problem.coffee | 15 +++++++-------- .../peer_grading/peer_grading_problem.html | 4 ++-- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/common/lib/xmodule/xmodule/js/src/peergrading/peer_grading_problem.coffee b/common/lib/xmodule/xmodule/js/src/peergrading/peer_grading_problem.coffee index 0cbccad548..8771b4fe91 100644 --- a/common/lib/xmodule/xmodule/js/src/peergrading/peer_grading_problem.coffee +++ b/common/lib/xmodule/xmodule/js/src/peergrading/peer_grading_problem.coffee @@ -257,8 +257,6 @@ class @PeerGradingProblem $(window).keydown @keydown_handler $(window).keyup @keyup_handler - @collapse_question() - Collapsible.setCollapsibles(@content_panel) # Set up the click event handlers @@ -571,16 +569,17 @@ class @PeerGradingProblem @grading_message.fadeIn() @grading_message.html("

    " + msg + "

    ") - collapse_question: () => + collapse_question: (event) => @prompt_container.slideToggle() @prompt_container.toggleClass('open') - if @question_header.text() == "(Hide)" - Logger.log 'peer_grading_hide_question', {location: @location} - new_text = "(Show)" + if @question_header.text() == "Hide Prompt" + new_text = "Show Prompt" + Logger.log 'oe_hide_question', {location: @location} else - Logger.log 'peer_grading_show_question', {location: @location} - new_text = "(Hide)" + Logger.log 'oe_show_question', {location: @location} + new_text = "Hide Prompt" @question_header.text(new_text) + return false scroll_to_top: () => $('html, body').animate({ diff --git a/lms/templates/peer_grading/peer_grading_problem.html b/lms/templates/peer_grading/peer_grading_problem.html index b945e030cb..80b230e2aa 100644 --- a/lms/templates/peer_grading/peer_grading_problem.html +++ b/lms/templates/peer_grading/peer_grading_problem.html @@ -14,10 +14,10 @@
    -
    +
    - ${_('Hide Prompt')} + ${_('Hide Prompt')}
    From f17987c13ae7b2745376649baf304579af19dc3e Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Fri, 16 Aug 2013 17:37:53 -0400 Subject: [PATCH 71/75] Fix flagging, select rubric labels in peer grading --- .../xmodule/css/combinedopenended/display.scss | 11 +++++++++++ .../js/src/peergrading/peer_grading_problem.coffee | 9 ++++++++- common/lib/xmodule/xmodule/peer_grading_module.py | 9 ++++++--- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss index 120ea0c52d..551d1c181f 100644 --- a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss +++ b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss @@ -234,6 +234,9 @@ section.combined-open-ended-status { &:hover { background-color: #eee; } + .rubric-label-selected{ + border: 2px solid #666; + } } span.rubric-category { @@ -952,3 +955,11 @@ section.open-ended-child { } } } + +section.peer-grading-container{ + div.peer-grading{ + section.calibration-feedback { + padding: 20px; + } + } +} diff --git a/common/lib/xmodule/xmodule/js/src/peergrading/peer_grading_problem.coffee b/common/lib/xmodule/xmodule/js/src/peergrading/peer_grading_problem.coffee index 8771b4fe91..4151bda33d 100644 --- a/common/lib/xmodule/xmodule/js/src/peergrading/peer_grading_problem.coffee +++ b/common/lib/xmodule/xmodule/js/src/peergrading/peer_grading_problem.coffee @@ -338,13 +338,15 @@ class @PeerGradingProblem remove_flag: () => @flag_student_checkbox.removeAttr("checked") @close_dialog_box() + @submit_button.attr('disabled', true) close_dialog_box: () => - @$(@flag_submission_confirmation_sel).dialog('close') + $(@flag_submission_confirmation_sel).dialog('close') flag_box_checked: () => if @flag_student_checkbox.is(':checked') @$(@flag_submission_confirmation_sel).dialog({ height: 400, width: 400 }) + @submit_button.attr('disabled', false) # called after we perform an is_student_calibrated check calibration_check_callback: (response) => @@ -397,6 +399,10 @@ class @PeerGradingProblem # called after a grade is selected on the interface graded_callback: (event) => + ev = @$(event.target).parent().parent() + ul = ev.parent().parent() + ul.find(".rubric-label-selected").removeClass('rubric-label-selected') + ev.addClass('rubric-label-selected') # check to see whether or not any categories have not been scored if @rub.check_complete() # show button if we have scores for all categories @@ -479,6 +485,7 @@ class @PeerGradingProblem @answer_unknown_container.show() @feedback_area.val("") + @flag_student_checkbox.removeAttr("checked") @submit_button.show() @submit_button.unbind('click') @submit_button.click @submit_grade diff --git a/common/lib/xmodule/xmodule/peer_grading_module.py b/common/lib/xmodule/xmodule/peer_grading_module.py index e8409948e9..d60f448d3b 100644 --- a/common/lib/xmodule/xmodule/peer_grading_module.py +++ b/common/lib/xmodule/xmodule/peer_grading_module.py @@ -310,13 +310,16 @@ class PeerGradingModule(PeerGradingFields, XModule): error: if there was an error in the submission, this is the error message """ - required = set(['location', 'submission_id', 'submission_key', 'score', 'feedback', 'rubric_scores[]', 'submission_flagged', 'answer_unknown']) - success, message = self._check_required(data, required) + required = ['location', 'submission_id', 'submission_key', 'score', 'feedback', 'submission_flagged', 'answer_unknown'] + if 'submission_flagged' not in data or data['submission_flagged'] in ["false", False, "False"]: + required.append("rubric_scores[]") + success, message = self._check_required(data, set(required)) if not success: return self._err_response(message) data_dict = {k:data.get(k) for k in required} - data_dict['rubric_scores'] = data.getlist('rubric_scores[]') + if 'rubric_scores[]' in required: + data_dict['rubric_scores'] = data.getlist('rubric_scores[]') data_dict['grader_id'] = self.system.anonymous_student_id try: From d782278d5caba66b4903ab5529ec1567d997abcc Mon Sep 17 00:00:00 2001 From: marco Date: Tue, 20 Aug 2013 01:33:06 -0400 Subject: [PATCH 72/75] minor cleanup of pull request comments within scss files, along with removal of some whitespace in text fixture file for rubrics --- common/lib/xmodule/xmodule/css/capa/display.scss | 2 +- .../xmodule/css/combinedopenended/display.scss | 11 ++++++----- common/lib/xmodule/xmodule/js/fixtures/rubric.html | 4 ---- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/common/lib/xmodule/xmodule/css/capa/display.scss b/common/lib/xmodule/xmodule/css/capa/display.scss index 2fa3c315ef..fcc067c51d 100644 --- a/common/lib/xmodule/xmodule/css/capa/display.scss +++ b/common/lib/xmodule/xmodule/css/capa/display.scss @@ -914,7 +914,7 @@ section.problem { .tag { display: inline-block; - margin-left: $baseline; + margin-left: $baseline*2; border: 1px solid rgb(102,102,102); cursor: pointer; diff --git a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss index 551d1c181f..7ca99be5c4 100644 --- a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss +++ b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss @@ -129,7 +129,7 @@ section.combined-open-ended-status { } &:last-child { - border-right: 0px; + border-right: 0; border-radius: 0 $baseline/4 $baseline/4 0; } @@ -235,7 +235,8 @@ section.combined-open-ended-status { background-color: #eee; } .rubric-label-selected{ - border: 2px solid #666; + border-radius: $baseline/4; + background-color: #eee; } } @@ -365,7 +366,7 @@ div.result-container { font-family: monospace; font-size: 1em; padding-top: $baseline/2; - padding-bottom:30px; + padding-bottom: 30px; header { font-size: 1.4em; @@ -433,8 +434,8 @@ div.result-container { .rubric-result-container { padding: 2px; - margin: 0px; - display : inline; + margin: 0; + display: inline; .rubric-result { font-size: .9em; diff --git a/common/lib/xmodule/xmodule/js/fixtures/rubric.html b/common/lib/xmodule/xmodule/js/fixtures/rubric.html index bdb572d11b..76ad59b8ff 100644 --- a/common/lib/xmodule/xmodule/js/fixtures/rubric.html +++ b/common/lib/xmodule/xmodule/js/fixtures/rubric.html @@ -19,8 +19,6 @@
    - -
    @@ -30,8 +28,6 @@
    - -
    From a6cc30d1fea1d4709da6c2e93b658aee3737397f Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 22 Aug 2013 13:51:27 -0400 Subject: [PATCH 73/75] Fix tests, address review feedback --- .../js/src/combinedopenended/display.coffee | 1 - .../combined_open_ended_modulev1.py | 49 +++++++++++++------ .../combined_open_ended_rubric.py | 26 +++++++--- .../grading_service_module.py | 1 - .../xmodule/xmodule/peer_grading_module.py | 14 +++--- .../xmodule/tests/test_combined_open_ended.py | 24 ++++----- .../xmodule/tests/test_peer_grading.py | 2 +- 7 files changed, 70 insertions(+), 47 deletions(-) diff --git a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee index 1732bfbe71..bd399e8c88 100644 --- a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee @@ -171,7 +171,6 @@ class @CombinedOpenEnded @results_container = @$(@result_container_sel) @combined_rubric_container = @$(@combined_rubric_sel) - # Where to put the rubric once we load it @oe = @$(@open_ended_child_sel) 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 23fa9c28c8..8c90983d3c 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 @@ -9,7 +9,7 @@ import self_assessment_module import open_ended_module from functools import partial from .combined_open_ended_rubric import CombinedOpenEndedRubric, GRADER_TYPE_IMAGE_DICT, HUMAN_GRADER_TYPE, LEGEND_LIST -from peer_grading_service import PeerGradingService, MockPeerGradingService +from peer_grading_service import PeerGradingService, MockPeerGradingService, GradingServiceError log = logging.getLogger("mitx.courseware") @@ -40,10 +40,10 @@ HUMAN_TASK_TYPE = { } HUMAN_STATES = { - 'intitial' : "Not started.", - 'assessing' : "Being scored.", - 'intermediate_done' : "Scoring finished.", - 'done' : "Complete." + 'intitial': "Not started.", + 'assessing': "Being scored.", + 'intermediate_done': "Scoring finished.", + 'done': "Complete.", } # Default value that controls whether or not to skip basic spelling checks in the controller @@ -438,6 +438,7 @@ class CombinedOpenEndedV1Module(): grader_type = grader_types[0] else: grader_type = "IN" + grader_types = ["IN"] if grader_type in HUMAN_GRADER_TYPE: human_grader_name = HUMAN_GRADER_TYPE[grader_type] @@ -514,33 +515,46 @@ class CombinedOpenEndedV1Module(): return return_html def check_if_student_has_done_needed_grading(self): + """ + Checks with the ORA server to see if the student has completed the needed peer grading to be shown their grade. + For example, if a student submits one response, and three peers grade their response, the student + cannot see their grades and feedback unless they reciprocate. + Output: + success - boolean indicator of success + allowed_to_submit - boolean indicator of whether student has done their needed grading or not + error_message - If not success, explains why + """ student_id = self.system.anonymous_student_id success = False allowed_to_submit = True - error_string = ("

    Feedback not available yet

    " - "

    You need to peer grade {0} more submissions in order to see your feedback.

    " - "

    You have graded responses from {1} students, and {2} students have graded your submissions.

    " - "

    You have made {3} submissions.

    ") try: response = self.peer_gs.get_data_for_location(self.location.url(), student_id) - log.info(response) count_graded = response['count_graded'] count_required = response['count_required'] student_sub_count = response['student_sub_count'] count_available = response['count_available'] success = True - except: + except GradingServiceError: # This is a dev_facing_error log.error("Could not contact external open ended graders for location {0} and student {1}".format( self.location, student_id)) # This is a student_facing_error error_message = "Could not contact the graders. Please notify course staff." return success, allowed_to_submit, error_message + except KeyError: + log.error("Invalid response from grading server for location {0} and student {1}".format(self.location, student_id)) + error_message = "Received invalid response from the graders. Please notify course staff." + return success, allowed_to_submit, error_message if count_graded >= count_required or count_available==0: - return success, allowed_to_submit, "" + error_message = "" + return success, allowed_to_submit, error_message else: allowed_to_submit = False # This is a student_facing_error + error_string = ("

    Feedback not available yet

    " + "

    You need to peer grade {0} more submissions in order to see your feedback.

    " + "

    You have graded responses from {1} students, and {2} students have graded your submissions.

    " + "

    You have made {3} submissions.

    ") error_message = error_string.format(count_required - count_graded, count_graded, count_required, student_sub_count) return success, allowed_to_submit, error_message @@ -562,9 +576,12 @@ class CombinedOpenEndedV1Module(): rubric_number+=1 response = self.get_last_response(rubric_number) score_length = len(response['grader_types']) - for z in xrange(0,score_length): - feedback = response['feedback_dicts'][z].get('feedback', '') - if response['grader_types'][z] in HUMAN_GRADER_TYPE.keys(): + for z in xrange(score_length): + if response['grader_types'][z] in HUMAN_GRADER_TYPE: + try: + feedback = response['feedback_dicts'][z].get('feedback', '') + except TypeError: + return {'success' : False} rubric_scores = [[response['rubric_scores'][z]]] grader_types = [[response['grader_types'][z]]] feedback_items = [[response['feedback_items'][z]]] @@ -664,7 +681,7 @@ class CombinedOpenEndedV1Module(): self.student_attempts +=1 self.state = self.INITIAL self.ready_to_reset = False - for i in xrange(0, len(self.task_xml)): + for i in xrange(len(self.task_xml)): self.current_task_number = i self.setup_next_task(reset=True) self.current_task.reset(self.system) diff --git a/common/lib/xmodule/xmodule/open_ended_grading_classes/combined_open_ended_rubric.py b/common/lib/xmodule/xmodule/open_ended_grading_classes/combined_open_ended_rubric.py index a072d5ad5e..a72fd07438 100644 --- a/common/lib/xmodule/xmodule/open_ended_grading_classes/combined_open_ended_rubric.py +++ b/common/lib/xmodule/xmodule/open_ended_grading_classes/combined_open_ended_rubric.py @@ -206,27 +206,39 @@ class CombinedOpenEndedRubric(object): def render_combined_rubric(self, rubric_xml, scores, score_types, feedback_types): success, score_tuples = CombinedOpenEndedRubric.reformat_scores_for_rendering(scores, score_types, feedback_types) + #Get all the categories in the rubric rubric_categories = self.extract_categories(rubric_xml) + #Get a list of max scores, each entry belonging to a rubric category max_scores = map((lambda cat: cat['options'][-1]['points']), rubric_categories) actual_scores = [] + #Get the highest possible score across all categories max_score = max(max_scores) - for i in xrange(0, len(rubric_categories)): - category = rubric_categories[i] - for j in xrange(0, len(category['options'])): + #Loop through each category + for i,category in enumerate(rubric_categories): + #Loop through each option in the category + for j in xrange(len(category['options'])): + #Intialize empty grader types list rubric_categories[i]['options'][j]['grader_types'] = [] - for tuple in score_tuples: - if tuple[1] == i and tuple[2] == j: - for grader_type in tuple[3]: + #Score tuples are a flat data structure with (category, option, grader_type_list) for selected graders + for tup in score_tuples: + if tup[1] == i and tup[2] == j: + for grader_type in tup[3]: + #Set the rubric grader type to the tuple grader types rubric_categories[i]['options'][j]['grader_types'].append(grader_type) + #Grab the score and add it to the actual scores. J will be the score for the selected + #grader type if len(actual_scores)<=i: + #Initialize a new list in the list of lists actual_scores.append([j]) else: + #If a list in the list of lists for this position exists, append to it actual_scores[i] += [j] actual_scores = [sum(i)/len(i) for i in actual_scores] correct = [] + #Define if the student is "correct" (1) "incorrect" (0) or "partially correct" (.5) for (i,a) in enumerate(actual_scores): - if int(a)/max_scores[i]==1: + if int(a) == max_scores[i]: correct.append(1) elif int(a)==0: correct.append(0) diff --git a/common/lib/xmodule/xmodule/open_ended_grading_classes/grading_service_module.py b/common/lib/xmodule/xmodule/open_ended_grading_classes/grading_service_module.py index 6857876703..fcbe9e5ad1 100644 --- a/common/lib/xmodule/xmodule/open_ended_grading_classes/grading_service_module.py +++ b/common/lib/xmodule/xmodule/open_ended_grading_classes/grading_service_module.py @@ -62,7 +62,6 @@ class GradingService(object): """ Make a get request to the grading controller """ - log.debug(params) op = lambda: self.session.get(url, allow_redirects=allow_redirects, params=params) diff --git a/common/lib/xmodule/xmodule/peer_grading_module.py b/common/lib/xmodule/xmodule/peer_grading_module.py index d60f448d3b..bbfc444cdc 100644 --- a/common/lib/xmodule/xmodule/peer_grading_module.py +++ b/common/lib/xmodule/xmodule/peer_grading_module.py @@ -227,7 +227,7 @@ class PeerGradingModule(PeerGradingFields, XModule): count_graded = self.student_data_for_location['count_graded'] count_required = self.student_data_for_location['count_required'] except: - success, response = self.query_data_for_location() + success, response = self.query_data_for_location(self.location) if not success: log.exception( "No instance data found and could not get data from controller for loc {0} student {1}".format( @@ -311,7 +311,7 @@ class PeerGradingModule(PeerGradingFields, XModule): """ required = ['location', 'submission_id', 'submission_key', 'score', 'feedback', 'submission_flagged', 'answer_unknown'] - if 'submission_flagged' not in data or data['submission_flagged'] in ["false", False, "False"]: + if data.get("submission_flagged", False) in ["false", False, "False", "FALSE"]: required.append("rubric_scores[]") success, message = self._check_required(data, set(required)) if not success: @@ -325,6 +325,8 @@ class PeerGradingModule(PeerGradingFields, XModule): try: response = self.peer_gs.save_grade(**data_dict) success, location_data = self.query_data_for_location(data_dict['location']) + #Don't check for success above because the response = statement will raise the same Exception as the one + #that will cause success to be false. response.update({'required_done' : False}) if 'count_graded' in location_data and 'count_required' in location_data and int(location_data['count_graded'])>=int(location_data['count_required']): response['required_done'] = True @@ -507,7 +509,7 @@ class PeerGradingModule(PeerGradingFields, XModule): error_text = "Could not get list of problems to peer grade. Please notify course staff." log.error(error_text) success = False - except: + except Exception: log.exception("Could not contact peer grading service.") success = False @@ -518,7 +520,7 @@ class PeerGradingModule(PeerGradingFields, XModule): ''' try: return modulestore().get_instance(self.system.course_id, location) - except: + except Exception: # the linked problem doesn't exist log.error("Problem {0} does not exist in this course".format(location)) raise @@ -528,14 +530,14 @@ class PeerGradingModule(PeerGradingFields, XModule): problem_location = problem['location'] try: descriptor = _find_corresponding_module_for_location(problem_location) - except: + except Exception: continue if descriptor: problem['due'] = descriptor.lms.due grace_period = descriptor.lms.graceperiod try: problem_timeinfo = TimeInfo(problem['due'], grace_period) - except: + except Exception: log.error("Malformed due date or grace period string for location {0}".format(problem_location)) raise if self._closed(problem_timeinfo): diff --git a/common/lib/xmodule/xmodule/tests/test_combined_open_ended.py b/common/lib/xmodule/xmodule/tests/test_combined_open_ended.py index 83f6dc6833..38d976370a 100644 --- a/common/lib/xmodule/xmodule/tests/test_combined_open_ended.py +++ b/common/lib/xmodule/xmodule/tests/test_combined_open_ended.py @@ -73,6 +73,7 @@ class OpenEndedChildTest(unittest.TestCase): def setUp(self): self.test_system = get_test_system() + self.test_system.open_ended_grading_interface = None self.openendedchild = OpenEndedChild(self.test_system, self.location, self.definition, self.descriptor, self.static_data, self.metadata) @@ -203,7 +204,7 @@ class OpenEndedModuleTest(unittest.TestCase): def setUp(self): self.test_system = get_test_system() - + self.test_system.open_ended_grading_interface = None self.test_system.location = self.location self.mock_xqueue = MagicMock() self.mock_xqueue.send_to_queue.return_value = (None, "Message") @@ -378,6 +379,7 @@ class CombinedOpenEndedModuleTest(unittest.TestCase): full_definition = definition_template.format(prompt=prompt, rubric=rubric, task1=task_xml1, task2=task_xml2) descriptor = Mock(data=full_definition) test_system = get_test_system() + test_system.open_ended_grading_interface = None combinedoe_container = CombinedOpenEndedModule( test_system, descriptor, @@ -504,6 +506,7 @@ class OpenEndedModuleXmlTest(unittest.TestCase, DummyModulestore): def setUp(self): self.test_system = get_test_system() + self.test_system.open_ended_grading_interface = None self.test_system.xqueue['interface'] = Mock( send_to_queue=Mock(side_effect=[1, "queued"]) ) @@ -537,9 +540,9 @@ class OpenEndedModuleXmlTest(unittest.TestCase, DummyModulestore): module = self.get_module_from_location(self.problem_location, COURSE) #Simulate a student saving an answer - module.handle_ajax("save_answer", {"student_answer": self.answer}) - status = module.handle_ajax("get_status", {}) - self.assertTrue(isinstance(status, basestring)) + html = module.handle_ajax("get_html", {}) + module.handle_ajax("save_answer", {"student_answer": self.answer, "can_upload_files" : False, "student_file" : None}) + html = module.handle_ajax("get_html", {}) #Mock a student submitting an assessment assessment_dict = MockQueryDict() @@ -547,8 +550,7 @@ class OpenEndedModuleXmlTest(unittest.TestCase, DummyModulestore): module.handle_ajax("save_assessment", assessment_dict) task_one_json = json.loads(module.task_states[0]) self.assertEqual(json.loads(task_one_json['child_history'][0]['post_assessment']), assessment) - status = module.handle_ajax("get_status", {}) - self.assertTrue(isinstance(status, basestring)) + rubric = module.handle_ajax("get_combined_rubric", {}) #Move to the next step in the problem module.handle_ajax("next_problem", {}) @@ -585,7 +587,6 @@ class OpenEndedModuleXmlTest(unittest.TestCase, DummyModulestore): module.handle_ajax("save_assessment", assessment_dict) task_one_json = json.loads(module.task_states[0]) self.assertEqual(json.loads(task_one_json['child_history'][0]['post_assessment']), assessment) - module.handle_ajax("get_status", {}) #Move to the next step in the problem try: @@ -628,12 +629,8 @@ class OpenEndedModuleXmlTest(unittest.TestCase, DummyModulestore): #Get html and other data client will request module.get_html() - legend = module.handle_ajax("get_legend", {}) - self.assertTrue(isinstance(legend, basestring)) - module.handle_ajax("get_status", {}) module.handle_ajax("skip_post_assessment", {}) - self.assertTrue(isinstance(legend, basestring)) #Get all results module.handle_ajax("get_combined_rubric", {}) @@ -654,6 +651,7 @@ class OpenEndedModuleXmlAttemptTest(unittest.TestCase, DummyModulestore): def setUp(self): self.test_system = get_test_system() + self.test_system.open_ended_grading_interface = None self.test_system.xqueue['interface'] = Mock( send_to_queue=Mock(side_effect=[1, "queued"]) ) @@ -670,8 +668,6 @@ class OpenEndedModuleXmlAttemptTest(unittest.TestCase, DummyModulestore): #Simulate a student saving an answer module.handle_ajax("save_answer", {"student_answer": self.answer}) - status = module.handle_ajax("get_status", {}) - self.assertTrue(isinstance(status, basestring)) #Mock a student submitting an assessment assessment_dict = MockQueryDict() @@ -679,8 +675,6 @@ class OpenEndedModuleXmlAttemptTest(unittest.TestCase, DummyModulestore): module.handle_ajax("save_assessment", assessment_dict) task_one_json = json.loads(module.task_states[0]) self.assertEqual(json.loads(task_one_json['child_history'][0]['post_assessment']), assessment) - status = module.handle_ajax("get_status", {}) - self.assertTrue(isinstance(status, basestring)) #Move to the next step in the problem module.handle_ajax("next_problem", {}) diff --git a/common/lib/xmodule/xmodule/tests/test_peer_grading.py b/common/lib/xmodule/xmodule/tests/test_peer_grading.py index fcdb0bb1ac..240fef4e87 100644 --- a/common/lib/xmodule/xmodule/tests/test_peer_grading.py +++ b/common/lib/xmodule/xmodule/tests/test_peer_grading.py @@ -61,7 +61,7 @@ class PeerGradingModuleTest(unittest.TestCase, DummyModulestore): Try getting data from the external grading service @return: """ - success, data = self.peer_grading.query_data_for_location() + success, data = self.peer_grading.query_data_for_location(self.problem_location.url()) self.assertEqual(success, True) def test_get_score(self): From a06801432eaf58b8196634546206595a1b5caae9 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 22 Aug 2013 14:12:12 -0400 Subject: [PATCH 74/75] Fix staff grading test --- .../coffee/src/staff_grading/staff_grading.coffee | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lms/static/coffee/src/staff_grading/staff_grading.coffee b/lms/static/coffee/src/staff_grading/staff_grading.coffee index 31c084ffd0..ef76bb31f7 100644 --- a/lms/static/coffee/src/staff_grading/staff_grading.coffee +++ b/lms/static/coffee/src/staff_grading/staff_grading.coffee @@ -476,9 +476,13 @@ class @StaffGrading @question_header.text(new_text) scroll_to_top: () => - $('html, body').animate({ - scrollTop: $(".staff-grading").offset().top - }, 200) + #This try/catch is needed because jasmine fails with it + try + $('html, body').animate({ + scrollTop: $(".staff-grading").offset().top + }, 200) + catch error + console.log("Scrolling error.") From 21e13e44af24e096c1afb0909fdb4ff46f71c656 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 22 Aug 2013 14:29:39 -0400 Subject: [PATCH 75/75] Pep8 and pylint fixes --- .../xmodule/combined_open_ended_module.py | 12 +++++----- .../combined_open_ended_modulev1.py | 22 ++++++++++++++----- .../combined_open_ended_rubric.py | 6 ++--- .../grading_service_module.py | 3 +++ .../openendedchild.py | 4 ++-- 5 files changed, 30 insertions(+), 17 deletions(-) diff --git a/common/lib/xmodule/xmodule/combined_open_ended_module.py b/common/lib/xmodule/xmodule/combined_open_ended_module.py index 62f537b1e9..f7960b13b1 100644 --- a/common/lib/xmodule/xmodule/combined_open_ended_module.py +++ b/common/lib/xmodule/xmodule/combined_open_ended_module.py @@ -213,7 +213,7 @@ class CombinedOpenEndedFields(object): help="The number of times the student can try to answer this problem.", default=1, scope=Scope.settings, - values={"min" : 1 } + values={"min": 1 } ) accept_file_upload = Boolean( display_name="Allow File Uploads", @@ -242,7 +242,7 @@ class CombinedOpenEndedFields(object): display_name="Problem Weight", help="Defines the number of points each problem is worth. If the value is not set, each problem is worth one point.", scope=Scope.settings, - values={"min" : 0 , "step": ".1"}, + values={"min": 0, "step": ".1"}, default=1 ) min_to_calibrate = Integer( @@ -250,28 +250,28 @@ class CombinedOpenEndedFields(object): help="The minimum number of calibration essays each student will need to complete for peer grading.", default=3, scope=Scope.settings, - values={"min" : 1, "max" : 20, "step" : "1"} + values={"min": 1, "max": 20, "step": "1"} ) max_to_calibrate = Integer( display_name="Maximum Peer Grading Calibrations", help="The maximum number of calibration essays each student will need to complete for peer grading.", default=6, scope=Scope.settings, - values={"min" : 1, "max" : 20, "step" : "1"} + values={"min": 1, "max": 20, "step": "1"} ) peer_grader_count = Integer( display_name="Peer Graders per Response", help="The number of peers who will grade each submission.", default=3, scope=Scope.settings, - values={"min" : 1, "step" : "1", "max" : 5} + values={"min": 1, "step": "1", "max": 5} ) required_peer_grading = Integer( display_name="Required Peer Grading", help="The number of other students each student making a submission will have to grade.", default=3, scope=Scope.settings, - values={"min" : 1, "step" : "1", "max" : 5} + values={"min": 1, "step": "1", "max": 5} ) markdown = String( help="Markdown source of this module", 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 8c90983d3c..c215df2d66 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 @@ -351,7 +351,12 @@ class CombinedOpenEndedV1Module(): return self.current_task.get_html(self.system) def get_html_ajax(self, data): - return {'html' : self.get_html()} + """ + Get HTML in AJAX callback + data - Needed to preserve AJAX structure + Output: Dictionary with html attribute + """ + return {'html': self.get_html()} def get_current_attributes(self, task_number): """ @@ -643,7 +648,12 @@ class CombinedOpenEndedV1Module(): def get_current_state(self, data): return self.get_context() - def get_last_response_ajax(self,data): + def get_last_response_ajax(self, data): + """ + Get the last response via ajax callback + data - Needed to preserve ajax callback structure + Output: Last response dictionary + """ return self.get_last_response(self.current_task_number) def next_problem(self, _data): @@ -666,10 +676,10 @@ class CombinedOpenEndedV1Module(): return self.out_of_sync_error(data) success, can_reset, error = self.check_if_student_has_done_needed_grading() if not can_reset: - return {'error' : error, 'success' : False} - if self.student_attempts >= self.max_attempts-1: - if self.student_attempts==self.max_attempts-1: - self.student_attempts +=1 + return {'error': error, 'success': False} + if self.student_attempts >= self.max_attempts - 1: + if self.student_attempts == self.max_attempts - 1: + self.student_attempts += 1 return { 'success': False, # This is a student_facing_error diff --git a/common/lib/xmodule/xmodule/open_ended_grading_classes/combined_open_ended_rubric.py b/common/lib/xmodule/xmodule/open_ended_grading_classes/combined_open_ended_rubric.py index a72fd07438..1b8d84754a 100644 --- a/common/lib/xmodule/xmodule/open_ended_grading_classes/combined_open_ended_rubric.py +++ b/common/lib/xmodule/xmodule/open_ended_grading_classes/combined_open_ended_rubric.py @@ -214,7 +214,7 @@ class CombinedOpenEndedRubric(object): #Get the highest possible score across all categories max_score = max(max_scores) #Loop through each category - for i,category in enumerate(rubric_categories): + for i, category in enumerate(rubric_categories): #Loop through each option in the category for j in xrange(len(category['options'])): #Intialize empty grader types list @@ -234,10 +234,10 @@ class CombinedOpenEndedRubric(object): #If a list in the list of lists for this position exists, append to it actual_scores[i] += [j] - actual_scores = [sum(i)/len(i) for i in actual_scores] + actual_scores = [sum(i) / len(i) for i in actual_scores] correct = [] #Define if the student is "correct" (1) "incorrect" (0) or "partially correct" (.5) - for (i,a) in enumerate(actual_scores): + for (i, a) in enumerate(actual_scores): if int(a) == max_scores[i]: correct.append(1) elif int(a)==0: diff --git a/common/lib/xmodule/xmodule/open_ended_grading_classes/grading_service_module.py b/common/lib/xmodule/xmodule/open_ended_grading_classes/grading_service_module.py index fcbe9e5ad1..4c6a79a5f1 100644 --- a/common/lib/xmodule/xmodule/open_ended_grading_classes/grading_service_module.py +++ b/common/lib/xmodule/xmodule/open_ended_grading_classes/grading_service_module.py @@ -11,6 +11,9 @@ log = logging.getLogger(__name__) class GradingServiceError(Exception): + """ + Exception for grading service. Shown when Open Response Assessment servers cannot be reached. + """ pass diff --git a/common/lib/xmodule/xmodule/open_ended_grading_classes/openendedchild.py b/common/lib/xmodule/xmodule/open_ended_grading_classes/openendedchild.py index d99e466886..2f8d4fa866 100644 --- a/common/lib/xmodule/xmodule/open_ended_grading_classes/openendedchild.py +++ b/common/lib/xmodule/xmodule/open_ended_grading_classes/openendedchild.py @@ -333,7 +333,7 @@ class OpenEndedChild(object): try: image_data.seek(0) image_ok = open_ended_image_submission.run_image_tests(image_data) - except: + except Exception: log.exception("Could not create image and check it.") if image_ok: @@ -346,7 +346,7 @@ class OpenEndedChild(object): success, s3_public_url = open_ended_image_submission.upload_to_s3( image_data, image_key, self.s3_interface ) - except: + except Exception: log.exception("Could not upload image to S3.") return success, image_ok, s3_public_url