Commit fcc1ab71 by Diana Huang

Update the formatting and layout of the Instructor Grading interface.

parent b5f3386d
...@@ -28,9 +28,27 @@ class StaffGradingBackend ...@@ -28,9 +28,27 @@ class StaffGradingBackend
problem_name: 'Problem 1' problem_name: 'Problem 1'
num_left: 3 num_left: 3
num_total: 5 num_total: 5
prompt: 'This is a fake prompt' prompt: '''
submission: 'submission! ' + @mock_cnt <h2>S11E3: Metal Bands</h2>
rubric: 'A rubric! ' + @mock_cnt <p>Shown below are schematic band diagrams for two different metals. Both diagrams appear different, yet both of the elements are undisputably metallic in nature.</p>
<img width="480" src="/static/images/LSQimages/shaded_metal_bands.png"/>
<p>* Why is it that both sodium and magnesium behave as metals, even though the s-band of magnesium is filled? </p>
<p>This is a self-assessed open response question. Please use as much space as you need in the box below to answer the question.</p>
'''
submission: '''
Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.
The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham.
'''
rubric: '''
<ul>
<li>Metals tend to be good electronic conductors, meaning that they have a large number of electrons which are able to access empty (mobile) energy states within the material.</li>
<li>Sodium has a half-filled s-band, so there are a number of empty states immediately above the highest occupied energy levels within the band.</li>
<li>Magnesium has a full s-band, but the the s-band and p-band overlap in magnesium. Thus are still a large number of available energy states immediately above the s-band highest occupied energy level.</li>
</ul>
<p>Please score your response according to how many of the above components you identified:</p>
'''
submission_id: @mock_cnt submission_id: @mock_cnt
max_score: 2 + @mock_cnt % 3 max_score: 2 + @mock_cnt % 3
ml_error_info : 'ML accuracy info: ' + @mock_cnt ml_error_info : 'ML accuracy info: ' + @mock_cnt
...@@ -116,6 +134,7 @@ class StaffGrading ...@@ -116,6 +134,7 @@ class StaffGrading
@rubric_container = $('.rubric-container') @rubric_container = $('.rubric-container')
@rubric_wrapper = $('.rubric-wrapper') @rubric_wrapper = $('.rubric-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')
...@@ -176,6 +195,7 @@ class StaffGrading ...@@ -176,6 +195,7 @@ class StaffGrading
graded_callback: (event) => graded_callback: (event) =>
@score = event.target.value @score = event.target.value
@state = state_graded @state = state_graded
@message = ''
@render_view() @render_view()
ajax_callback: (response) => ajax_callback: (response) =>
...@@ -247,12 +267,23 @@ class StaffGrading ...@@ -247,12 +267,23 @@ class StaffGrading
@max_score = 0 @max_score = 0
@state = state_no_data @state = state_no_data
hide_if_empty: (container,message) ->
if message == ''
container.hide()
else
container.html(message)
render_view: () -> render_view: () ->
# clear the problem list and breadcrumbs # clear the problem list and breadcrumbs
@problem_list.html('') @problem_list.html('')
@breadcrumbs.html('') @breadcrumbs.html('')
@problem_list_container.toggle(@list_view) @problem_list_container.toggle(@list_view)
@message_container.html(@message) if @backend.mock_backend
@message = @message + "<p>NOTE: Mocking backend.</p>"
@hide_if_empty(@message_container, @message)
@hide_if_empty(@error_container, @error_msg)
# 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
show_grading_elements = !(@list_view || @state == state_error || show_grading_elements = !(@list_view || @state == state_error ||
...@@ -260,11 +291,10 @@ class StaffGrading ...@@ -260,11 +291,10 @@ class StaffGrading
@prompt_wrapper.toggle(show_grading_elements) @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)
@grading_wrapper.toggle(show_grading_elements)
@ml_error_info_container.toggle(show_grading_elements) @ml_error_info_container.toggle(show_grading_elements)
@submit_button.hide() @submit_button.hide()
if @backend.mock_backend
@message_container.append("<p>NOTE: Mocking backend.</p>")
if @list_view if @list_view
@render_list() @render_list()
else else
...@@ -276,6 +306,12 @@ class StaffGrading ...@@ -276,6 +306,12 @@ class StaffGrading
.click => .click =>
@get_next_submission problem.location @get_next_submission problem.location
make_paragraphs: (text) ->
paragraph_split = text.split("\n")
new_text = ''
for paragraph in paragraph_split
new_text += "<p>#{paragraph}</p>"
return new_text
render_list: () -> render_list: () ->
for problem in @problems for problem in @problems
...@@ -285,13 +321,13 @@ class StaffGrading ...@@ -285,13 +321,13 @@ class StaffGrading
# make the view elements match the state. Idempotent. # make the view elements match the state. Idempotent.
show_submit_button = true show_submit_button = true
@error_container.html(@error_msg)
problem_list_link = $('<a>').attr('href', 'javascript:void(0);') problem_list_link = $('<a>').attr('href', 'javascript:void(0);')
.append("Problem List") .append("< Back to problem list")
.click => @get_problem_list() .click => @get_problem_list()
# set up the breadcrumbing # set up the breadcrumbing
@breadcrumbs.append(problem_list_link).append(" > #{@prompt_name}") @breadcrumbs.append(problem_list_link)
if @state == state_error if @state == state_error
@set_button_text('Try loading again') @set_button_text('Try loading again')
...@@ -300,7 +336,7 @@ class StaffGrading ...@@ -300,7 +336,7 @@ class StaffGrading
@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} <span class='sub-heading'>(#{@num_left} left out of #{@num_total})</span>") @prompt_name_container.html("#{@prompt_name} <span class='sub-heading'>(#{@num_left} left out of #{@num_total})</span>")
@submission_container.html(@submission) @submission_container.html(@make_paragraphs(@submission))
@rubric_container.html(@rubric) @rubric_container.html(@rubric)
# no submit button until user picks grade. # no submit button until user picks grade.
......
...@@ -18,49 +18,52 @@ ...@@ -18,49 +18,52 @@
<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 class="breadcrumbs">
</div> </div>
<div class="error-container"> <div class="error-container">
</div> </div>
<div class="message-container"> <div class="message-container">
</div> </div>
<section class="ml-info-wrapper">
<div class="ml-error-info-container"> <div class="ml-error-info-container">
</div> </div>
<div class="problem-list-container"> <section class="problem-list-container">
<ul class="problem-list"> <ul class="problem-list">
</ul> </ul>
</div> </section>
<section class="prompt-wrapper"> <section class="prompt-wrapper">
<h2 class="prompt-name"></h2> <h2 class="prompt-name"></h2>
<div class="prompt-information-container">
<h3>Question</h3> <h3>Question</h3>
<div class="prompt-container"> <div class="prompt-container">
</div> </div>
</section> </div>
<div class="rubric-wrapper">
<section class="submission-wrapper"> <h3>Grading Rubric</h3>
<div class="rubric-container">
</div>
</div>
<div class="submission-wrapper">
<h3>Student Submission</h3> <h3>Student Submission</h3>
<div class="submission-container"> <div class="submission-container">
</div> </div>
</div>
</section> </section>
<section class="rubric-wrapper">
<h3>Grading Rubric</h3>
<div class="rubric-container">
</div>
<section class="grading-wrapper">
<h2>Grading</h2>
<div class="grading-container">
<div class="evaluation"> <div class="evaluation">
<textarea name="feedback" placeholder="Feedback for student..." <textarea name="feedback" placeholder="Feedback for student..."
class="feedback-area" cols="70" rows="10"></textarea> class="feedback-area" cols="70" rows="10"></textarea>
<p class="score-selection-container"> <p class="score-selection-container">
</p> </p>
</div> </div>
</section>
<div class="submission"> <div class="submission">
<input type="button" value="Submit" class="submit-button" name="show"/> <input type="button" value="Submit" class="submit-button" name="show"/>
...@@ -68,4 +71,5 @@ ...@@ -68,4 +71,5 @@
</div> </div>
</div>
</section> </section>
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