Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
f9667849
Commit
f9667849
authored
Feb 20, 2013
by
Diana Huang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix some minor bugs in event handling and add enter key support
parent
3ecafa9b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
4 deletions
+29
-4
common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee
+8
-1
common/lib/xmodule/xmodule/js/src/peergrading/peer_grading_problem.coffee
+15
-3
lms/static/coffee/src/staff_grading/staff_grading.coffee
+6
-0
No files found.
common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee
View file @
f9667849
...
...
@@ -5,6 +5,7 @@ class @Rubric
$
(
'.rubric'
).
data
(
"location"
,
location
)
$
(
'input[class="score-selection"]'
).
change
@
tracking_callback
# set up the hotkeys
$
(
window
).
unbind
(
'keydown'
,
@
keypress_callback
)
$
(
window
).
keydown
@
keypress_callback
# display the 'current' carat
@
categories
=
$
(
'.rubric-category'
)
...
...
@@ -28,7 +29,7 @@ class @Rubric
return
# if we actually have a current category (not past the end)
if
(
@
category
.
length
>
0
)
if
(
@
category
_index
<=
@
categories
.
length
)
# find the valid selections for this category
inputs
=
$
(
"input[name='score-selection-
#{
@
category_index
}
']"
)
max_score
=
inputs
.
length
-
1
...
...
@@ -88,6 +89,7 @@ class @CombinedOpenEnded
constructor
:
(
element
)
->
@
element
=
element
@
reinitialize
(
element
)
$
(
window
).
keydown
@
keydown_handler
reinitialize
:
(
element
)
->
@
wrapper
=
$
(
element
).
find
(
'section.xmodule_CombinedOpenEndedModule'
)
...
...
@@ -358,6 +360,11 @@ class @CombinedOpenEnded
else
@
errors_area
.
html
(
@
out_of_sync_message
)
keydown_handler
:
(
e
)
=>
# only do anything when the key pressed is the 'enter' key
if
e
.
which
==
13
&&
@
child_state
==
'assessing'
&&
Rubric
.
check_complete
()
@
save_assessment
(
e
)
save_assessment
:
(
event
)
=>
event
.
preventDefault
()
if
@
child_state
==
'assessing'
&&
Rubric
.
check_complete
()
...
...
common/lib/xmodule/xmodule/js/src/peergrading/peer_grading_problem.coffee
View file @
f9667849
...
...
@@ -210,6 +210,9 @@ class @PeerGradingProblem
@
calibration_interstitial_page_button
=
$
(
'.calibration-interstitial-page-button'
)
@
flag_student_checkbox
=
$
(
'.flag-checkbox'
)
@
answer_unknown_checkbox
=
$
(
'.answer-unknown-checkbox'
)
$
(
window
).
keydown
@
keydown_handler
@
collapse_question
()
Collapsible
.
setCollapsibles
(
@
content_panel
)
...
...
@@ -251,9 +254,6 @@ class @PeerGradingProblem
fetch_submission_essay
:
()
=>
@
backend
.
post
(
'get_next_submission'
,
{
location
:
@
location
},
@
render_submission
)
gentle_alert
:
(
msg
)
=>
@
grading_message
.
fadeIn
()
@
grading_message
.
html
(
"<p>"
+
msg
+
"</p>"
)
construct_data
:
()
->
data
=
...
...
@@ -337,6 +337,14 @@ class @PeerGradingProblem
@
show_submit_button
()
@
grade
=
Rubric
.
get_total_score
()
keydown_handler
:
(
event
)
=>
if
event
.
which
==
13
&&
@
submit_button
.
is
(
':visible'
)
if
@
calibration
@
submit_calibration_essay
()
else
@
submit_grade
()
##########
...
...
@@ -473,6 +481,10 @@ class @PeerGradingProblem
# And now hook up an event handler again
$
(
"input[class='score-selection']"
).
change
@
graded_callback
gentle_alert
:
(
msg
)
=>
@
grading_message
.
fadeIn
()
@
grading_message
.
html
(
"<p>"
+
msg
+
"</p>"
)
collapse_question
:
()
=>
@
prompt_container
.
slideToggle
()
@
prompt_container
.
toggleClass
(
'open'
)
...
...
lms/static/coffee/src/staff_grading/staff_grading.coffee
View file @
f9667849
...
...
@@ -183,6 +183,8 @@ class @StaffGrading
@
breadcrumbs
=
$
(
'.breadcrumbs'
)
$
(
window
).
keydown
@
keydown_handler
@
question_header
=
$
(
'.question-header'
)
@
question_header
.
click
@
collapse_question
@
collapse_question
()
...
...
@@ -229,6 +231,10 @@ class @StaffGrading
@
state
=
state_graded
@
submit_button
.
show
()
keydown_handler
:
(
e
)
=>
if
e
.
which
==
13
&&
!
@
list_view
&&
Rubric
.
check_complete
()
@
submit_and_get_next
()
set_button_text
:
(
text
)
=>
@
action_button
.
attr
(
'value'
,
text
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment