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
41167a49
Commit
41167a49
authored
Dec 11, 2012
by
Your Name
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into bugfix/kevin/mathjax-rendering
parents
343dde6e
785974da
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
3 deletions
+50
-3
common/lib/capa/capa/responsetypes.py
+2
-2
lms/djangoapps/instructor/staff_grading_service.py
+29
-1
lms/djangoapps/instructor/tests.py
+19
-0
No files found.
common/lib/capa/capa/responsetypes.py
View file @
41167a49
...
...
@@ -2061,7 +2061,7 @@ class OpenEndedResponse(LoncapaResponse):
<div class="{feedback_type}">
{value}
</div>
"""
.
format
(
feedback_type
,
value
)
"""
.
format
(
feedback_type
=
feedback_type
,
value
=
value
)
# TODO (vshnayder): design and document the details of this format so
# that we can do proper escaping here (e.g. are the graders allowed to
...
...
@@ -2153,7 +2153,7 @@ class OpenEndedResponse(LoncapaResponse):
#Currently ignore msg and only return feedback (which takes the place of msg)
return
ScoreMessage
(
valid
=
True
,
correct
=
correct
,
score
=
score_result
[
'score'
],
msg
=
feedback
)
points
=
score_result
[
'score'
],
msg
=
feedback
)
#-----------------------------------------------------------------------------
# TEMPORARY: List of all response subclasses
...
...
lms/djangoapps/instructor/staff_grading_service.py
View file @
41167a49
...
...
@@ -42,6 +42,17 @@ class MockStaffGradingService(object):
'max_score'
:
2
+
self
.
cnt
%
3
,
'rubric'
:
'A rubric'
})
def
get_problem_list
(
self
,
course_id
,
grader_id
):
self
.
cnt
+=
1
return
json
.
dumps
({
'success'
:
True
,
'problem_list'
:
[
json
.
dumps
({
'location'
:
'i4x://MITx/3.091x/problem/open_ended_demo1'
,
\
'problem_name'
:
"Problem 1"
,
'num_graded'
:
3
,
'num_pending'
:
5
,
'min_for_ml'
:
10
}),
json
.
dumps
({
'location'
:
'i4x://MITx/3.091x/problem/open_ended_demo2'
,
\
'problem_name'
:
"Problem 2"
,
'num_graded'
:
1
,
'num_pending'
:
5
,
'min_for_ml'
:
10
})
]})
def
save_grade
(
self
,
course_id
,
grader_id
,
submission_id
,
score
,
feedback
):
return
self
.
get_next
(
course_id
,
'fake location'
,
grader_id
)
...
...
@@ -274,7 +285,24 @@ def get_next(request, course_id):
def
get_problem_list
(
request
,
course_id
):
"""
Get all the problems for the given course id
TODO: fill in all of this stuff
Returns a json dict with the following keys:
success: bool
problem_list: a list containing json dicts with the following keys:
each dict represents a different problem in the course
location: the location of the problem
problem_name: the name of the problem
num_graded: the number of responses that have been graded
num_pending: the number of responses that are sitting in the queue
min_for_ml: the number of responses that need to be graded before
the ml can be run
"""
_check_access
(
request
.
user
,
course_id
)
try
:
...
...
lms/djangoapps/instructor/tests.py
View file @
41167a49
...
...
@@ -278,6 +278,14 @@ class TestStaffGradingService(ct.PageLoader):
d
=
json
.
loads
(
r
.
content
)
self
.
assertTrue
(
d
[
'success'
])
self
.
assertEquals
(
d
[
'submission_id'
],
self
.
mock_service
.
cnt
)
self
.
assertIsNotNone
(
d
[
'submission'
])
self
.
assertIsNotNone
(
d
[
'num_graded'
])
self
.
assertIsNotNone
(
d
[
'min_for_ml'
])
self
.
assertIsNotNone
(
d
[
'num_pending'
])
self
.
assertIsNotNone
(
d
[
'prompt'
])
self
.
assertIsNotNone
(
d
[
'ml_error_info'
])
self
.
assertIsNotNone
(
d
[
'max_score'
])
self
.
assertIsNotNone
(
d
[
'rubric'
])
def
test_save_grade
(
self
):
...
...
@@ -294,4 +302,15 @@ class TestStaffGradingService(ct.PageLoader):
self
.
assertTrue
(
d
[
'success'
],
str
(
d
))
self
.
assertEquals
(
d
[
'submission_id'
],
self
.
mock_service
.
cnt
)
def
test_get_problem_list
(
self
):
self
.
login
(
self
.
instructor
,
self
.
password
)
url
=
reverse
(
'staff_grading_get_problem_list'
,
kwargs
=
{
'course_id'
:
self
.
course_id
})
data
=
{}
r
=
self
.
check_for_post_code
(
200
,
url
,
data
)
d
=
json
.
loads
(
r
.
content
)
self
.
assertTrue
(
d
[
'success'
],
str
(
d
))
self
.
assertIsNotNone
(
d
[
'problem_list'
])
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