Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
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-platform
Commits
a1f2f395
Commit
a1f2f395
authored
Oct 21, 2015
by
Amir Qayyum Khan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
overriden start and due dates for problems to controll due date of a unit from ccx schedule
parent
a7e21bf1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
1 deletions
+21
-1
lms/djangoapps/ccx/tests/test_views.py
+11
-1
lms/djangoapps/ccx/views.py
+10
-0
No files found.
lms/djangoapps/ccx/tests/test_views.py
View file @
a1f2f395
...
...
@@ -156,7 +156,7 @@ class TestCoachDashboard(SharedModuleStoreTestCase, LoginEnrollmentTestCase):
cls
.
verticals
=
flatten
([
[
ItemFactory
.
create
(
due
=
due
,
parent
=
sequential
,
graded
=
True
,
format
=
'Homework
'
start
=
start
,
due
=
due
,
parent
=
sequential
,
graded
=
True
,
format
=
'Homework'
,
category
=
u'vertical
'
)
for
_
in
xrange
(
2
)
]
for
sequential
in
cls
.
sequentials
])
...
...
@@ -363,6 +363,9 @@ class TestCoachDashboard(SharedModuleStoreTestCase, LoginEnrollmentTestCase):
unhide
(
schedule
[
0
])
schedule
[
0
][
'start'
]
=
u'2014-11-20 00:00'
schedule
[
0
][
'children'
][
0
][
'due'
]
=
u'2014-12-25 00:00'
# what a jerk!
schedule
[
0
][
'children'
][
0
][
'children'
][
0
][
'start'
]
=
u'2014-12-20 00:00'
schedule
[
0
][
'children'
][
0
][
'children'
][
0
][
'due'
]
=
u'2014-12-25 00:00'
response
=
self
.
client
.
post
(
url
,
json
.
dumps
(
schedule
),
content_type
=
'application/json'
)
...
...
@@ -374,6 +377,13 @@ class TestCoachDashboard(SharedModuleStoreTestCase, LoginEnrollmentTestCase):
schedule
[
0
][
'children'
][
0
][
'due'
],
u'2014-12-25 00:00'
)
self
.
assertEqual
(
schedule
[
0
][
'children'
][
0
][
'children'
][
0
][
'due'
],
u'2014-12-25 00:00'
)
self
.
assertEqual
(
schedule
[
0
][
'children'
][
0
][
'children'
][
0
][
'start'
],
u'2014-12-20 00:00'
)
# Make sure start date set on course, follows start date of earliest
# scheduled chapter
ccx
=
CustomCourseForEdX
.
objects
.
get
()
...
...
lms/djangoapps/ccx/views.py
View file @
a1f2f395
...
...
@@ -258,6 +258,16 @@ def save_ccx(request, course, ccx=None):
graded
[
block
.
format
]
=
graded
.
get
(
block
.
format
,
0
)
+
1
children
=
unit
.
get
(
'children'
,
None
)
# For a vertical, override start and due dates of all its problems.
if
unit
.
get
(
'category'
,
None
)
==
u'vertical'
:
for
component
in
block
.
get_children
():
# override start and due date of problem (Copy dates of vertical into problems)
if
start
:
override_field_for_ccx
(
ccx
,
component
,
'start'
,
start
)
if
due
:
override_field_for_ccx
(
ccx
,
component
,
'due'
,
due
)
if
children
:
override_fields
(
block
,
children
,
graded
,
earliest
,
ccx_ids_to_delete
)
return
earliest
,
ccx_ids_to_delete
...
...
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