Commit ad63c492 by Diana Huang

Minor updates to the page to handle showing Calibration feedback.

Also, allow for the hiding of the Prompt and the Rubric.
parent d2228205
...@@ -497,6 +497,7 @@ PIPELINE_JS = { ...@@ -497,6 +497,7 @@ PIPELINE_JS = {
for pth in sorted(glob2.glob(PROJECT_ROOT / 'static/coffee/src/**/*.coffee'))\ for pth in sorted(glob2.glob(PROJECT_ROOT / 'static/coffee/src/**/*.coffee'))\
if (pth not in courseware_only_js and if (pth not in courseware_only_js and
pth not in discussion_js and pth not in discussion_js and
pth not in peer_grading_js and
pth not in staff_grading_js) pth not in staff_grading_js)
] + [ ] + [
'js/form.ext.js', 'js/form.ext.js',
......
...@@ -16,7 +16,7 @@ class PeerGradingProblemBackend ...@@ -16,7 +16,7 @@ class PeerGradingProblemBackend
# change to test each version # change to test each version
response = response =
success: true success: true
calibrated: true calibrated: false
else if cmd == 'show_calibration_essay' else if cmd == 'show_calibration_essay'
#response = #response =
# success: false # success: false
...@@ -41,6 +41,7 @@ class PeerGradingProblemBackend ...@@ -41,6 +41,7 @@ class PeerGradingProblemBackend
else if cmd == 'save_calibration_essay' else if cmd == 'save_calibration_essay'
response = response =
success: true success: true
correct_score: 2
else if cmd == 'save_grade' else if cmd == 'save_grade'
response = response =
success: true success: true
...@@ -70,6 +71,7 @@ class PeerGradingProblem ...@@ -70,6 +71,7 @@ class PeerGradingProblem
@content_panel = $('.content-panel') @content_panel = $('.content-panel')
@grading_wrapper =$('.grading-wrapper') @grading_wrapper =$('.grading-wrapper')
@calibration_feedback_panel = $('.calibration-feedback')
@error_container = $('.error-container') @error_container = $('.error-container')
...@@ -81,8 +83,14 @@ class PeerGradingProblem ...@@ -81,8 +83,14 @@ class PeerGradingProblem
@submit_button = $('.submit-button') @submit_button = $('.submit-button')
@action_button = $('.action-button') @action_button = $('.action-button')
@calibration_feedback_button = $('.calibration-feedback-button')
Collapsible.setCollapsibles(@content_panel)
@action_button.click -> document.location.reload(true) @action_button.click -> document.location.reload(true)
@calibration_feedback_button.click =>
@calibration_feedback_panel.hide()
@grading_wrapper.show()
@is_calibrated_check
@is_calibrated_check() @is_calibrated_check()
...@@ -113,7 +121,7 @@ class PeerGradingProblem ...@@ -113,7 +121,7 @@ class PeerGradingProblem
submit_calibration_essay: ()=> submit_calibration_essay: ()=>
data = @construct_data() data = @construct_data()
@backend.post('save_calibration_essay', data, @submission_callback) @backend.post('save_calibration_essay', data, @calibration_callback)
submit_grade: () => submit_grade: () =>
data = @construct_data() data = @construct_data()
...@@ -143,6 +151,8 @@ class PeerGradingProblem ...@@ -143,6 +151,8 @@ class PeerGradingProblem
if response.success if response.success
# display correct grade # display correct grade
@grading_wrapper.hide() @grading_wrapper.hide()
@calibration_feedback_panel.show()
@calibration_feedback_panel.prepend("<p>The correct grade is: #{response.correct_score}</p>")
else if response.error else if response.error
@render_error(response.error) @render_error(response.error)
...@@ -233,6 +243,7 @@ class PeerGradingProblem ...@@ -233,6 +243,7 @@ class PeerGradingProblem
@setup_score_selection(response.max_score) @setup_score_selection(response.max_score)
@submit_button.hide() @submit_button.hide()
@action_button.hide() @action_button.hide()
@calibration_feedback_panel.hide()
...@@ -263,7 +274,7 @@ class PeerGradingProblem ...@@ -263,7 +274,7 @@ class PeerGradingProblem
mock_backend = false mock_backend = true
ajax_url = $('.peer-grading').data('ajax_url') ajax_url = $('.peer-grading').data('ajax_url')
backend = new PeerGradingProblemBackend(ajax_url, mock_backend) backend = new PeerGradingProblemBackend(ajax_url, mock_backend)
$(document).ready(() -> new PeerGradingProblem(backend)) $(document).ready(() -> new PeerGradingProblem(backend))
...@@ -37,7 +37,6 @@ div.peer-grading{ ...@@ -37,7 +37,6 @@ div.peer-grading{
} }
.prompt-information-container, .prompt-information-container,
.submission-wrapper,
.rubric-wrapper, .rubric-wrapper,
.grading-container .grading-container
{ {
...@@ -50,6 +49,10 @@ div.peer-grading{ ...@@ -50,6 +49,10 @@ div.peer-grading{
padding: 15px; padding: 15px;
margin-left: 0px; margin-left: 0px;
} }
.submission-wrapper
{
padding: 15px;
}
.meta-info-wrapper .meta-info-wrapper
{ {
background-color: #eee; background-color: #eee;
......
...@@ -43,7 +43,11 @@ ...@@ -43,7 +43,11 @@
</div> </div>
</div> </div>
<section class="prompt-wrapper"> <div class="prompt-wrapper collapsible">
<header>
<a href="javascript:void(0);">Display problem information</a>
</header>
<section>
<div class="prompt-information-container"> <div class="prompt-information-container">
<h3>Question</h3> <h3>Question</h3>
<div class="prompt-container"> <div class="prompt-container">
...@@ -56,6 +60,7 @@ ...@@ -56,6 +60,7 @@
</div> </div>
</section> </section>
</div>
<section class="grading-wrapper"> <section class="grading-wrapper">
...@@ -85,6 +90,7 @@ ...@@ -85,6 +90,7 @@
</section> </section>
</section> </section>
<div class="calibration-feedback"><input type="button" class="calibration-feedback-button" value="Next" name="calibration-feedback-button" /></div>
<input type="button" value="Reload page" class="action-button" name="reload" /> <input type="button" value="Reload page" class="action-button" name="reload" />
</div> </div>
</section> </section>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment