Commit 4e4bd4ab by Vik Paruchuri

Altered staff grading to display message about ml grading performance.

parent bcd30223
...@@ -26,6 +26,7 @@ class StaffGradingBackend ...@@ -26,6 +26,7 @@ class StaffGradingBackend
rubric: 'A rubric! ' + @mock_cnt rubric: 'A rubric! ' + @mock_cnt
submission_id: @mock_cnt submission_id: @mock_cnt
max_score: 2 + @mock_cnt % 3 max_score: 2 + @mock_cnt % 3
ml_error_info : 'ML error info!' + @mock_cnt
else if cmd == 'save_grade' else if cmd == 'save_grade'
console.log("eval: #{data.score} pts, Feedback: #{data.feedback}") console.log("eval: #{data.score} pts, Feedback: #{data.feedback}")
...@@ -71,7 +72,8 @@ class StaffGrading ...@@ -71,7 +72,8 @@ class StaffGrading
@rubric_wrapper = $('.rubric-wrapper') @rubric_wrapper = $('.rubric-wrapper')
@feedback_area = $('.feedback-area') @feedback_area = $('.feedback-area')
@score_selection_container = $('.score-selection-container') @score_selection_container = $('.score-selection-container')
@submit_button = $('.submit-button') @submit_button = $('.submit-button')
@ml_error_info_container = $('.ml-error-info-container')
# model state # model state
@state = state_no_data @state = state_no_data
...@@ -81,6 +83,7 @@ class StaffGrading ...@@ -81,6 +83,7 @@ class StaffGrading
@error_msg = '' @error_msg = ''
@message = '' @message = ''
@max_score = 0 @max_score = 0
@ml_error_info= ''
@score = null @score = null
...@@ -127,7 +130,7 @@ class StaffGrading ...@@ -127,7 +130,7 @@ class StaffGrading
if response.success if response.success
if response.submission if response.submission
@data_loaded(response.submission, response.rubric, response.submission_id, response.max_score) @data_loaded(response.submission, response.rubric, response.submission_id, response.max_score, response.ml_error_info)
else else
@no_more(response.message) @no_more(response.message)
else else
...@@ -150,18 +153,20 @@ class StaffGrading ...@@ -150,18 +153,20 @@ class StaffGrading
@error_msg = msg @error_msg = msg
@state = state_error @state = state_error
data_loaded: (submission, rubric, submission_id, max_score) -> data_loaded: (submission, rubric, submission_id, max_score, ml_error_info) ->
@submission = submission @submission = submission
@rubric = rubric @rubric = rubric
@submission_id = submission_id @submission_id = submission_id
@feedback_area.val('') @feedback_area.val('')
@max_score = max_score @max_score = max_score
@score = null @score = null
@ml_error_info=ml_error_info
@state = state_grading @state = state_grading
no_more: (message) -> no_more: (message) ->
@submission = null @submission = null
@rubric = null @rubric = null
@ml_error_info = null
@submission_id = null @submission_id = null
@message = message @message = message
@score = null @score = null
...@@ -183,6 +188,7 @@ class StaffGrading ...@@ -183,6 +188,7 @@ class StaffGrading
@set_button_text('Try loading again') @set_button_text('Try loading again')
else if @state == state_grading else if @state == state_grading
@ml_error_info_container.html(@ml_error_info)
@submission_container.html(@submission) @submission_container.html(@submission)
@rubric_container.html(@rubric) @rubric_container.html(@rubric)
show_grading_elements = true show_grading_elements = true
...@@ -206,6 +212,7 @@ class StaffGrading ...@@ -206,6 +212,7 @@ class StaffGrading
@submit_button.toggle(show_submit_button) @submit_button.toggle(show_submit_button)
@submission_wrapper.toggle(show_grading_elements) @submission_wrapper.toggle(show_grading_elements)
@rubric_wrapper.toggle(show_grading_elements) @rubric_wrapper.toggle(show_grading_elements)
@ml_error_info_container.toggle(show_grading_elements)
submit: (event) => submit: (event) =>
......
...@@ -25,6 +25,9 @@ ...@@ -25,6 +25,9 @@
<div class="message-container"> <div class="message-container">
</div> </div>
<div class="ml-error-info-container">
</div>
<section class="submission-wrapper"> <section class="submission-wrapper">
<h3>Submission</h3> <h3>Submission</h3>
<div class="submission-container"> <div class="submission-container">
......
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