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
33f2d55a
Commit
33f2d55a
authored
Dec 10, 2012
by
Diana Huang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new test for problem lists
parent
5cf9982c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
1 deletions
+48
-1
lms/djangoapps/instructor/staff_grading_service.py
+29
-1
lms/djangoapps/instructor/tests.py
+19
-0
No files found.
lms/djangoapps/instructor/staff_grading_service.py
View file @
33f2d55a
...
...
@@ -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 @
33f2d55a
...
...
@@ -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