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
45e32107
Commit
45e32107
authored
Jun 03, 2013
by
Vasyl Nakvasiuk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
video module: remove old methods
parent
68716f99
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
43 deletions
+3
-43
common/lib/xmodule/xmodule/video_module.py
+2
-18
lms/djangoapps/courseware/tests/test_video_mongo.py
+1
-23
lms/djangoapps/courseware/tests/test_video_xml.py
+0
-2
No files found.
common/lib/xmodule/xmodule/video_module.py
View file @
45e32107
# pylint: disable=W0223
"""Video is ungraded Xmodule for support video content."""
import
json
...
...
@@ -94,28 +95,11 @@ class VideoModule(VideoFields, XModule):
return
parse_time
(
xmltree
.
get
(
'from'
)),
parse_time
(
xmltree
.
get
(
'to'
))
def
handle_ajax
(
self
,
dispatch
,
get
):
"""Handle ajax calls to this video.
TODO (vshnayder): This is not being called right now, so the position
is not being saved.
"""
"""This is not being called right now and we raise 404 error."""
log
.
debug
(
u"GET {0}"
.
format
(
get
))
log
.
debug
(
u"DISPATCH {0}"
.
format
(
dispatch
))
if
dispatch
==
'goto_position'
:
self
.
position
=
int
(
float
(
get
[
'position'
]))
log
.
info
(
u"NEW POSITION {0}"
.
format
(
self
.
position
))
return
json
.
dumps
({
'success'
:
True
})
raise
Http404
()
def
get_progress
(
self
):
"""TODO (vshnayder): Get and save duration of youtube video, then return
fraction watched.
(Be careful to notice when video link changes and update)
For now, we have no way of knowing if the video has even been watched, so
just return None.
"""
return
None
def
get_instance_state
(
self
):
"""Return information about state (position)."""
return
json
.
dumps
({
'position'
:
self
.
position
})
...
...
lms/djangoapps/courseware/tests/test_video_mongo.py
View file @
45e32107
# -*- coding: utf-8 -*-
"""Video xmodule tests in mongo."""
import
json
from
.
import
BaseTestXmodule
...
...
@@ -12,27 +10,7 @@ class TestVideo(BaseTestXmodule):
TEMPLATE_NAME
=
"i4x://edx/templates/video/default"
DATA
=
'<video youtube="0.75:JMD_ifUUfsU,1.0:OEoXaMPEzfM,1.25:AKqURZnYqpk,1.50:DYpADpL7jAY"/>'
def
test_handle_ajax_correct_dispatch
(
self
):
responses
=
{
user
.
username
:
self
.
clients
[
user
.
username
]
.
post
(
self
.
get_url
(
'goto_position'
),
{
'position'
:
10
},
HTTP_X_REQUESTED_WITH
=
'XMLHttpRequest'
)
for
user
in
self
.
users
}
response_contents
=
{
username
:
json
.
loads
(
response
.
content
)
for
username
,
response
in
responses
.
items
()
}
self
.
assertTrue
(
all
([
content
[
'success'
]
for
_
,
content
in
response_contents
.
items
()
]))
def
test_handle_ajax_incorrect_dispatch
(
self
):
def
test_handle_ajax_dispatch
(
self
):
responses
=
{
user
.
username
:
self
.
clients
[
user
.
username
]
.
post
(
self
.
get_url
(
'whatever'
),
...
...
lms/djangoapps/courseware/tests/test_video_xml.py
View file @
45e32107
...
...
@@ -133,5 +133,3 @@ class VideoModuleUnitTest(unittest.TestCase):
self
.
assertDictEqual
(
json
.
loads
(
module
.
get_instance_state
()),
{
'position'
:
0
})
self
.
assertIsNone
(
module
.
get_progress
())
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