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
43d76b98
Commit
43d76b98
authored
Dec 11, 2012
by
Diana Huang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add skip button logic to the LMS
parent
370dfc77
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
8 deletions
+25
-8
lms/djangoapps/instructor/staff_grading_service.py
+11
-7
lms/static/coffee/src/staff_grading/staff_grading.coffee
+13
-1
lms/templates/instructor/staff_grading.html
+1
-0
No files found.
lms/djangoapps/instructor/staff_grading_service.py
View file @
43d76b98
...
...
@@ -53,7 +53,7 @@ class MockStaffGradingService(object):
]})
def
save_grade
(
self
,
course_id
,
grader_id
,
submission_id
,
score
,
feedback
):
def
save_grade
(
self
,
course_id
,
grader_id
,
submission_id
,
score
,
feedback
,
skipped
):
return
self
.
get_next
(
course_id
,
'fake location'
,
grader_id
)
...
...
@@ -109,7 +109,8 @@ class StaffGradingService(object):
log
.
warning
(
"Couldn't log into staff_grading backend. Response:
%
s"
,
r
)
# try again
return
operation
()
response
=
operation
()
response
.
raise_for_status
()
return
response
...
...
@@ -173,7 +174,7 @@ class StaffGradingService(object):
return
r
.
text
def
save_grade
(
self
,
course_id
,
grader_id
,
submission_id
,
score
,
feedback
):
def
save_grade
(
self
,
course_id
,
grader_id
,
submission_id
,
score
,
feedback
,
skipped
):
"""
Save a score and feedback for a submission.
...
...
@@ -190,7 +191,8 @@ class StaffGradingService(object):
'submission_id'
:
submission_id
,
'score'
:
score
,
'feedback'
:
feedback
,
'grader_id'
:
grader_id
}
'grader_id'
:
grader_id
,
'skipped'
:
skipped
}
op
=
lambda
:
self
.
session
.
post
(
self
.
save_grade_url
,
data
=
data
,
allow_redirects
=
False
)
...
...
@@ -350,7 +352,6 @@ def save_grade(request, course_id):
required
=
set
([
'score'
,
'feedback'
,
'submission_id'
,
'location'
])
actual
=
set
(
request
.
POST
.
keys
())
log
.
debug
(
actual
)
missing
=
required
-
actual
if
len
(
missing
)
>
0
:
return
_err_response
(
'Missing required keys {0}'
.
format
(
...
...
@@ -358,14 +359,17 @@ def save_grade(request, course_id):
grader_id
=
request
.
user
.
id
p
=
request
.
POST
location
=
p
[
'location'
]
location
=
p
[
'location'
]
skipped
=
'skipped'
in
p
try
:
result_json
=
grading_service
()
.
save_grade
(
course_id
,
grader_id
,
p
[
'submission_id'
],
p
[
'score'
],
p
[
'feedback'
])
p
[
'feedback'
],
skipped
)
except
GradingServiceError
:
log
.
exception
(
"Error saving grade"
)
return
_err_response
(
'Could not connect to grading service'
)
...
...
lms/static/coffee/src/staff_grading/staff_grading.coffee
View file @
43d76b98
...
...
@@ -139,8 +139,10 @@ class StaffGrading
@
feedback_area
=
$
(
'.feedback-area'
)
@
score_selection_container
=
$
(
'.score-selection-container'
)
@
submit_button
=
$
(
'.submit-button'
)
@
action_button
=
$
(
'.action-button'
)
@
skip_button
=
$
(
'.skip-button'
)
@
problem_meta_info
=
$
(
'.problem-meta-info-container'
)
@
meta_info_wrapper
=
$
(
'.meta-info-wrapper'
)
...
...
@@ -171,6 +173,7 @@ class StaffGrading
@
submit_button
.
click
@
submit
# TODO: fix this to do something more intelligent
@
action_button
.
click
@
submit
@
skip_button
.
click
@
skip_and_get_next
# send initial request automatically
@
get_problem_list
()
...
...
@@ -225,6 +228,15 @@ class StaffGrading
@
list_view
=
false
@
backend
.
post
(
'get_next'
,
{
location
:
location
},
@
ajax_callback
)
skip_and_get_next
:
()
=>
data
=
score
:
@
score
feedback
:
@
feedback_area
.
val
()
submission_id
:
@
submission_id
location
:
@
location
skipped
:
true
@
backend
.
post
(
'save_grade'
,
data
,
@
ajax_callback
)
get_problem_list
:
()
->
@
list_view
=
true
@
backend
.
post
(
'get_problem_list'
,
{},
@
ajax_callback
)
...
...
@@ -342,7 +354,7 @@ class StaffGrading
meta_list
=
$
(
"<ul>"
)
meta_list
.
append
(
"<li><span class='meta-info'>Pending - </span>
#{
@
num_pending
}
</li>"
)
meta_list
.
append
(
"<li><span class='meta-info'>Graded - </span>
#{
@
num_graded
}
</li>"
)
meta_list
.
append
(
"<li><span class='meta-info'>Needed for ML - </span>
#{
Math
.
max
(
@
min_for_ml
-
@
num_graded
)
}
</li>"
)
meta_list
.
append
(
"<li><span class='meta-info'>Needed for ML - </span>
#{
Math
.
max
(
@
min_for_ml
-
@
num_graded
,
0
)
}
</li>"
)
@
problem_meta_info
.
html
(
meta_list
)
@
prompt_container
.
html
(
@
prompt
)
...
...
lms/templates/instructor/staff_grading.html
View file @
43d76b98
...
...
@@ -81,6 +81,7 @@
<div
class=
"submission"
>
<input
type=
"button"
value=
"Submit"
class=
"submit-button"
name=
"show"
/>
<input
type=
"button"
value=
"Skip"
class=
"skip-button"
name=
"skip"
/>
</div>
</div>
...
...
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