Commit e5c6414d by Vik Paruchuri

Adding score selection back into staff grading view

parent 50f951d9
......@@ -175,6 +175,7 @@ class StaffGrading
@feedback_area = $('.feedback-area')
@score_selection_container = $('.score-selection-container')
@grade_selection_container = $('.grade-selection-container')
@submit_button = $('.submit-button')
@action_button = $('.action-button')
......@@ -202,6 +203,7 @@ class StaffGrading
@num_graded = 0
@num_pending = 0
@score_lst = []
@score = null
@problems = null
......@@ -216,10 +218,23 @@ class StaffGrading
setup_score_selection: =>
# first, get rid of all the old inputs, if any.
@grade_selection_container.html('Choose score: ')
# Now create new labels and inputs for each possible score.
for score in [0..@max_score]
id = 'score-' + score
label = """<label for="#{id}">#{score}</label>"""
input = """
<input type="radio" name="grade-selection" id="#{id}" value="#{score}"/>
""" # " fix broken parsing in emacs
@grade_selection_container.append(input + label)
@score_selection_container.html(@rubric)
$('.score-selection').click => @graded_callback()
graded_callback: () =>
@grade = $("input[name='grade-selection']:selected").val()
# 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)]
......@@ -230,8 +245,6 @@ class StaffGrading
@state = state_graded
@submit_button.show()
set_button_text: (text) =>
@action_button.attr('value', text)
......@@ -272,6 +285,7 @@ class StaffGrading
skip_and_get_next: () =>
data =
score: @grade
rubric_scores: @get_score_list()
feedback: @feedback_area.val()
submission_id: @submission_id
......@@ -285,8 +299,8 @@ class StaffGrading
submit_and_get_next: () ->
data =
score: @grade
rubric_scores: @get_score_list()
score: 0
feedback: @feedback_area.val()
submission_id: @submission_id
location: @location
......@@ -303,6 +317,8 @@ class StaffGrading
@rubric = response.rubric
@submission_id = response.submission_id
@feedback_area.val('')
@grade = null
@max_score = response.max_score
@ml_error_info=response.ml_error_info
@prompt_name = response.problem_name
@num_graded = response.num_graded
......@@ -322,9 +338,10 @@ class StaffGrading
@ml_error_info = null
@submission_id = null
@message = message
@grade = null
@max_score = 0
@state = state_no_data
render_view: () ->
# clear the problem list and breadcrumbs
@problem_list.html('')
......
......@@ -71,6 +71,8 @@
</div>
</div>
<div class="evaluation">
<p class="grade-selection-container">
</p>
<p class="score-selection-container">
</p>
<textarea name="feedback" placeholder="Feedback for student (optional)"
......
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