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
51d9a5a5
Commit
51d9a5a5
authored
Apr 14, 2015
by
Dennis Jen
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #70 from edx/dsjen/remove-milliseconds
Removed milliseconds from created date in problems endpoint.
parents
eb085de4
fe085f5d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
analytics_data_api/v0/tests/views/test_courses.py
+4
-3
analytics_data_api/v0/views/courses.py
+1
-1
No files found.
analytics_data_api/v0/tests/views/test_courses.py
View file @
51d9a5a5
...
@@ -604,13 +604,14 @@ class CourseProblemsListViewTests(DemoCourseMixin, TestCaseWithAuthentication):
...
@@ -604,13 +604,14 @@ class CourseProblemsListViewTests(DemoCourseMixin, TestCaseWithAuthentication):
alt_module_id
=
'i4x://test/problem/2'
alt_module_id
=
'i4x://test/problem/2'
created
=
datetime
.
datetime
.
utcnow
()
created
=
datetime
.
datetime
.
utcnow
()
alt_created
=
created
+
datetime
.
timedelta
(
seconds
=
2
)
alt_created
=
created
+
datetime
.
timedelta
(
seconds
=
2
)
date_time_format
=
'
%
Y-
%
m-
%
d
%
H:
%
M:
%
S'
o1
=
G
(
models
.
ProblemResponseAnswerDistribution
,
course_id
=
self
.
course_id
,
module_id
=
module_id
,
correct
=
True
,
o1
=
G
(
models
.
ProblemResponseAnswerDistribution
,
course_id
=
self
.
course_id
,
module_id
=
module_id
,
correct
=
True
,
count
=
100
,
created
=
created
)
count
=
100
,
created
=
created
.
strftime
(
date_time_format
)
)
o2
=
G
(
models
.
ProblemResponseAnswerDistribution
,
course_id
=
self
.
course_id
,
module_id
=
alt_module_id
,
o2
=
G
(
models
.
ProblemResponseAnswerDistribution
,
course_id
=
self
.
course_id
,
module_id
=
alt_module_id
,
correct
=
True
,
count
=
100
,
created
=
created
)
correct
=
True
,
count
=
100
,
created
=
created
.
strftime
(
date_time_format
)
)
o3
=
G
(
models
.
ProblemResponseAnswerDistribution
,
course_id
=
self
.
course_id
,
module_id
=
module_id
,
correct
=
False
,
o3
=
G
(
models
.
ProblemResponseAnswerDistribution
,
course_id
=
self
.
course_id
,
module_id
=
module_id
,
correct
=
False
,
count
=
200
,
created
=
alt_created
)
count
=
200
,
created
=
alt_created
.
strftime
(
date_time_format
)
)
expected
=
[
expected
=
[
{
{
...
...
analytics_data_api/v0/views/courses.py
View file @
51d9a5a5
...
@@ -661,6 +661,6 @@ GROUP BY module_id;
...
@@ -661,6 +661,6 @@ GROUP BY module_id;
# Rather than write custom SQL for the SQLite backend, simply parse the timestamp.
# Rather than write custom SQL for the SQLite backend, simply parse the timestamp.
created
=
row
[
'created'
]
created
=
row
[
'created'
]
if
not
isinstance
(
created
,
datetime
.
datetime
):
if
not
isinstance
(
created
,
datetime
.
datetime
):
row
[
'created'
]
=
datetime
.
datetime
.
strptime
(
created
,
'
%
Y-
%
m-
%
d
%
H:
%
M:
%
S
.
%
f
'
)
row
[
'created'
]
=
datetime
.
datetime
.
strptime
(
created
,
'
%
Y-
%
m-
%
d
%
H:
%
M:
%
S'
)
return
rows
return
rows
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