Commit d0ecbbb4 by Vik Paruchuri

Fix hotkeys in peer and staff grading to use ctrl prefix

parent 463a88cc
...@@ -161,6 +161,7 @@ class @PeerGradingProblem ...@@ -161,6 +161,7 @@ class @PeerGradingProblem
constructor: (backend) -> constructor: (backend) ->
@prompt_wrapper = $('.prompt-wrapper') @prompt_wrapper = $('.prompt-wrapper')
@backend = backend @backend = backend
@is_ctrl = false
# get the location of the problem # get the location of the problem
...@@ -212,6 +213,7 @@ class @PeerGradingProblem ...@@ -212,6 +213,7 @@ class @PeerGradingProblem
@answer_unknown_checkbox = $('.answer-unknown-checkbox') @answer_unknown_checkbox = $('.answer-unknown-checkbox')
$(window).keydown @keydown_handler $(window).keydown @keydown_handler
$(window).keyup @keyup_handler
@collapse_question() @collapse_question()
...@@ -338,13 +340,17 @@ class @PeerGradingProblem ...@@ -338,13 +340,17 @@ class @PeerGradingProblem
@grade = Rubric.get_total_score() @grade = Rubric.get_total_score()
keydown_handler: (event) => 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 if @calibration
@submit_calibration_essay() @submit_calibration_essay()
else else
@submit_grade() @submit_grade()
keyup_handler: (event) =>
if event.which == 17 && @is_ctrl==true
@is_ctrl=false
########## ##########
......
...@@ -185,6 +185,7 @@ class @StaffGrading ...@@ -185,6 +185,7 @@ class @StaffGrading
$(window).keydown @keydown_handler $(window).keydown @keydown_handler
$(window).keyup @keyup_handler
@question_header = $('.question-header') @question_header = $('.question-header')
@question_header.click @collapse_question @question_header.click @collapse_question
@collapse_question() @collapse_question()
...@@ -206,6 +207,7 @@ class @StaffGrading ...@@ -206,6 +207,7 @@ class @StaffGrading
@num_pending = 0 @num_pending = 0
@score_lst = [] @score_lst = []
@grade = null @grade = null
@is_ctrl = false
@problems = null @problems = null
...@@ -231,10 +233,16 @@ class @StaffGrading ...@@ -231,10 +233,16 @@ class @StaffGrading
@state = state_graded @state = state_graded
@submit_button.show() @submit_button.show()
keydown_handler: (e) => keydown_handler: (event) =>
if e.which == 13 && !@list_view && Rubric.check_complete() 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() @submit_and_get_next()
keyup_handler: (event) =>
if event.which == 17 && @is_ctrl==true
@is_ctrl=false
set_button_text: (text) => set_button_text: (text) =>
@action_button.attr('value', text) @action_button.attr('value', text)
......
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