Commit e5c6414d by Vik Paruchuri

Adding score selection back into staff grading view

parent 50f951d9
...@@ -174,7 +174,8 @@ class StaffGrading ...@@ -174,7 +174,8 @@ class StaffGrading
@grading_wrapper = $('.grading-wrapper') @grading_wrapper = $('.grading-wrapper')
@feedback_area = $('.feedback-area') @feedback_area = $('.feedback-area')
@score_selection_container = $('.score-selection-container') @score_selection_container = $('.score-selection-container')
@grade_selection_container = $('.grade-selection-container')
@submit_button = $('.submit-button') @submit_button = $('.submit-button')
@action_button = $('.action-button') @action_button = $('.action-button')
...@@ -202,6 +203,7 @@ class StaffGrading ...@@ -202,6 +203,7 @@ class StaffGrading
@num_graded = 0 @num_graded = 0
@num_pending = 0 @num_pending = 0
@score_lst = [] @score_lst = []
@score = null
@problems = null @problems = null
...@@ -216,10 +218,23 @@ class StaffGrading ...@@ -216,10 +218,23 @@ class StaffGrading
setup_score_selection: => 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_container.html(@rubric)
$('.score-selection').click => @graded_callback() $('.score-selection').click => @graded_callback()
graded_callback: () => graded_callback: () =>
@grade = $("input[name='grade-selection']:selected").val()
# check to see whether or not any categories have not been scored # check to see whether or not any categories have not been scored
num_categories = $('table.rubric tr').length num_categories = $('table.rubric tr').length
for i in [0..(num_categories-1)] for i in [0..(num_categories-1)]
...@@ -229,8 +244,6 @@ class StaffGrading ...@@ -229,8 +244,6 @@ class StaffGrading
# show button if we have scores for all categories # show button if we have scores for all categories
@state = state_graded @state = state_graded
@submit_button.show() @submit_button.show()
set_button_text: (text) => set_button_text: (text) =>
@action_button.attr('value', text) @action_button.attr('value', text)
...@@ -272,6 +285,7 @@ class StaffGrading ...@@ -272,6 +285,7 @@ class StaffGrading
skip_and_get_next: () => skip_and_get_next: () =>
data = data =
score: @grade
rubric_scores: @get_score_list() rubric_scores: @get_score_list()
feedback: @feedback_area.val() feedback: @feedback_area.val()
submission_id: @submission_id submission_id: @submission_id
...@@ -285,8 +299,8 @@ class StaffGrading ...@@ -285,8 +299,8 @@ class StaffGrading
submit_and_get_next: () -> submit_and_get_next: () ->
data = data =
score: @grade
rubric_scores: @get_score_list() rubric_scores: @get_score_list()
score: 0
feedback: @feedback_area.val() feedback: @feedback_area.val()
submission_id: @submission_id submission_id: @submission_id
location: @location location: @location
...@@ -303,6 +317,8 @@ class StaffGrading ...@@ -303,6 +317,8 @@ class StaffGrading
@rubric = response.rubric @rubric = response.rubric
@submission_id = response.submission_id @submission_id = response.submission_id
@feedback_area.val('') @feedback_area.val('')
@grade = null
@max_score = response.max_score
@ml_error_info=response.ml_error_info @ml_error_info=response.ml_error_info
@prompt_name = response.problem_name @prompt_name = response.problem_name
@num_graded = response.num_graded @num_graded = response.num_graded
...@@ -322,9 +338,10 @@ class StaffGrading ...@@ -322,9 +338,10 @@ class StaffGrading
@ml_error_info = null @ml_error_info = null
@submission_id = null @submission_id = null
@message = message @message = message
@grade = null
@max_score = 0
@state = state_no_data @state = state_no_data
render_view: () -> render_view: () ->
# clear the problem list and breadcrumbs # clear the problem list and breadcrumbs
@problem_list.html('') @problem_list.html('')
......
...@@ -71,6 +71,8 @@ ...@@ -71,6 +71,8 @@
</div> </div>
</div> </div>
<div class="evaluation"> <div class="evaluation">
<p class="grade-selection-container">
</p>
<p class="score-selection-container"> <p class="score-selection-container">
</p> </p>
<textarea name="feedback" placeholder="Feedback for student (optional)" <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