Fix hotkeys in peer and staff grading to use ctrl prefix
This commit is contained in:
@@ -161,6 +161,7 @@ class @PeerGradingProblem
|
||||
constructor: (backend) ->
|
||||
@prompt_wrapper = $('.prompt-wrapper')
|
||||
@backend = backend
|
||||
@is_ctrl = false
|
||||
|
||||
|
||||
# get the location of the problem
|
||||
@@ -212,6 +213,7 @@ class @PeerGradingProblem
|
||||
@answer_unknown_checkbox = $('.answer-unknown-checkbox')
|
||||
|
||||
$(window).keydown @keydown_handler
|
||||
$(window).keyup @keyup_handler
|
||||
|
||||
@collapse_question()
|
||||
|
||||
@@ -338,13 +340,17 @@ class @PeerGradingProblem
|
||||
@grade = Rubric.get_total_score()
|
||||
|
||||
keydown_handler: (event) =>
|
||||
if event.which == 13 && @submit_button.is(':visible')
|
||||
if event.which == 17 && @is_ctrl==false
|
||||
@is_ctrl=true
|
||||
else if event.which == 13 && @submit_button.is(':visible') && @is_ctrl==true
|
||||
if @calibration
|
||||
@submit_calibration_essay()
|
||||
else
|
||||
@submit_grade()
|
||||
|
||||
|
||||
keyup_handler: (event) =>
|
||||
if event.which == 17 && @is_ctrl==true
|
||||
@is_ctrl=false
|
||||
|
||||
|
||||
##########
|
||||
|
||||
@@ -185,6 +185,7 @@ class @StaffGrading
|
||||
|
||||
|
||||
$(window).keydown @keydown_handler
|
||||
$(window).keyup @keyup_handler
|
||||
@question_header = $('.question-header')
|
||||
@question_header.click @collapse_question
|
||||
@collapse_question()
|
||||
@@ -206,6 +207,7 @@ class @StaffGrading
|
||||
@num_pending = 0
|
||||
@score_lst = []
|
||||
@grade = null
|
||||
@is_ctrl = false
|
||||
|
||||
@problems = null
|
||||
|
||||
@@ -231,10 +233,16 @@ class @StaffGrading
|
||||
@state = state_graded
|
||||
@submit_button.show()
|
||||
|
||||
keydown_handler: (e) =>
|
||||
if e.which == 13 && !@list_view && Rubric.check_complete()
|
||||
keydown_handler: (event) =>
|
||||
if event.which == 17 && @is_ctrl==false
|
||||
@is_ctrl=true
|
||||
else if @is_ctrl==true && event.which == 13 && !@list_view && Rubric.check_complete()
|
||||
@submit_and_get_next()
|
||||
|
||||
keyup_handler: (event) =>
|
||||
if event.which == 17 && @is_ctrl==true
|
||||
@is_ctrl=false
|
||||
|
||||
set_button_text: (text) =>
|
||||
@action_button.attr('value', text)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user