Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
4a2dabd3
Commit
4a2dabd3
authored
12 years ago
by
Diana Huang
Browse files
Options
Downloads
Patches
Plain Diff
new test for problem lists
parent
df578de1
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lms/djangoapps/instructor/staff_grading_service.py
+29
-1
29 additions, 1 deletion
lms/djangoapps/instructor/staff_grading_service.py
lms/djangoapps/instructor/tests.py
+19
-0
19 additions, 0 deletions
lms/djangoapps/instructor/tests.py
with
48 additions
and
1 deletion
lms/djangoapps/instructor/staff_grading_service.py
+
29
−
1
View file @
4a2dabd3
...
...
@@ -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
:
...
...
This diff is collapsed.
Click to expand it.
lms/djangoapps/instructor/tests.py
+
19
−
0
View file @
4a2dabd3
...
...
@@ -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
'
])
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment