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
e910f60e
Commit
e910f60e
authored
Nov 15, 2012
by
Victor Shnayder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wip
parent
e1fd6d73
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
7 deletions
+23
-7
lms/static/coffee/src/staff_grading/staff_grading.coffee
+11
-7
lms/static/coffee/src/staff_grading/test_grading.html
+12
-0
No files found.
lms/static/coffee/src/staff_grading/staff_grading.coffee
View file @
e910f60e
...
...
@@ -22,7 +22,7 @@ class StaffGradingBackend
response
=
success
:
true
submission
:
'submission! '
+
@
mock_cnt
rubric
:
'A rubric!'
+
@
mock_cnt
rubric
:
'A rubric!
'
+
@
mock_cnt
else
if
cmd
==
'save_grade'
console
.
log
(
"eval:
#{
data
.
score
}
pts, Feedback:
#{
data
.
feedback
}
"
)
...
...
@@ -68,7 +68,8 @@ class StaffGrading
@
rubric_container
=
$
(
'.rubric-container'
)
@
submission_wrapper
=
$
(
'.submission-wrapper'
)
@
rubric_wrapper
=
$
(
'.rubric-wrapper'
)
@
button
=
$
(
'.submit-button'
)
@
feedback_area
=
$
(
'.feedback-area'
)
@
submit_button
=
$
(
'.submit-button'
)
# model state
@
state
=
state_no_data
...
...
@@ -77,11 +78,12 @@ class StaffGrading
@
error_msg
=
''
@
message
=
''
@
feedback
=
null
@
score
=
null
# action handlers
@
button
.
click
@
clicked
@
submit_button
.
click
@
submit
@
correct_button
.
click
()
=>
@
score
=
1
@
incorrect_button
.
click
()
=>
@
score
=
0
# render intial state
@
render_view
()
...
...
@@ -91,7 +93,7 @@ class StaffGrading
set_button_text
:
(
text
)
->
@
button
.
prop
(
'value'
,
text
)
@
submit_
button
.
prop
(
'value'
,
text
)
ajax_callback
:
(
response
)
=>
# always clear out errors and messages on transition.
...
...
@@ -112,7 +114,7 @@ class StaffGrading
@
backend
.
post
(
'get_next'
,
{},
@
ajax_callback
)
submit_and_get_next
:
()
->
data
=
{
score
:
'1'
,
feedback
:
'Great!'
}
data
=
{
score
:
@
score
,
feedback
:
@
feedback_area
.
val
()
}
@
backend
.
post
(
'save_grade'
,
data
,
@
ajax_callback
)
...
...
@@ -123,6 +125,8 @@ class StaffGrading
data_loaded
:
(
submission
,
rubric
)
->
@
submission
=
submission
@
rubric
=
rubric
@
feedback_area
.
val
(
''
)
@
score
=
null
@
state
=
state_grading
no_more
:
()
->
...
...
@@ -158,7 +162,7 @@ class StaffGrading
@
rubric_wrapper
.
toggle
(
show_grading_elements
)
clicked
:
(
event
)
=>
submit
:
(
event
)
=>
event
.
preventDefault
()
if
@
state
==
state_error
...
...
lms/static/coffee/src/staff_grading/test_grading.html
View file @
e910f60e
...
...
@@ -26,6 +26,18 @@
<div
class=
"rubric-container"
>
</div>
<div
class=
"evaluation"
>
<textarea
name=
"feedback"
placeholder=
"Feedback for student..."
class=
"feedback-area"
cols=
"70"
rows=
"10"
></textarea>
<p>
<label
for=
"correct-radio"
>
Correct
</label>
<input
type=
"radio"
name=
"score-selection"
id=
"correct-radio"
value=
"1"
>
<label
for=
"correct-radio"
>
Incorrect
</label>
<input
type=
"radio"
name=
"score-selection"
id=
"incorrect-radio"
value=
"0"
>
</p>
</div>
</section>
<div
class=
"submission"
>
...
...
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