Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-analytics-data-api-client
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
OpenEdx
edx-analytics-data-api-client
Commits
f60923c6
Commit
f60923c6
authored
Jan 12, 2015
by
Clinton Blackburn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed submission_counts method
This method/endpoint will be replaced by a course-problems endpoint.
parent
b12ac07b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 additions
and
34 deletions
+1
-34
analyticsclient/module.py
+0
-17
analyticsclient/tests/test_module.py
+1
-17
No files found.
analyticsclient/module.py
View file @
f60923c6
import
analyticsclient.constants.data_format
as
DF
import
analyticsclient.constants.data_format
as
DF
from
analyticsclient.exceptions
import
InvalidRequestError
class
Module
(
object
):
class
Module
(
object
):
...
@@ -29,22 +28,6 @@ class Module(object):
...
@@ -29,22 +28,6 @@ class Module(object):
return
self
.
client
.
get
(
path
,
data_format
=
data_format
)
return
self
.
client
.
get
(
path
,
data_format
=
data_format
)
def
submission_counts
(
self
,
module_ids
,
data_format
=
DF
.
JSON
):
"""
Get submission counts data for multiple modules.
Arguments:
module_ids (list[str]): IDs of modules for which data should be returned
data_format (str): Format in which to return data (default is JSON)
"""
if
not
module_ids
:
raise
InvalidRequestError
(
'At least one module ID must be supplied.'
)
module_ids
=
','
.
join
(
module_ids
)
path
=
'problems/submission_counts/?problem_ids={}'
.
format
(
module_ids
)
return
self
.
client
.
get
(
path
,
data_format
=
data_format
)
def
grade_distribution
(
self
,
data_format
=
DF
.
JSON
):
def
grade_distribution
(
self
,
data_format
=
DF
.
JSON
):
"""
"""
Get grade distribution data for a module.
Get grade distribution data for a module.
...
...
analyticsclient/tests/test_module.py
View file @
f60923c6
import
json
import
json
import
httpretty
import
httpretty
from
analyticsclient.exceptions
import
InvalidRequestError
from
analyticsclient.tests
import
ClientTestCase
from
analyticsclient.tests
import
ClientTestCase
...
@@ -95,19 +95,3 @@ class ModulesTests(ClientTestCase):
...
@@ -95,19 +95,3 @@ class ModulesTests(ClientTestCase):
uri
=
self
.
get_api_url
(
'problems/{0}/grade_distribution/'
.
format
(
self
.
module_id
))
uri
=
self
.
get_api_url
(
'problems/{0}/grade_distribution/'
.
format
(
self
.
module_id
))
httpretty
.
register_uri
(
httpretty
.
GET
,
uri
,
body
=
json
.
dumps
(
body
))
httpretty
.
register_uri
(
httpretty
.
GET
,
uri
,
body
=
json
.
dumps
(
body
))
self
.
assertEqual
(
body
,
self
.
module
.
grade_distribution
())
self
.
assertEqual
(
body
,
self
.
module
.
grade_distribution
())
@httpretty.activate
def
test_submission_counts
(
self
):
self
.
assertRaises
(
InvalidRequestError
,
self
.
module
.
submission_counts
,
None
)
body
=
[
{
'module_id'
:
self
.
module_id
,
'total'
:
100
,
'correct'
:
80
}
]
uri
=
self
.
get_api_url
(
'problems/submission_counts/'
)
httpretty
.
register_uri
(
httpretty
.
GET
,
uri
,
body
=
json
.
dumps
(
body
))
self
.
assertEqual
(
body
,
self
.
module
.
submission_counts
([
self
.
module_id
]))
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