Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-analytics-data-api
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-analytics-data-api
Commits
68f79a41
Commit
68f79a41
authored
Aug 30, 2016
by
Dennis Jen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed serialization of problem part IDs and tags.
parent
e95f2178
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
8 deletions
+11
-8
analytics_data_api/v0/serializers.py
+5
-2
analytics_data_api/v0/tests/views/test_courses.py
+6
-6
No files found.
analytics_data_api/v0/serializers.py
View file @
68f79a41
...
@@ -56,7 +56,7 @@ class ProblemSerializer(serializers.Serializer):
...
@@ -56,7 +56,7 @@ class ProblemSerializer(serializers.Serializer):
module_id
=
serializers
.
CharField
(
required
=
True
)
module_id
=
serializers
.
CharField
(
required
=
True
)
total_submissions
=
serializers
.
IntegerField
(
default
=
0
)
total_submissions
=
serializers
.
IntegerField
(
default
=
0
)
correct_submissions
=
serializers
.
IntegerField
(
default
=
0
)
correct_submissions
=
serializers
.
IntegerField
(
default
=
0
)
part_ids
=
serializers
.
CharField
(
)
part_ids
=
serializers
.
ListField
(
child
=
serializers
.
CharField
()
)
created
=
serializers
.
DateTimeField
(
format
=
settings
.
DATETIME_FORMAT
)
created
=
serializers
.
DateTimeField
(
format
=
settings
.
DATETIME_FORMAT
)
...
@@ -69,9 +69,12 @@ class ProblemsAndTagsSerializer(serializers.Serializer):
...
@@ -69,9 +69,12 @@ class ProblemsAndTagsSerializer(serializers.Serializer):
module_id
=
serializers
.
CharField
(
required
=
True
)
module_id
=
serializers
.
CharField
(
required
=
True
)
total_submissions
=
serializers
.
IntegerField
(
default
=
0
)
total_submissions
=
serializers
.
IntegerField
(
default
=
0
)
correct_submissions
=
serializers
.
IntegerField
(
default
=
0
)
correct_submissions
=
serializers
.
IntegerField
(
default
=
0
)
tags
=
serializers
.
Char
Field
()
tags
=
serializers
.
SerializerMethod
Field
()
created
=
serializers
.
DateTimeField
(
format
=
settings
.
DATETIME_FORMAT
)
created
=
serializers
.
DateTimeField
(
format
=
settings
.
DATETIME_FORMAT
)
def
get_tags
(
self
,
obj
):
return
obj
.
get
(
'tags'
,
None
)
class
ProblemResponseAnswerDistributionSerializer
(
ModelSerializerWithCreatedField
):
class
ProblemResponseAnswerDistributionSerializer
(
ModelSerializerWithCreatedField
):
"""
"""
...
...
analytics_data_api/v0/tests/views/test_courses.py
View file @
68f79a41
...
@@ -628,14 +628,14 @@ class CourseProblemsListViewTests(DemoCourseMixin, TestCaseWithAuthentication):
...
@@ -628,14 +628,14 @@ class CourseProblemsListViewTests(DemoCourseMixin, TestCaseWithAuthentication):
'module_id'
:
module_id
,
'module_id'
:
module_id
,
'total_submissions'
:
150
,
'total_submissions'
:
150
,
'correct_submissions'
:
50
,
'correct_submissions'
:
50
,
'part_ids'
:
unicode
([
o1
.
part_id
,
o3
.
part_id
])
,
'part_ids'
:
[
unicode
(
o1
.
part_id
),
unicode
(
o3
.
part_id
)]
,
'created'
:
alt_created
.
strftime
(
settings
.
DATETIME_FORMAT
)
'created'
:
alt_created
.
strftime
(
settings
.
DATETIME_FORMAT
)
},
},
{
{
'module_id'
:
alt_module_id
,
'module_id'
:
alt_module_id
,
'total_submissions'
:
100
,
'total_submissions'
:
100
,
'correct_submissions'
:
100
,
'correct_submissions'
:
100
,
'part_ids'
:
unicode
([
o2
.
part_id
])
,
'part_ids'
:
[
unicode
(
o2
.
part_id
)]
,
'created'
:
unicode
(
created
.
strftime
(
settings
.
DATETIME_FORMAT
))
'created'
:
unicode
(
created
.
strftime
(
settings
.
DATETIME_FORMAT
))
}
}
]
]
...
@@ -699,19 +699,19 @@ class CourseProblemsAndTagsListViewTests(DemoCourseMixin, TestCaseWithAuthentica
...
@@ -699,19 +699,19 @@ class CourseProblemsAndTagsListViewTests(DemoCourseMixin, TestCaseWithAuthentica
'module_id'
:
module_id
,
'module_id'
:
module_id
,
'total_submissions'
:
11
,
'total_submissions'
:
11
,
'correct_submissions'
:
4
,
'correct_submissions'
:
4
,
'tags'
:
unicode
(
{
'tags'
:
{
u'difficulty'
:
u'Easy'
,
u'difficulty'
:
u'Easy'
,
u'learning_outcome'
:
u'Learned a few things'
,
u'learning_outcome'
:
u'Learned a few things'
,
}
)
,
},
'created'
:
alt_created
.
strftime
(
settings
.
DATETIME_FORMAT
)
'created'
:
alt_created
.
strftime
(
settings
.
DATETIME_FORMAT
)
},
},
{
{
'module_id'
:
alt_module_id
,
'module_id'
:
alt_module_id
,
'total_submissions'
:
4
,
'total_submissions'
:
4
,
'correct_submissions'
:
0
,
'correct_submissions'
:
0
,
'tags'
:
unicode
(
{
'tags'
:
{
u'learning_outcome'
:
u'Learned everything'
,
u'learning_outcome'
:
u'Learned everything'
,
}
)
,
},
'created'
:
created
.
strftime
(
settings
.
DATETIME_FORMAT
)
'created'
:
created
.
strftime
(
settings
.
DATETIME_FORMAT
)
}
}
]
]
...
...
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