Commit d4687aa6 by Giulio Gratta

4 OE/ORA UI fixes to make it easier to use

- require confirmation when clicking Open Ended reset button (now working)
- require confirmation when submitting Open Ended essay (now working)
- disable text feedback area during calibration and let users know that they should give feedback when grading
- fixed error message typos
parent c0fec1b2
...@@ -153,9 +153,11 @@ class @CombinedOpenEnded ...@@ -153,9 +153,11 @@ class @CombinedOpenEnded
@rub = new Rubric(@coe) @rub = new Rubric(@coe)
@rub.initialize(@location) @rub.initialize(@location)
@is_ctrl = false @is_ctrl = false
#Setup reset #Setup reset
@reset_button = @$(@reset_button_sel) @reset_button = @$(@reset_button_sel)
@reset_button.click @reset @reset_button.click @confirm_reset
#Setup next problem #Setup next problem
@next_problem_button = @$(@next_step_sel) @next_problem_button = @$(@next_step_sel)
@next_problem_button.click @next_problem @next_problem_button.click @next_problem
...@@ -291,7 +293,7 @@ class @CombinedOpenEnded ...@@ -291,7 +293,7 @@ class @CombinedOpenEnded
else if @child_state == 'initial' else if @child_state == 'initial'
@answer_area.attr("disabled", false) @answer_area.attr("disabled", false)
@submit_button.prop('value', 'Submit') @submit_button.prop('value', 'Submit')
@submit_button.click @save_answer @submit_button.click @confirm_save_answer
@setup_file_upload() @setup_file_upload()
else if @child_state == 'assessing' else if @child_state == 'assessing'
@answer_area.attr("disabled", true) @answer_area.attr("disabled", true)
...@@ -304,7 +306,7 @@ class @CombinedOpenEnded ...@@ -304,7 +306,7 @@ class @CombinedOpenEnded
@submit_button.hide() @submit_button.hide()
@queueing() @queueing()
@grader_status = @$(@grader_status_sel) @grader_status = @$(@grader_status_sel)
@grader_status.html("<span class='grading'>Your response has been submitted. Please check back later for your grade.</span> ") @grader_status.html("<span class='grading'>Your response has been submitted. Please check back later for your grade.</span>")
else if @child_type == "selfassessment" else if @child_type == "selfassessment"
@setup_score_selection() @setup_score_selection()
else if @child_state == 'post_assessment' else if @child_state == 'post_assessment'
...@@ -354,6 +356,9 @@ class @CombinedOpenEnded ...@@ -354,6 +356,9 @@ class @CombinedOpenEnded
@can_upload_files = pre_can_upload_files @can_upload_files = pre_can_upload_files
@gentle_alert response.error @gentle_alert response.error
confirm_save_answer: (event) =>
@save_answer(event) if confirm('Please confirm that you wish to submit your work. You will not be able to make any changes after submitting.')
save_answer: (event) => save_answer: (event) =>
@submit_button.attr("disabled",true) @submit_button.attr("disabled",true)
@submit_button.hide() @submit_button.hide()
...@@ -453,6 +458,9 @@ class @CombinedOpenEnded ...@@ -453,6 +458,9 @@ class @CombinedOpenEnded
else else
@errors_area.html(@out_of_sync_message) @errors_area.html(@out_of_sync_message)
confirm_reset: (event) =>
@reset(event) if confirm('Are you sure you want to remove your previous response to this question?')
reset: (event) => reset: (event) =>
event.preventDefault() event.preventDefault()
if @child_state == 'done' or @allow_reset=="True" if @child_state == 'done' or @allow_reset=="True"
......
...@@ -27,7 +27,7 @@ class @PeerGradingProblemBackend ...@@ -27,7 +27,7 @@ class @PeerGradingProblemBackend
else else
# if this post request fails, the error callback will catch it # if this post request fails, the error callback will catch it
$.post(@ajax_url + cmd, data, callback) $.post(@ajax_url + cmd, data, callback)
.error => callback({success: false, error: "Error occured while performing this operation"}) .error => callback({success: false, error: "Error occurred while performing this operation"})
mock: (cmd, data) -> mock: (cmd, data) ->
if cmd == 'is_student_calibrated' if cmd == 'is_student_calibrated'
...@@ -460,8 +460,8 @@ class @PeerGradingProblem ...@@ -460,8 +460,8 @@ class @PeerGradingProblem
@flag_student_container.hide() @flag_student_container.hide()
@answer_unknown_container.hide() @answer_unknown_container.hide()
@feedback_area.val("") @feedback_area.val("Once you are done with training and are grading real student essays, you will be asked to share feedback with them in addition to grading their rubric.")
@feedback_area.attr('disabled', true)
@submit_button.show() @submit_button.show()
@submit_button.unbind('click') @submit_button.unbind('click')
@submit_button.click @submit_calibration_essay @submit_button.click @submit_calibration_essay
...@@ -499,6 +499,7 @@ class @PeerGradingProblem ...@@ -499,6 +499,7 @@ class @PeerGradingProblem
@change_tracker.rebindTracker() @change_tracker.rebindTracker()
else else
@feedback_area.val("") @feedback_area.val("")
@feedback_area.attr('disabled', false)
@answer_unknown_checkbox.removeAttr("checked") @answer_unknown_checkbox.removeAttr("checked")
@flag_student_checkbox.removeAttr("checked") @flag_student_checkbox.removeAttr("checked")
@submit_button.show() @submit_button.show()
...@@ -509,7 +510,7 @@ class @PeerGradingProblem ...@@ -509,7 +510,7 @@ class @PeerGradingProblem
else if response.error else if response.error
@render_error(response.error) @render_error(response.error)
else else
@render_error("An error occured when retrieving the next submission.") @render_error("An error occurred when retrieving the next submission.")
make_paragraphs: (text) -> make_paragraphs: (text) ->
paragraph_split = text.split(/\n\s*\n/) paragraph_split = text.split(/\n\s*\n/)
......
...@@ -70,8 +70,8 @@ ALERT_DICT = { ...@@ -70,8 +70,8 @@ ALERT_DICT = {
'Flagged Submissions': "Submissions have been flagged for review" 'Flagged Submissions': "Submissions have been flagged for review"
} }
STUDENT_ERROR_MESSAGE = "Error occured while contacting the grading service. Please notify course staff." STUDENT_ERROR_MESSAGE = "Error occurred while contacting the grading service. Please notify course staff."
STAFF_ERROR_MESSAGE = "Error occured while contacting the grading service. Please notify the development team. If you do not have a point of contact, please email Vik at vik@edx.org" STAFF_ERROR_MESSAGE = "Error occurred while contacting the grading service. Please notify the development team. If you do not have a point of contact, please email Vik at vik@edx.org"
@cache_control(no_cache=True, no_store=True, must_revalidate=True) @cache_control(no_cache=True, no_store=True, must_revalidate=True)
......
...@@ -41,7 +41,7 @@ class OpenEnded ...@@ -41,7 +41,7 @@ class OpenEnded
post: (cmd, data, callback) -> post: (cmd, data, callback) ->
# if this post request fails, the error callback will catch it # if this post request fails, the error callback will catch it
$.post(@ajax_url + cmd, data, callback) $.post(@ajax_url + cmd, data, callback)
.error => callback({success: false, error: "Error occured while performing javascript ajax post."}) .error => callback({success: false, error: "Error occurred while performing javascript ajax post."})
after_action_wrapper: (target, action_type) -> after_action_wrapper: (target, action_type) ->
tr_parent = target.parent().parent() tr_parent = target.parent().parent()
......
...@@ -142,7 +142,7 @@ The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for t ...@@ -142,7 +142,7 @@ The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for t
else else
# TODO: replace with postWithPrefix when that's loaded # TODO: replace with postWithPrefix when that's loaded
$.post(@ajax_url + cmd, data, callback) $.post(@ajax_url + cmd, data, callback)
.error => callback({success: false, error: "Error occured while performing javascript AJAX post."}) .error => callback({success: false, error: "Error occurred while performing javascript AJAX post."})
class @StaffGrading class @StaffGrading
......
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