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
b1d5273a
Commit
b1d5273a
authored
Nov 15, 2012
by
Victor Shnayder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add messages, headers for sections
parent
546096e8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
11 deletions
+36
-11
lms/static/coffee/src/staff_grading/staff_grading.coffee
+19
-6
lms/static/coffee/src/staff_grading/test_grading.html
+17
-5
No files found.
lms/static/coffee/src/staff_grading/staff_grading.coffee
View file @
b1d5273a
...
...
@@ -61,12 +61,18 @@ class StaffGrading
@
backend
=
backend
@
error_container
=
$
(
'.error-container'
)
@
message_container
=
$
(
'.message-container'
)
@
submission_container
=
$
(
'.submission-container'
)
@
rubric_container
=
$
(
'.rubric-container'
)
@
submission_wrapper
=
$
(
'.submission-wrapper'
)
@
rubric_wrapper
=
$
(
'.rubric-wrapper'
)
@
button
=
$
(
'.submit-button'
)
@
button
.
click
@
clicked
@
state
=
state_no_data
@
submission_wrapper
.
hide
()
@
rubric_wrapper
.
hide
()
@
get_next_submission
()
...
...
@@ -102,26 +108,35 @@ class StaffGrading
@
update
()
no_more
:
()
->
@
submission_container
.
html
(
''
)
@
rubric_container
.
html
(
''
)
@
state
=
state_no_data
@
update
()
update
:
()
->
# make button
state and actions right
# make button
and div state match the state. Idempotent.
if
@
state
==
state_error
@
set_button_text
(
'Try loading again'
)
else
if
@
state
==
state_grading
@
submission_wrapper
.
show
()
@
rubric_wrapper
.
show
()
@
set_button_text
(
'Submit'
)
else
if
@
state
==
state_no_data
@
submission_wrapper
.
hide
()
@
rubric_wrapper
.
hide
()
@
message_container
.
html
(
'Nothing to grade'
)
@
set_button_text
(
'Re-check for submissions'
)
else
@
error
(
'System got into invalid state '
+
@
state
)
clicked
:
(
event
)
=>
event
.
preventDefault
()
# always clear out errors and messages on transition...
@
message_container
.
html
(
''
)
@
error_container
.
html
(
''
)
if
@
state
==
state_error
@
error_container
.
html
(
''
)
@
get_next_submission
()
else
if
@
state
==
state_grading
@
submit_and_get_next
()
...
...
@@ -131,8 +146,6 @@ class StaffGrading
@
error
(
'System got into invalid state '
+
@
state
)
# for now, just create an instance and load it...
mock_backend
=
true
ajax_url
=
$
(
'.staff-grading'
).
data
(
'ajax_url'
)
...
...
lms/static/coffee/src/staff_grading/test_grading.html
View file @
b1d5273a
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<title></title>
<script
src=
"http://code.jquery.com/jquery-latest.js"
></script>
<script
src=
"http://code.jquery.com/jquery-latest.js"
></script>
<script
type=
"text/javascript"
src=
"staff_grading.js"
></script>
</head>
...
...
@@ -9,11 +9,23 @@
<div
class=
"staff-grading"
data-ajax_url=
"/some_url/"
>
<h1>
Staff grading
</h1>
<div
class=
"error-container"
></div>
<div
class=
"submission-container"
></div>
<div
class=
"error-container"
>
</div>
<div
class=
"message-container"
>
</div>
<div
class=
"rubric-container"
></div>
<section
class=
"submission-wrapper"
>
<h3>
Submission
</h3>
<div
class=
"submission-container"
>
</div>
</section>
<section
class=
"rubric-wrapper"
>
<h3>
Rubric
</h3>
<div
class=
"rubric-container"
>
</div>
</section>
<div
class=
"submission"
>
<input
type=
"button"
value=
"Submit"
class=
"submit-button"
name=
"show"
/>
...
...
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