Commit b5f34a9d by Diana Huang

Show special text when calibrating or when grading.

parent fe86c25f
...@@ -69,6 +69,8 @@ class PeerGradingProblem ...@@ -69,6 +69,8 @@ class PeerGradingProblem
@grading_panel = $('.grading-panel') @grading_panel = $('.grading-panel')
@content_panel = $('.content-panel') @content_panel = $('.content-panel')
@grading_wrapper =$('.grading-wrapper')
@error_container = $('.error-container') @error_container = $('.error-container')
@submission_key_input = $("input[name='submission-key']") @submission_key_input = $("input[name='submission-key']")
...@@ -76,7 +78,6 @@ class PeerGradingProblem ...@@ -76,7 +78,6 @@ class PeerGradingProblem
@feedback_area = $('.feedback-area') @feedback_area = $('.feedback-area')
@score_selection_container = $('.score-selection-container') @score_selection_container = $('.score-selection-container')
@score = null
@submit_button = $('.submit-button') @submit_button = $('.submit-button')
@action_button = $('.action-button') @action_button = $('.action-button')
...@@ -138,6 +139,13 @@ class PeerGradingProblem ...@@ -138,6 +139,13 @@ class PeerGradingProblem
else else
@render_error("Error contacting the grading service") @render_error("Error contacting the grading service")
calibration_callback: (response) =>
if response.success
# display correct grade
@grading_wrapper.hide()
else if response.error
@render_error(response.error)
submission_callback: (response) => submission_callback: (response) =>
if response.success if response.success
...@@ -149,7 +157,6 @@ class PeerGradingProblem ...@@ -149,7 +157,6 @@ class PeerGradingProblem
@render_error("Error occurred while submitting grade") @render_error("Error occurred while submitting grade")
graded_callback: (event) => graded_callback: (event) =>
@score = event.target.value
@show_submit_button() @show_submit_button()
...@@ -170,12 +177,14 @@ class PeerGradingProblem ...@@ -170,12 +177,14 @@ class PeerGradingProblem
@grading_panel.removeClass('current-state') @grading_panel.removeClass('current-state')
# clear out all of the existing text # clear out all of the existing text
@calibration_panel.find('p').remove() @calibration_panel.find('.calibration-text').show()
@grading_panel.find('p').remove() @grading_panel.find('.calibration-text').show()
@calibration_panel.find('.grading-text').hide()
# add in new text @grading_panel.find('.grading-text').hide()
# TODO: add in new text
@submit_button.unbind('click')
@submit_button.click @submit_calibration_essay @submit_button.click @submit_calibration_essay
else if response.error else if response.error
...@@ -194,9 +203,12 @@ class PeerGradingProblem ...@@ -194,9 +203,12 @@ class PeerGradingProblem
@grading_panel.addClass('current-state') @grading_panel.addClass('current-state')
# clear out all of the existing text # clear out all of the existing text
@calibration_panel.find('p').remove() @calibration_panel.find('.calibration-text').hide()
@grading_panel.find('p').remove() @grading_panel.find('.calibration-text').hide()
@calibration_panel.find('.grading-text').show()
@grading_panel.find('.grading-text').show()
@submit_button.unbind('click')
@submit_button.click @submit_grade @submit_button.click @submit_grade
else if response.error else if response.error
@render_error(response.error) @render_error(response.error)
...@@ -251,8 +263,6 @@ class PeerGradingProblem ...@@ -251,8 +263,6 @@ class PeerGradingProblem
mock_backend = false mock_backend = false
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)
......
...@@ -83,10 +83,39 @@ div.peer-grading{ ...@@ -83,10 +83,39 @@ div.peer-grading{
font-size: .8em; font-size: .8em;
} }
.current-state .instructions-panel
{ {
background: #eee;
> div
{
padding: 10px;
margin: 0px;
border: 1px solid black;
}
.calibration-panel
{
float:left;
width:47%;
}
.grading-panel
{
float:right;
width: 47%;
}
.current-state
{
background: #eee;
}
&:after
{
content:".";
display:block;
height:0;
visibility: hidden;
clear:both;
}
} }
padding: 40px; padding: 40px;
} }
...@@ -25,9 +25,21 @@ ...@@ -25,9 +25,21 @@
<div class="instructions-panel"> <div class="instructions-panel">
<div class="calibration-panel"> <div class="calibration-panel">
<h3>Calibration</h3> <h3>Calibration</h3>
<div class="calibration-text">
<p>You are being calibrated on this problem</p>
</div>
<div class="grading-text">
<p>You have successfully calibrated on this problem</p>
</div>
</div> </div>
<div class="grading-panel"> <div class="grading-panel">
<h3>Grading</h3> <h3>Grading</h3>
<div class="calibration-text">
<p>You cannot start grading until you have finished calibrating</p>
</div>
<div class="grading-text">
<p>Now that you are done calibrating, you can now start grading.</p>
</div>
</div> </div>
</div> </div>
......
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