Commit 94e1a9ff by Diana Huang

Clean up some minor issues with list view

and display some new information on the problem-specific page
parent 48b90432
...@@ -80,7 +80,6 @@ class StaffGradingBackend ...@@ -80,7 +80,6 @@ class StaffGradingBackend
class StaffGrading class StaffGrading
constructor: (backend) -> constructor: (backend) ->
@backend = backend @backend = backend
@list_view = true
# all the jquery selectors # all the jquery selectors
...@@ -90,6 +89,7 @@ class StaffGrading ...@@ -90,6 +89,7 @@ class StaffGrading
@error_container = $('.error-container') @error_container = $('.error-container')
@message_container = $('.message-container') @message_container = $('.message-container')
@prompt_name_container = $('.prompt-name')
@prompt_container = $('.prompt-container') @prompt_container = $('.prompt-container')
@prompt_wrapper = $('.prompt-wrapper') @prompt_wrapper = $('.prompt-wrapper')
...@@ -115,6 +115,9 @@ class StaffGrading ...@@ -115,6 +115,9 @@ class StaffGrading
@max_score = 0 @max_score = 0
@ml_error_info= '' @ml_error_info= ''
@location = '' @location = ''
@prompt_name = ''
@num_total = 0
@num_left = 0
@score = null @score = null
@problems = null @problems = null
...@@ -164,7 +167,7 @@ class StaffGrading ...@@ -164,7 +167,7 @@ class StaffGrading
if response.problem_list if response.problem_list
@problems = response.problem_list @problems = response.problem_list
else if response.submission else if response.submission
@data_loaded(response.prompt, 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, response.problem_name, response.num_left, response.num_total)
else else
@no_more(response.message) @no_more(response.message)
else else
...@@ -178,6 +181,7 @@ class StaffGrading ...@@ -178,6 +181,7 @@ class StaffGrading
@backend.post('get_next', {location}, @ajax_callback) @backend.post('get_next', {location}, @ajax_callback)
get_problem_list: () -> get_problem_list: () ->
@list_view = true
@backend.post('get_problem_list', {}, @ajax_callback) @backend.post('get_problem_list', {}, @ajax_callback)
submit_and_get_next: () -> submit_and_get_next: () ->
...@@ -192,7 +196,7 @@ class StaffGrading ...@@ -192,7 +196,7 @@ class StaffGrading
@error_msg = msg @error_msg = msg
@state = state_error @state = state_error
data_loaded: (prompt, submission, rubric, submission_id, max_score, ml_error_info) -> data_loaded: (prompt, submission, rubric, submission_id, max_score, ml_error_info, prompt_name, num_left, num_total) ->
@prompt = prompt @prompt = prompt
@submission = submission @submission = submission
@rubric = rubric @rubric = rubric
...@@ -201,12 +205,18 @@ class StaffGrading ...@@ -201,12 +205,18 @@ class StaffGrading
@max_score = max_score @max_score = max_score
@score = null @score = null
@ml_error_info=ml_error_info @ml_error_info=ml_error_info
@prompt_name = prompt_name
@num_left = num_left
@num_total = num_total
@state = state_grading @state = state_grading
if not @max_score? if not @max_score?
@error("No max score specified for submission.") @error("No max score specified for submission.")
no_more: (message) -> no_more: (message) ->
@prompt = null @prompt = null
@prompt_name = ''
@num_left = 0
@num_total = 0
@submission = null @submission = null
@rubric = null @rubric = null
@ml_error_info = null @ml_error_info = null
...@@ -219,6 +229,7 @@ class StaffGrading ...@@ -219,6 +229,7 @@ class StaffGrading
render_view: () -> render_view: () ->
# clear the problem list # clear the problem list
@problem_list.html('') @problem_list.html('')
@problem_list_container.toggle(@list_view)
@message_container.html(@message) @message_container.html(@message)
# only show the grading elements when we are not in list view or the state # only show the grading elements when we are not in list view or the state
# is invalid # is invalid
...@@ -260,6 +271,7 @@ class StaffGrading ...@@ -260,6 +271,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) @prompt_container.html(@prompt)
@prompt_name_container.html("#{@prompt_name} (#{@num_left} / #{@num_total})")
@submission_container.html(@submission) @submission_container.html(@submission)
@rubric_container.html(@rubric) @rubric_container.html(@rubric)
......
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
<div class="staff-grading" data-ajax_url="${ajax_url}"> <div class="staff-grading" data-ajax_url="${ajax_url}">
<h1>Staff grading</h1> <h1>Staff grading</h1>
<div class="breadcrumbs">
</div>
<div class="error-container"> <div class="error-container">
</div> </div>
...@@ -27,8 +29,13 @@ ...@@ -27,8 +29,13 @@
<div class="ml-error-info-container"> <div class="ml-error-info-container">
</div> </div>
<div class="problem-list-container">
<ul class="problem-list">
</ul>
</div>
<section class="prompt-wrapper"> <section class="prompt-wrapper">
<h2 class="prompt-name"></h2>
<h3>Question prompt</h3> <h3>Question prompt</h3>
<div class="prompt-container"> <div class="prompt-container">
</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