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
078b2a5b
Commit
078b2a5b
authored
Jan 03, 2013
by
Diana Huang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix up some minor state issues and
complete basic JS functionality for page
parent
becffd4d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
78 additions
and
21 deletions
+78
-21
lms/djangoapps/open_ended_grading/peer_grading_service.py
+3
-3
lms/static/coffee/src/peer_grading/peer_grading_problem.coffee
+70
-18
lms/static/sass/course/_staff_grading.scss
+5
-0
No files found.
lms/djangoapps/open_ended_grading/peer_grading_service.py
View file @
078b2a5b
...
...
@@ -132,7 +132,7 @@ def save_grade(request, course_id):
TODO: fill in this documentation
"""
_check_post
(
request
)
required
=
set
([
'location'
,
'
grader_id'
,
'
submission_id'
,
'submission_key'
,
'score'
,
'feedback'
])
required
=
set
([
'location'
,
'submission_id'
,
'submission_key'
,
'score'
,
'feedback'
])
success
,
message
=
_check_required
(
request
,
required
)
if
not
success
:
return
_err_response
(
message
)
...
...
@@ -211,14 +211,14 @@ def save_calibration_essay(request, course_id):
"""
_check_post
(
request
)
required
=
set
([
'location'
,
'
calibration_essay
_id'
,
'submission_key'
,
'score'
,
'feedback'
])
required
=
set
([
'location'
,
'
submission
_id'
,
'submission_key'
,
'score'
,
'feedback'
])
success
,
message
=
_check_required
(
request
,
required
)
if
not
success
:
return
_err_response
(
message
)
grader_id
=
request
.
user
.
id
p
=
request
.
POST
location
=
p
[
'location'
]
calibration_essay_id
=
p
[
'
calibration_essay
_id'
]
calibration_essay_id
=
p
[
'
submission
_id'
]
submission_key
=
p
[
'submission_key'
]
score
=
p
[
'score'
]
feedback
=
p
[
'feedback'
]
...
...
lms/static/coffee/src/peer_grading/peer_grading_problem.coffee
View file @
078b2a5b
...
...
@@ -16,7 +16,7 @@ class PeerGradingProblemBackend
# change to test each version
response
=
success
:
true
calibrated
:
fals
e
calibrated
:
tru
e
else
if
cmd
==
'show_calibration_essay'
#response =
# success: false
...
...
@@ -38,7 +38,12 @@ class PeerGradingProblemBackend
prompt
:
'Answer this question'
rubric
:
'This is a rubric.'
max_score
:
4
else
if
cmd
==
'save_calibration_essay'
response
=
success
:
true
else
if
cmd
==
'save_grade'
response
=
success
:
true
return
response
...
...
@@ -61,13 +66,15 @@ class PeerGradingProblem
@
submission_container
=
$
(
'.submission-container'
)
@
prompt_container
=
$
(
'.prompt-container'
)
@
rubric_container
=
$
(
'.rubric-container'
)
@
instructions_panel
=
$
(
'.instructions-panel'
)
@
calibration_panel
=
$
(
'.calibration-panel'
)
@
grading_panel
=
$
(
'.grading-panel'
)
@
content_panel
=
$
(
'.content-panel'
)
@
error_container
=
$
(
'.error-container'
)
@
submission_key_input
=
$
(
"input[name='submission-key']"
)
@
essay_id_input
=
$
(
"input[name='essay-id']"
)
@
feedback_area
=
$
(
'.feedback-area'
)
@
score_selection_container
=
$
(
'.score-selection-container'
)
@
score
=
null
...
...
@@ -94,11 +101,23 @@ class PeerGradingProblem
fetch_submission_essay
:
()
=>
@
backend
.
post
(
'get_next_submission'
,
{
location
:
@
location
},
@
render_submission
)
submit_calibration_essay
:
()
->
#TODO: onclick of the submit button. submits the calibration essay grade
construct_data
:
()
=>
data
=
score
:
@
score
location
:
@
location
submission_id
:
@
essay_id_input
.
val
()
submission_key
:
@
submission_key_input
.
val
()
feedback
:
@
feedback_area
.
val
()
return
data
submit_grade
:
()
->
#TODO: onclick of the submit button. submits the grade
submit_calibration_essay
:
()
=>
data
=
@
construct_data
()
@
backend
.
post
(
'save_calibration_essay'
,
data
,
@
submission_callback
)
submit_grade
:
()
=>
data
=
@
construct_data
()
@
backend
.
post
(
'save_grade'
,
data
,
@
submission_callback
)
##########
...
...
@@ -110,7 +129,7 @@ class PeerGradingProblem
if
response
.
success
# check whether or not we're still calibrating
if
response
.
calibrated
@
fetch_submission
()
@
fetch_submission
_essay
()
@
calibration
=
false
else
@
fetch_calibration_essay
()
...
...
@@ -147,18 +166,55 @@ class PeerGradingProblem
# load in all the data
@
submission_container
.
html
(
"<h3>Calibration Essay</h3>"
)
@
render_submission_data
(
response
)
# TODO: indicate that we're in calibration mode
@
calibration_panel
.
addClass
(
'current-state'
)
@
grading_panel
.
removeClass
(
'current-state'
)
# clear out all of the existing text
@
calibration_panel
.
find
(
'p'
).
remove
()
@
grading_panel
.
find
(
'p'
).
remove
()
# add in new text
@
submit_button
.
click
@
submit_calibration_essay
else
if
response
.
error
@
render_error
(
response
.
error
)
else
if
response
.
error
@
render_error
(
response
.
error
)
else
@
render_error
(
"An error occurred while contacting the grading server"
)
@
render_error
(
"An error occurred while retrieving the next calibration essay"
)
render_submission
:
(
response
)
=>
if
response
.
success
#TODO: fill this in
@
submit_button
.
hide
()
@
submission_container
.
html
(
"<h3>Submitted Essay</h3>"
)
@
render_submission_data
(
response
)
@
calibration_panel
.
removeClass
(
'current-state'
)
@
grading_panel
.
addClass
(
'current-state'
)
# clear out all of the existing text
@
calibration_panel
.
find
(
'p'
).
remove
()
@
grading_panel
.
find
(
'p'
).
remove
()
@
submit_button
.
click
@
submit_grade
else
if
response
.
error
@
render_error
(
response
.
error
)
else
@
render_error
(
"An error occured when retrieving the next submission."
)
make_paragraphs
:
(
text
)
->
paragraph_split
=
text
.
split
(
/\n\s*\n/
)
new_text
=
''
for
paragraph
in
paragraph_split
new_text
+=
"<p>
#{
paragraph
}
</p>"
return
new_text
render_submission_data
:
(
response
)
=>
@
content_panel
.
show
()
@
submission_container
.
append
(
response
.
student_response
)
@
submission_container
.
append
(
@
make_paragraphs
(
response
.
student_response
)
)
@
prompt_container
.
html
(
response
.
prompt
)
@
rubric_container
.
html
(
response
.
rubric
)
@
submission_key_input
.
val
(
response
.
submission_key
)
...
...
@@ -168,10 +224,6 @@ class PeerGradingProblem
@
action_button
.
hide
()
render_submission
:
(
response
)
=>
#TODO: fill this in
@
submit_button
.
hide
()
@
render_submission_data
(
response
)
render_error
:
(
error_message
)
=>
@
error_container
.
show
()
...
...
lms/static/sass/course/_staff_grading.scss
View file @
078b2a5b
...
...
@@ -82,6 +82,11 @@ div.peer-grading{
margin-bottom
:
5px
;
font-size
:
.8em
;
}
.current-state
{
background
:
#eee
;
}
padding
:
40px
;
}
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