From 02ac72d0afca6e0798ded6623754e56d263ea3bd Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Wed, 6 Feb 2013 13:49:59 -0500 Subject: [PATCH 01/79] Doing some restyling on peer grading --- lms/static/sass/course/_staff_grading.scss | 48 ++++++++++--------- .../peer_grading/peer_grading_problem.html | 15 +----- 2 files changed, 26 insertions(+), 37 deletions(-) diff --git a/lms/static/sass/course/_staff_grading.scss b/lms/static/sass/course/_staff_grading.scss index e3de7c8eab..0bbde2cdf9 100644 --- a/lms/static/sass/course/_staff_grading.scss +++ b/lms/static/sass/course/_staff_grading.scss @@ -2,16 +2,20 @@ div.staff-grading, div.peer-grading{ textarea.feedback-area { height: 75px; - margin: 20px; + margin: 0px; + } + + h1 { + margin : 0 0 0 10px; } div { - margin: 10px; + margin: 0px; } label { - margin: 10px; - padding: 5px; + margin: 0px; + padding: 2px; display: inline-block; min-width: 50px; background-color: #CCC; @@ -36,11 +40,11 @@ div.peer-grading{ width:100%; th { - padding: 10px; + padding: 2px; } td { - padding:10px; + padding:2px; } td.problem-name { @@ -59,31 +63,30 @@ div.peer-grading{ .calibration-feedback-wrapper, .grading-container { - border: 1px solid gray; - padding: 15px; + padding: 2px; } .error-container { background-color: #FFCCCC; - padding: 15px; + padding: 2px; margin-left: 0px; } .submission-wrapper { h3 { - margin-bottom: 15px; + margin-bottom: 2px; } p { - margin-left:10px; + margin-left:2px; } - padding: 15px; + padding: 2px; } .meta-info-wrapper { background-color: #eee; - padding:15px; + padding:2px; h3 { font-size:1em; @@ -94,7 +97,7 @@ div.peer-grading{ font-size: .85em; li { - margin: 5px 0px; + margin: 1px 0px; } } } @@ -102,28 +105,27 @@ div.peer-grading{ .grading-message { background-color: $yellow; - padding: 10px; + padding: 2px; margin-left:0px; } .breadcrumbs { - margin-top:20px; + margin-top:2px; margin-left:0px; - margin-bottom:5px; + margin-bottom:2px; font-size: .8em; } .instructions-panel { - margin-right:20px; + margin-right:2px; > div { padding: 2px; - margin: 0px; + margin-bottom: 5px; background: #eee; - height: 10em; width:47.6%; h3 { @@ -161,8 +163,8 @@ div.peer-grading{ margin-left: 0px; header { - margin-top:20px; - margin-bottom:20px; + margin-top:2px; + margin-bottom:2px; font-size: 1.2em; } } @@ -175,7 +177,7 @@ div.peer-grading{ margin-top: 20px; } } - padding: 40px; + padding: 5px; .rubric { tr { margin:10px 0px; diff --git a/lms/templates/peer_grading/peer_grading_problem.html b/lms/templates/peer_grading/peer_grading_problem.html index 007fd42c8d..ecacd59218 100644 --- a/lms/templates/peer_grading/peer_grading_problem.html +++ b/lms/templates/peer_grading/peer_grading_problem.html @@ -3,25 +3,12 @@
-

Peer Grading

Learning to Grade

-
-

Before you can do any proper peer grading, you first need to understand how your own grading compares to that of the instrutor. Once your grades begin to match the instructor's, you will move on to grading your peers!

-
-
-

You have successfully managed to calibrate your answers to that of the instructors and have moved onto the next step in the peer grading process.

-
-

Grading

-
-

You cannot start grading until you have graded a sufficient number of training problems and have been able to demonstrate that your scores closely match that of the instructor.

-
-
-

Now that you have finished your training, you are now allowed to grade your peers. Please keep in mind that students are allowed to respond to the grades and feedback they receive.

-
+

Peer Grading

From 9e4e98ef74d4c14dc472c121ea4a174b7311efe0 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Wed, 6 Feb 2013 15:13:56 -0500 Subject: [PATCH 02/79] Fix some css to get things to properly close/open --- .../js/src/peergrading/peer_grading_problem.coffee | 13 +++++++++++++ lms/static/sass/course/_staff_grading.scss | 6 ++++++ .../peer_grading/peer_grading_problem.html | 4 ++-- 3 files changed, 21 insertions(+), 2 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 ee98905cda..9cd1a1cf1b 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 @@ -179,6 +179,9 @@ class @PeerGradingProblem @grading_panel = $('.grading-panel') @content_panel = $('.content-panel') @grading_message = $('.grading-message') + @question_header = $('.question-header') + @question_header + @question_header.click @collapse_question @grading_message.hide() @grading_wrapper =$('.grading-wrapper') @@ -280,6 +283,7 @@ class @PeerGradingProblem if response.calibrated and (@calibration == null or @calibration == false) @calibration = false @fetch_submission_essay() + @collapse_question() # If we were calibrating before and no longer need to, # show the interstitial page else if response.calibrated and @calibration == true @@ -469,6 +473,15 @@ class @PeerGradingProblem $("input[name='score-selection']").change @graded_callback $("input[name='grade-selection']").change @graded_callback + collapse_question: () => + @prompt_container.slideToggle() + @prompt_container.toggleClass('open') + if @question_header.text() == "(Hide)" + new_text = "(Show)" + else + new_text = "(Hide)" + @question_header.text(new_text) + #mock_backend = false #ajax_url = $('.peer-grading').data('ajax_url') #backend = new PeerGradingProblemBackend(ajax_url, mock_backend) diff --git a/lms/static/sass/course/_staff_grading.scss b/lms/static/sass/course/_staff_grading.scss index 0bbde2cdf9..7c8219c7bd 100644 --- a/lms/static/sass/course/_staff_grading.scss +++ b/lms/static/sass/course/_staff_grading.scss @@ -9,6 +9,12 @@ div.peer-grading{ margin : 0 0 0 10px; } + h2{ + a{ + text-size: .5em; + } + } + div { margin: 0px; } diff --git a/lms/templates/peer_grading/peer_grading_problem.html b/lms/templates/peer_grading/peer_grading_problem.html index ecacd59218..e3d713e7e4 100644 --- a/lms/templates/peer_grading/peer_grading_problem.html +++ b/lms/templates/peer_grading/peer_grading_problem.html @@ -13,7 +13,7 @@
-

Question

+

Question (Hide)

@@ -21,7 +21,7 @@
-
+
From 8bc98b2ff891cec22a87f1c0a52da14cb0509bb9 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Wed, 6 Feb 2013 16:32:16 -0500 Subject: [PATCH 03/79] Fix sass --- lms/static/sass/course/_staff_grading.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lms/static/sass/course/_staff_grading.scss b/lms/static/sass/course/_staff_grading.scss index 81622cc195..5c71d0fb62 100644 --- a/lms/static/sass/course/_staff_grading.scss +++ b/lms/static/sass/course/_staff_grading.scss @@ -10,7 +10,8 @@ div.peer-grading{ } h2{ - a{ + a + { text-size: .5em; } } @@ -22,7 +23,6 @@ div.peer-grading{ label { margin: 0px; padding: 2px; - @include: inline-block; min-width: 50px; background-color: #CCC; text-size: 1.5em; From 28a0e441204dea73c01e416ba019c513d3bef57c Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Wed, 6 Feb 2013 16:57:10 -0500 Subject: [PATCH 04/79] Quick rubric restyle --- lms/static/sass/course/_rubric.scss | 18 +++++----- lms/templates/open_ended_rubric.html | 52 ++++++++++++---------------- 2 files changed, 31 insertions(+), 39 deletions(-) diff --git a/lms/static/sass/course/_rubric.scss b/lms/static/sass/course/_rubric.scss index 5048d70253..a864fc2869 100644 --- a/lms/static/sass/course/_rubric.scss +++ b/lms/static/sass/course/_rubric.scss @@ -1,11 +1,10 @@ .rubric { - margin: 40px 0px; + margin: 0px 0px; tr { - margin:10px 0px; + margin:0px 0px; height: 100%; } td { - padding: 20px 0px 25px 0px; height: 100%; border: 1px black solid; text-align: center; @@ -21,10 +20,6 @@ .rubric-label { position: relative; - padding: 0px 15px 15px 15px; - width: 130px; - min-height: 50px; - min-width: 50px; font-size: .9em; background-color: white; display: block; @@ -33,7 +28,6 @@ position: absolute; bottom:0px; right:0px; - margin:10px; } .selected-grade, .selected-grade .rubric-label { @@ -42,10 +36,14 @@ } input[type=radio]:checked + .rubric-label { background: white; - color: $base-font-color; } + color: $base-font-color; + white-space:nowrap; + } + .wrappable { + white-space:normal; + } input[class='score-selection'] { position: relative; - margin-left: 10px; font-size: 16px; } } diff --git a/lms/templates/open_ended_rubric.html b/lms/templates/open_ended_rubric.html index eb3fc564b4..25f98102e6 100644 --- a/lms/templates/open_ended_rubric.html +++ b/lms/templates/open_ended_rubric.html @@ -1,4 +1,4 @@ -
+

Rubric

% if view_only and has_score:

This is the rubric that was used to grade your submission. The highlighted selection matches how the grader feels you performed in each category.

@@ -7,38 +7,32 @@ % else:

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

% endif - - - - % for i in range(max_score + 1): - - % endfor - +
% for i in range(len(categories)): - <% category = categories[i] %> -
- - % for j in range(len(category['options'])): + <% category = categories[i] %> + ${category['description']}
+
    + % for j in range(len(category['options'])): <% option = category['options'][j] %> - %if option['selected']: -
- % endfor - + + % else: + + % endif + + % endfor + % endfor
- ${i} points -
${category['description']} - %else: - - % endif - % if view_only: + %if option['selected']: +
  • + %else: +
  • + % endif + % if view_only: ## if this is the selected rubric block, show it highlighted -
    +
    ${option['text']} -
    - % else: - - - % endif -
  • From 83608fd983d9396ff729e8d084833ba82ba587e5 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Wed, 6 Feb 2013 16:58:59 -0500 Subject: [PATCH 05/79] Restyle lists --- lms/static/sass/course/_rubric.scss | 6 ++++++ lms/templates/open_ended_rubric.html | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lms/static/sass/course/_rubric.scss b/lms/static/sass/course/_rubric.scss index a864fc2869..43dd88b626 100644 --- a/lms/static/sass/course/_rubric.scss +++ b/lms/static/sass/course/_rubric.scss @@ -46,5 +46,11 @@ position: relative; font-size: 16px; } + + ul + { + list-style-type: none; + } + } diff --git a/lms/templates/open_ended_rubric.html b/lms/templates/open_ended_rubric.html index 25f98102e6..3ce848cf8d 100644 --- a/lms/templates/open_ended_rubric.html +++ b/lms/templates/open_ended_rubric.html @@ -27,7 +27,7 @@ % else: % endif From 6a6962df9e13df7fe26402cc87dccb0cec9845c5 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 7 Feb 2013 09:26:27 -0500 Subject: [PATCH 06/79] Alter rubric list, restyle rubric --- .../lib/xmodule/xmodule/css/combinedopenended/display.scss | 7 +++++++ .../xmodule/js/src/peergrading/peer_grading_problem.coffee | 2 +- lms/static/sass/course/_rubric.scss | 6 +++--- lms/templates/open_ended_rubric.html | 4 ++-- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss index 8d921f828b..9d4cbc6647 100644 --- a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss +++ b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss @@ -478,6 +478,13 @@ section.open-ended-child { margin-left: .75rem; } + ul.rubric-list + { + list-style-type: none; + padding:0; + margin:0; + } + ol { list-style: decimal outside none; margin-bottom: lh(); 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 9cd1a1cf1b..7dc410b19c 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 @@ -239,7 +239,7 @@ class @PeerGradingProblem # finds the scores for each rubric category get_score_list: () => # find the number of categories: - num_categories = $('table.rubric tr').length + num_categories = $('ul.rubric-list li').length score_lst = [] # get the score for each one diff --git a/lms/static/sass/course/_rubric.scss b/lms/static/sass/course/_rubric.scss index 43dd88b626..92a8b0c574 100644 --- a/lms/static/sass/course/_rubric.scss +++ b/lms/static/sass/course/_rubric.scss @@ -46,11 +46,11 @@ position: relative; font-size: 16px; } - - ul + ul.rubric-list { list-style-type: none; + padding:0; + margin:0; } - } diff --git a/lms/templates/open_ended_rubric.html b/lms/templates/open_ended_rubric.html index 3ce848cf8d..8d7f6be544 100644 --- a/lms/templates/open_ended_rubric.html +++ b/lms/templates/open_ended_rubric.html @@ -11,7 +11,7 @@ % for i in range(len(categories)): <% category = categories[i] %> ${category['description']}
    -
      +
        % for j in range(len(category['options'])): <% option = category['options'][j] %> %if option['selected']: @@ -27,7 +27,7 @@ % else: % endif From 9a5a988116ae2da868dcfd53c4c4a3912b3a0166 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 7 Feb 2013 09:29:24 -0500 Subject: [PATCH 07/79] Revert peer grading problem to master version --- .../peergrading/peer_grading_problem.coffee | 69 +++---------------- 1 file changed, 8 insertions(+), 61 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 7dc410b19c..deeb82900b 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 @@ -179,9 +179,6 @@ class @PeerGradingProblem @grading_panel = $('.grading-panel') @content_panel = $('.content-panel') @grading_message = $('.grading-message') - @question_header = $('.question-header') - @question_header - @question_header.click @collapse_question @grading_message.hide() @grading_wrapper =$('.grading-wrapper') @@ -236,23 +233,11 @@ class @PeerGradingProblem fetch_submission_essay: () => @backend.post('get_next_submission', {location: @location}, @render_submission) - # finds the scores for each rubric category - get_score_list: () => - # find the number of categories: - num_categories = $('ul.rubric-list li').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_lst.push(score) - - return score_lst construct_data: () -> data = - rubric_scores: @get_score_list() - score: @grade + rubric_scores: Rubric.get_score_list() + score: Rubric.get_total_score() location: @location submission_id: @essay_id_input.val() submission_key: @submission_key_input.val() @@ -283,7 +268,6 @@ class @PeerGradingProblem if response.calibrated and (@calibration == null or @calibration == false) @calibration = false @fetch_submission_essay() - @collapse_question() # If we were calibrating before and no longer need to, # show the interstitial page else if response.calibrated and @calibration == true @@ -321,17 +305,11 @@ class @PeerGradingProblem # called after a grade is selected on the interface graded_callback: (event) => - @grade = $("input[name='grade-selection']:checked").val() - if @grade == undefined - return # check to see whether or not any categories have not been scored - num_categories = $('table.rubric tr').length - for i in [0..(num_categories-1)] - score = $("input[name='score-selection-#{i}']:checked").val() - if score == undefined - return - # show button if we have scores for all categories - @show_submit_button() + if Rubric.check_complete() + # show button if we have scores for all categories + @show_submit_button() + @grade = Rubric.get_total_score() @@ -405,6 +383,7 @@ class @PeerGradingProblem # render common information between calibration and grading render_submission_data: (response) => @content_panel.show() + @error_container.hide() @submission_container.append(@make_paragraphs(response.student_response)) @prompt_container.html(response.prompt) @@ -452,37 +431,5 @@ class @PeerGradingProblem @submit_button.show() setup_score_selection: (max_score) => - - # first, get rid of all the old inputs, if any. - @score_selection_container.html(""" -

        Overall Score

        -

        Choose an overall score for this submission.

        - """) - - # Now create new labels and inputs for each possible score. - for score in [0..max_score] - id = 'score-' + score - label = """""" - - input = """ - - """ # " fix broken parsing in emacs - @score_selection_container.append(input + label) - # And now hook up an event handler again - $("input[name='score-selection']").change @graded_callback - $("input[name='grade-selection']").change @graded_callback - - collapse_question: () => - @prompt_container.slideToggle() - @prompt_container.toggleClass('open') - if @question_header.text() == "(Hide)" - new_text = "(Show)" - else - new_text = "(Hide)" - @question_header.text(new_text) - -#mock_backend = false -#ajax_url = $('.peer-grading').data('ajax_url') -#backend = new PeerGradingProblemBackend(ajax_url, mock_backend) -#$(document).ready(() -> new PeerGradingProblem(backend)) + $("input[class='score-selection']").change @graded_callback From 03a6572bbe4e4772d1828167c93342802f4b76e2 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 7 Feb 2013 09:49:56 -0500 Subject: [PATCH 08/79] Restyle status, get rubric to work properly --- .../xmodule/css/combinedopenended/display.scss | 15 ++++++--------- .../js/src/combinedopenended/display.coffee | 11 +++++------ lms/templates/combined_open_ended_status.html | 5 +---- lms/templates/open_ended_rubric.html | 2 +- 4 files changed, 13 insertions(+), 20 deletions(-) diff --git a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss index 9d4cbc6647..3ffe62213e 100644 --- a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss +++ b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss @@ -24,14 +24,11 @@ section.combined-open-ended { @include clearfix; .status-container { - float:right; - width:40%; + padding-bottom: 5px; } .item-container { - float:left; - width: 53%; - padding-bottom: 50px; + padding-bottom: 10px; } .result-container @@ -49,11 +46,11 @@ section.combined-open-ended { section.combined-open-ended-status { .statusitem { - background-color: #FAFAFA; color: #2C2C2C; - font-family: monospace; - font-size: 1em; - padding: 10px; + font-size: .8em; + padding: 0px; + display: block; + width: 55%; .show-results { margin-top: .3em; text-align:right; diff --git a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee index ae63171ed4..42f1378dd8 100644 --- a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee @@ -4,11 +4,11 @@ class @Rubric # finds the scores for each rubric category @get_score_list: () => # find the number of categories: - num_categories = $('table.rubric tr').length + num_categories = $('b.rubric-category').length score_lst = [] # get the score for each one - for i in [0..(num_categories-2)] + for i in [0..(num_categories-1)] score = $("input[name='score-selection-#{i}']:checked").val() score_lst.push(score) @@ -23,9 +23,8 @@ class @Rubric @check_complete: () -> # check to see whether or not any categories have not been scored - num_categories = $('table.rubric tr').length - # -2 because we want to skip the header - for i in [0..(num_categories-2)] + num_categories = $('b.rubric-category').length + for i in [0..(num_categories-1)] score = $("input[name='score-selection-#{i}']:checked").val() if score == undefined return false @@ -102,7 +101,7 @@ class @CombinedOpenEnded Collapsible.setCollapsibles(@results_container) show_results: (event) => - status_item = $(event.target).parent().parent() + status_item = $(event.target).parent() status_number = status_item.data('status-number') data = {'task_number' : status_number} $.postWithPrefix "#{@ajax_url}/get_results", data, (response) => diff --git a/lms/templates/combined_open_ended_status.html b/lms/templates/combined_open_ended_status.html index 1640ae3311..0ed1609b9f 100644 --- a/lms/templates/combined_open_ended_status.html +++ b/lms/templates/combined_open_ended_status.html @@ -22,10 +22,7 @@ % endif %if status['type']=="openended" and status['state'] in ['done', 'post_assessment']: - + Show results %endif %endfor diff --git a/lms/templates/open_ended_rubric.html b/lms/templates/open_ended_rubric.html index 8d7f6be544..36c6638323 100644 --- a/lms/templates/open_ended_rubric.html +++ b/lms/templates/open_ended_rubric.html @@ -10,7 +10,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 de8e1e94726ee25bfe41229e8f4dc3b43ffaa73a Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 7 Feb 2013 09:57:41 -0500 Subject: [PATCH 09/79] Change around some names, restyle rubric --- .../lib/xmodule/xmodule/combined_open_ended_modulev1.py | 2 +- .../xmodule/xmodule/css/combinedopenended/display.scss | 4 ++-- common/lib/xmodule/xmodule/openendedchild.py | 8 ++++---- lms/templates/combined_open_ended.html | 2 +- lms/templates/combined_open_ended_status.html | 2 +- lms/templates/open_ended_rubric.html | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py b/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py index 8bd7df86c1..08f7abcf6b 100644 --- a/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py +++ b/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py @@ -55,7 +55,7 @@ TRUE_DICT = ["True", True, "TRUE", "true"] HUMAN_TASK_TYPE = { 'selfassessment' : "Self Assessment", - 'openended' : "External Grader", + 'openended' : "edX Assessment", } class CombinedOpenEndedV1Module(): diff --git a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss index 3ffe62213e..232eadfc40 100644 --- a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss +++ b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss @@ -47,10 +47,10 @@ section.combined-open-ended-status { .statusitem { color: #2C2C2C; - font-size: .8em; + font-size: 1em; padding: 0px; display: block; - width: 55%; + width: 70%; .show-results { margin-top: .3em; text-align:right; diff --git a/common/lib/xmodule/xmodule/openendedchild.py b/common/lib/xmodule/xmodule/openendedchild.py index ba2de5c930..e5b17503c3 100644 --- a/common/lib/xmodule/xmodule/openendedchild.py +++ b/common/lib/xmodule/xmodule/openendedchild.py @@ -68,10 +68,10 @@ class OpenEndedChild(object): #This is used to tell students where they are at in the module HUMAN_NAMES = { - 'initial': 'Started', - 'assessing': 'Being scored', - 'post_assessment': 'Scoring finished', - 'done': 'Problem complete', + 'initial': 'Not started', + 'assessing': 'In progress', + 'post_assessment': 'In progress', + 'done': 'Done', } def __init__(self, system, location, definition, descriptor, static_data, diff --git a/lms/templates/combined_open_ended.html b/lms/templates/combined_open_ended.html index 4599feaa3b..34cc007431 100644 --- a/lms/templates/combined_open_ended.html +++ b/lms/templates/combined_open_ended.html @@ -2,7 +2,7 @@

          ${display_name}

          - ${status | n} + ${status | n}
          diff --git a/lms/templates/combined_open_ended_status.html b/lms/templates/combined_open_ended_status.html index 0ed1609b9f..bc552c0d76 100644 --- a/lms/templates/combined_open_ended_status.html +++ b/lms/templates/combined_open_ended_status.html @@ -22,7 +22,7 @@ % endif %if status['type']=="openended" and status['state'] in ['done', 'post_assessment']: - Show results + Show results %endif
          %endfor diff --git a/lms/templates/open_ended_rubric.html b/lms/templates/open_ended_rubric.html index 36c6638323..c340da3af7 100644 --- a/lms/templates/open_ended_rubric.html +++ b/lms/templates/open_ended_rubric.html @@ -22,7 +22,7 @@ % if view_only: ## if this is the selected rubric block, show it highlighted
          - ${option['text']} + ${option['points']} points : ${option['text']}
          % else:
        % endfor - +
        From aa699905d610208530c6fa5314a2fde3bd8f8cf8 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 7 Feb 2013 10:32:39 -0500 Subject: [PATCH 12/79] Feedback and view only rubric restyle --- lms/templates/open_ended_feedback.html | 8 +++++--- lms/templates/open_ended_rubric.html | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lms/templates/open_ended_feedback.html b/lms/templates/open_ended_feedback.html index 20a9904e88..2cd7faec70 100644 --- a/lms/templates/open_ended_feedback.html +++ b/lms/templates/open_ended_feedback.html @@ -1,9 +1,11 @@
        -
        -

        Score: ${score}

        -
        ${rubric_feedback | n} + % if grader_type=="PE": +
        + ${ feedback | n} +
        + % endif
        diff --git a/lms/templates/open_ended_rubric.html b/lms/templates/open_ended_rubric.html index 8ef4a033fd..34b8f9821e 100644 --- a/lms/templates/open_ended_rubric.html +++ b/lms/templates/open_ended_rubric.html @@ -14,7 +14,7 @@
          % for j in range(len(category['options'])): <% option = category['options'][j] %> - %if option['selected']: + %if option['selected'] and not view_only:
        • %else:
        • From 198885f7e0136fb90c866b9aeea9238995f5081a Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 7 Feb 2013 10:40:15 -0500 Subject: [PATCH 13/79] Move elements around, do some restyling --- .../lib/xmodule/xmodule/css/combinedopenended/display.scss | 7 ++++--- 1 file 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 232eadfc40..3d97200a25 100644 --- a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss +++ b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss @@ -480,6 +480,8 @@ section.open-ended-child { list-style-type: none; padding:0; margin:0; + float:left; + display: block; } ol { @@ -507,9 +509,8 @@ section.open-ended-child { } li { - line-height: 1.4em; - margin-bottom: lh(.5); - + margin-bottom: 0px; + padding: 0px; &:last-child { margin-bottom: 0; } From c195fe65cd38e53d99e690cd7f7503fdc67cfe23 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 7 Feb 2013 11:10:29 -0500 Subject: [PATCH 14/79] Restyle rubric list, submission container --- .../css/combinedopenended/display.scss | 21 +++++++++++-------- .../peergrading/peer_grading_problem.coffee | 4 ++-- lms/static/sass/course/_staff_grading.scss | 17 ++++++++++++++- lms/templates/open_ended_rubric.html | 4 ++-- .../peer_grading/peer_grading_problem.html | 4 ++-- 5 files changed, 34 insertions(+), 16 deletions(-) diff --git a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss index 3d97200a25..f4bb374622 100644 --- a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss +++ b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss @@ -401,7 +401,7 @@ section.open-ended-child { div.short-form-response { background: #F6F6F6; border: 1px solid #ddd; - margin-bottom: 20px; + margin-bottom: 0px; overflow-y: auto; height: 200px; @include clearfix; @@ -475,14 +475,17 @@ section.open-ended-child { margin-left: .75rem; } - ul.rubric-list - { - list-style-type: none; - padding:0; - margin:0; - float:left; - display: block; - } + ul.rubric-list{ + list-style-type: none; + padding:0; + margin:0; + li { + &.rubric-list-item{ + margin-bottom: 0px; + padding: 0px; + } + } + } ol { list-style: decimal outside none; 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 deeb82900b..06a24193d4 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 @@ -323,7 +323,7 @@ class @PeerGradingProblem if response.success # load in all the data - @submission_container.html("

          Training Essay

          ") + @submission_container.html("") @render_submission_data(response) # TODO: indicate that we're in calibration mode @calibration_panel.addClass('current-state') @@ -350,7 +350,7 @@ class @PeerGradingProblem render_submission: (response) => if response.success @submit_button.hide() - @submission_container.html("

          Submitted Essay

          ") + @submission_container.html("") @render_submission_data(response) @calibration_panel.removeClass('current-state') diff --git a/lms/static/sass/course/_staff_grading.scss b/lms/static/sass/course/_staff_grading.scss index 5c71d0fb62..acca3327e3 100644 --- a/lms/static/sass/course/_staff_grading.scss +++ b/lms/static/sass/course/_staff_grading.scss @@ -5,6 +5,18 @@ div.peer-grading{ margin: 0px; } + ul.rubric-list{ + list-style-type: none; + padding:0; + margin:0; + li { + &.rubric-list-item{ + margin-bottom: 0px; + padding: 0px; + } + } + } + h1 { margin : 0 0 0 10px; } @@ -18,6 +30,10 @@ div.peer-grading{ div { margin: 0px; + &.submission-container{ + overflow-y: auto; + height: 200px; + } } label { @@ -132,7 +148,6 @@ div.peer-grading{ padding: 2px; margin-bottom: 5px; background: #eee; - height: 10em; width:47.6%; h3 { diff --git a/lms/templates/open_ended_rubric.html b/lms/templates/open_ended_rubric.html index 34b8f9821e..2436cbb849 100644 --- a/lms/templates/open_ended_rubric.html +++ b/lms/templates/open_ended_rubric.html @@ -15,9 +15,9 @@ % for j in range(len(category['options'])): <% option = category['options'][j] %> %if option['selected'] and not view_only: -
        • +
        • %else: -
        • +
        • % endif % if view_only: % if option['selected']: diff --git a/lms/templates/peer_grading/peer_grading_problem.html b/lms/templates/peer_grading/peer_grading_problem.html index 290f4dbc80..5e3b231a4a 100644 --- a/lms/templates/peer_grading/peer_grading_problem.html +++ b/lms/templates/peer_grading/peer_grading_problem.html @@ -13,7 +13,7 @@
        -

        Question (Hide)

        +

        Prompt (Hide)

        @@ -25,7 +25,7 @@
        -

        Grading

        +

        Student Response

        From 3457b86bd023c30325cf9790372ea9eb7b39177b Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 7 Feb 2013 12:36:57 -0500 Subject: [PATCH 15/79] Fix JS, style student response box --- .../js/src/peergrading/peer_grading_problem.coffee | 13 +++++++++++++ lms/static/sass/course/_staff_grading.scss | 3 +++ 2 files changed, 16 insertions(+) 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 06a24193d4..69bd99d54a 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 @@ -180,6 +180,9 @@ class @PeerGradingProblem @content_panel = $('.content-panel') @grading_message = $('.grading-message') @grading_message.hide() + @question_header = $('.question-header') + @question_header + @question_header.click @collapse_question @grading_wrapper =$('.grading-wrapper') @calibration_feedback_panel = $('.calibration-feedback') @@ -268,6 +271,7 @@ class @PeerGradingProblem if response.calibrated and (@calibration == null or @calibration == false) @calibration = false @fetch_submission_essay() + @collapse_question() # If we were calibrating before and no longer need to, # show the interstitial page else if response.calibrated and @calibration == true @@ -433,3 +437,12 @@ class @PeerGradingProblem setup_score_selection: (max_score) => # And now hook up an event handler again $("input[class='score-selection']").change @graded_callback + + collapse_question: () => + @prompt_container.slideToggle() + @prompt_container.toggleClass('open') + if @question_header.text() == "(Hide)" + new_text = "(Show)" + else + new_text = "(Hide)" + @question_header.text(new_text) diff --git a/lms/static/sass/course/_staff_grading.scss b/lms/static/sass/course/_staff_grading.scss index acca3327e3..bd6cb10192 100644 --- a/lms/static/sass/course/_staff_grading.scss +++ b/lms/static/sass/course/_staff_grading.scss @@ -33,6 +33,9 @@ div.peer-grading{ &.submission-container{ overflow-y: auto; height: 200px; + background: #F6F6F6; + border: 1px solid #ddd; + @include clearfix; } } From baba8d3a369be6ccfd4968f539cc642d27c1906e Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 7 Feb 2013 12:42:05 -0500 Subject: [PATCH 16/79] Add collapse action into staff grading view --- .../src/peergrading/peer_grading_problem.coffee | 3 +-- .../coffee/src/staff_grading/staff_grading.coffee | 15 ++++++++++++++- lms/templates/instructor/staff_grading.html | 2 +- 3 files changed, 16 insertions(+), 4 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 69bd99d54a..d0dce5343f 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 @@ -181,7 +181,6 @@ class @PeerGradingProblem @grading_message = $('.grading-message') @grading_message.hide() @question_header = $('.question-header') - @question_header @question_header.click @collapse_question @grading_wrapper =$('.grading-wrapper') @@ -445,4 +444,4 @@ class @PeerGradingProblem new_text = "(Show)" else new_text = "(Hide)" - @question_header.text(new_text) + @question_header.text(new_text) diff --git a/lms/static/coffee/src/staff_grading/staff_grading.coffee b/lms/static/coffee/src/staff_grading/staff_grading.coffee index 117388bab0..d3102a38c5 100644 --- a/lms/static/coffee/src/staff_grading/staff_grading.coffee +++ b/lms/static/coffee/src/staff_grading/staff_grading.coffee @@ -180,6 +180,9 @@ class @StaffGrading @ml_error_info_container = $('.ml-error-info-container') @breadcrumbs = $('.breadcrumbs') + + @question_header = $('.question-header') + @question_header.click @collapse_question # model state @state = state_no_data @@ -428,7 +431,17 @@ class @StaffGrading @get_next_submission(@location) else @error('System got into invalid state for submission: ' + @state) - + + collapse_question: () => + @prompt_container.slideToggle() + @prompt_container.toggleClass('open') + if @question_header.text() == "(Hide)" + new_text = "(Show)" + else + new_text = "(Hide)" + @question_header.text(new_text) + + # for now, just create an instance and load it... mock_backend = false diff --git a/lms/templates/instructor/staff_grading.html b/lms/templates/instructor/staff_grading.html index dcfece34b8..21af70756a 100644 --- a/lms/templates/instructor/staff_grading.html +++ b/lms/templates/instructor/staff_grading.html @@ -50,7 +50,7 @@
        -

        Question

        +

        Question (Hide)

        From ade44c330dd72f1c239abc494329b31280ee314f Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 7 Feb 2013 12:45:08 -0500 Subject: [PATCH 17/79] Make staff grading interface much nicer --- lms/static/coffee/src/staff_grading/staff_grading.coffee | 3 ++- lms/templates/instructor/staff_grading.html | 5 ++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lms/static/coffee/src/staff_grading/staff_grading.coffee b/lms/static/coffee/src/staff_grading/staff_grading.coffee index d3102a38c5..f816f74931 100644 --- a/lms/static/coffee/src/staff_grading/staff_grading.coffee +++ b/lms/static/coffee/src/staff_grading/staff_grading.coffee @@ -292,6 +292,7 @@ class @StaffGrading @min_for_ml = response.min_for_ml @num_pending = response.num_pending @state = state_grading + @collapse_question if not @max_score? @error("No max score specified for submission.") @@ -431,7 +432,7 @@ class @StaffGrading @get_next_submission(@location) else @error('System got into invalid state for submission: ' + @state) - + collapse_question: () => @prompt_container.slideToggle() @prompt_container.toggleClass('open') diff --git a/lms/templates/instructor/staff_grading.html b/lms/templates/instructor/staff_grading.html index 21af70756a..da1d42b62a 100644 --- a/lms/templates/instructor/staff_grading.html +++ b/lms/templates/instructor/staff_grading.html @@ -50,7 +50,7 @@
        -

        Question (Hide)

        +

        Prompt (Hide)

        @@ -62,11 +62,10 @@
        -

        Grading

        -

        Student Submission

        +

        Student Response

        From 5ef4af5afdecf13ed2f07a55574a82e41ec5870a Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 7 Feb 2013 12:54:36 -0500 Subject: [PATCH 18/79] Fix peer and staff grading interfaces --- .../xmodule/js/src/peergrading/peer_grading_problem.coffee | 2 +- lms/static/coffee/src/staff_grading/staff_grading.coffee | 2 +- 2 files changed, 2 insertions(+), 2 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 d0dce5343f..78d9fd11bf 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 @@ -204,6 +204,7 @@ class @PeerGradingProblem @calibration_feedback_button = $('.calibration-feedback-button') @interstitial_page_button = $('.interstitial-page-button') @flag_student_checkbox = $('.flag-checkbox') + @collapse_question() Collapsible.setCollapsibles(@content_panel) @@ -270,7 +271,6 @@ class @PeerGradingProblem if response.calibrated and (@calibration == null or @calibration == false) @calibration = false @fetch_submission_essay() - @collapse_question() # If we were calibrating before and no longer need to, # show the interstitial page else if response.calibrated and @calibration == true diff --git a/lms/static/coffee/src/staff_grading/staff_grading.coffee b/lms/static/coffee/src/staff_grading/staff_grading.coffee index f816f74931..1ea51258c6 100644 --- a/lms/static/coffee/src/staff_grading/staff_grading.coffee +++ b/lms/static/coffee/src/staff_grading/staff_grading.coffee @@ -183,6 +183,7 @@ class @StaffGrading @question_header = $('.question-header') @question_header.click @collapse_question + @collapse_question() # model state @state = state_no_data @@ -292,7 +293,6 @@ class @StaffGrading @min_for_ml = response.min_for_ml @num_pending = response.num_pending @state = state_grading - @collapse_question if not @max_score? @error("No max score specified for submission.") From b1726dae99bc1933170cf4a314d19be3c02111b3 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 7 Feb 2013 13:48:32 -0500 Subject: [PATCH 19/79] Fix prompt UI in combined open ended to close by default and be collapsible --- .../js/src/combinedopenended/display.coffee | 35 ++++++++++++++++++- .../peergrading/peer_grading_problem.coffee | 2 +- lms/templates/combined_open_ended.html | 5 ++- 3 files changed, 37 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 42f1378dd8..aee753125c 100644 --- a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee @@ -55,6 +55,9 @@ class @CombinedOpenEnded @show_results_button=@$('.show-results-button') @show_results_button.click @show_results + @question_header = @$('.question-header') + @question_header.click @collapse_question + # valid states: 'initial', 'assessing', 'post_assessment', 'done' Collapsible.setCollapsibles(@el) @submit_evaluation_button = $('.submit-evaluation-button') @@ -66,7 +69,7 @@ class @CombinedOpenEnded @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') @@ -81,6 +84,11 @@ class @CombinedOpenEnded @can_upload_files = false @open_ended_child= @$('.open-ended-child') + if @task_number>1 + @prompt_hide() + else if @task_number==1 and @child_state!='initial' + @prompt_hide() + @find_assessment_elements() @find_hint_elements() @@ -155,6 +163,8 @@ class @CombinedOpenEnded @next_problem_button.hide() @hide_file_upload() @hint_area.attr('disabled', false) + if @task_number==1 and @child_state=='assessing' + @prompt_hide() if @child_state == 'done' @rubric_wrapper.hide() if @child_type=="openended" @@ -389,3 +399,26 @@ class @CombinedOpenEnded # wrap this so that it can be mocked reload: -> location.reload() + + collapse_question: () => + @prompt_container.slideToggle() + @prompt_container.toggleClass('open') + if @question_header.text() == "(Hide)" + new_text = "(Show)" + else + new_text = "(Hide)" + @question_header.text(new_text) + + prompt_show: () => + if @prompt_container.is(":hidden")==true + @prompt_container.slideToggle() + @prompt_container.toggleClass('open') + @question_header.text("(Hide)") + + prompt_hide: () => + if @prompt_container.is(":visible")==true + @prompt_container.slideToggle() + @prompt_container.toggleClass('open') + @question_header.text("(Show)") + + 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 78d9fd11bf..19a48f9356 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 @@ -413,7 +413,7 @@ class @PeerGradingProblem if score == actual_score calibration_wrapper.append("

        Congratulations! Your score matches the actual score!

        ") else - calibration_wrapper.append("

        Please try to understand the grading critera better to be more accurate next time.

        ") + calibration_wrapper.append("

        Please try to understand the grading criteria better to be more accurate next time.

        ") # disable score selection and submission from the grading interface $("input[name='score-selection']").attr('disabled', true) diff --git a/lms/templates/combined_open_ended.html b/lms/templates/combined_open_ended.html index 34cc007431..afd6ade5db 100644 --- a/lms/templates/combined_open_ended.html +++ b/lms/templates/combined_open_ended.html @@ -6,14 +6,13 @@
        -

        Problem

        +

        Prompt (Hide)

        % for item in items: -
        ${item['content'] | n}
        +
        ${item['content'] | n}
        % endfor
        -
        From 1cf8326b323db42834ee1f7dcf9426cac618f282 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 7 Feb 2013 14:03:43 -0500 Subject: [PATCH 20/79] Make status bar, minor CSS fixes --- .../xmodule/css/combinedopenended/display.scss | 9 +++++---- lms/static/sass/course/_rubric.scss | 1 - lms/templates/combined_open_ended_status.html | 13 +------------ 3 files changed, 6 insertions(+), 17 deletions(-) diff --git a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss index f4bb374622..b34439e0a1 100644 --- a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss +++ b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss @@ -47,10 +47,11 @@ section.combined-open-ended-status { .statusitem { color: #2C2C2C; - font-size: 1em; + background-color : #d4d4d4; + font-size: .9em; padding: 0px; - display: block; - width: 70%; + display: inline; + width: 20%; .show-results { margin-top: .3em; text-align:right; @@ -61,7 +62,7 @@ section.combined-open-ended-status { } .statusitem-current { - background-color: #d4d4d4; + background-color: #B2B2B2; color: #222; } diff --git a/lms/static/sass/course/_rubric.scss b/lms/static/sass/course/_rubric.scss index 92a8b0c574..00c0f31a1e 100644 --- a/lms/static/sass/course/_rubric.scss +++ b/lms/static/sass/course/_rubric.scss @@ -21,7 +21,6 @@ { position: relative; font-size: .9em; - background-color: white; display: block; } .grade { diff --git a/lms/templates/combined_open_ended_status.html b/lms/templates/combined_open_ended_status.html index bc552c0d76..265c26c6ce 100644 --- a/lms/templates/combined_open_ended_status.html +++ b/lms/templates/combined_open_ended_status.html @@ -1,5 +1,4 @@ %if status_list[0]['state'] != 'initial': -

        Status

        %for i in xrange(0,len(status_list)): @@ -10,17 +9,7 @@
        %endif - ${status['task_number']}. ${status['human_task']} (${status['human_state']}) : ${status['score']} / ${status['max_score']} - % if status['state'] == 'initial': - - % elif status['state'] in ['done', 'post_assessment'] and status['correct'] == 'correct': - - % elif status['state'] in ['done', 'post_assessment'] and status['correct'] == 'incorrect': - - % elif status['state'] == 'assessing': - - % endif - + ${status['human_task']} (${status['human_state']}) ${status['score']} / ${status['max_score']} %if status['type']=="openended" and status['state'] in ['done', 'post_assessment']: Show results %endif From 62435b4c271ceef50c1779215f62335e418feb15 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 7 Feb 2013 14:12:14 -0500 Subject: [PATCH 21/79] Clean up results display --- common/lib/xmodule/xmodule/combined_open_ended_modulev1.py | 2 +- common/lib/xmodule/xmodule/css/combinedopenended/display.scss | 2 +- lms/templates/combined_open_ended.html | 3 ++- lms/templates/combined_open_ended_results.html | 2 +- lms/templates/combined_open_ended_status.html | 2 -- lms/templates/open_ended.html | 2 +- lms/templates/self_assessment_prompt.html | 2 +- 7 files changed, 7 insertions(+), 8 deletions(-) diff --git a/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py b/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py index 08f7abcf6b..dd51e009f2 100644 --- a/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py +++ b/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py @@ -511,7 +511,7 @@ class CombinedOpenEndedV1Module(): task_number = int(get['task_number']) self.update_task_states() response_dict = self.get_last_response(task_number) - context = {'results': response_dict['post_assessment'], 'task_number': task_number + 1} + context = {'results': response_dict['post_assessment'], 'task_number': task_number + 1, 'task_name' : response_dict['human_task']} html = self.system.render_template('combined_open_ended_results.html', context) return {'html': html, 'success': True} diff --git a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss index b34439e0a1..d8072bb1b3 100644 --- a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss +++ b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss @@ -49,7 +49,7 @@ section.combined-open-ended-status { color: #2C2C2C; background-color : #d4d4d4; font-size: .9em; - padding: 0px; + padding: 2px; display: inline; width: 20%; .show-results { diff --git a/lms/templates/combined_open_ended.html b/lms/templates/combined_open_ended.html index afd6ade5db..935cff3b7b 100644 --- a/lms/templates/combined_open_ended.html +++ b/lms/templates/combined_open_ended.html @@ -1,10 +1,11 @@
        -

        ${display_name}

        ${status | n}
        +

        ${display_name}

        +

        Prompt (Hide)

        diff --git a/lms/templates/combined_open_ended_results.html b/lms/templates/combined_open_ended_results.html index 65732cdbaa..698a4f52a4 100644 --- a/lms/templates/combined_open_ended_results.html +++ b/lms/templates/combined_open_ended_results.html @@ -1,4 +1,4 @@
        -

        Results from Step ${task_number}

        +

        Results from ${task_name}

        ${results | n}
        diff --git a/lms/templates/combined_open_ended_status.html b/lms/templates/combined_open_ended_status.html index 265c26c6ce..d00f763f56 100644 --- a/lms/templates/combined_open_ended_status.html +++ b/lms/templates/combined_open_ended_status.html @@ -1,4 +1,3 @@ -%if status_list[0]['state'] != 'initial':
        %for i in xrange(0,len(status_list)): @@ -17,4 +16,3 @@ %endfor
        -%endif diff --git a/lms/templates/open_ended.html b/lms/templates/open_ended.html index 5697a5ab8b..64defedda4 100644 --- a/lms/templates/open_ended.html +++ b/lms/templates/open_ended.html @@ -3,7 +3,7 @@
        ${prompt|n}
        -

        Answer

        +

        Response

        diff --git a/lms/templates/self_assessment_prompt.html b/lms/templates/self_assessment_prompt.html index 364009b134..564508cb7b 100644 --- a/lms/templates/self_assessment_prompt.html +++ b/lms/templates/self_assessment_prompt.html @@ -5,7 +5,7 @@ ${prompt}
        -

        Answer

        +

        Response

        From 9bf53026e6bb1bd2e0de24ccae6ad0ae2f8c5db3 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 7 Feb 2013 14:18:38 -0500 Subject: [PATCH 22/79] Tweak box in peer and staff grading views --- lms/static/sass/course/_staff_grading.scss | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lms/static/sass/course/_staff_grading.scss b/lms/static/sass/course/_staff_grading.scss index bd6cb10192..1807d9821d 100644 --- a/lms/static/sass/course/_staff_grading.scss +++ b/lms/static/sass/course/_staff_grading.scss @@ -43,7 +43,7 @@ div.peer-grading{ margin: 0px; padding: 2px; min-width: 50px; - background-color: #CCC; + background-color: white; text-size: 1.5em; } @@ -107,6 +107,7 @@ div.peer-grading{ margin-left:2px; } padding: 2px; + padding-bottom: 15px; } .meta-info-wrapper { From 3874fe545afec5c9913e8d35746d42716ef94c96 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 7 Feb 2013 15:46:49 -0500 Subject: [PATCH 23/79] Working on making a combined rubric --- common/lib/logsettings.py | 20 +++++++++++++++++-- .../xmodule/combined_open_ended_rubric.py | 5 +++-- .../xmodule/xmodule/grading_service_module.py | 4 +++- .../js/src/combinedopenended/display.coffee | 3 ++- .../lib/xmodule/xmodule/open_ended_module.py | 17 +++++++++++----- common/lib/xmodule/xmodule/openendedchild.py | 2 -- .../xmodule/xmodule/self_assessment_module.py | 8 +++++--- 7 files changed, 43 insertions(+), 16 deletions(-) diff --git a/common/lib/logsettings.py b/common/lib/logsettings.py index 8fc2bb9db1..aa9dc6226f 100644 --- a/common/lib/logsettings.py +++ b/common/lib/logsettings.py @@ -53,7 +53,7 @@ def get_logger_config(log_dir, logging_env=logging_env, hostname=hostname) - handlers = ['console', 'local'] if debug else ['console', + handlers = ['console', 'local', 'null'] if debug else ['console', 'syslogger-remote', 'local'] logger_config = { @@ -84,6 +84,12 @@ def get_logger_config(log_dir, 'level': 'ERROR', 'class': 'newrelic_logging.NewRelicHandler', 'formatter': 'raw', + }, + 'null' : { + 'level': 'CRITICAL', + 'class': 'logging.handlers.SysLogHandler', + 'address': syslog_addr, + 'formatter': 'syslog_format', } }, 'loggers': { @@ -92,11 +98,21 @@ def get_logger_config(log_dir, 'level': 'DEBUG', 'propagate': False, }, + 'django.db.backends': { + 'handlers': ['null'], + 'propagate': False, + 'level':'DEBUG', + }, + 'django_comment_client.utils' : { + 'handlers': ['null'], + 'propagate': False, + 'level':'DEBUG', + }, '': { 'handlers': handlers, 'level': 'DEBUG', 'propagate': False - }, + } } } diff --git a/common/lib/xmodule/xmodule/combined_open_ended_rubric.py b/common/lib/xmodule/xmodule/combined_open_ended_rubric.py index 689103a86a..41838e875c 100644 --- a/common/lib/xmodule/xmodule/combined_open_ended_rubric.py +++ b/common/lib/xmodule/xmodule/combined_open_ended_rubric.py @@ -29,6 +29,7 @@ class CombinedOpenEndedRubric(object): success = False try: rubric_categories = self.extract_categories(rubric_xml) + rubric_scores = [cat['score'] for cat in rubric_categories] max_scores = map((lambda cat: cat['options'][-1]['points']), rubric_categories) max_score = max(max_scores) html = self.system.render_template('open_ended_rubric.html', @@ -41,7 +42,7 @@ class CombinedOpenEndedRubric(object): error_message = "[render_rubric] Could not parse the rubric with xml: {0}".format(rubric_xml) log.error(error_message) raise RubricParsingError(error_message) - return success, html + return {'success' : success, 'html' : html, 'rubric_scores' : rubric_scores} def check_if_rubric_is_parseable(self, rubric_string, location, max_score_allowed, max_score): success, rubric_feedback = self.render_rubric(rubric_string) @@ -149,7 +150,7 @@ class CombinedOpenEndedRubric(object): options = sorted(options, key=lambda option: option['points']) CombinedOpenEndedRubric.validate_options(options) - return {'description': description, 'options': options} + return {'description': description, 'options': options, 'score' : score} @staticmethod diff --git a/common/lib/xmodule/xmodule/grading_service_module.py b/common/lib/xmodule/xmodule/grading_service_module.py index 10c6f16adb..9af28a72c5 100644 --- a/common/lib/xmodule/xmodule/grading_service_module.py +++ b/common/lib/xmodule/xmodule/grading_service_module.py @@ -114,7 +114,9 @@ class GradingService(object): if 'rubric' in response_json: rubric = response_json['rubric'] rubric_renderer = CombinedOpenEndedRubric(self.system, view_only) - success, rubric_html = rubric_renderer.render_rubric(rubric) + rubric_dict = rubric_renderer.render_rubric(rubric) + success = rubric_dict['success'] + rubric_html = rubric_dict['html'] response_json['rubric'] = rubric_html return response_json # if we can't parse the rubric into HTML, diff --git a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee index aee753125c..9c3f10d5a2 100644 --- a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee @@ -266,7 +266,8 @@ class @CombinedOpenEnded event.preventDefault() if @child_state == 'assessing' && Rubric.check_complete() checked_assessment = Rubric.get_total_score() - data = {'assessment' : checked_assessment} + score_list = Rubric.get_score_list() + data = {'assessment' : checked_assessment, 'score_list' : score_list} $.postWithPrefix "#{@ajax_url}/save_assessment", data, (response) => if response.success @child_state = response.state diff --git a/common/lib/xmodule/xmodule/open_ended_module.py b/common/lib/xmodule/xmodule/open_ended_module.py index 07db43c502..4c288c90a9 100644 --- a/common/lib/xmodule/xmodule/open_ended_module.py +++ b/common/lib/xmodule/xmodule/open_ended_module.py @@ -388,7 +388,10 @@ class OpenEndedModule(openendedchild.OpenEndedChild): feedback = self._convert_longform_feedback_to_html(response_items) if response_items['rubric_scores_complete'] == True: rubric_renderer = CombinedOpenEndedRubric(system, True) - success, rubric_feedback = rubric_renderer.render_rubric(response_items['rubric_xml']) + rubric_dict = rubric_renderer.render_rubric(response_items['rubric_xml']) + success = rubric_dict['success'] + rubric_feedback = rubric_dict['html'] + rubric_scores = rubric_dict['rubric_scores'] if not response_items['success']: return system.render_template("open_ended_error.html", @@ -401,7 +404,7 @@ class OpenEndedModule(openendedchild.OpenEndedChild): 'rubric_feedback': rubric_feedback }) - return feedback_template + return feedback_template, rubric_scores def _parse_score_msg(self, score_msg, system, join_feedback=True): @@ -452,6 +455,7 @@ class OpenEndedModule(openendedchild.OpenEndedChild): #This is to support peer grading if isinstance(score_result['score'], list): feedback_items = [] + rubric_scores = [] for i in xrange(0, len(score_result['score'])): new_score_result = { 'score': score_result['score'][i], @@ -463,7 +467,9 @@ class OpenEndedModule(openendedchild.OpenEndedChild): 'rubric_scores_complete': score_result['rubric_scores_complete'][i], 'rubric_xml': score_result['rubric_xml'][i], } - feedback_items.append(self._format_feedback(new_score_result, system)) + feedback_template, rubric_score = self._format_feedback(new_score_result, system) + feedback_items.append(feedback_template) + rubric_scores.append(rubric_score) if join_feedback: feedback = "".join(feedback_items) else: @@ -471,13 +477,14 @@ class OpenEndedModule(openendedchild.OpenEndedChild): score = int(median(score_result['score'])) else: #This is for instructor and ML grading - feedback = self._format_feedback(score_result, system) + feedback, rubric_score = self._format_feedback(score_result, system) score = score_result['score'] + rubric_scores = [rubric_score] self.submission_id = score_result['submission_id'] self.grader_id = score_result['grader_id'] - return {'valid': True, 'score': score, 'feedback': feedback} + return {'valid': True, 'score': score, 'feedback': feedback, 'rubric_scores' : rubric_scores} def latest_post_assessment(self, system, short_feedback=False, join_feedback=True): """ diff --git a/common/lib/xmodule/xmodule/openendedchild.py b/common/lib/xmodule/xmodule/openendedchild.py index e5b17503c3..09e1e92903 100644 --- a/common/lib/xmodule/xmodule/openendedchild.py +++ b/common/lib/xmodule/xmodule/openendedchild.py @@ -137,8 +137,6 @@ class OpenEndedChild(object): else: return False, {} - - def latest_answer(self): """Empty string if not available""" if not self.history: diff --git a/common/lib/xmodule/xmodule/self_assessment_module.py b/common/lib/xmodule/xmodule/self_assessment_module.py index c8d1fe7a28..75323670d1 100644 --- a/common/lib/xmodule/xmodule/self_assessment_module.py +++ b/common/lib/xmodule/xmodule/self_assessment_module.py @@ -108,7 +108,6 @@ class SelfAssessmentModule(openendedchild.OpenEndedChild): if dispatch not in handlers: return 'Error' - log.debug(get) before = self.get_progress() d = handlers[dispatch](get, system) after = self.get_progress() @@ -126,7 +125,9 @@ class SelfAssessmentModule(openendedchild.OpenEndedChild): return '' rubric_renderer = CombinedOpenEndedRubric(system, False) - success, rubric_html = rubric_renderer.render_rubric(self.rubric) + rubric_dict = rubric_renderer.render_rubric(self.rubric) + success = rubric_dict['success'] + rubric_html = rubric_dict['html'] # we'll render it context = {'rubric': rubric_html, @@ -235,8 +236,9 @@ class SelfAssessmentModule(openendedchild.OpenEndedChild): try: score = int(get['assessment']) + score_list = get.getlist('score_list[]') except ValueError: - return {'success': False, 'error': "Non-integer score value"} + return {'success': False, 'error': "Non-integer score value, or no score list"} self.record_latest_score(score) From 4a897d4e7fa34ce20668cf6299a767fa859eb5a4 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 7 Feb 2013 15:52:23 -0500 Subject: [PATCH 24/79] Save rubric scores in self assessment --- common/lib/xmodule/xmodule/self_assessment_module.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common/lib/xmodule/xmodule/self_assessment_module.py b/common/lib/xmodule/xmodule/self_assessment_module.py index 75323670d1..6bc3e34608 100644 --- a/common/lib/xmodule/xmodule/self_assessment_module.py +++ b/common/lib/xmodule/xmodule/self_assessment_module.py @@ -237,10 +237,14 @@ class SelfAssessmentModule(openendedchild.OpenEndedChild): try: score = int(get['assessment']) score_list = get.getlist('score_list[]') + for i in xrange(0,len(score_list)): + score_list[i] = int(score_list[i]) except ValueError: return {'success': False, 'error': "Non-integer score value, or no score list"} + #Record score as assessment and rubric scores as post assessment self.record_latest_score(score) + self.record_latest_post_assessment(json.dumps(score_list)) d = {'success': True, } From 4b5457c99717e3ff35154ecb9602ee94a91c1b78 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 7 Feb 2013 16:13:07 -0500 Subject: [PATCH 25/79] Fixing some rubric score errors --- .../xmodule/xmodule/combined_open_ended_modulev1.py | 7 ++++++- .../lib/xmodule/xmodule/combined_open_ended_rubric.py | 4 +++- common/lib/xmodule/xmodule/open_ended_module.py | 3 ++- common/lib/xmodule/xmodule/self_assessment_module.py | 10 ++++++++++ 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py b/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py index dd51e009f2..c854be3cd9 100644 --- a/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py +++ b/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py @@ -441,6 +441,10 @@ class CombinedOpenEndedV1Module(): else: last_post_evaluation = task.format_feedback_with_evaluation(self.system, last_post_assessment) last_post_assessment = last_post_evaluation + rubric_scores = task._parse_score_msg(task.history[-1].get('post_assessment', ""), self.system)['rubric_scores'] + elif task_type== "selfassessment": + rubric_scores = last_post_assessment + last_post_assessment = "" last_correctness = task.is_last_response_correct() max_score = task.max_score() state = task.state @@ -465,8 +469,9 @@ class CombinedOpenEndedV1Module(): 'correct': last_correctness, 'min_score_to_attempt': min_score_to_attempt, 'max_score_to_attempt': max_score_to_attempt, + 'rubric_scores' : rubric_scores, } - + log.debug(last_response_dict) return last_response_dict def update_task_states(self): diff --git a/common/lib/xmodule/xmodule/combined_open_ended_rubric.py b/common/lib/xmodule/xmodule/combined_open_ended_rubric.py index 41838e875c..1ecdec14b7 100644 --- a/common/lib/xmodule/xmodule/combined_open_ended_rubric.py +++ b/common/lib/xmodule/xmodule/combined_open_ended_rubric.py @@ -45,7 +45,9 @@ class CombinedOpenEndedRubric(object): return {'success' : success, 'html' : html, 'rubric_scores' : rubric_scores} def check_if_rubric_is_parseable(self, rubric_string, location, max_score_allowed, max_score): - success, rubric_feedback = self.render_rubric(rubric_string) + rubric_dict = self.render_rubric(rubric_string) + success = rubric_dict['success'] + rubric_feedback = rubric_dict['html'] if not success: error_message = "Could not parse rubric : {0} for location {1}".format(rubric_string, location.url()) log.error(error_message) diff --git a/common/lib/xmodule/xmodule/open_ended_module.py b/common/lib/xmodule/xmodule/open_ended_module.py index 4c288c90a9..d8d80cc199 100644 --- a/common/lib/xmodule/xmodule/open_ended_module.py +++ b/common/lib/xmodule/xmodule/open_ended_module.py @@ -386,6 +386,7 @@ class OpenEndedModule(openendedchild.OpenEndedChild): rubric_feedback = "" feedback = self._convert_longform_feedback_to_html(response_items) + rubric_scores = [] if response_items['rubric_scores_complete'] == True: rubric_renderer = CombinedOpenEndedRubric(system, True) rubric_dict = rubric_renderer.render_rubric(response_items['rubric_xml']) @@ -428,7 +429,7 @@ class OpenEndedModule(openendedchild.OpenEndedChild): correct: Correctness of submission (Boolean) score: Points to be assigned (numeric, can be float) """ - fail = {'valid': False, 'score': 0, 'feedback': ''} + fail = {'valid': False, 'score': 0, 'feedback': '', 'rubric_scores' : []} try: score_result = json.loads(score_msg) except (TypeError, ValueError): diff --git a/common/lib/xmodule/xmodule/self_assessment_module.py b/common/lib/xmodule/xmodule/self_assessment_module.py index 6bc3e34608..a3740b1fcb 100644 --- a/common/lib/xmodule/xmodule/self_assessment_module.py +++ b/common/lib/xmodule/xmodule/self_assessment_module.py @@ -257,6 +257,7 @@ class SelfAssessmentModule(openendedchild.OpenEndedChild): def save_hint(self, get, system): ''' + Not used currently, as hints have been removed from the system. Save the hint. Returns a dict { 'success': bool, 'message_html': message_html, @@ -277,6 +278,15 @@ class SelfAssessmentModule(openendedchild.OpenEndedChild): 'message_html': self.get_message_html(), 'allow_reset': self._allow_reset()} + def latest_post_assessment(self, system): + latest_post_assessment = super(SelfAssessmentModule, self).latest_post_assessment(system) + try: + rubric_scores = json.loads(latest_post_assessment) + except: + log.error("Cannot parse rubric scores in self assessment module from {0}".format(latest_post_assessment)) + rubric_scores = [] + return [rubric_scores] + class SelfAssessmentDescriptor(XmlDescriptor, EditingDescriptor): """ From 091f34668b86caf0b9f2ce95d7234a56ff3901bf Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 7 Feb 2013 16:40:25 -0500 Subject: [PATCH 26/79] Support centralized results --- common/lib/logsettings.py | 5 ++ .../xmodule/combined_open_ended_modulev1.py | 19 +++++++- .../xmodule/combined_open_ended_rubric.py | 48 +++++++++++++++++++ .../lib/xmodule/xmodule/open_ended_module.py | 5 +- 4 files changed, 74 insertions(+), 3 deletions(-) diff --git a/common/lib/logsettings.py b/common/lib/logsettings.py index aa9dc6226f..2ed20a0bad 100644 --- a/common/lib/logsettings.py +++ b/common/lib/logsettings.py @@ -108,6 +108,11 @@ def get_logger_config(log_dir, 'propagate': False, 'level':'DEBUG', }, + 'pipeline.compilers' : { + 'handlers': ['null'], + 'propagate': False, + 'level':'DEBUG', + }, '': { 'handlers': handlers, 'level': 'DEBUG', diff --git a/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py b/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py index c854be3cd9..9989fb8614 100644 --- a/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py +++ b/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py @@ -441,9 +441,12 @@ class CombinedOpenEndedV1Module(): else: last_post_evaluation = task.format_feedback_with_evaluation(self.system, last_post_assessment) last_post_assessment = last_post_evaluation - rubric_scores = task._parse_score_msg(task.history[-1].get('post_assessment', ""), self.system)['rubric_scores'] + rubric_data = task._parse_score_msg(task.history[-1].get('post_assessment', ""), self.system) + rubric_scores = rubric_data['rubric_scores'] + grader_types = rubric_data['grader_types'] elif task_type== "selfassessment": rubric_scores = last_post_assessment + grader_types = ['SA'] last_post_assessment = "" last_correctness = task.is_last_response_correct() max_score = task.max_score() @@ -471,7 +474,6 @@ class CombinedOpenEndedV1Module(): 'max_score_to_attempt': max_score_to_attempt, 'rubric_scores' : rubric_scores, } - log.debug(last_response_dict) return last_response_dict def update_task_states(self): @@ -507,6 +509,19 @@ class CombinedOpenEndedV1Module(): pass return return_html + def get_rubric_scores(self, get): + """ + Gets the results of a given grader via ajax. + Input: AJAX get dictionary + Output: Dictionary to be rendered via ajax that contains the result html. + """ + task_number = int(get['task_number']) + self.update_task_states() + response_dict = self.get_last_response(task_number) + context = {'results': response_dict['post_assessment'], 'task_number': task_number + 1, 'task_name' : response_dict['human_task']} + html = self.system.render_template('combined_open_ended_results.html', context) + return {'html': html, 'success': True} + def get_results(self, get): """ Gets the results of a given grader via ajax. diff --git a/common/lib/xmodule/xmodule/combined_open_ended_rubric.py b/common/lib/xmodule/xmodule/combined_open_ended_rubric.py index 1ecdec14b7..44ae8cb0de 100644 --- a/common/lib/xmodule/xmodule/combined_open_ended_rubric.py +++ b/common/lib/xmodule/xmodule/combined_open_ended_rubric.py @@ -170,3 +170,51 @@ class CombinedOpenEndedRubric(object): raise RubricParsingError("[extract_category]: found duplicate point values between two different options") else: prev = option['points'] + + @staticmethod + def reformat_scores_for_rendering(scores, score_types): + success = False + if len(scores)==0: + return success + + score_lists = [] + score_type_list = [] + for i in xrange(0,len(scores)): + score_cont_list = scores[i] + for j in xrange(0,len(score_cont_list)): + score_list = score_cont_list[j] + score_lists.append(score_list) + score_type_list.append(score_types[i]) + + score_list_len = len(score_lists[0]) + for score_list in score_lists: + if len(score_list)!=score_list_len: + return success + + score_tuples = [] + for i in xrange(0,len(score_lists)): + for j in xrange(0,len(score_lists[i])): + tuple = (1,j,score_lists[i][j]) + score_tuples, tup_ind = CombinedOpenEndedRubric.check_for_tuple_matches(score_tuples,tuple) + score_tuples[tup_ind][0] += 1 + + @staticmethod + def check_for_tuple_matches(tuples, tuple): + category = tuple[1] + score = tuple[2] + tup_ind = -1 + for t in xrange(0,len(tuples)): + if tuples[t][1] == category and tuples[t][2] == score: + tup_ind = t + break + + if tup_ind == -1: + tuples.append([0,category,score]) + tup_ind = len(tuples)-1 + return tuples, tup_ind + + + + + + diff --git a/common/lib/xmodule/xmodule/open_ended_module.py b/common/lib/xmodule/xmodule/open_ended_module.py index d8d80cc199..53c5e0278b 100644 --- a/common/lib/xmodule/xmodule/open_ended_module.py +++ b/common/lib/xmodule/xmodule/open_ended_module.py @@ -457,6 +457,7 @@ class OpenEndedModule(openendedchild.OpenEndedChild): if isinstance(score_result['score'], list): feedback_items = [] rubric_scores = [] + grader_types = [] for i in xrange(0, len(score_result['score'])): new_score_result = { 'score': score_result['score'][i], @@ -471,6 +472,7 @@ class OpenEndedModule(openendedchild.OpenEndedChild): feedback_template, rubric_score = self._format_feedback(new_score_result, system) feedback_items.append(feedback_template) rubric_scores.append(rubric_score) + grader_types.append(score_result['grader_type']) if join_feedback: feedback = "".join(feedback_items) else: @@ -481,11 +483,12 @@ class OpenEndedModule(openendedchild.OpenEndedChild): feedback, rubric_score = self._format_feedback(score_result, system) score = score_result['score'] rubric_scores = [rubric_score] + grader_types = [score_result['grader_type']] self.submission_id = score_result['submission_id'] self.grader_id = score_result['grader_id'] - return {'valid': True, 'score': score, 'feedback': feedback, 'rubric_scores' : rubric_scores} + return {'valid': True, 'score': score, 'feedback': feedback, 'rubric_scores' : rubric_scores, 'grader_types' : grader_types} def latest_post_assessment(self, system, short_feedback=False, join_feedback=True): """ From 47d5fe60efe98e2a738e2787fff53a55c1dddda9 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 7 Feb 2013 16:43:21 -0500 Subject: [PATCH 27/79] Return feedback items individually --- common/lib/xmodule/xmodule/open_ended_module.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/common/lib/xmodule/xmodule/open_ended_module.py b/common/lib/xmodule/xmodule/open_ended_module.py index 53c5e0278b..6ef13c26fb 100644 --- a/common/lib/xmodule/xmodule/open_ended_module.py +++ b/common/lib/xmodule/xmodule/open_ended_module.py @@ -484,11 +484,19 @@ class OpenEndedModule(openendedchild.OpenEndedChild): score = score_result['score'] rubric_scores = [rubric_score] grader_types = [score_result['grader_type']] + feedback_items = [feedback] self.submission_id = score_result['submission_id'] self.grader_id = score_result['grader_id'] - return {'valid': True, 'score': score, 'feedback': feedback, 'rubric_scores' : rubric_scores, 'grader_types' : grader_types} + return { + 'valid': True, + 'score': score, + 'feedback': feedback, + 'rubric_scores' : rubric_scores, + 'grader_types' : grader_types, + 'feedback_items' : feedback_items + } def latest_post_assessment(self, system, short_feedback=False, join_feedback=True): """ From 0f81b0f816344c26448bde3d77d01952c4db8b5c Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 7 Feb 2013 16:51:51 -0500 Subject: [PATCH 28/79] Aggregate rubric feedback --- .../xmodule/combined_open_ended_rubric.py | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/common/lib/xmodule/xmodule/combined_open_ended_rubric.py b/common/lib/xmodule/xmodule/combined_open_ended_rubric.py index 44ae8cb0de..25bac18679 100644 --- a/common/lib/xmodule/xmodule/combined_open_ended_rubric.py +++ b/common/lib/xmodule/xmodule/combined_open_ended_rubric.py @@ -172,31 +172,41 @@ class CombinedOpenEndedRubric(object): prev = option['points'] @staticmethod - def reformat_scores_for_rendering(scores, score_types): + def reformat_scores_for_rendering(scores, score_types, feedback_types): success = False if len(scores)==0: return success + if len(scores) != len(score_types) or len(feedback_types) != len(scores): + return success + score_lists = [] score_type_list = [] + feedback_type_list = [] for i in xrange(0,len(scores)): score_cont_list = scores[i] for j in xrange(0,len(score_cont_list)): score_list = score_cont_list[j] score_lists.append(score_list) - score_type_list.append(score_types[i]) + score_type_list.append(score_types[i][j]) + feedback_type_list.append(feedback_types[i][j]) score_list_len = len(score_lists[0]) - for score_list in score_lists: - if len(score_list)!=score_list_len: + for i in xrange(0,len(score_lists)): + score_list = score_lists[i] + score_type = score_type_list[i] + feedback_type = feedback_type_list[i] + if len(score_list)!=score_list_len or len(score_type)!=score_list_len or len(feedback_type)!=score_list_len: return success score_tuples = [] for i in xrange(0,len(score_lists)): for j in xrange(0,len(score_lists[i])): - tuple = (1,j,score_lists[i][j]) + tuple = [1,j,score_lists[i][j],[],[]] score_tuples, tup_ind = CombinedOpenEndedRubric.check_for_tuple_matches(score_tuples,tuple) score_tuples[tup_ind][0] += 1 + score_tuples[tup_ind][3].append(score_type_list[i][j]) + score_tuples[tup_ind][4].append(feedback_type_list[i][j]) @staticmethod def check_for_tuple_matches(tuples, tuple): @@ -209,7 +219,7 @@ class CombinedOpenEndedRubric(object): break if tup_ind == -1: - tuples.append([0,category,score]) + tuples.append([0,category,score,[],[]]) tup_ind = len(tuples)-1 return tuples, tup_ind From 41d35632f3849b511fd9837dc0cb4e90e0c5d8d5 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 7 Feb 2013 17:18:53 -0500 Subject: [PATCH 29/79] Working on combined rubric stuff --- .../xmodule/combined_open_ended_modulev1.py | 25 +++++++++---- .../xmodule/combined_open_ended_rubric.py | 36 ++++++++++++++++--- lms/templates/open_ended_rubric.html | 9 ++++- 3 files changed, 59 insertions(+), 11 deletions(-) diff --git a/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py b/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py index 9989fb8614..16df364ff6 100644 --- a/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py +++ b/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py @@ -191,9 +191,9 @@ class CombinedOpenEndedV1Module(): # completion (doesn't matter if you self-assessed correct/incorrect). self._max_score = int(self.metadata.get('max_score', MAX_SCORE)) - rubric_renderer = CombinedOpenEndedRubric(system, True) + self.rubric_renderer = CombinedOpenEndedRubric(system, True) rubric_string = stringify_children(definition['rubric']) - rubric_renderer.check_if_rubric_is_parseable(rubric_string, location, MAX_SCORE_ALLOWED, self._max_score) + self.rubric_renderer.check_if_rubric_is_parseable(rubric_string, location, MAX_SCORE_ALLOWED, self._max_score) #Static data is passed to the child modules to render self.static_data = { @@ -444,9 +444,11 @@ class CombinedOpenEndedV1Module(): rubric_data = task._parse_score_msg(task.history[-1].get('post_assessment', ""), self.system) rubric_scores = rubric_data['rubric_scores'] grader_types = rubric_data['grader_types'] + feedback_items = rubric_data['feedback_items'] elif task_type== "selfassessment": rubric_scores = last_post_assessment grader_types = ['SA'] + feedback_items = [] last_post_assessment = "" last_correctness = task.is_last_response_correct() max_score = task.max_score() @@ -473,6 +475,8 @@ class CombinedOpenEndedV1Module(): 'min_score_to_attempt': min_score_to_attempt, 'max_score_to_attempt': max_score_to_attempt, 'rubric_scores' : rubric_scores, + 'grader_types' : grader_types, + 'feedback_items' : feedback_items, } return last_response_dict @@ -509,7 +513,7 @@ class CombinedOpenEndedV1Module(): pass return return_html - def get_rubric_scores(self, get): + def get_results(self, get): """ Gets the results of a given grader via ajax. Input: AJAX get dictionary @@ -517,12 +521,21 @@ class CombinedOpenEndedV1Module(): """ task_number = int(get['task_number']) self.update_task_states() - response_dict = self.get_last_response(task_number) - context = {'results': response_dict['post_assessment'], 'task_number': task_number + 1, 'task_name' : response_dict['human_task']} + all_responses = [] + for i in xrange(0,task_number+1): + all_responses.append(self.get_last_response(i)) + rubric_scores = [rd['rubric_scores'] for rd in all_responses] + grader_types = [rd['grader_types'] for rd in all_responses] + feedback_items = [rd['feedback_items'] for rd in all_responses] + + rubric_html = self.rubric_renderer.render_combined_rubric(self.static_data['rubric'], rubric_scores, + grader_types, feedback_items) + + context = {'results': rubric_html, 'task_number': task_number + 1, 'task_name' : response_dict['human_task']} html = self.system.render_template('combined_open_ended_results.html', context) return {'html': html, 'success': True} - def get_results(self, get): + def get_results_old(self, get): """ Gets the results of a given grader via ajax. Input: AJAX get dictionary diff --git a/common/lib/xmodule/xmodule/combined_open_ended_rubric.py b/common/lib/xmodule/xmodule/combined_open_ended_rubric.py index 25bac18679..6b10b66653 100644 --- a/common/lib/xmodule/xmodule/combined_open_ended_rubric.py +++ b/common/lib/xmodule/xmodule/combined_open_ended_rubric.py @@ -36,7 +36,9 @@ class CombinedOpenEndedRubric(object): {'categories': rubric_categories, 'has_score': self.has_score, 'view_only': self.view_only, - 'max_score': max_score}) + 'max_score': max_score, + 'combined_rubric' : False + }) success = True except: error_message = "[render_rubric] Could not parse the rubric with xml: {0}".format(rubric_xml) @@ -154,6 +156,29 @@ class CombinedOpenEndedRubric(object): return {'description': description, 'options': options, 'score' : score} + def render_combined_rubric(self,rubric_xml,scores,score_types,feedback_types): + score_tuples = CombinedOpenEndedRubric.reformat_scores_for_rendering(scores,score_types,feedback_types) + rubric_categories = self.extract_categories(rubric_xml) + max_scores = map((lambda cat: cat['options'][-1]['points']), rubric_categories) + max_score = max(max_scores) + for i in xrange(0,len(rubric_categories)): + category = rubric_categories[i] + rubric_categories[i]['grader_types'] = [] + for j in xrange(0,len(category['options'])): + for tuple in score_tuples: + if tuple[1] == i and tuple[2] ==j: + for grader_type in tuple[3]: + rubric_categories[i]['grader_types'].append(grader_type) + + html = self.system.render_template('open_ended_rubric.html', + {'categories': rubric_categories, + 'has_score': True, + 'view_only': True, + 'max_score': max_score, + 'combined_rubric' : True + }) + return html + @staticmethod def validate_options(options): @@ -175,10 +200,10 @@ class CombinedOpenEndedRubric(object): def reformat_scores_for_rendering(scores, score_types, feedback_types): success = False if len(scores)==0: - return success + return success, "" if len(scores) != len(score_types) or len(feedback_types) != len(scores): - return success + return success, "" score_lists = [] score_type_list = [] @@ -197,7 +222,7 @@ class CombinedOpenEndedRubric(object): score_type = score_type_list[i] feedback_type = feedback_type_list[i] if len(score_list)!=score_list_len or len(score_type)!=score_list_len or len(feedback_type)!=score_list_len: - return success + return success, "" score_tuples = [] for i in xrange(0,len(score_lists)): @@ -208,6 +233,9 @@ class CombinedOpenEndedRubric(object): score_tuples[tup_ind][3].append(score_type_list[i][j]) score_tuples[tup_ind][4].append(feedback_type_list[i][j]) + success = True + return success, score_tuples + @staticmethod def check_for_tuple_matches(tuples, tuple): category = tuple[1] diff --git a/lms/templates/open_ended_rubric.html b/lms/templates/open_ended_rubric.html index 2436cbb849..0dc4bf29f0 100644 --- a/lms/templates/open_ended_rubric.html +++ b/lms/templates/open_ended_rubric.html @@ -20,11 +20,18 @@
      • % endif % if view_only: - % if option['selected']: + % if option['selected'] and combined_rubric==False: ## if this is the selected rubric block, show it highlighted
        ${option['points']} points : ${option['text']}
        + % elif combined_rubric == True +
        + %for grader_type in option['grader_types'] + ${grader_type} + %endfor + ${option['points']} points : ${option['text']} +
        % endif % else:
      • diff --git a/lms/templates/combined_open_ended_status.html b/lms/templates/combined_open_ended_status.html index d00f763f56..5aeb6b2a37 100644 --- a/lms/templates/combined_open_ended_status.html +++ b/lms/templates/combined_open_ended_status.html @@ -9,9 +9,6 @@ %endif ${status['human_task']} (${status['human_state']}) ${status['score']} / ${status['max_score']} - %if status['type']=="openended" and status['state'] in ['done', 'post_assessment']: - Show results - %endif
        %endfor
        diff --git a/lms/templates/open_ended_rubric.html b/lms/templates/open_ended_rubric.html index 6dad40bbfc..9274d395bb 100644 --- a/lms/templates/open_ended_rubric.html +++ b/lms/templates/open_ended_rubric.html @@ -27,7 +27,7 @@
        % elif combined_rubric == True:
        - %for grader_type in category['grader_types'][j]: + %for grader_type in category['options'][j]['grader_types']: ${grader_type} %endfor ${option['points']} points : ${option['text']} From a2d9e666349df9a4fb6de0e584a742b74aaf5596 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 7 Feb 2013 18:21:50 -0500 Subject: [PATCH 34/79] Centralized rubric now displays properly --- .../xmodule/combined_open_ended_modulev1.py | 25 +++++++++++++------ .../js/src/combinedopenended/display.coffee | 11 ++++++++ .../lib/xmodule/xmodule/open_ended_module.py | 2 +- .../combined_open_ended_results.html | 4 +-- 4 files changed, 31 insertions(+), 11 deletions(-) diff --git a/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py b/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py index 5236e4bc78..14849d3f28 100644 --- a/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py +++ b/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py @@ -519,20 +519,23 @@ class CombinedOpenEndedV1Module(): Input: AJAX get dictionary Output: Dictionary to be rendered via ajax that contains the result html. """ - task_number = int(get['task_number']) self.update_task_states() all_responses = [] - for i in xrange(0,task_number+1): + for i in xrange(0,self.current_task_number+1): all_responses.append(self.get_last_response(i)) - rubric_scores = [rd['rubric_scores'] for rd in all_responses] - grader_types = [rd['grader_types'] for rd in all_responses] - feedback_items = [rd['feedback_items'] for rd in all_responses] + rubric_scores = [rd['rubric_scores'] for rd in all_responses if len(rd['rubric_scores'])>0] + grader_types = [rd['grader_types'] for rd in all_responses if len(rd['grader_types'])>0] + feedback_items = [rd['feedback_items'] for rd in all_responses if len(rd['feedback_items'])>0] rubric_html = self.rubric_renderer.render_combined_rubric(stringify_children(self.static_data['rubric']), rubric_scores, grader_types, feedback_items) response_dict = all_responses[-1] - context = {'results': rubric_html, 'task_number': task_number + 1, 'task_name' : response_dict['human_task']} + context = { + 'results': rubric_html, + 'task_name' : 'Combined Rubric', + 'class_name' : 'combined-rubric-container' + } html = self.system.render_template('combined_open_ended_results.html', context) return {'html': html, 'success': True} @@ -545,7 +548,12 @@ class CombinedOpenEndedV1Module(): task_number = int(get['task_number']) self.update_task_states() response_dict = self.get_last_response(task_number) - context = {'results': response_dict['post_assessment'], 'task_number': task_number + 1, 'task_name' : response_dict['human_task']} + context = { + 'results': response_dict['post_assessment'], + 'task_number': task_number + 1, + 'task_name' : response_dict['human_task'], + 'class_name' : "result-container", + } html = self.system.render_template('combined_open_ended_results.html', context) return {'html': html, 'success': True} @@ -563,7 +571,8 @@ class CombinedOpenEndedV1Module(): handlers = { 'next_problem': self.next_problem, 'reset': self.reset, - 'get_results': self.get_results + 'get_results': self.get_results, + 'get_combined_rubric': self.get_rubric, } if dispatch not in handlers: diff --git a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee index 9c3f10d5a2..4774ed5655 100644 --- a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee @@ -64,6 +64,7 @@ class @CombinedOpenEnded @submit_evaluation_button.click @message_post @results_container = $('.result-container') + @combined_rubric_container = $('.combined-rubric-container') # Where to put the rubric once we load it @el = $(element).find('section.open-ended-child') @@ -122,6 +123,13 @@ class @CombinedOpenEnded else @gentle_alert response.error + show_combined_rubric_current: () => + data = {} + $.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') + message_post: (event)=> Logger.log 'message_post', @answers external_grader_message=$(event.target).parent().parent().parent() @@ -163,6 +171,9 @@ class @CombinedOpenEnded @next_problem_button.hide() @hide_file_upload() @hint_area.attr('disabled', false) + + if @task_number>1 + @show_combined_rubric_current() if @task_number==1 and @child_state=='assessing' @prompt_hide() if @child_state == 'done' diff --git a/common/lib/xmodule/xmodule/open_ended_module.py b/common/lib/xmodule/xmodule/open_ended_module.py index 6ef13c26fb..8ba85eef0e 100644 --- a/common/lib/xmodule/xmodule/open_ended_module.py +++ b/common/lib/xmodule/xmodule/open_ended_module.py @@ -429,7 +429,7 @@ class OpenEndedModule(openendedchild.OpenEndedChild): correct: Correctness of submission (Boolean) score: Points to be assigned (numeric, can be float) """ - fail = {'valid': False, 'score': 0, 'feedback': '', 'rubric_scores' : []} + fail = {'valid': False, 'score': 0, 'feedback': '', 'rubric_scores' : [], 'grader_types' : [], 'feedback_items' : []} try: score_result = json.loads(score_msg) except (TypeError, ValueError): diff --git a/lms/templates/combined_open_ended_results.html b/lms/templates/combined_open_ended_results.html index 698a4f52a4..0a03737b8f 100644 --- a/lms/templates/combined_open_ended_results.html +++ b/lms/templates/combined_open_ended_results.html @@ -1,4 +1,4 @@ -
        -

        Results from ${task_name}

        +
        +

        ${task_name}

        ${results | n}
        From 497336335395faef3fca5ace567b13a3e92c2b6a Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 7 Feb 2013 18:35:09 -0500 Subject: [PATCH 35/79] Attach images to rubric to indicate which graders scored what --- .../xmodule/xmodule/combined_open_ended_rubric.py | 8 +++++++- common/static/images/ml_grading_icon.png | Bin 0 -> 405 bytes common/static/images/peer_grading_icon.png | Bin 0 -> 610 bytes common/static/images/self_assessment_icon.png | Bin 0 -> 705 bytes lms/templates/open_ended_rubric.html | 3 ++- 5 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 common/static/images/ml_grading_icon.png create mode 100644 common/static/images/peer_grading_icon.png create mode 100644 common/static/images/self_assessment_icon.png diff --git a/common/lib/xmodule/xmodule/combined_open_ended_rubric.py b/common/lib/xmodule/xmodule/combined_open_ended_rubric.py index 0cfa6cde88..a9771cd878 100644 --- a/common/lib/xmodule/xmodule/combined_open_ended_rubric.py +++ b/common/lib/xmodule/xmodule/combined_open_ended_rubric.py @@ -171,12 +171,18 @@ class CombinedOpenEndedRubric(object): rubric_categories[i]['options'][j]['grader_types'].append(grader_type) log.debug(rubric_categories) + grader_type_image_dict = { + 'SA' : '/static/images/self_assessment_icon.png', + 'PE' : '/static/images/peer_grading_icon.png', + 'ML' : '/static/images/ml_grading_icon.png', + } html = self.system.render_template('open_ended_rubric.html', {'categories': rubric_categories, 'has_score': True, 'view_only': True, 'max_score': max_score, - 'combined_rubric' : True + 'combined_rubric' : True, + 'grader_type_image_dict' : grader_type_image_dict, }) return html diff --git a/common/static/images/ml_grading_icon.png b/common/static/images/ml_grading_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..283355814e64c04fbc49a5e72fbdc7f193d0eeeb GIT binary patch literal 405 zcmV;G0c!q^BrBB({|1i?CG@(Mn{)q;gZNM*P~*N@vchSkgIxsrv!b!X^P2*aLL&;4a)O;6#y{+*!8BIJ0(d%Ns`Qx zFvciNQ>1Cyuot?nQ&>{ZWt*mnilX=hv~4>$9^XEh$@9{~mcIEpBrTU)N700000NkvXXu0mjfbDFIk literal 0 HcmV?d00001 diff --git a/common/static/images/peer_grading_icon.png b/common/static/images/peer_grading_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..0ee7cf5f1740d2b3f7df3e8ed4eb8ff68a8964ed GIT binary patch literal 610 zcmV-o0-gPdP)?%7k*K zJ2m{yf=hx7z=!wNvrGfx|KDD30%H&xBnFdbVjv7MEz+hk{QvbFj6rN9*D$aUVF1Iw zZ?|#EF`@evi2sA|l~oZBpf*iEwPXUrzwdXz7{msN!Spb~0udHamO1Od{Nq!C7zDI} zKfhFQ=Y4;qlR@I$U9k8IA!UYpl15-dYC@M~Asg@?>OVL*F)N$Fy80c%yU!0WoIY(! zJ=hQyLVo@D^(DjkyPGk@lie#BCatZ>gd4yoV|D=OKL?XwA29#S+AR#?Mu`kRe*R_P z=Tc<2_4F8A^YL?M7+xAZXZZ5z6C@VOXP(`4_i3w*J>$fG3~RT51C~uSp5ZuC3B&7M zPZqX|Dr=sCmdD|i2h>L{ZGDoAYcCuNo&-~aw`F!NvUu;^VFx&Px#07*qoM6N<$f>tOHDF6Tf literal 0 HcmV?d00001 diff --git a/common/static/images/self_assessment_icon.png b/common/static/images/self_assessment_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..c4b84e2ec8a63baf55e25c2bdefcc23210f0b397 GIT binary patch literal 705 zcmV;y0zUnTP)qBW^5fQ_nundO@Z4F(c z)XjWrbMxiiy!Y;UJNGJK8%X});d#z;{^xfd&b^c2 zc#Z>2(>{i#Z$I~X->>#bqS65ttF1@s0?+ecSr#dd;pgU<%6KdmSPf7i zP2{F}c2TL8z!D%O2#}^=7Z=qW%ibXt$7+8DfMb%i+AIM#To+MpP=QYg_%h0(xuqSP zAe>0|E7BW@B$Ivlsv8z_AsL$kwIpEg?qXcI=EA~nL7VPZHFenkX*8V)4_geZiA#=S ziRa{=Nb3D&C0Z{`1l*7H%f6L!850nBCPOcw$k_;yQj<{0_4E&~yq9jK8lRoZAXEiA z+P4%PcjlW8%j?)kH>ScbJiR+l*JS|4eIeudJ{VrA8};Cx_5C_!hJD%tP17##=HV6zxIl)B5(}ZRO5`6~{0=`yEMo0(lz> zut{fHeuLRj#OI^P)o#URT@l_5yh1qo)#EW{Nx!M*j{pMzFop+aEaMdd00000NkvXXu0mjf!}dJh literal 0 HcmV?d00001 diff --git a/lms/templates/open_ended_rubric.html b/lms/templates/open_ended_rubric.html index 9274d395bb..47300508d0 100644 --- a/lms/templates/open_ended_rubric.html +++ b/lms/templates/open_ended_rubric.html @@ -28,7 +28,8 @@ % elif combined_rubric == True:
        %for grader_type in category['options'][j]['grader_types']: - ${grader_type} + <% grader_image = grader_type_image_dict[grader_type]%> + %endfor ${option['points']} points : ${option['text']}
        From f5fcd3e1ffe1c5b4373ffcd5fc5e67ee2bcbadb5 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 7 Feb 2013 18:37:03 -0500 Subject: [PATCH 36/79] Make grader image dict a constant --- .../xmodule/xmodule/combined_open_ended_rubric.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/common/lib/xmodule/xmodule/combined_open_ended_rubric.py b/common/lib/xmodule/xmodule/combined_open_ended_rubric.py index a9771cd878..e9454de7ef 100644 --- a/common/lib/xmodule/xmodule/combined_open_ended_rubric.py +++ b/common/lib/xmodule/xmodule/combined_open_ended_rubric.py @@ -3,6 +3,11 @@ from lxml import etree log = logging.getLogger(__name__) +GRADER_TYPE_IMAGE_DICT = { + 'SA' : '/static/images/self_assessment_icon.png', + 'PE' : '/static/images/peer_grading_icon.png', + 'ML' : '/static/images/ml_grading_icon.png', + } class RubricParsingError(Exception): def __init__(self, msg): @@ -171,18 +176,13 @@ class CombinedOpenEndedRubric(object): rubric_categories[i]['options'][j]['grader_types'].append(grader_type) log.debug(rubric_categories) - grader_type_image_dict = { - 'SA' : '/static/images/self_assessment_icon.png', - 'PE' : '/static/images/peer_grading_icon.png', - 'ML' : '/static/images/ml_grading_icon.png', - } html = self.system.render_template('open_ended_rubric.html', {'categories': rubric_categories, 'has_score': True, 'view_only': True, 'max_score': max_score, 'combined_rubric' : True, - 'grader_type_image_dict' : grader_type_image_dict, + 'grader_type_image_dict' : GRADER_TYPE_IMAGE_DICT, }) return html From 68eb802516a5b2afdcf874dfd7a36e6c6e9a85cc Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 7 Feb 2013 18:48:13 -0500 Subject: [PATCH 37/79] Remove images from status bar after finding out that they run afoul of the rewriting of static links. Need to send them back via ajax to avoid --- common/lib/xmodule/xmodule/combined_open_ended_modulev1.py | 5 +++-- common/lib/xmodule/xmodule/combined_open_ended_rubric.py | 1 + lms/templates/combined_open_ended_status.html | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py b/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py index 14849d3f28..09f89f5756 100644 --- a/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py +++ b/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py @@ -21,7 +21,7 @@ from .xml_module import XmlDescriptor from xmodule.modulestore import Location import self_assessment_module import open_ended_module -from combined_open_ended_rubric import CombinedOpenEndedRubric, RubricParsingError +from combined_open_ended_rubric import CombinedOpenEndedRubric, RubricParsingError, GRADER_TYPE_IMAGE_DICT from .stringify import stringify_children import dateutil import dateutil.parser @@ -477,6 +477,7 @@ class CombinedOpenEndedV1Module(): 'rubric_scores' : rubric_scores, 'grader_types' : grader_types, 'feedback_items' : feedback_items, + 'grader_type' : grader_types[0], } return last_response_dict @@ -647,7 +648,7 @@ class CombinedOpenEndedV1Module(): task_data = self.get_last_response(i) task_data.update({'task_number': i + 1}) status.append(task_data) - context = {'status_list': status} + context = {'status_list': status, 'grader_type_image_dict' : GRADER_TYPE_IMAGE_DICT} status_html = self.system.render_template("combined_open_ended_status.html", context) return status_html diff --git a/common/lib/xmodule/xmodule/combined_open_ended_rubric.py b/common/lib/xmodule/xmodule/combined_open_ended_rubric.py index e9454de7ef..abb8945aee 100644 --- a/common/lib/xmodule/xmodule/combined_open_ended_rubric.py +++ b/common/lib/xmodule/xmodule/combined_open_ended_rubric.py @@ -7,6 +7,7 @@ GRADER_TYPE_IMAGE_DICT = { 'SA' : '/static/images/self_assessment_icon.png', 'PE' : '/static/images/peer_grading_icon.png', 'ML' : '/static/images/ml_grading_icon.png', + 'IN' : '/static/images/peer_grading_icon.png', } class RubricParsingError(Exception): diff --git a/lms/templates/combined_open_ended_status.html b/lms/templates/combined_open_ended_status.html index 5aeb6b2a37..d2c6ab1224 100644 --- a/lms/templates/combined_open_ended_status.html +++ b/lms/templates/combined_open_ended_status.html @@ -8,7 +8,8 @@
        %endif - ${status['human_task']} (${status['human_state']}) ${status['score']} / ${status['max_score']} + <% grader_image = grader_type_image_dict[status['grader_type']]%> + ${status['human_task']}(${status['human_state']}) ${status['score']} / ${status['max_score']}
        %endfor
        From 14372a4079bd96c4821b276155a2dc4b398e604f Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 7 Feb 2013 19:02:01 -0500 Subject: [PATCH 38/79] Address some issues with robustness, make images work properly throughout flow --- .../lib/xmodule/xmodule/combined_open_ended_modulev1.py | 8 +++++++- common/lib/xmodule/xmodule/open_ended_module.py | 2 +- lms/templates/combined_open_ended_status.html | 5 +++-- lms/templates/open_ended_rubric.html | 6 ++++-- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py b/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py index 09f89f5756..8ea27ce867 100644 --- a/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py +++ b/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py @@ -8,6 +8,7 @@ from lxml.html import rewrite_links from path import path import os import sys +import re from pkg_resources import resource_string @@ -462,6 +463,10 @@ class CombinedOpenEndedV1Module(): human_state = task.HUMAN_NAMES[state] else: human_state = state + if len(grader_types)>0: + grader_type = grader_types[0] + else: + grader_type = "IN" last_response_dict = { 'response': last_response, 'score': last_score, @@ -477,7 +482,7 @@ class CombinedOpenEndedV1Module(): 'rubric_scores' : rubric_scores, 'grader_types' : grader_types, 'feedback_items' : feedback_items, - 'grader_type' : grader_types[0], + 'grader_type' : grader_type, } return last_response_dict @@ -648,6 +653,7 @@ class CombinedOpenEndedV1Module(): task_data = self.get_last_response(i) task_data.update({'task_number': i + 1}) status.append(task_data) + context = {'status_list': status, 'grader_type_image_dict' : GRADER_TYPE_IMAGE_DICT} status_html = self.system.render_template("combined_open_ended_status.html", context) diff --git a/common/lib/xmodule/xmodule/open_ended_module.py b/common/lib/xmodule/xmodule/open_ended_module.py index 8ba85eef0e..2feab3e035 100644 --- a/common/lib/xmodule/xmodule/open_ended_module.py +++ b/common/lib/xmodule/xmodule/open_ended_module.py @@ -429,7 +429,7 @@ class OpenEndedModule(openendedchild.OpenEndedChild): correct: Correctness of submission (Boolean) score: Points to be assigned (numeric, can be float) """ - fail = {'valid': False, 'score': 0, 'feedback': '', 'rubric_scores' : [], 'grader_types' : [], 'feedback_items' : []} + fail = {'valid': False, 'score': 0, 'feedback': '', 'rubric_scores' : [[0,0]], 'grader_types' : [''], 'feedback_items' : ['']} try: score_result = json.loads(score_msg) except (TypeError, ValueError): diff --git a/lms/templates/combined_open_ended_status.html b/lms/templates/combined_open_ended_status.html index d2c6ab1224..7d803fc230 100644 --- a/lms/templates/combined_open_ended_status.html +++ b/lms/templates/combined_open_ended_status.html @@ -7,8 +7,9 @@ %else:
        %endif - - <% grader_image = grader_type_image_dict[status['grader_type']]%> + %if status['grader_type'] in grader_type_image_dict: + <% grader_image = grader_type_image_dict[status['grader_type']]%> + %endif ${status['human_task']}(${status['human_state']}) ${status['score']} / ${status['max_score']}
        %endfor diff --git a/lms/templates/open_ended_rubric.html b/lms/templates/open_ended_rubric.html index 47300508d0..372dc2230a 100644 --- a/lms/templates/open_ended_rubric.html +++ b/lms/templates/open_ended_rubric.html @@ -28,8 +28,10 @@ % elif combined_rubric == True:
        %for grader_type in category['options'][j]['grader_types']: - <% grader_image = grader_type_image_dict[grader_type]%> - + % if grader_type in grader_type_image_dict: + <% grader_image = grader_type_image_dict[grader_type]%> + + % endif %endfor ${option['points']} points : ${option['text']}
        From a49f740e87c9a9058eb553c7bc7205dfafe219ba Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 7 Feb 2013 19:22:54 -0500 Subject: [PATCH 39/79] Fix rubric and make images display with tooltips --- .../xmodule/combined_open_ended_modulev1.py | 19 ++++++++++++++++++- .../xmodule/combined_open_ended_rubric.py | 8 ++++++++ .../js/src/combinedopenended/display.coffee | 10 +++++++++- lms/templates/combined_open_ended_status.html | 5 ++++- lms/templates/open_ended_rubric.html | 9 +++++++-- 5 files changed, 46 insertions(+), 5 deletions(-) diff --git a/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py b/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py index 8ea27ce867..a515ad2553 100644 --- a/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py +++ b/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py @@ -22,7 +22,7 @@ from .xml_module import XmlDescriptor from xmodule.modulestore import Location import self_assessment_module import open_ended_module -from combined_open_ended_rubric import CombinedOpenEndedRubric, RubricParsingError, GRADER_TYPE_IMAGE_DICT +from combined_open_ended_rubric import CombinedOpenEndedRubric, RubricParsingError, GRADER_TYPE_IMAGE_DICT, HUMAN_GRADER_TYPE from .stringify import stringify_children import dateutil import dateutil.parser @@ -467,6 +467,12 @@ class CombinedOpenEndedV1Module(): grader_type = grader_types[0] else: grader_type = "IN" + + if grader_type in HUMAN_GRADER_TYPE: + human_grader_name = HUMAN_GRADER_TYPE[grader_type] + else: + human_grader_name = grader_type + last_response_dict = { 'response': last_response, 'score': last_score, @@ -483,6 +489,7 @@ class CombinedOpenEndedV1Module(): 'grader_types' : grader_types, 'feedback_items' : feedback_items, 'grader_type' : grader_type, + 'human_grader_type' : human_grader_name, } return last_response_dict @@ -563,6 +570,15 @@ class CombinedOpenEndedV1Module(): html = self.system.render_template('combined_open_ended_results.html', context) return {'html': html, 'success': True} + def get_status_ajax(self, get): + """ + Gets the results of a given grader via ajax. + Input: AJAX get dictionary + Output: Dictionary to be rendered via ajax that contains the result html. + """ + html = self.get_status() + return {'html': html, 'success': True} + def handle_ajax(self, dispatch, get): """ This is called by courseware.module_render, to handle an AJAX call. @@ -579,6 +595,7 @@ class CombinedOpenEndedV1Module(): 'reset': self.reset, 'get_results': self.get_results, 'get_combined_rubric': self.get_rubric, + 'get_status' : self.get_status_ajax, } if dispatch not in handlers: diff --git a/common/lib/xmodule/xmodule/combined_open_ended_rubric.py b/common/lib/xmodule/xmodule/combined_open_ended_rubric.py index abb8945aee..4394e15f37 100644 --- a/common/lib/xmodule/xmodule/combined_open_ended_rubric.py +++ b/common/lib/xmodule/xmodule/combined_open_ended_rubric.py @@ -10,6 +10,13 @@ GRADER_TYPE_IMAGE_DICT = { 'IN' : '/static/images/peer_grading_icon.png', } +HUMAN_GRADER_TYPE = { + 'SA' : 'Self-Assessment', + 'PE' : 'Peer-Assessment', + 'IN' : 'Instructor-Assessment', + 'ML' : 'AI-Assessment', + } + class RubricParsingError(Exception): def __init__(self, msg): self.msg = msg @@ -184,6 +191,7 @@ class CombinedOpenEndedRubric(object): 'max_score': max_score, 'combined_rubric' : True, 'grader_type_image_dict' : GRADER_TYPE_IMAGE_DICT, + 'human_grader_types' : HUMAN_GRADER_TYPE, }) return html diff --git a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee index 4774ed5655..a710ecbd0c 100644 --- a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee @@ -51,6 +51,7 @@ class @CombinedOpenEnded @reset_button.click @reset @next_problem_button = @$('.next-step-button') @next_problem_button.click @next_problem + @status_container = @$('.status-elements') @show_results_button=@$('.show-results-button') @show_results_button.click @show_results @@ -130,6 +131,13 @@ class @CombinedOpenEnded @combined_rubric_container.after(response.html).remove() @combined_rubric_container= $('div.combined_rubric_container') + show_status_current: () => + data = {} + $.postWithPrefix "#{@ajax_url}/get_status", data, (response) => + if response.success + @status_container.after(response.html).remove() + @status_container= $('.status-elements') + message_post: (event)=> Logger.log 'message_post', @answers external_grader_message=$(event.target).parent().parent().parent() @@ -171,7 +179,7 @@ class @CombinedOpenEnded @next_problem_button.hide() @hide_file_upload() @hint_area.attr('disabled', false) - + @show_status_current() if @task_number>1 @show_combined_rubric_current() if @task_number==1 and @child_state=='assessing' diff --git a/lms/templates/combined_open_ended_status.html b/lms/templates/combined_open_ended_status.html index 7d803fc230..116bca87a4 100644 --- a/lms/templates/combined_open_ended_status.html +++ b/lms/templates/combined_open_ended_status.html @@ -9,8 +9,11 @@ %endif %if status['grader_type'] in grader_type_image_dict: <% grader_image = grader_type_image_dict[status['grader_type']]%> + + %else: + ${status['human_task']} %endif - ${status['human_task']}(${status['human_state']}) ${status['score']} / ${status['max_score']} + (${status['human_state']}) ${status['score']} / ${status['max_score']}
        %endfor
        diff --git a/lms/templates/open_ended_rubric.html b/lms/templates/open_ended_rubric.html index 372dc2230a..58e74a68da 100644 --- a/lms/templates/open_ended_rubric.html +++ b/lms/templates/open_ended_rubric.html @@ -29,8 +29,13 @@
        %for grader_type in category['options'][j]['grader_types']: % if grader_type in grader_type_image_dict: - <% grader_image = grader_type_image_dict[grader_type]%> - + <% grader_image = grader_type_image_dict[grader_type] %> + % if grader_type in human_grader_types: + <% human_title = human_grader_types[grader_type] %> + % else: + <% human_title = grader_type %> + % endif + % endif %endfor ${option['points']} points : ${option['text']} From 17cc6b4dffd7b5362e5725138e70bb7d5214b5f8 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 7 Feb 2013 19:26:21 -0500 Subject: [PATCH 40/79] Fix minor display issue --- common/lib/xmodule/xmodule/openendedchild.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/lib/xmodule/xmodule/openendedchild.py b/common/lib/xmodule/xmodule/openendedchild.py index 09e1e92903..c83b0f0ea3 100644 --- a/common/lib/xmodule/xmodule/openendedchild.py +++ b/common/lib/xmodule/xmodule/openendedchild.py @@ -70,7 +70,7 @@ class OpenEndedChild(object): HUMAN_NAMES = { 'initial': 'Not started', 'assessing': 'In progress', - 'post_assessment': 'In progress', + 'post_assessment': 'Done', 'done': 'Done', } From 0c6ac1c743b7941d1c4ff7ceff5765f449b4febe Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Fri, 8 Feb 2013 22:43:38 -0500 Subject: [PATCH 41/79] Add in BC --- common/lib/xmodule/xmodule/combined_open_ended_rubric.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/lib/xmodule/xmodule/combined_open_ended_rubric.py b/common/lib/xmodule/xmodule/combined_open_ended_rubric.py index 4394e15f37..a0f42a14cf 100644 --- a/common/lib/xmodule/xmodule/combined_open_ended_rubric.py +++ b/common/lib/xmodule/xmodule/combined_open_ended_rubric.py @@ -8,6 +8,7 @@ GRADER_TYPE_IMAGE_DICT = { 'PE' : '/static/images/peer_grading_icon.png', 'ML' : '/static/images/ml_grading_icon.png', 'IN' : '/static/images/peer_grading_icon.png', + 'BC' : '/static/images/ml_grading_icon.png', } HUMAN_GRADER_TYPE = { @@ -15,6 +16,7 @@ HUMAN_GRADER_TYPE = { 'PE' : 'Peer-Assessment', 'IN' : 'Instructor-Assessment', 'ML' : 'AI-Assessment', + 'BC' : 'AI-Assessment', } class RubricParsingError(Exception): From 35babcf5920d8910bbe0dad2da79e694aa8f61ea Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Fri, 8 Feb 2013 22:55:20 -0500 Subject: [PATCH 42/79] Properly show status on combined rubric --- .../xmodule/xmodule/combined_open_ended_modulev1.py | 12 ++++++++++-- common/lib/xmodule/xmodule/open_ended_module.py | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py b/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py index a515ad2553..ef8e8ce4e4 100644 --- a/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py +++ b/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py @@ -534,12 +534,20 @@ class CombinedOpenEndedV1Module(): """ self.update_task_states() all_responses = [] - for i in xrange(0,self.current_task_number+1): + loop_up_to_task = self.current_task_number+1 + if self.state in [self.ASSESSING, self.INITIAL] and self.current_task_number>0: + loop_up_to_task = loop_up_to_task-1 + log.debug(self.state) + log.debug(self.current_task_number) + log.debug(loop_up_to_task) + for i in xrange(0,loop_up_to_task): all_responses.append(self.get_last_response(i)) rubric_scores = [rd['rubric_scores'] for rd in all_responses if len(rd['rubric_scores'])>0] grader_types = [rd['grader_types'] for rd in all_responses if len(rd['grader_types'])>0] feedback_items = [rd['feedback_items'] for rd in all_responses if len(rd['feedback_items'])>0] - + log.debug(rubric_scores) + log.debug(grader_types) + log.debug(feedback_items) rubric_html = self.rubric_renderer.render_combined_rubric(stringify_children(self.static_data['rubric']), rubric_scores, grader_types, feedback_items) diff --git a/common/lib/xmodule/xmodule/open_ended_module.py b/common/lib/xmodule/xmodule/open_ended_module.py index 2feab3e035..c9d12ef75c 100644 --- a/common/lib/xmodule/xmodule/open_ended_module.py +++ b/common/lib/xmodule/xmodule/open_ended_module.py @@ -429,7 +429,7 @@ class OpenEndedModule(openendedchild.OpenEndedChild): correct: Correctness of submission (Boolean) score: Points to be assigned (numeric, can be float) """ - fail = {'valid': False, 'score': 0, 'feedback': '', 'rubric_scores' : [[0,0]], 'grader_types' : [''], 'feedback_items' : ['']} + fail = {'valid': False, 'score': 0, 'feedback': '', 'rubric_scores' : [[0]], 'grader_types' : [''], 'feedback_items' : ['']} try: score_result = json.loads(score_msg) except (TypeError, ValueError): From 8bfad8f2bd0c7ee83b0ac1631275a51a6df57c98 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Fri, 8 Feb 2013 23:11:51 -0500 Subject: [PATCH 43/79] Work on properly displaying rubric icons --- common/lib/xmodule/xmodule/combined_open_ended_modulev1.py | 3 ++- .../xmodule/xmodule/js/src/combinedopenended/display.coffee | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py b/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py index ef8e8ce4e4..59b9fa5ebb 100644 --- a/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py +++ b/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py @@ -532,11 +532,12 @@ class CombinedOpenEndedV1Module(): Input: AJAX get dictionary Output: Dictionary to be rendered via ajax that contains the result html. """ - self.update_task_states() all_responses = [] loop_up_to_task = self.current_task_number+1 if self.state in [self.ASSESSING, self.INITIAL] and self.current_task_number>0: loop_up_to_task = loop_up_to_task-1 + log.debug(self.allow_reset) + log.debug(self.check_allow_reset()) log.debug(self.state) log.debug(self.current_task_number) log.debug(loop_up_to_task) diff --git a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee index a710ecbd0c..377d08cd13 100644 --- a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee @@ -96,6 +96,9 @@ class @CombinedOpenEnded @rebind() + if @task_number>1 + @show_combined_rubric_current() + # locally scoped jquery. $: (selector) -> $(selector, @el) @@ -180,8 +183,6 @@ class @CombinedOpenEnded @hide_file_upload() @hint_area.attr('disabled', false) @show_status_current() - if @task_number>1 - @show_combined_rubric_current() if @task_number==1 and @child_state=='assessing' @prompt_hide() if @child_state == 'done' From 5ac6fad1f70212072075921235e55ef9070acced Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Fri, 8 Feb 2013 23:16:44 -0500 Subject: [PATCH 44/79] Properly display rubric scores at all times --- .../xmodule/xmodule/combined_open_ended_modulev1.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py b/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py index 59b9fa5ebb..22e65b2347 100644 --- a/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py +++ b/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py @@ -534,18 +534,11 @@ class CombinedOpenEndedV1Module(): """ all_responses = [] loop_up_to_task = self.current_task_number+1 - if self.state in [self.ASSESSING, self.INITIAL] and self.current_task_number>0: - loop_up_to_task = loop_up_to_task-1 - log.debug(self.allow_reset) - log.debug(self.check_allow_reset()) - log.debug(self.state) - log.debug(self.current_task_number) - log.debug(loop_up_to_task) for i in xrange(0,loop_up_to_task): all_responses.append(self.get_last_response(i)) - rubric_scores = [rd['rubric_scores'] for rd in all_responses if len(rd['rubric_scores'])>0] - grader_types = [rd['grader_types'] for rd in all_responses if len(rd['grader_types'])>0] - feedback_items = [rd['feedback_items'] for rd in all_responses if len(rd['feedback_items'])>0] + 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()] log.debug(rubric_scores) log.debug(grader_types) log.debug(feedback_items) From 70f718572377d246041d3f51f539aef031d8d7e2 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Fri, 8 Feb 2013 23:27:45 -0500 Subject: [PATCH 45/79] Make a legend --- .../xmodule/combined_open_ended_modulev1.py | 4 +- .../xmodule/combined_open_ended_rubric.py | 4 ++ lms/templates/combined_open_ended.html | 1 - lms/templates/combined_open_ended_status.html | 46 +++++++++++-------- 4 files changed, 34 insertions(+), 21 deletions(-) diff --git a/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py b/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py index 22e65b2347..a5eb2ed64c 100644 --- a/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py +++ b/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py @@ -22,7 +22,7 @@ from .xml_module import XmlDescriptor from xmodule.modulestore import Location import self_assessment_module import open_ended_module -from combined_open_ended_rubric import CombinedOpenEndedRubric, RubricParsingError, GRADER_TYPE_IMAGE_DICT, HUMAN_GRADER_TYPE +from combined_open_ended_rubric import CombinedOpenEndedRubric, RubricParsingError, GRADER_TYPE_IMAGE_DICT, HUMAN_GRADER_TYPE, LEGEND_LIST from .stringify import stringify_children import dateutil import dateutil.parser @@ -673,7 +673,7 @@ class CombinedOpenEndedV1Module(): task_data.update({'task_number': i + 1}) status.append(task_data) - context = {'status_list': status, 'grader_type_image_dict' : GRADER_TYPE_IMAGE_DICT} + context = {'status_list': status, 'grader_type_image_dict' : GRADER_TYPE_IMAGE_DICT, 'legend_list' : LEGEND_LIST} status_html = self.system.render_template("combined_open_ended_status.html", context) return status_html diff --git a/common/lib/xmodule/xmodule/combined_open_ended_rubric.py b/common/lib/xmodule/xmodule/combined_open_ended_rubric.py index a0f42a14cf..162a188c72 100644 --- a/common/lib/xmodule/xmodule/combined_open_ended_rubric.py +++ b/common/lib/xmodule/xmodule/combined_open_ended_rubric.py @@ -19,6 +19,10 @@ HUMAN_GRADER_TYPE = { 'BC' : 'AI-Assessment', } +DO_NOT_DISPLAY = ['BC', 'IN'] + +LEGEND_LIST = [{'name' : HUMAN_GRADER_TYPE[k], 'image' : GRADER_TYPE_IMAGE_DICT[k]} for k in GRADER_TYPE_IMAGE_DICT.keys() if k not in DO_NOT_DISPLAY ] + class RubricParsingError(Exception): def __init__(self, msg): self.msg = msg diff --git a/lms/templates/combined_open_ended.html b/lms/templates/combined_open_ended.html index e219814744..db5edc2159 100644 --- a/lms/templates/combined_open_ended.html +++ b/lms/templates/combined_open_ended.html @@ -17,7 +17,6 @@
        -
        diff --git a/lms/templates/combined_open_ended_status.html b/lms/templates/combined_open_ended_status.html index 116bca87a4..d41d2dc718 100644 --- a/lms/templates/combined_open_ended_status.html +++ b/lms/templates/combined_open_ended_status.html @@ -1,20 +1,30 @@
        -
        - %for i in xrange(0,len(status_list)): - <%status=status_list[i]%> - %if i==len(status_list)-1: -
        - %else: -
        - %endif - %if status['grader_type'] in grader_type_image_dict: - <% grader_image = grader_type_image_dict[status['grader_type']]%> - - %else: - ${status['human_task']} - %endif - (${status['human_state']}) ${status['score']} / ${status['max_score']} -
        - %endfor -
        +
        + % for i in xrange(0,len(legend_list)): + <%legend_title=legend_list[i]['name'] %> + <%legend_image=legend_list[i]['image'] %> + +
        + ${legend_title}= +
        + % endfor +
        +
        + %for i in xrange(0,len(status_list)): + <%status=status_list[i]%> + %if i==len(status_list)-1: +
        + %else: +
        + %endif + %if status['grader_type'] in grader_type_image_dict: + <% grader_image = grader_type_image_dict[status['grader_type']]%> + + %else: + ${status['human_task']} + %endif + (${status['human_state']}) ${status['score']} / ${status['max_score']} +
        + %endfor +
        From dbfc77e4a5a03e2f51f86bd941a0207cf8d2f89f Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Fri, 8 Feb 2013 23:37:03 -0500 Subject: [PATCH 46/79] Add in legend, move status bar, fix js where it was constantly displaying a message --- .../xmodule/css/combinedopenended/display.scss | 15 +++++++++++++-- .../js/src/combinedopenended/display.coffee | 14 +++++++------- lms/templates/combined_open_ended.html | 8 ++++---- lms/templates/combined_open_ended_status.html | 2 +- 4 files changed, 25 insertions(+), 14 deletions(-) diff --git a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss index d8072bb1b3..b2139d3b31 100644 --- a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss +++ b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss @@ -43,6 +43,17 @@ section.combined-open-ended { } } +section.legend-container { + .legenditem { + color: #FFFFFF; + background-color : #000000; + font-size: .9em; + padding: 2px; + display: inline; + width: 20%; + } +} + section.combined-open-ended-status { .statusitem { @@ -59,12 +70,12 @@ section.combined-open-ended-status { .show-results-button { font: 1em monospace; } - } + } .statusitem-current { background-color: #B2B2B2; color: #222; - } + } span { &.unanswered { diff --git a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee index 377d08cd13..504a1c2fd3 100644 --- a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee @@ -397,13 +397,13 @@ class @CombinedOpenEnded window.queuePollerID = window.setTimeout(@poll, 10000) setup_file_upload: => - if window.File and window.FileReader and window.FileList and window.Blob - if @accept_file_upload == "True" - @can_upload_files = true - @file_upload_area.html('') - @file_upload_area.show() - 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.' + if @accept_file_upload == "True" + if window.File and window.FileReader and window.FileList and window.Blob + @can_upload_files = true + @file_upload_area.html('') + @file_upload_area.show() + 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.' hide_file_upload: => if @accept_file_upload == "True" diff --git a/lms/templates/combined_open_ended.html b/lms/templates/combined_open_ended.html index db5edc2159..4e298f8ec7 100644 --- a/lms/templates/combined_open_ended.html +++ b/lms/templates/combined_open_ended.html @@ -1,9 +1,5 @@
        -
        - ${status | n} -
        -

        ${display_name}

        @@ -17,6 +13,10 @@
        +
        + ${status | n} +
        +
        diff --git a/lms/templates/combined_open_ended_status.html b/lms/templates/combined_open_ended_status.html index d41d2dc718..fc517bfbba 100644 --- a/lms/templates/combined_open_ended_status.html +++ b/lms/templates/combined_open_ended_status.html @@ -1,5 +1,5 @@
        -
        +
        % for i in xrange(0,len(legend_list)): <%legend_title=legend_list[i]['name'] %> <%legend_image=legend_list[i]['image'] %> From 8ef45915df9396d4eb21a054b049046d647dc57c Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Fri, 8 Feb 2013 23:52:44 -0500 Subject: [PATCH 47/79] Move legend and status around to find optimal placements --- .../xmodule/combined_open_ended_modulev1.py | 14 ++++++++++++++ .../js/src/combinedopenended/display.coffee | 10 ++++++++++ lms/templates/combined_open_ended.html | 9 +++++---- lms/templates/combined_open_ended_legend.html | 12 ++++++++++++ lms/templates/combined_open_ended_status.html | 13 +++---------- 5 files changed, 44 insertions(+), 14 deletions(-) create mode 100644 lms/templates/combined_open_ended_legend.html diff --git a/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py b/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py index a5eb2ed64c..0e14accfeb 100644 --- a/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py +++ b/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py @@ -358,6 +358,7 @@ class CombinedOpenEndedV1Module(): 'status': self.get_status(), 'display_name': self.display_name, 'accept_file_upload': self.accept_file_upload, + 'legend_list' : LEGEND_LIST, } return context @@ -554,6 +555,18 @@ class CombinedOpenEndedV1Module(): html = self.system.render_template('combined_open_ended_results.html', context) return {'html': html, 'success': True} + def get_legend(self, get): + """ + Gets the results of a given grader via ajax. + Input: AJAX get dictionary + Output: Dictionary to be rendered via ajax that contains the result html. + """ + context = { + 'legend_list' : LEGEND_LIST, + } + html = self.system.render_template('combined_open_ended_legend.html', context) + return {'html': html, 'success': True} + def get_results(self, get): """ Gets the results of a given grader via ajax. @@ -598,6 +611,7 @@ class CombinedOpenEndedV1Module(): 'get_results': self.get_results, 'get_combined_rubric': self.get_rubric, 'get_status' : self.get_status_ajax, + 'get_legend' : self.get_legend, } if dispatch not in handlers: diff --git a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee index 504a1c2fd3..fd7f7f916d 100644 --- a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee @@ -67,6 +67,9 @@ class @CombinedOpenEnded @results_container = $('.result-container') @combined_rubric_container = $('.combined-rubric-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') @@ -141,6 +144,13 @@ class @CombinedOpenEnded @status_container.after(response.html).remove() @status_container= $('.status-elements') + show_legend_current: () => + data = {} + $.postWithPrefix "#{@ajax_url}/get_legend", data, (response) => + if response.success + @legend_container.after(response.html).remove() + @legend_container= $('.legend-container') + message_post: (event)=> Logger.log 'message_post', @answers external_grader_message=$(event.target).parent().parent().parent() diff --git a/lms/templates/combined_open_ended.html b/lms/templates/combined_open_ended.html index 4e298f8ec7..700e171ace 100644 --- a/lms/templates/combined_open_ended.html +++ b/lms/templates/combined_open_ended.html @@ -1,5 +1,7 @@
        - +
        + ${status|n} +

        ${display_name}

        @@ -13,10 +15,9 @@
        -
        - ${status | n} -
        +
        +
        diff --git a/lms/templates/combined_open_ended_legend.html b/lms/templates/combined_open_ended_legend.html new file mode 100644 index 0000000000..1ac6e824f4 --- /dev/null +++ b/lms/templates/combined_open_ended_legend.html @@ -0,0 +1,12 @@ +
        +
        +
        + % for i in xrange(0,len(legend_list)): + <%legend_title=legend_list[i]['name'] %> + <%legend_image=legend_list[i]['image'] %> + +
        + ${legend_title}= +
        + % endfor +
        diff --git a/lms/templates/combined_open_ended_status.html b/lms/templates/combined_open_ended_status.html index fc517bfbba..287d269074 100644 --- a/lms/templates/combined_open_ended_status.html +++ b/lms/templates/combined_open_ended_status.html @@ -1,15 +1,8 @@
        -
        - % for i in xrange(0,len(legend_list)): - <%legend_title=legend_list[i]['name'] %> - <%legend_image=legend_list[i]['image'] %> - -
        - ${legend_title}= -
        - % endfor -
        +
        + Status +
        %for i in xrange(0,len(status_list)): <%status=status_list[i]%> %if i==len(status_list)-1: From 0feb8f66bcacb43c11ede7cd5e34e5fe5693f6dc Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Fri, 8 Feb 2013 23:59:39 -0500 Subject: [PATCH 48/79] Fix colors on legend, add random assessment --- .../xmodule/xmodule/combined_open_ended_rubric.py | 2 ++ .../xmodule/css/combinedopenended/display.scss | 3 +-- common/static/images/random_grading_icon.png | Bin 0 -> 724 bytes lms/templates/combined_open_ended_legend.html | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 common/static/images/random_grading_icon.png diff --git a/common/lib/xmodule/xmodule/combined_open_ended_rubric.py b/common/lib/xmodule/xmodule/combined_open_ended_rubric.py index 162a188c72..02c253f555 100644 --- a/common/lib/xmodule/xmodule/combined_open_ended_rubric.py +++ b/common/lib/xmodule/xmodule/combined_open_ended_rubric.py @@ -4,6 +4,7 @@ from lxml import etree log = logging.getLogger(__name__) GRADER_TYPE_IMAGE_DICT = { + '8B' : '/static/images/random_grading_icon.png', 'SA' : '/static/images/self_assessment_icon.png', 'PE' : '/static/images/peer_grading_icon.png', 'ML' : '/static/images/ml_grading_icon.png', @@ -12,6 +13,7 @@ GRADER_TYPE_IMAGE_DICT = { } HUMAN_GRADER_TYPE = { + '8B' : 'Magic-8-Ball-Assessment', 'SA' : 'Self-Assessment', 'PE' : 'Peer-Assessment', 'IN' : 'Instructor-Assessment', diff --git a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss index b2139d3b31..6a9e9ad2a5 100644 --- a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss +++ b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss @@ -45,8 +45,7 @@ section.combined-open-ended { section.legend-container { .legenditem { - color: #FFFFFF; - background-color : #000000; + background-color : #d4d4d4; font-size: .9em; padding: 2px; display: inline; diff --git a/common/static/images/random_grading_icon.png b/common/static/images/random_grading_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..d3737e61b071e91e14b4e891bc82aae510cbf177 GIT binary patch literal 724 zcmV;_0xSKAP){PO6&?Q|;gbps*x~iR|gCvIN6i5ha9!8V+ zi2l9j!!LwhxPI5`J?B0(ZES2{XJ-dmW@cud%kx%rRdjCZJ{SEh`a|MRbZj=8g%wXk zz!{gz^?7Aw#o_gOVKSL891d}Lc{zW4d>pCQ>tA!Z+;<86CPZUmOsqhh7O{UuqtW$v zJdSWU48PxxX0wS>sf2@r1Ki%;;_U1Uhlhu_xVR`te9|zCp{^jaw6wGyi^Y&gB$Okc z&!f}nAel_UVzHo7slem$AQ%kd;o%`6zhxxsi&?U>=TD(f2+PaM3behwjbgEgR4S#2 zgj|tWtyVZ34)}aN=J+Tr&YQ(ZM`?=mkwAiay&kTwuhpvw zrRrZC?V{*kS)qkh2$>#`YKtWk#P#we87mRxCBC%CB{t
        + Legend
        % for i in xrange(0,len(legend_list)): <%legend_title=legend_list[i]['name'] %> From 995a075f8f8062f4a0e6ad65fc250341deeb6b5b Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Sat, 9 Feb 2013 00:18:04 -0500 Subject: [PATCH 49/79] Separate the rubric templates --- lms/templates/open_ended_combined_rubric.html | 29 ++++++++++++ lms/templates/open_ended_rubric.html | 46 ++++--------------- .../open_ended_view_only_rubric.html | 12 +++++ 3 files changed, 49 insertions(+), 38 deletions(-) create mode 100644 lms/templates/open_ended_combined_rubric.html create mode 100644 lms/templates/open_ended_view_only_rubric.html diff --git a/lms/templates/open_ended_combined_rubric.html b/lms/templates/open_ended_combined_rubric.html new file mode 100644 index 0000000000..f58ed2f03d --- /dev/null +++ b/lms/templates/open_ended_combined_rubric.html @@ -0,0 +1,29 @@ +
        +
        + % for i in range(len(categories)): + <% category = categories[i] %> + ${category['description']}
        +
          + % for j in range(len(category['options'])): + <% 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']} +
          +
        • + % endfor +
        + % endfor +
        +
        diff --git a/lms/templates/open_ended_rubric.html b/lms/templates/open_ended_rubric.html index 58e74a68da..da2be513d9 100644 --- a/lms/templates/open_ended_rubric.html +++ b/lms/templates/open_ended_rubric.html @@ -1,52 +1,22 @@
        - % if view_only and has_score: -

        - % elif view_only: -

        Use the below rubric to rate this submission.

        - % else: -

        Rubric

        -

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

        - % endif +

        Rubric

        +

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

        % for i in range(len(categories)): <% category = categories[i] %> - ${category['description']}
        + ${category['description']}
          % for j in range(len(category['options'])): <% option = category['options'][j] %> - %if option['selected'] and not view_only: + %if option['selected']:
        • %else:
        • % endif - % if view_only: - % if option['selected'] and combined_rubric==False: - ## if this is the selected rubric block, show it highlighted -
          - ${option['points']} points : ${option['text']} -
          - % elif combined_rubric == True: -
          - %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']} -
          - % endif - % else: - - % endif +
        • % endfor
        diff --git a/lms/templates/open_ended_view_only_rubric.html b/lms/templates/open_ended_view_only_rubric.html new file mode 100644 index 0000000000..55bf5338cf --- /dev/null +++ b/lms/templates/open_ended_view_only_rubric.html @@ -0,0 +1,12 @@ +
        +
        + % for i in range(len(categories)): + <% category = categories[i] %> + % for j in range(len(category['options'])): + <% option = category['options'][j] %> + % if option['selected']: + ${category['description']} : ${option['points']} points + % endfor + % endfor +
        +
        From efe5e491ef42810fa656a377dea1cda074642553 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Sat, 9 Feb 2013 00:19:34 -0500 Subject: [PATCH 50/79] Separate rubric rendering --- common/lib/xmodule/xmodule/combined_open_ended_rubric.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/common/lib/xmodule/xmodule/combined_open_ended_rubric.py b/common/lib/xmodule/xmodule/combined_open_ended_rubric.py index 02c253f555..7c8aea60be 100644 --- a/common/lib/xmodule/xmodule/combined_open_ended_rubric.py +++ b/common/lib/xmodule/xmodule/combined_open_ended_rubric.py @@ -53,7 +53,10 @@ class CombinedOpenEndedRubric(object): rubric_scores = [cat['score'] for cat in rubric_categories] max_scores = map((lambda cat: cat['options'][-1]['points']), rubric_categories) max_score = max(max_scores) - html = self.system.render_template('open_ended_rubric.html', + rubric_template = 'open_ended_rubric.html' + if self.view_only: + rubric_template = 'open_ended_view_only_rubric.html' + html = self.system.render_template(rubric_template, {'categories': rubric_categories, 'has_score': self.has_score, 'view_only': self.view_only, @@ -192,7 +195,7 @@ class CombinedOpenEndedRubric(object): rubric_categories[i]['options'][j]['grader_types'].append(grader_type) log.debug(rubric_categories) - html = self.system.render_template('open_ended_rubric.html', + html = self.system.render_template('open_ended_combined_rubric.html', {'categories': rubric_categories, 'has_score': True, 'view_only': True, From 4dc0859fbd0105d6e81175b4a425307e9d570d62 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Sat, 9 Feb 2013 00:30:25 -0500 Subject: [PATCH 51/79] Finish refactor of rubric templates, redo some margins --- .../xmodule/combined_open_ended_rubric.py | 40 +++++++++---------- .../css/combinedopenended/display.scss | 15 +++++++ .../open_ended_view_only_rubric.html | 1 + 3 files changed, 36 insertions(+), 20 deletions(-) diff --git a/common/lib/xmodule/xmodule/combined_open_ended_rubric.py b/common/lib/xmodule/xmodule/combined_open_ended_rubric.py index 7c8aea60be..cf0c91c3d1 100644 --- a/common/lib/xmodule/xmodule/combined_open_ended_rubric.py +++ b/common/lib/xmodule/xmodule/combined_open_ended_rubric.py @@ -48,26 +48,26 @@ class CombinedOpenEndedRubric(object): html: the html that corresponds to the xml given ''' success = False - try: - rubric_categories = self.extract_categories(rubric_xml) - rubric_scores = [cat['score'] for cat in rubric_categories] - max_scores = map((lambda cat: cat['options'][-1]['points']), rubric_categories) - max_score = max(max_scores) - rubric_template = 'open_ended_rubric.html' - if self.view_only: - rubric_template = 'open_ended_view_only_rubric.html' - html = self.system.render_template(rubric_template, - {'categories': rubric_categories, - 'has_score': self.has_score, - 'view_only': self.view_only, - 'max_score': max_score, - 'combined_rubric' : False - }) - success = True - except: - error_message = "[render_rubric] Could not parse the rubric with xml: {0}".format(rubric_xml) - log.error(error_message) - raise RubricParsingError(error_message) + #try: + rubric_categories = self.extract_categories(rubric_xml) + rubric_scores = [cat['score'] for cat in rubric_categories] + max_scores = map((lambda cat: cat['options'][-1]['points']), rubric_categories) + max_score = max(max_scores) + rubric_template = 'open_ended_rubric.html' + if self.view_only: + rubric_template = 'open_ended_view_only_rubric.html' + html = self.system.render_template(rubric_template, + {'categories': rubric_categories, + 'has_score': self.has_score, + 'view_only': self.view_only, + 'max_score': max_score, + 'combined_rubric' : False + }) + success = True + #except: + # error_message = "[render_rubric] Could not parse the rubric with xml: {0}".format(rubric_xml) + # log.error(error_message) + # raise RubricParsingError(error_message) return {'success' : success, 'html' : html, 'rubric_scores' : rubric_scores} def check_if_rubric_is_parseable(self, rubric_string, location, max_score_allowed, max_score): diff --git a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss index 6a9e9ad2a5..119b8b044a 100644 --- a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss +++ b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss @@ -51,6 +51,7 @@ section.legend-container { display: inline; width: 20%; } + margin-bottom: 5px; } section.combined-open-ended-status { @@ -106,6 +107,20 @@ section.combined-open-ended-status { } } +div.combined-rubric-container { + ul.rubric-list{ + list-style-type: none; + padding:0; + margin:0; + li { + &.rubric-list-item{ + margin-bottom: 2px; + padding: 0px; + } + } + } +} + div.result-container { .evaluation { diff --git a/lms/templates/open_ended_view_only_rubric.html b/lms/templates/open_ended_view_only_rubric.html index 55bf5338cf..d8e1fb778b 100644 --- a/lms/templates/open_ended_view_only_rubric.html +++ b/lms/templates/open_ended_view_only_rubric.html @@ -6,6 +6,7 @@ <% option = category['options'][j] %> % if option['selected']: ${category['description']} : ${option['points']} points + % endif % endfor % endfor
        From 757ff604bf1fed89238e65570b9cd2d7556b3841 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Sat, 9 Feb 2013 00:44:50 -0500 Subject: [PATCH 52/79] Start to abstract away rendering of feedback from the open ended module into the combined module --- .../xmodule/combined_open_ended_modulev1.py | 5 ++-- .../lib/xmodule/xmodule/open_ended_module.py | 26 +++++++++++++++++-- lms/templates/open_ended_feedback.html | 7 +---- 3 files changed, 28 insertions(+), 10 deletions(-) diff --git a/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py b/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py index 0e14accfeb..2683aa40b1 100644 --- a/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py +++ b/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py @@ -573,9 +573,10 @@ class CombinedOpenEndedV1Module(): Input: AJAX get dictionary Output: Dictionary to be rendered via ajax that contains the result html. """ - task_number = int(get['task_number']) self.update_task_states() - response_dict = self.get_last_response(task_number) + loop_up_to_task = self.current_task_number+1 + for i in xrange(0,loop_up_to_task): + all_responses.append(self.get_last_response(i)) context = { 'results': response_dict['post_assessment'], 'task_number': task_number + 1, diff --git a/common/lib/xmodule/xmodule/open_ended_module.py b/common/lib/xmodule/xmodule/open_ended_module.py index c9d12ef75c..4603fbae1d 100644 --- a/common/lib/xmodule/xmodule/open_ended_module.py +++ b/common/lib/xmodule/xmodule/open_ended_module.py @@ -429,7 +429,17 @@ class OpenEndedModule(openendedchild.OpenEndedChild): correct: Correctness of submission (Boolean) score: Points to be assigned (numeric, can be float) """ - fail = {'valid': False, 'score': 0, 'feedback': '', 'rubric_scores' : [[0]], 'grader_types' : [''], 'feedback_items' : ['']} + fail = { + 'valid': False, + 'score': 0, + 'feedback': '', + 'rubric_scores' : [[0]], + 'grader_types' : [''], + 'feedback_items' : [''], + 'feedback_dicts' : [{}], + 'grader_ids' : [0], + 'submission_ids' : [0], + } try: score_result = json.loads(score_msg) except (TypeError, ValueError): @@ -458,6 +468,9 @@ class OpenEndedModule(openendedchild.OpenEndedChild): feedback_items = [] rubric_scores = [] grader_types = [] + feedback_dicts = [] + grader_ids = [] + submission_ids = [] for i in xrange(0, len(score_result['score'])): new_score_result = { 'score': score_result['score'][i], @@ -473,6 +486,9 @@ class OpenEndedModule(openendedchild.OpenEndedChild): feedback_items.append(feedback_template) rubric_scores.append(rubric_score) grader_types.append(score_result['grader_type']) + feedback_dicts.append(score_result['feedback'][i]) + grader_ids.append(score_result['grader_id'][i]) + submission_ids.append(score_result['submission_id']) if join_feedback: feedback = "".join(feedback_items) else: @@ -485,6 +501,9 @@ class OpenEndedModule(openendedchild.OpenEndedChild): rubric_scores = [rubric_score] grader_types = [score_result['grader_type']] feedback_items = [feedback] + feedback_dicts = [score_result['feedback']] + grader_ids = [score_result['grader_id']] + submission_ids = [score_result['submission_id']] self.submission_id = score_result['submission_id'] self.grader_id = score_result['grader_id'] @@ -495,7 +514,10 @@ class OpenEndedModule(openendedchild.OpenEndedChild): 'feedback': feedback, 'rubric_scores' : rubric_scores, 'grader_types' : grader_types, - 'feedback_items' : feedback_items + 'feedback_items' : feedback_items, + 'feedback_dicts' : feedback_dicts, + 'grader_ids' : grader_ids, + 'submission_ids' : submission_ids, } def latest_post_assessment(self, system, short_feedback=False, join_feedback=True): diff --git a/lms/templates/open_ended_feedback.html b/lms/templates/open_ended_feedback.html index 2cd7faec70..e16aea0b53 100644 --- a/lms/templates/open_ended_feedback.html +++ b/lms/templates/open_ended_feedback.html @@ -1,5 +1,5 @@
        -
        +
        ${rubric_feedback | n} % if grader_type=="PE":
        @@ -7,9 +7,4 @@
        % endif
        -
        -
        - ${ feedback | n} -
        -
        From 4421e09ddac3d6dd7b343c6aeb0e989575a053fe Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Sat, 9 Feb 2013 00:49:14 -0500 Subject: [PATCH 53/79] Pass through feedback dict, grader ids, submission ids --- .../lib/xmodule/xmodule/combined_open_ended_modulev1.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py b/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py index 2683aa40b1..e1ae0cad84 100644 --- a/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py +++ b/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py @@ -433,6 +433,9 @@ class CombinedOpenEndedV1Module(): last_score = task.latest_score() last_post_assessment = task.latest_post_assessment(self.system) last_post_feedback = "" + feedback_dicts = [{}] + grader_ids = [0] + submission_ids = [0] if task_type == "openended": last_post_assessment = task.latest_post_assessment(self.system, short_feedback=False, join_feedback=False) if isinstance(last_post_assessment, list): @@ -447,6 +450,9 @@ class CombinedOpenEndedV1Module(): rubric_scores = rubric_data['rubric_scores'] grader_types = rubric_data['grader_types'] feedback_items = rubric_data['feedback_items'] + feedback_dicts = rubric_data['feedback_dicts'] + grader_ids = rubric_data['grader_ids'] + submission_ids = rubric_data['submission_ids'] elif task_type== "selfassessment": rubric_scores = last_post_assessment grader_types = ['SA'] @@ -491,6 +497,9 @@ class CombinedOpenEndedV1Module(): 'feedback_items' : feedback_items, 'grader_type' : grader_type, 'human_grader_type' : human_grader_name, + 'feedback_dicts' : feedback_dicts, + 'grader_ids' : grader_ids, + 'submission_ids' : submission_ids, } return last_response_dict From a7a55e462dcb7f0fc2ebbd1d6c1ca5001b534dc7 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Sat, 9 Feb 2013 01:11:21 -0500 Subject: [PATCH 54/79] Create a combined results view --- .../xmodule/combined_open_ended_modulev1.py | 20 ++++++-- .../xmodule/combined_open_ended_rubric.py | 48 +++++++++++-------- lms/templates/open_ended_result_table.html | 14 ++++++ .../open_ended_view_only_rubric.html | 2 +- 4 files changed, 58 insertions(+), 26 deletions(-) create mode 100644 lms/templates/open_ended_result_table.html diff --git a/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py b/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py index e1ae0cad84..21e9c4cb06 100644 --- a/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py +++ b/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py @@ -586,12 +586,24 @@ class CombinedOpenEndedV1Module(): loop_up_to_task = self.current_task_number+1 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','') + context = { + 'rubric_html': self.rubric_renderer.render_rubric(stringify_children(self.static_data['rubric']), ri['rubric_scores'][i]), + 'grader_type': ri['grader_type'], + 'grader_type_image_dict' : GRADER_TYPE_IMAGE_DICT, + 'human_grader_types' : HUMAN_GRADER_TYPE, + 'feedback' : feedback, + } + context_list.append(context) + feedback_table = self.system.render_template('open_ended_result_table.html', context_list) context = { - 'results': response_dict['post_assessment'], - 'task_number': task_number + 1, - 'task_name' : response_dict['human_task'], + 'results': feedback_table, + 'task_name' : "Combined Results", 'class_name' : "result-container", - } + } html = self.system.render_template('combined_open_ended_results.html', context) return {'html': html, 'success': True} diff --git a/common/lib/xmodule/xmodule/combined_open_ended_rubric.py b/common/lib/xmodule/xmodule/combined_open_ended_rubric.py index cf0c91c3d1..817d0293e7 100644 --- a/common/lib/xmodule/xmodule/combined_open_ended_rubric.py +++ b/common/lib/xmodule/xmodule/combined_open_ended_rubric.py @@ -37,7 +37,7 @@ class CombinedOpenEndedRubric(object): self.view_only = view_only self.system = system - def render_rubric(self, rubric_xml): + def render_rubric(self, rubric_xml, score_list = None): ''' render_rubric: takes in an xml string and outputs the corresponding html for that xml, given the type of rubric we're generating @@ -48,26 +48,32 @@ class CombinedOpenEndedRubric(object): html: the html that corresponds to the xml given ''' success = False - #try: - rubric_categories = self.extract_categories(rubric_xml) - rubric_scores = [cat['score'] for cat in rubric_categories] - max_scores = map((lambda cat: cat['options'][-1]['points']), rubric_categories) - max_score = max(max_scores) - rubric_template = 'open_ended_rubric.html' - if self.view_only: - rubric_template = 'open_ended_view_only_rubric.html' - html = self.system.render_template(rubric_template, - {'categories': rubric_categories, - 'has_score': self.has_score, - 'view_only': self.view_only, - 'max_score': max_score, - 'combined_rubric' : False - }) - success = True - #except: - # error_message = "[render_rubric] Could not parse the rubric with xml: {0}".format(rubric_xml) - # log.error(error_message) - # raise RubricParsingError(error_message) + try: + rubric_categories = self.extract_categories(rubric_xml) + if score_list: + for i in xrange(0,len(rubric_categories)): + category = rubric_categories[i] + for j in xrange(0,len(category['options'])): + if score_list[i]==j: + rubric_categories[i]['options'][j]['selected'] = True + rubric_scores = [cat['score'] for cat in rubric_categories] + max_scores = map((lambda cat: cat['options'][-1]['points']), rubric_categories) + max_score = max(max_scores) + rubric_template = 'open_ended_rubric.html' + if self.view_only: + rubric_template = 'open_ended_view_only_rubric.html' + html = self.system.render_template(rubric_template, + {'categories': rubric_categories, + 'has_score': self.has_score, + 'view_only': self.view_only, + 'max_score': max_score, + 'combined_rubric' : False + }) + success = True + except: + error_message = "[render_rubric] Could not parse the rubric with xml: {0}".format(rubric_xml) + log.error(error_message) + raise RubricParsingError(error_message) return {'success' : success, 'html' : html, 'rubric_scores' : rubric_scores} def check_if_rubric_is_parseable(self, rubric_string, location, max_score_allowed, max_score): diff --git a/lms/templates/open_ended_result_table.html b/lms/templates/open_ended_result_table.html new file mode 100644 index 0000000000..741e491771 --- /dev/null +++ b/lms/templates/open_ended_result_table.html @@ -0,0 +1,14 @@ +% for context in context_list: + % if context['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 + ${rubric_html} + ${feedback} + %endif +%endfor \ No newline at end of file diff --git a/lms/templates/open_ended_view_only_rubric.html b/lms/templates/open_ended_view_only_rubric.html index d8e1fb778b..c778a05cad 100644 --- a/lms/templates/open_ended_view_only_rubric.html +++ b/lms/templates/open_ended_view_only_rubric.html @@ -5,7 +5,7 @@ % for j in range(len(category['options'])): <% option = category['options'][j] %> % if option['selected']: - ${category['description']} : ${option['points']} points + ${category['description']} : ${option['points']} points , % endif % endfor % endfor From e566005b5a81facd2b3474e32bd123bbadcb5e6b Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Sat, 9 Feb 2013 01:17:54 -0500 Subject: [PATCH 55/79] Add in feedback dict and render the feedback table with it --- .../xmodule/xmodule/combined_open_ended_modulev1.py | 3 ++- common/lib/xmodule/xmodule/open_ended_module.py | 12 ++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py b/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py index 21e9c4cb06..898daf3769 100644 --- a/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py +++ b/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py @@ -584,6 +584,7 @@ class CombinedOpenEndedV1Module(): """ self.update_task_states() 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 = [] @@ -598,7 +599,7 @@ class CombinedOpenEndedV1Module(): 'feedback' : feedback, } context_list.append(context) - feedback_table = self.system.render_template('open_ended_result_table.html', context_list) + feedback_table = self.system.render_template('open_ended_result_table.html', {'context_list' : context_list}) context = { 'results': feedback_table, 'task_name' : "Combined Results", diff --git a/common/lib/xmodule/xmodule/open_ended_module.py b/common/lib/xmodule/xmodule/open_ended_module.py index 4603fbae1d..98260f3401 100644 --- a/common/lib/xmodule/xmodule/open_ended_module.py +++ b/common/lib/xmodule/xmodule/open_ended_module.py @@ -486,7 +486,11 @@ class OpenEndedModule(openendedchild.OpenEndedChild): feedback_items.append(feedback_template) rubric_scores.append(rubric_score) grader_types.append(score_result['grader_type']) - feedback_dicts.append(score_result['feedback'][i]) + try: + feedback_dict = json.loads(score_result['feedback'][i]) + except: + pass + feedback_dicts.append(feedback_dict) grader_ids.append(score_result['grader_id'][i]) submission_ids.append(score_result['submission_id']) if join_feedback: @@ -501,7 +505,11 @@ class OpenEndedModule(openendedchild.OpenEndedChild): rubric_scores = [rubric_score] grader_types = [score_result['grader_type']] feedback_items = [feedback] - feedback_dicts = [score_result['feedback']] + try: + feedback_dict = json.loads(score_result['feedback']) + except: + pass + feedback_dicts = [feedback_dict] grader_ids = [score_result['grader_id']] submission_ids = [score_result['submission_id']] From 85324ec83fbd864d515963f11f34b1d04fd884f5 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Sat, 9 Feb 2013 01:35:55 -0500 Subject: [PATCH 56/79] Restyle creates a combined results view --- .../xmodule/combined_open_ended_modulev1.py | 15 +++++++++++---- .../css/combinedopenended/display.scss | 6 ++++++ lms/templates/open_ended_result_table.html | 19 +++++++++++++------ .../open_ended_view_only_rubric.html | 2 +- 4 files changed, 31 insertions(+), 11 deletions(-) diff --git a/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py b/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py index 898daf3769..d2a3fdc385 100644 --- a/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py +++ b/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py @@ -591,15 +591,22 @@ class CombinedOpenEndedV1Module(): 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': self.rubric_renderer.render_rubric(stringify_children(self.static_data['rubric']), ri['rubric_scores'][i]), + 'rubric_html': rubric_html, 'grader_type': ri['grader_type'], - 'grader_type_image_dict' : GRADER_TYPE_IMAGE_DICT, - 'human_grader_types' : HUMAN_GRADER_TYPE, 'feedback' : feedback, } context_list.append(context) - feedback_table = self.system.render_template('open_ended_result_table.html', {'context_list' : context_list}) + feedback_table = self.system.render_template('open_ended_result_table.html', { + 'context_list' : context_list, + 'grader_type_image_dict' : GRADER_TYPE_IMAGE_DICT, + 'human_grader_types' : HUMAN_GRADER_TYPE, + }) context = { 'results': feedback_table, 'task_name' : "Combined Results", diff --git a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss index 119b8b044a..87ec30d037 100644 --- a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss +++ b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss @@ -119,6 +119,7 @@ div.combined-rubric-container { } } } + margin-bottom: 5px; } div.result-container { @@ -252,6 +253,11 @@ div.result-container { } } } + .rubric-result { + font-size: .9em; + padding: 2px; + display: inline-table; + } } diff --git a/lms/templates/open_ended_result_table.html b/lms/templates/open_ended_result_table.html index 741e491771..71600cb19d 100644 --- a/lms/templates/open_ended_result_table.html +++ b/lms/templates/open_ended_result_table.html @@ -1,14 +1,21 @@ -% for context in context_list: - % if context['grader_type'] in grader_type_image_dict: +% for co in context_list: + % if co['grader_type'] in grader_type_image_dict: + <%grader_type=co['grader_type']%> <% grader_image = grader_type_image_dict[grader_type] %> % if grader_type in human_grader_types: <% human_title = human_grader_types[grader_type] %> % else: <% human_title = grader_type %> % endif - - % endif - ${rubric_html} - ${feedback} +
        + +
        +
        + ${co['rubric_html']} +
        +
        + ${co['feedback']} +
        +
        %endif %endfor \ No newline at end of file diff --git a/lms/templates/open_ended_view_only_rubric.html b/lms/templates/open_ended_view_only_rubric.html index c778a05cad..96bfd40a3b 100644 --- a/lms/templates/open_ended_view_only_rubric.html +++ b/lms/templates/open_ended_view_only_rubric.html @@ -5,7 +5,7 @@ % for j in range(len(category['options'])): <% option = category['options'][j] %> % if option['selected']: - ${category['description']} : ${option['points']} points , + ${category['description']} : ${option['points']} points | % endif % endfor % endfor From 3eb18a9ebc73fa6d27744800fe89b7b08a847bb7 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Sat, 9 Feb 2013 08:17:20 -0500 Subject: [PATCH 57/79] Fix status display/make it more robust, and fix module render error --- .../xmodule/xmodule/combined_open_ended_modulev1.py | 13 +++++++++---- .../xmodule/js/src/combinedopenended/display.coffee | 4 +++- lms/templates/combined_open_ended_status.html | 2 +- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py b/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py index d2a3fdc385..4d3839166a 100644 --- a/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py +++ b/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py @@ -355,7 +355,7 @@ class CombinedOpenEndedV1Module(): 'state': self.state, 'task_count': len(self.task_xml), 'task_number': self.current_task_number + 1, - 'status': self.get_status(), + 'status': self.get_status(False), 'display_name': self.display_name, 'accept_file_upload': self.accept_file_upload, 'legend_list' : LEGEND_LIST, @@ -621,7 +621,7 @@ class CombinedOpenEndedV1Module(): Input: AJAX get dictionary Output: Dictionary to be rendered via ajax that contains the result html. """ - html = self.get_status() + html = self.get_status(True) return {'html': html, 'success': True} def handle_ajax(self, dispatch, get): @@ -705,7 +705,7 @@ class CombinedOpenEndedV1Module(): return json.dumps(state) - def get_status(self): + def get_status(self, render_via_ajax): """ Gets the status panel to be displayed at the top right. Input: None @@ -717,7 +717,12 @@ class CombinedOpenEndedV1Module(): task_data.update({'task_number': i + 1}) status.append(task_data) - context = {'status_list': status, 'grader_type_image_dict' : GRADER_TYPE_IMAGE_DICT, 'legend_list' : LEGEND_LIST} + context = { + 'status_list': status, + 'grader_type_image_dict' : GRADER_TYPE_IMAGE_DICT, + 'legend_list' : LEGEND_LIST, + 'render_via_ajax' : render_via_ajax, + } status_html = self.system.render_template("combined_open_ended_status.html", context) return status_html diff --git a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee index fd7f7f916d..0dde4bdd68 100644 --- a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee @@ -192,7 +192,9 @@ class @CombinedOpenEnded @next_problem_button.hide() @hide_file_upload() @hint_area.attr('disabled', false) - @show_status_current() + 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' diff --git a/lms/templates/combined_open_ended_status.html b/lms/templates/combined_open_ended_status.html index 287d269074..fa84e7bab7 100644 --- a/lms/templates/combined_open_ended_status.html +++ b/lms/templates/combined_open_ended_status.html @@ -10,7 +10,7 @@ %else:
        %endif - %if status['grader_type'] in grader_type_image_dict: + %if status['grader_type'] in grader_type_image_dict and render_via_ajax: <% grader_image = grader_type_image_dict[status['grader_type']]%> %else: From 6d0af13923c6d7b16724c516156ead83155d255b Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Sat, 9 Feb 2013 08:46:24 -0500 Subject: [PATCH 58/79] Fix respond to feedback --- .../xmodule/combined_open_ended_modulev1.py | 4 ++ .../css/combinedopenended/display.scss | 14 +++-- lms/templates/open_ended_combined_rubric.html | 53 +++++++++---------- lms/templates/open_ended_result_table.html | 46 ++++++++++++---- .../open_ended_view_only_rubric.html | 23 ++++---- 5 files changed, 87 insertions(+), 53 deletions(-) diff --git a/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py b/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py index 4d3839166a..ea6e9731bb 100644 --- a/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py +++ b/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py @@ -600,12 +600,16 @@ class CombinedOpenEndedV1Module(): '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('open_ended_result_table.html', { '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, diff --git a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss index 87ec30d037..cc30e4a6ae 100644 --- a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss +++ b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss @@ -137,9 +137,8 @@ div.result-container { } .evaluation-response { - margin-bottom: 10px; + margin-bottom: 2px; header { - text-align: right; a { font-size: .85em; } @@ -253,10 +252,15 @@ div.result-container { } } } - .rubric-result { - font-size: .9em; + .rubric-result-container { + .rubric-result { + font-size: .9em; + padding: 2px; + display: inline-table; + } padding: 2px; - display: inline-table; + margin: 0px; + display : inline; } } diff --git a/lms/templates/open_ended_combined_rubric.html b/lms/templates/open_ended_combined_rubric.html index f58ed2f03d..7f988a38dc 100644 --- a/lms/templates/open_ended_combined_rubric.html +++ b/lms/templates/open_ended_combined_rubric.html @@ -1,29 +1,28 @@ -
        -
        - % for i in range(len(categories)): - <% category = categories[i] %> - ${category['description']}
        -
          - % for j in range(len(category['options'])): - <% 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 - +
          + % for i in range(len(categories)): + <% category = categories[i] %> + ${category['description']}
          +
            + % for j in range(len(category['options'])): + <% 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 - %endfor - ${option['points']} points : ${option['text']} -
            -
          • - % endfor -
          + + % endif + %endfor + ${option['points']} points : ${option['text']} +
          +
        • % endfor -
        -
        +
      + % endfor + + diff --git a/lms/templates/open_ended_result_table.html b/lms/templates/open_ended_result_table.html index 71600cb19d..1cb51d7cff 100644 --- a/lms/templates/open_ended_result_table.html +++ b/lms/templates/open_ended_result_table.html @@ -7,15 +7,43 @@ % else: <% human_title = grader_type %> % endif -
      - -
      -
      - ${co['rubric_html']} -
      -
      - ${co['feedback']} -
      +
      +
      + +
      +
      + ${co['rubric_html']} +
      +
      + ${co['feedback']} +
      + %if grader_type!="SA": +
      + + +
      +
      + Respond to Feedback +
      +
      +

      How accurate do you find this feedback?

      +
      +
        +
      • +
      • +
      • +
      • +
      • +
      +
      +

      Additional comments:

      + + +
      +
      +
      + %endif +

      %endif %endfor \ No newline at end of file diff --git a/lms/templates/open_ended_view_only_rubric.html b/lms/templates/open_ended_view_only_rubric.html index 96bfd40a3b..7cd9370c47 100644 --- a/lms/templates/open_ended_view_only_rubric.html +++ b/lms/templates/open_ended_view_only_rubric.html @@ -1,13 +1,12 @@ -
      -
      - % for i in range(len(categories)): - <% category = categories[i] %> - % for j in range(len(category['options'])): - <% option = category['options'][j] %> - % if option['selected']: - ${category['description']} : ${option['points']} points | - % endif - % endfor +
      + % for i in range(len(categories)): + <% category = categories[i] %> + % for j in range(len(category['options'])): + <% option = category['options'][j] %> + % if option['selected']: + ${category['description']} : ${option['points']} | + % endif % endfor -
      -
      + % endfor + + From dc9f4a61a26b5f9900fa02202e3a7fd2c0b003c8 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Sat, 9 Feb 2013 08:54:37 -0500 Subject: [PATCH 59/79] Enable ability to see full results and to respond to feedback --- lms/templates/open_ended_result_table.html | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lms/templates/open_ended_result_table.html b/lms/templates/open_ended_result_table.html index 1cb51d7cff..4bffdf34d7 100644 --- a/lms/templates/open_ended_result_table.html +++ b/lms/templates/open_ended_result_table.html @@ -15,12 +15,20 @@ ${co['rubric_html']}
      - ${co['feedback']} + %if len(co['feedback'])>2: +
      +
      + See full feedback +
      + + %endif
      %if grader_type!="SA":
      - +
      Respond to Feedback From ae1df0108c7f413fdfe95510dc595f09dee449d1 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Sat, 9 Feb 2013 09:00:43 -0500 Subject: [PATCH 60/79] Remove save successful message --- common/lib/xmodule/xmodule/combined_open_ended_modulev1.py | 4 ++-- .../xmodule/xmodule/js/src/combinedopenended/display.coffee | 1 - common/lib/xmodule/xmodule/self_assessment_module.py | 1 - 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py b/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py index ea6e9731bb..2ec5a10030 100644 --- a/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py +++ b/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py @@ -558,7 +558,7 @@ class CombinedOpenEndedV1Module(): response_dict = all_responses[-1] context = { 'results': rubric_html, - 'task_name' : 'Combined Rubric', + 'task_name' : 'Scored Rubric', 'class_name' : 'combined-rubric-container' } html = self.system.render_template('combined_open_ended_results.html', context) @@ -613,7 +613,7 @@ class CombinedOpenEndedV1Module(): }) context = { 'results': feedback_table, - 'task_name' : "Combined Results", + 'task_name' : "Results", 'class_name' : "result-container", } html = self.system.render_template('combined_open_ended_results.html', context) diff --git a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee index 0dde4bdd68..4e0a88e272 100644 --- a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee @@ -309,7 +309,6 @@ class @CombinedOpenEnded @find_hint_elements() else if @child_state == 'done' @rubric_wrapper.hide() - @message_wrapper.html(response.message_html) @rebind() else diff --git a/common/lib/xmodule/xmodule/self_assessment_module.py b/common/lib/xmodule/xmodule/self_assessment_module.py index a3740b1fcb..79eb635223 100644 --- a/common/lib/xmodule/xmodule/self_assessment_module.py +++ b/common/lib/xmodule/xmodule/self_assessment_module.py @@ -249,7 +249,6 @@ class SelfAssessmentModule(openendedchild.OpenEndedChild): d = {'success': True, } self.change_state(self.DONE) - d['message_html'] = self.get_message_html() d['allow_reset'] = self._allow_reset() d['state'] = self.state From e8cb3590b1af19e491f6ccbbdcf90cf1748f9fdd Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Sat, 9 Feb 2013 09:06:14 -0500 Subject: [PATCH 61/79] Trim hint and submit messages out of self assessment --- .../xmodule/xmodule/self_assessment_module.py | 26 ++++--------------- lms/templates/self_assessment_hint.html | 2 +- lms/templates/self_assessment_prompt.html | 4 +-- 3 files changed, 8 insertions(+), 24 deletions(-) diff --git a/common/lib/xmodule/xmodule/self_assessment_module.py b/common/lib/xmodule/xmodule/self_assessment_module.py index 79eb635223..0d1092f96f 100644 --- a/common/lib/xmodule/xmodule/self_assessment_module.py +++ b/common/lib/xmodule/xmodule/self_assessment_module.py @@ -53,8 +53,6 @@ class SelfAssessmentModule(openendedchild.OpenEndedChild): @param descriptor: SelfAssessmentDescriptor @return: None """ - self.submit_message = definition['submitmessage'] - self.hint_prompt = definition['hintprompt'] self.prompt = stringify_children(self.prompt) self.rubric = stringify_children(self.rubric) @@ -76,8 +74,6 @@ class SelfAssessmentModule(openendedchild.OpenEndedChild): 'previous_answer': previous_answer, 'ajax_url': system.ajax_url, 'initial_rubric': self.get_rubric_html(system), - 'initial_hint': "", - 'initial_message': self.get_message_html(), 'state': self.state, 'allow_reset': self._allow_reset(), 'child_type': 'selfassessment', @@ -157,8 +153,7 @@ class SelfAssessmentModule(openendedchild.OpenEndedChild): else: hint = '' - context = {'hint_prompt': self.hint_prompt, - 'hint': hint} + context = {'hint': hint} if self.state == self.POST_ASSESSMENT: context['read_only'] = False @@ -169,15 +164,6 @@ class SelfAssessmentModule(openendedchild.OpenEndedChild): return system.render_template('self_assessment_hint.html', context) - def get_message_html(self): - """ - Return the appropriate version of the message view, based on state. - """ - if self.state != self.DONE: - return "" - - return """
      {0}
      """.format(self.submit_message) - def save_answer(self, get, system): """ @@ -274,7 +260,7 @@ class SelfAssessmentModule(openendedchild.OpenEndedChild): self.change_state(self.DONE) return {'success': True, - 'message_html': self.get_message_html(), + 'message_html': '', 'allow_reset': self._allow_reset()} def latest_post_assessment(self, system): @@ -314,7 +300,7 @@ class SelfAssessmentDescriptor(XmlDescriptor, EditingDescriptor): 'hintprompt': 'some-html' } """ - expected_children = ['submitmessage', 'hintprompt'] + expected_children = [] for child in expected_children: if len(xml_object.xpath(child)) != 1: raise ValueError("Self assessment definition must include exactly one '{0}' tag".format(child)) @@ -323,9 +309,7 @@ class SelfAssessmentDescriptor(XmlDescriptor, EditingDescriptor): """Assumes that xml_object has child k""" return stringify_children(xml_object.xpath(k)[0]) - return {'submitmessage': parse('submitmessage'), - 'hintprompt': parse('hintprompt'), - } + return {} def definition_to_xml(self, resource_fs): '''Return an xml element representing this definition.''' @@ -336,7 +320,7 @@ class SelfAssessmentDescriptor(XmlDescriptor, EditingDescriptor): child_node = etree.fromstring(child_str) elt.append(child_node) - for child in ['submitmessage', 'hintprompt']: + for child in []: add_child(child) return elt diff --git a/lms/templates/self_assessment_hint.html b/lms/templates/self_assessment_hint.html index 1adfc69e39..8c6eacba11 100644 --- a/lms/templates/self_assessment_hint.html +++ b/lms/templates/self_assessment_hint.html @@ -1,6 +1,6 @@
      - ${hint_prompt} + Please enter a hint below:
      diff --git a/lms/templates/self_assessment_prompt.html b/lms/templates/self_assessment_prompt.html index 564508cb7b..5347e23844 100644 --- a/lms/templates/self_assessment_prompt.html +++ b/lms/templates/self_assessment_prompt.html @@ -14,9 +14,9 @@
      ${initial_rubric}
      -
      ${initial_hint}
      +
      -
      ${initial_message}
      +
      From 67e364fa701c3441c62fe6a5a4d49a0529233184 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Sat, 9 Feb 2013 09:13:21 -0500 Subject: [PATCH 62/79] Fix spacing, slightly prune CSS --- .../css/combinedopenended/display.scss | 20 ++++--------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss index cc30e4a6ae..7fb74d6121 100644 --- a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss +++ b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss @@ -119,11 +119,13 @@ div.combined-rubric-container { } } } - margin-bottom: 5px; + padding-bottom: 5px; + padding-top: 5px; } div.result-container { - + padding-top: 5px; + padding-bottom: 5px; .evaluation { p { @@ -221,20 +223,6 @@ div.result-container { } } - .result-correct { - background: url('../images/correct-icon.png') left 20px no-repeat; - .result-actual-output { - color: #090; - } - } - - .result-incorrect { - background: url('../images/incorrect-icon.png') left 20px no-repeat; - .result-actual-output { - color: #B00; - } - } - .markup-text{ margin: 5px; padding: 20px 0px 15px 50px; From 46da4cf241a8423daf09c46a4655bcc4a8d08182 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Sat, 9 Feb 2013 10:15:11 -0500 Subject: [PATCH 63/79] Add in a better notification icon --- common/static/images/grading_notification.png | Bin 0 -> 584 bytes .../open_ended_notifications.py | 6 +++--- 2 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 common/static/images/grading_notification.png diff --git a/common/static/images/grading_notification.png b/common/static/images/grading_notification.png new file mode 100644 index 0000000000000000000000000000000000000000..cd93857da902646ffbc0adc93f82657d36050bf0 GIT binary patch literal 584 zcmV-O0=NB%P)mjmakwyHcMN>-9do@D0lqz)A{Oh2ci(&WaD*SB+ z_0QN34cPFdzr5=^qsfblu5NjE9_71>FW;I#`sRfeo4W1qLj@M9PF#P?1AxZ+Oa{uD z?EdlzrxxfD8%So`c2xfa$;s-XozW0?7WFlB<7Dc0ppV9Z#@A3hs;f|J%xdcXF_<6d z#u3{KbTS5*olrcYJ@}%=G|6Gm?BBsi95BB^ais_m8P*IJ2Xm)tfo_ekj&4u{5sJS7 zSi?a0p?JSR@xdxEbOSBa!XuChfZ5P6)fG{3bYrs;#auptx%p?<{PetM2X$Y=QvQk- z^v(FnMmKWv$B=)VME;>c?!ExlKqy{w6?`KzIy&*8NH!K42tTq_IS}Y=1q@zo+k37B zz%1BTq^MgC8J+t3d)8&Joiu%I9fuA^TAaRq9Iz7YV%L-M);CV|9Mj&?;X-wBi1imS z%1cEqpC;F` Date: Sat, 9 Feb 2013 10:43:40 -0500 Subject: [PATCH 64/79] Add additional calibration interstitial page, add in message when calibration essay saved. --- .../peergrading/peer_grading_problem.coffee | 29 +++++++++++++++++-- .../peer_grading/peer_grading_problem.html | 14 +++++++-- 2 files changed, 38 insertions(+), 5 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 19a48f9356..8802fcc20d 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 @@ -188,6 +188,9 @@ class @PeerGradingProblem @interstitial_page = $('.interstitial-page') @interstitial_page.hide() + @calibration_interstitial_page = $('.calibration-interstitial-page') + @calibration_interstitial_page.hide() + @error_container = $('.error-container') @submission_key_input = $("input[name='submission-key']") @@ -203,6 +206,7 @@ class @PeerGradingProblem @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') @collapse_question() @@ -213,12 +217,21 @@ class @PeerGradingProblem @calibration_feedback_button.click => @calibration_feedback_panel.hide() @grading_wrapper.show() + @gentle_alert "Calibration essay saved. Fetching next essay." @is_calibrated_check() @interstitial_page_button.click => @interstitial_page.hide() @is_calibrated_check() + @calibration_interstitial_page_button.click => + @calibration_interstitial_page.hide() + @is_calibrated_check() + + @calibration_feedback_button.hide() + @calibration_feedback_panel.hide() + @error_container.hide() + @is_calibrated_check() @@ -236,6 +249,9 @@ class @PeerGradingProblem fetch_submission_essay: () => @backend.post('get_next_submission', {location: @location}, @render_submission) + gentle_alert: (msg) => + @grading_message.fadeIn() + @grading_message.html("

      " + msg + "

      ") construct_data: () -> data = @@ -276,6 +292,9 @@ class @PeerGradingProblem else if response.calibrated and @calibration == true @calibration = false @render_interstitial_page() + else if not response.calibrated and @calibration==null + @calibration=true + @render_calibration_interstitial_page() else @calibration = true @fetch_calibration_essay() @@ -411,18 +430,24 @@ class @PeerGradingProblem actual_score = parseInt(response.actual_score) if score == actual_score - calibration_wrapper.append("

      Congratulations! Your score matches the actual score!

      ") + calibration_wrapper.append("

      Your score matches the actual score!

      ") else - calibration_wrapper.append("

      Please try to understand the grading criteria better to be more accurate next time.

      ") + calibration_wrapper.append("

      You may want to review the rubric again.

      ") # disable score selection and submission from the grading interface $("input[name='score-selection']").attr('disabled', true) @submit_button.hide() + @calibration_feedback_button.show() render_interstitial_page: () => @content_panel.hide() @interstitial_page.show() + render_calibration_interstitial_page: () => + @content_panel.hide() + @action_button.hide() + @calibration_interstitial_page.show() + render_error: (error_message) => @error_container.show() @calibration_feedback_panel.hide() diff --git a/lms/templates/peer_grading/peer_grading_problem.html b/lms/templates/peer_grading/peer_grading_problem.html index 5e3b231a4a..9468b594a2 100644 --- a/lms/templates/peer_grading/peer_grading_problem.html +++ b/lms/templates/peer_grading/peer_grading_problem.html @@ -57,7 +57,6 @@
    -

    How did I do?

    @@ -68,11 +67,20 @@
    -

    Congratulations!

    -

    You have now completed the calibration step. You are now ready to start grading.

    +

    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.

    + +
    +
    From d6a2148bfb67d23499a65045c3a6d2b332ce5fe1 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Sat, 9 Feb 2013 10:47:14 -0500 Subject: [PATCH 65/79] Clean up message and calibration page --- .../xmodule/js/src/peergrading/peer_grading_problem.coffee | 2 ++ 1 file changed, 2 insertions(+) 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 8802fcc20d..fe95ab91de 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 @@ -330,6 +330,7 @@ class @PeerGradingProblem # check to see whether or not any categories have not been scored if Rubric.check_complete() # show button if we have scores for all categories + @grading_message.hide() @show_submit_button() @grade = Rubric.get_total_score() @@ -441,6 +442,7 @@ class @PeerGradingProblem render_interstitial_page: () => @content_panel.hide() + @grading_message.hide() @interstitial_page.show() render_calibration_interstitial_page: () => From add3aa90e1ddfec686474a1fa6600f79c4760d94 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Sat, 9 Feb 2013 11:01:34 -0500 Subject: [PATCH 66/79] Fix peer grading interface transitions (reset feedback box, change message) --- .../xmodule/js/src/peergrading/peer_grading_problem.coffee | 6 ++++-- 1 file changed, 4 insertions(+), 2 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 fe95ab91de..5770238649 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 @@ -217,7 +217,7 @@ class @PeerGradingProblem @calibration_feedback_button.click => @calibration_feedback_panel.hide() @grading_wrapper.show() - @gentle_alert "Calibration essay saved. Fetching next essay." + @gentle_alert "Calibration essay saved. Fetched the next essay." @is_calibrated_check() @interstitial_page_button.click => @@ -318,7 +318,7 @@ class @PeerGradingProblem if response.success @is_calibrated_check() @grading_message.fadeIn() - @grading_message.html("

    Grade sent successfully.

    ") + @grading_message.html("

    Successfully saved your feedback. Fetched the next essay.

    ") else if response.error @render_error(response.error) @@ -360,6 +360,7 @@ class @PeerGradingProblem @calibration_panel.find('.grading-text').hide() @grading_panel.find('.grading-text').hide() @flag_student_container.hide() + @feedback_area.val("") @submit_button.unbind('click') @submit_button.click @submit_calibration_essay @@ -387,6 +388,7 @@ class @PeerGradingProblem @calibration_panel.find('.grading-text').show() @grading_panel.find('.grading-text').show() @flag_student_container.show() + @feedback_area.val("") @submit_button.unbind('click') @submit_button.click @submit_grade From 21cca5fb97ff809273e4acfacffa4243e1e57c8d Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Sat, 9 Feb 2013 11:14:12 -0500 Subject: [PATCH 67/79] Add missing tag --- lms/templates/open_ended_result_table.html | 1 + 1 file changed, 1 insertion(+) diff --git a/lms/templates/open_ended_result_table.html b/lms/templates/open_ended_result_table.html index 4bffdf34d7..24bf7a76fe 100644 --- a/lms/templates/open_ended_result_table.html +++ b/lms/templates/open_ended_result_table.html @@ -23,6 +23,7 @@ + %endif %if grader_type!="SA": From e68103f3e7618422ff6b81831c228b0d0bea4162 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Sat, 9 Feb 2013 11:24:29 -0500 Subject: [PATCH 68/79] Render results at needed times --- .../lib/xmodule/xmodule/js/src/combinedopenended/display.coffee | 1 + 1 file changed, 1 insertion(+) diff --git a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee index 4e0a88e272..1b14d67016 100644 --- a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee @@ -101,6 +101,7 @@ class @CombinedOpenEnded if @task_number>1 @show_combined_rubric_current() + @show_results_current() # locally scoped jquery. $: (selector) -> From 2523c1e189e42496efdc36d97ceac4c0bf15f82d Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Sat, 9 Feb 2013 12:40:11 -0500 Subject: [PATCH 69/79] Slight visual tweaks --- .../lib/xmodule/xmodule/combined_open_ended_modulev1.py | 2 +- .../xmodule/xmodule/css/combinedopenended/display.scss | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py b/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py index 2ec5a10030..a3b34a735e 100644 --- a/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py +++ b/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py @@ -613,7 +613,7 @@ class CombinedOpenEndedV1Module(): }) context = { 'results': feedback_table, - 'task_name' : "Results", + 'task_name' : "Feedback", 'class_name' : "result-container", } html = self.system.render_template('combined_open_ended_results.html', context) diff --git a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss index 7fb74d6121..4cff477127 100644 --- a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss +++ b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss @@ -119,12 +119,16 @@ div.combined-rubric-container { } } } + + b.rubric-category { + font-size: .9em; + } padding-bottom: 5px; - padding-top: 5px; + padding-top: 10px; } div.result-container { - padding-top: 5px; + padding-top: 10px; padding-bottom: 5px; .evaluation { From d7c60231f0599fde1a4eff163dc4d52cf54c7204 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Sat, 9 Feb 2013 15:13:55 -0500 Subject: [PATCH 70/79] Fix template icon --- lms/templates/open_ended_problems/combined_notifications.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lms/templates/open_ended_problems/combined_notifications.html b/lms/templates/open_ended_problems/combined_notifications.html index 9de6ef3273..deb66b6064 100644 --- a/lms/templates/open_ended_problems/combined_notifications.html +++ b/lms/templates/open_ended_problems/combined_notifications.html @@ -33,7 +33,7 @@
    ${notification['name']}
    %if notification['alert']: -

    ${notification['alert_message']}

    +

    ${notification['alert_message']}

    %endif

    ${notification['description']}

    From 838d948c15e953d3dc535ca07668c694a91b3dcf Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Mon, 11 Feb 2013 11:07:20 -0500 Subject: [PATCH 71/79] Fix padding and border on staff and peer grading panels --- lms/static/sass/course/_staff_grading.scss | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lms/static/sass/course/_staff_grading.scss b/lms/static/sass/course/_staff_grading.scss index 1807d9821d..0be8385215 100644 --- a/lms/static/sass/course/_staff_grading.scss +++ b/lms/static/sass/course/_staff_grading.scss @@ -203,6 +203,7 @@ div.peer-grading{ margin-top: 20px; } } - padding: 40px; + padding: 5px; + border: none; } From 920acffd2ce620a618abed07e0192189fa51b299 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Mon, 11 Feb 2013 11:13:34 -0500 Subject: [PATCH 72/79] Resize student submission box --- lms/static/sass/course/_staff_grading.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lms/static/sass/course/_staff_grading.scss b/lms/static/sass/course/_staff_grading.scss index 0be8385215..9ed8eb1c7c 100644 --- a/lms/static/sass/course/_staff_grading.scss +++ b/lms/static/sass/course/_staff_grading.scss @@ -32,7 +32,7 @@ div.peer-grading{ margin: 0px; &.submission-container{ overflow-y: auto; - height: 200px; + height: 150px; background: #F6F6F6; border: 1px solid #ddd; @include clearfix; From 4e071d086f0adc3e8a94c900c176b589a5e648c6 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Mon, 11 Feb 2013 11:31:26 -0500 Subject: [PATCH 73/79] Fix staff grading ML error info a bit --- .../coffee/src/staff_grading/staff_grading.coffee | 8 ++++---- lms/static/sass/course/_staff_grading.scss | 13 ++----------- lms/templates/instructor/staff_grading.html | 2 -- 3 files changed, 6 insertions(+), 17 deletions(-) diff --git a/lms/static/coffee/src/staff_grading/staff_grading.coffee b/lms/static/coffee/src/staff_grading/staff_grading.coffee index 1ea51258c6..e26a96ebed 100644 --- a/lms/static/coffee/src/staff_grading/staff_grading.coffee +++ b/lms/static/coffee/src/staff_grading/staff_grading.coffee @@ -392,10 +392,10 @@ class @StaffGrading else if @state == state_grading @ml_error_info_container.html(@ml_error_info) - meta_list = $("
      ") - meta_list.append("
    • Available - #{@num_pending}
    • ") - meta_list.append("
    • Graded - #{@num_graded}
    • ") - meta_list.append("
    • Needed for ML - #{Math.max(@min_for_ml - @num_graded, 0)}
    • ") + meta_list = $("
      ") + meta_list.append("
      #{@num_pending} available |
      ") + meta_list.append("
      #{@num_graded} graded |
      ") + meta_list.append("
      #{Math.max(@min_for_ml - @num_graded, 0)} more needed to start ML

      ") @problem_meta_info.html(meta_list) @prompt_container.html(@prompt) diff --git a/lms/static/sass/course/_staff_grading.scss b/lms/static/sass/course/_staff_grading.scss index 9ed8eb1c7c..7e0df6bf11 100644 --- a/lms/static/sass/course/_staff_grading.scss +++ b/lms/static/sass/course/_staff_grading.scss @@ -113,18 +113,9 @@ div.peer-grading{ { background-color: #eee; padding:2px; - h3 + div { - font-size:1em; - } - ul - { - list-style-type: none; - font-size: .85em; - li - { - margin: 1px 0px; - } + display : inline; } } .message-container, diff --git a/lms/templates/instructor/staff_grading.html b/lms/templates/instructor/staff_grading.html index da1d42b62a..6b2e6a8136 100644 --- a/lms/templates/instructor/staff_grading.html +++ b/lms/templates/instructor/staff_grading.html @@ -42,10 +42,8 @@

      -

      Problem Information

      -

      Maching Learning Information

      From 58a2186e71b6eff2de48e906ca61f8e658505749 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Mon, 11 Feb 2013 11:33:44 -0500 Subject: [PATCH 74/79] Increase padding a bit --- lms/static/sass/course/_staff_grading.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lms/static/sass/course/_staff_grading.scss b/lms/static/sass/course/_staff_grading.scss index 7e0df6bf11..b387d753d1 100644 --- a/lms/static/sass/course/_staff_grading.scss +++ b/lms/static/sass/course/_staff_grading.scss @@ -194,7 +194,7 @@ div.peer-grading{ margin-top: 20px; } } - padding: 5px; + padding: 15px; border: none; } From 65cb53b8a6503291464ecc8d05ffaeb7d7d520b3 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Mon, 11 Feb 2013 19:21:22 -0500 Subject: [PATCH 75/79] Revert logsettings --- common/lib/logsettings.py | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/common/lib/logsettings.py b/common/lib/logsettings.py index 2ed20a0bad..8fc2bb9db1 100644 --- a/common/lib/logsettings.py +++ b/common/lib/logsettings.py @@ -53,7 +53,7 @@ def get_logger_config(log_dir, logging_env=logging_env, hostname=hostname) - handlers = ['console', 'local', 'null'] if debug else ['console', + handlers = ['console', 'local'] if debug else ['console', 'syslogger-remote', 'local'] logger_config = { @@ -84,12 +84,6 @@ def get_logger_config(log_dir, 'level': 'ERROR', 'class': 'newrelic_logging.NewRelicHandler', 'formatter': 'raw', - }, - 'null' : { - 'level': 'CRITICAL', - 'class': 'logging.handlers.SysLogHandler', - 'address': syslog_addr, - 'formatter': 'syslog_format', } }, 'loggers': { @@ -98,26 +92,11 @@ def get_logger_config(log_dir, 'level': 'DEBUG', 'propagate': False, }, - 'django.db.backends': { - 'handlers': ['null'], - 'propagate': False, - 'level':'DEBUG', - }, - 'django_comment_client.utils' : { - 'handlers': ['null'], - 'propagate': False, - 'level':'DEBUG', - }, - 'pipeline.compilers' : { - 'handlers': ['null'], - 'propagate': False, - 'level':'DEBUG', - }, '': { 'handlers': handlers, 'level': 'DEBUG', 'propagate': False - } + }, } } From 9e5eca14178265760de02dd7749cf7d24955c8dc Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Wed, 13 Feb 2013 11:29:18 -0500 Subject: [PATCH 76/79] Swap b tag for span --- common/lib/xmodule/xmodule/css/combinedopenended/display.scss | 2 +- .../xmodule/xmodule/js/src/combinedopenended/display.coffee | 4 ++-- lms/templates/open_ended_combined_rubric.html | 2 +- lms/templates/open_ended_rubric.html | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss index 4cff477127..20700ab092 100644 --- a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss +++ b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss @@ -120,7 +120,7 @@ div.combined-rubric-container { } } - b.rubric-category { + span.rubric-category { font-size: .9em; } 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 1b14d67016..052d005152 100644 --- a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee @@ -4,7 +4,7 @@ class @Rubric # finds the scores for each rubric category @get_score_list: () => # find the number of categories: - num_categories = $('b.rubric-category').length + num_categories = $('span.rubric-category').length score_lst = [] # get the score for each one @@ -23,7 +23,7 @@ class @Rubric @check_complete: () -> # check to see whether or not any categories have not been scored - num_categories = $('b.rubric-category').length + num_categories = $('span.rubric-category').length for i in [0..(num_categories-1)] score = $("input[name='score-selection-#{i}']:checked").val() if score == undefined diff --git a/lms/templates/open_ended_combined_rubric.html b/lms/templates/open_ended_combined_rubric.html index 7f988a38dc..61393cdc95 100644 --- a/lms/templates/open_ended_combined_rubric.html +++ b/lms/templates/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] %> diff --git a/lms/templates/open_ended_rubric.html b/lms/templates/open_ended_rubric.html index da2be513d9..2cbab3ab3b 100644 --- a/lms/templates/open_ended_rubric.html +++ b/lms/templates/open_ended_rubric.html @@ -4,7 +4,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 382d4d70eae751e15da3feb4c7727b02ee2e819e Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Wed, 13 Feb 2013 11:35:43 -0500 Subject: [PATCH 77/79] Minor parsing fix, remove b tag from selectors --- common/lib/xmodule/xmodule/combined_open_ended_rubric.py | 2 +- .../xmodule/xmodule/js/src/combinedopenended/display.coffee | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/common/lib/xmodule/xmodule/combined_open_ended_rubric.py b/common/lib/xmodule/xmodule/combined_open_ended_rubric.py index 817d0293e7..fa7f83ec69 100644 --- a/common/lib/xmodule/xmodule/combined_open_ended_rubric.py +++ b/common/lib/xmodule/xmodule/combined_open_ended_rubric.py @@ -50,7 +50,7 @@ class CombinedOpenEndedRubric(object): success = False try: rubric_categories = self.extract_categories(rubric_xml) - if score_list: + if score_list and len(score_list)==len(rubric_categories): for i in xrange(0,len(rubric_categories)): category = rubric_categories[i] for j in xrange(0,len(category['options'])): diff --git a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee index 052d005152..fd0391450b 100644 --- a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee @@ -4,7 +4,7 @@ class @Rubric # finds the scores for each rubric category @get_score_list: () => # find the number of categories: - num_categories = $('span.rubric-category').length + num_categories = $('.rubric-category').length score_lst = [] # get the score for each one @@ -23,7 +23,7 @@ class @Rubric @check_complete: () -> # check to see whether or not any categories have not been scored - num_categories = $('span.rubric-category').length + num_categories = $('.rubric-category').length for i in [0..(num_categories-1)] score = $("input[name='score-selection-#{i}']:checked").val() if score == undefined From 833aa01bd4f6daf5ec1351337d34651dba212ce6 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Wed, 13 Feb 2013 11:38:43 -0500 Subject: [PATCH 78/79] Add in documentation on tuple matching --- .../xmodule/xmodule/combined_open_ended_rubric.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/common/lib/xmodule/xmodule/combined_open_ended_rubric.py b/common/lib/xmodule/xmodule/combined_open_ended_rubric.py index fa7f83ec69..7c00c5f029 100644 --- a/common/lib/xmodule/xmodule/combined_open_ended_rubric.py +++ b/common/lib/xmodule/xmodule/combined_open_ended_rubric.py @@ -231,6 +231,14 @@ class CombinedOpenEndedRubric(object): @staticmethod def reformat_scores_for_rendering(scores, score_types, feedback_types): + """ + Takes in a list of rubric scores, the types of those scores, and feedback associated with them + Outputs a reformatted list of score tuples (count, rubric category, rubric score, [graders that gave this score], [feedback types]) + @param scores: + @param score_types: + @param feedback_types: + @return: + """ success = False if len(scores)==0: log.error("Score length is 0.") @@ -271,6 +279,13 @@ class CombinedOpenEndedRubric(object): @staticmethod def check_for_tuple_matches(tuples, tuple): + """ + Checks to see if a tuple in a list of tuples is a match for tuple. + If not match, creates a new tuple matching tuple. + @param tuples: list of tuples + @param tuple: tuples to match + @return: a new list of tuples, and the index of the tuple that matches tuple + """ category = tuple[1] score = tuple[2] tup_ind = -1 From 8447eb5460a24f29f377bebb2a856d880810bf0a Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Wed, 13 Feb 2013 11:40:07 -0500 Subject: [PATCH 79/79] Remove extraneous debug messages --- common/lib/xmodule/xmodule/combined_open_ended_modulev1.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py b/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py index a3b34a735e..ce5d55d7b7 100644 --- a/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py +++ b/common/lib/xmodule/xmodule/combined_open_ended_modulev1.py @@ -549,9 +549,6 @@ class CombinedOpenEndedV1Module(): 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()] - log.debug(rubric_scores) - log.debug(grader_types) - log.debug(feedback_items) rubric_html = self.rubric_renderer.render_combined_rubric(stringify_children(self.static_data['rubric']), rubric_scores, grader_types, feedback_items)