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
32c50090
Commit
32c50090
authored
May 21, 2012
by
Piotr Mitros
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Very draft/prototype edits. Moving CMS components in LMS.
parent
9906bd2b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
14 deletions
+68
-14
djangoapps/courseware/modules/seq_module.py
+3
-1
djangoapps/courseware/modules/x_module.py
+65
-13
No files found.
djangoapps/courseware/modules/seq_module.py
View file @
32c50090
...
@@ -20,7 +20,9 @@ class Module(XModule):
...
@@ -20,7 +20,9 @@ class Module(XModule):
@classmethod
@classmethod
def
get_xml_tags
(
c
):
def
get_xml_tags
(
c
):
return
[
"sequential"
,
'tab'
]
obsolete_tags
=
[
"sequential"
,
'tab'
]
modern_tags
=
[
"problemset"
,
"videosequence"
]
return
obsolete_tags
+
modern_tags
def
get_html
(
self
):
def
get_html
(
self
):
self
.
render
()
self
.
render
()
...
...
djangoapps/courseware/modules/x_module.py
View file @
32c50090
...
@@ -17,6 +17,39 @@ class XModule(object):
...
@@ -17,6 +17,39 @@ class XModule(object):
''' Tags in the courseware file guaranteed to correspond to the module '''
''' Tags in the courseware file guaranteed to correspond to the module '''
return
[]
return
[]
@classmethod
(
c
):
def
get_usage_tags
(
c
):
''' We should convert to a real module system
For now, this tells us whether we use this as an xmodule, a CAPA response type
or a CAPA input type '''
return
[
'xmodule'
]
def
__init__
(
self
,
system
=
None
,
xml
=
None
,
item_id
=
None
,
json
=
None
,
track_url
=
None
,
state
=
None
):
''' In most cases, you must pass state or xml'''
if
not
item_id
:
raise
ValueError
(
"Missing Index"
)
if
not
xml
and
not
json
:
raise
ValueError
(
"xml or json required"
)
if
not
system
:
raise
ValueError
(
"System context required"
)
self
.
xml
=
xml
self
.
json
=
json
self
.
item_id
=
item_id
self
.
state
=
state
if
system
:
## These are temporary; we really should go
## through self.system.
self
.
ajax_url
=
system
.
ajax_url
self
.
tracker
=
system
.
track_function
self
.
filestore
=
system
.
filestore
self
.
render_function
=
system
.
render_function
self
.
system
=
system
### Functions used in the LMS
def
get_completion
(
self
):
def
get_completion
(
self
):
''' This is mostly unimplemented.
''' This is mostly unimplemented.
It gives a progress indication -- e.g. 30 minutes of 1.5 hours watched. 3 of 5 problems done, etc. '''
It gives a progress indication -- e.g. 30 minutes of 1.5 hours watched. 3 of 5 problems done, etc. '''
...
@@ -45,6 +78,12 @@ class XModule(object):
...
@@ -45,6 +78,12 @@ class XModule(object):
'''
'''
return
"Unimplemented"
return
"Unimplemented"
# TODO:
# def get_header_js(self):
# ''' Filename of common js that needs to be included in the header
# '''
# raise NotImplementedError
def
get_init_js
(
self
):
def
get_init_js
(
self
):
''' JavaScript code to be run when problem is shown. Be aware
''' JavaScript code to be run when problem is shown. Be aware
that this may happen several times on the same page
that this may happen several times on the same page
...
@@ -63,17 +102,30 @@ class XModule(object):
...
@@ -63,17 +102,30 @@ class XModule(object):
get is a dictionary-like object '''
get is a dictionary-like object '''
return
""
return
""
def
__init__
(
self
,
system
,
xml
,
item_id
,
track_url
=
None
,
state
=
None
):
### Functions used in the CMS
''' In most cases, you must pass state or xml'''
def
get_xml
(
self
):
self
.
xml
=
xml
''' For conversions between JSON and legacy XML representations.
self
.
item_id
=
item_id
'''
self
.
state
=
state
if
self
.
xml
:
return
self
.
xml
else
:
raise
NotImplementedError
if
system
:
def
get_json
(
self
):
## These are temporary; we really should go
''' For conversions between JSON and legacy XML representations.
## through self.system.
'''
self
.
ajax_url
=
system
.
ajax_url
if
self
.
json
:
self
.
tracker
=
system
.
track_function
raise
NotImplementedError
self
.
filestore
=
system
.
filestore
return
self
.
json
# TODO: Return context as well -- files, etc.
self
.
render_function
=
system
.
render_function
else
:
self
.
system
=
system
raise
NotImplementedError
def
handle_cms_json
(
self
):
raise
NotImplementedError
def
render
(
self
,
size
):
''' Size: [thumbnail, small, full]
Small ==> what we drag around
Full ==> what we edit
'''
raise
NotImplementedError
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