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
2cea81b0
Commit
2cea81b0
authored
Feb 18, 2014
by
Alexander Kryklia
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2620 from edx/alex/fix_enable_download_track
Enable download_track for existing courses if self.track.
parents
acad35bb
23a2177d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
2 deletions
+20
-2
common/lib/xmodule/xmodule/video_module.py
+7
-0
lms/djangoapps/courseware/tests/test_video_mongo.py
+13
-2
No files found.
common/lib/xmodule/xmodule/video_module.py
View file @
2cea81b0
...
...
@@ -351,6 +351,13 @@ class VideoDescriptor(VideoFields, TabsEditingDescriptor, EmptyDataRawDescriptor
if
not
download_video
[
'explicitly_set'
]:
self
.
download_video
=
True
# for backward compatibility.
# If course was existed and was not re-imported by the moment of adding `download_track` field,
# we should enable `download_track` if following is true:
download_track
=
editable_fields
[
'download_track'
]
if
not
download_track
[
'explicitly_set'
]
and
self
.
track
:
self
.
download_track
=
True
@property
def
editable_metadata_fields
(
self
):
editable_fields
=
super
(
VideoDescriptor
,
self
)
.
editable_metadata_fields
...
...
lms/djangoapps/courseware/tests/test_video_mongo.py
View file @
2cea81b0
...
...
@@ -420,13 +420,23 @@ class TestVideoDescriptorInitialization(BaseTestXmodule):
'display_name'
:
'Download Transcript'
,
'help'
:
'The external URL to download the timed transcript track.'
,
'type'
:
'Generic'
,
'value'
:
u''
,
'value'
:
u'
http://some_track.srt
'
,
'field_name'
:
'track'
,
'options'
:
[],
},
'download_track'
:
{
'default_value'
:
False
,
'explicitly_set'
:
False
,
'display_name'
:
'Transcript Download Allowed'
,
'help'
:
'Show a link beneath the video to allow students to download the transcript. Note: You must add a link to the HTML5 Transcript field above.'
,
'type'
:
'Generic'
,
'value'
:
False
,
'field_name'
:
'download_track'
,
'options'
:
[],
}
}
metadata
=
{
'track'
:
None
,
'track'
:
u'http://some_track.srt'
,
'source'
:
'http://example.org/video.mp4'
,
'html5_sources'
:
[
'http://youtu.be/OEoXaMPEzfM.mp4'
],
}
...
...
@@ -437,6 +447,7 @@ class TestVideoDescriptorInitialization(BaseTestXmodule):
self
.
assertIn
(
'source'
,
fields
)
self
.
assertFalse
(
self
.
item_module
.
download_video
)
self
.
assertTrue
(
self
.
item_module
.
source_visible
)
self
.
assertTrue
(
self
.
item_module
.
download_track
)
def
test_source_is_empty
(
self
):
metadata
=
{
...
...
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