Commit c57b9f32 by Victor Shnayder

merge prompt and ml accuracy display

parent d4a3e4d0
...@@ -66,10 +66,16 @@ class StaffGrading ...@@ -66,10 +66,16 @@ class StaffGrading
# all the jquery selectors # all the jquery selectors
@error_container = $('.error-container') @error_container = $('.error-container')
@message_container = $('.message-container') @message_container = $('.message-container')
@prompt_container = $('.prompt-container')
@prompt_wrapper = $('.prompt-wrapper')
@submission_container = $('.submission-container') @submission_container = $('.submission-container')
@rubric_container = $('.rubric-container')
@submission_wrapper = $('.submission-wrapper') @submission_wrapper = $('.submission-wrapper')
@rubric_container = $('.rubric-container')
@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')
...@@ -78,6 +84,7 @@ class StaffGrading ...@@ -78,6 +84,7 @@ class StaffGrading
# model state # model state
@state = state_no_data @state = state_no_data
@submission_id = null @submission_id = null
@prompt = ''
@submission = '' @submission = ''
@rubric = '' @rubric = ''
@error_msg = '' @error_msg = ''
...@@ -130,7 +137,7 @@ class StaffGrading ...@@ -130,7 +137,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, response.ml_error_info) @data_loaded(response.prompt, 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
...@@ -153,7 +160,8 @@ class StaffGrading ...@@ -153,7 +160,8 @@ class StaffGrading
@error_msg = msg @error_msg = msg
@state = state_error @state = state_error
data_loaded: (submission, rubric, submission_id, max_score, ml_error_info) -> data_loaded: (prompt, submission, rubric, submission_id, max_score, ml_error_info) ->
@prompt = prompt
@submission = submission @submission = submission
@rubric = rubric @rubric = rubric
@submission_id = submission_id @submission_id = submission_id
...@@ -162,8 +170,11 @@ class StaffGrading ...@@ -162,8 +170,11 @@ class StaffGrading
@score = null @score = null
@ml_error_info=ml_error_info @ml_error_info=ml_error_info
@state = state_grading @state = state_grading
if not @max_score?
@error("No max score specified for submission.")
no_more: (message) -> no_more: (message) ->
@prompt = null
@submission = null @submission = null
@rubric = null @rubric = null
@ml_error_info = null @ml_error_info = null
...@@ -189,6 +200,7 @@ class StaffGrading ...@@ -189,6 +200,7 @@ class StaffGrading
else if @state == state_grading else if @state == state_grading
@ml_error_info_container.html(@ml_error_info) @ml_error_info_container.html(@ml_error_info)
@prompt_container.html(@prompt)
@submission_container.html(@submission) @submission_container.html(@submission)
@rubric_container.html(@rubric) @rubric_container.html(@rubric)
show_grading_elements = true show_grading_elements = true
...@@ -210,6 +222,7 @@ class StaffGrading ...@@ -210,6 +222,7 @@ class StaffGrading
@error('System got into invalid state ' + @state) @error('System got into invalid state ' + @state)
@submit_button.toggle(show_submit_button) @submit_button.toggle(show_submit_button)
@prompt_wrapper.toggle(show_grading_elements)
@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) @ml_error_info_container.toggle(show_grading_elements)
......
...@@ -28,6 +28,12 @@ ...@@ -28,6 +28,12 @@
<div class="ml-error-info-container"> <div class="ml-error-info-container">
</div> </div>
<section class="prompt-wrapper">
<h3>Question prompt</h3>
<div class="prompt-container">
</div>
</section>
<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