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
fe085f5d
Commit
fe085f5d
authored
Apr 13, 2015
by
Dennis Jen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed milliseconds from created date in problems endpoint.
parent
eb085de4
Show 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 @
fe085f5d
...
...
@@ -604,13 +604,14 @@ class CourseProblemsListViewTests(DemoCourseMixin, TestCaseWithAuthentication):
alt_module_id
=
'i4x://test/problem/2'
created
=
datetime
.
datetime
.
utcnow
()
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
,
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
,
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
,
count
=
200
,
created
=
alt_created
)
count
=
200
,
created
=
alt_created
.
strftime
(
date_time_format
)
)
expected
=
[
{
...
...
analytics_data_api/v0/views/courses.py
View file @
fe085f5d
...
...
@@ -661,6 +661,6 @@ GROUP BY module_id;
# Rather than write custom SQL for the SQLite backend, simply parse the timestamp.
created
=
row
[
'created'
]
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
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