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
c0f12e69
Commit
c0f12e69
authored
Dec 27, 2012
by
Chris Dodge
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes on the export. There's some attributes not being handled correctly
parent
239b118a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
5 deletions
+14
-5
cms/templates/export.html
+4
-2
common/lib/xmodule/xmodule/html_module.py
+1
-1
common/lib/xmodule/xmodule/xml_module.py
+9
-2
No files found.
cms/templates/export.html
View file @
c0f12e69
...
@@ -26,16 +26,17 @@
...
@@ -26,16 +26,17 @@
<!-- default state -->
<!-- default state -->
<div
class=
"export-form-wrapper"
>
<div
class=
"export-form-wrapper"
>
<form
action=
"${reverse('export_course', kwargs=dict(org=context_course.location.org, course=context_course.location.course, name=context_course.location.name))}"
method=
"post"
enctype=
"multipart/form-data"
class=
"export-form"
>
<form
action=
"${reverse('
generate_
export_course', kwargs=dict(org=context_course.location.org, course=context_course.location.course, name=context_course.location.name))}"
method=
"post"
enctype=
"multipart/form-data"
class=
"export-form"
>
<h2>
Export Course:
</h2>
<h2>
Export Course:
</h2>
<p
class=
"error-block"
></p>
<p
class=
"error-block"
></p>
<a
href=
"
#
"
class=
"button-export"
>
Download Files
</a>
<a
href=
"
${reverse('generate_export_course', kwargs=dict(org=context_course.location.org, course=context_course.location.course, name=context_course.location.name))}
"
class=
"button-export"
>
Download Files
</a>
</form>
</form>
</div>
</div>
<!-- download state: after user clicks download buttons -->
<!-- download state: after user clicks download buttons -->
<
%
doc
>
<div
class=
"export-form-wrapper is-downloading"
>
<div
class=
"export-form-wrapper is-downloading"
>
<form
action=
"${reverse('export_course', kwargs=dict(org=context_course.location.org, course=context_course.location.course, name=context_course.location.name))}"
method=
"post"
enctype=
"multipart/form-data"
class=
"export-form"
>
<form
action=
"${reverse('export_course', kwargs=dict(org=context_course.location.org, course=context_course.location.course, name=context_course.location.name))}"
method=
"post"
enctype=
"multipart/form-data"
class=
"export-form"
>
<h2>
Export Course:
</h2>
<h2>
Export Course:
</h2>
...
@@ -46,6 +47,7 @@
...
@@ -46,6 +47,7 @@
<p
class=
"message-status"
>
Download not start?
<a
href=
"#"
class=
"text-export"
>
Try again
</a></p>
<p
class=
"message-status"
>
Download not start?
<a
href=
"#"
class=
"text-export"
>
Try again
</a></p>
</form>
</form>
</div>
</div>
</
%
doc>
</article>
</article>
</div>
</div>
</div>
</div>
...
...
common/lib/xmodule/xmodule/html_module.py
View file @
c0f12e69
...
@@ -160,7 +160,7 @@ class HtmlDescriptor(XmlDescriptor, EditingDescriptor):
...
@@ -160,7 +160,7 @@ class HtmlDescriptor(XmlDescriptor, EditingDescriptor):
filepath
=
u'{category}/{pathname}.html'
.
format
(
category
=
self
.
category
,
filepath
=
u'{category}/{pathname}.html'
.
format
(
category
=
self
.
category
,
pathname
=
pathname
)
pathname
=
pathname
)
resource_fs
.
makedir
(
os
.
path
.
dirname
(
filepath
),
allow_recreate
=
True
)
resource_fs
.
makedir
(
os
.
path
.
dirname
(
filepath
),
recursive
=
True
,
allow_recreate
=
True
)
with
resource_fs
.
open
(
filepath
,
'w'
)
as
file
:
with
resource_fs
.
open
(
filepath
,
'w'
)
as
file
:
file
.
write
(
self
.
definition
[
'data'
])
file
.
write
(
self
.
definition
[
'data'
])
...
...
common/lib/xmodule/xmodule/xml_module.py
View file @
c0f12e69
...
@@ -99,6 +99,7 @@ class XmlDescriptor(XModuleDescriptor):
...
@@ -99,6 +99,7 @@ class XmlDescriptor(XModuleDescriptor):
metadata_to_strip
=
(
'data_dir'
,
metadata_to_strip
=
(
'data_dir'
,
# cdodge: @TODO: We need to figure out a way to export out 'tabs' and 'grading_policy' which is on the course
# cdodge: @TODO: We need to figure out a way to export out 'tabs' and 'grading_policy' which is on the course
'tabs'
,
'grading_policy'
,
'is_draft'
,
'published_by'
,
'published_date'
,
'tabs'
,
'grading_policy'
,
'is_draft'
,
'published_by'
,
'published_date'
,
'discussion_blackouts'
,
# VS[compat] -- remove the below attrs once everything is in the CMS
# VS[compat] -- remove the below attrs once everything is in the CMS
'course'
,
'org'
,
'url_name'
,
'filename'
)
'course'
,
'org'
,
'url_name'
,
'filename'
)
...
@@ -110,11 +111,17 @@ class XmlDescriptor(XModuleDescriptor):
...
@@ -110,11 +111,17 @@ class XmlDescriptor(XModuleDescriptor):
to_bool
=
lambda
val
:
val
==
'true'
or
val
==
True
to_bool
=
lambda
val
:
val
==
'true'
or
val
==
True
from_bool
=
lambda
val
:
str
(
val
)
.
lower
()
from_bool
=
lambda
val
:
str
(
val
)
.
lower
()
bool_map
=
AttrMap
(
to_bool
,
from_bool
)
bool_map
=
AttrMap
(
to_bool
,
from_bool
)
to_int
=
lambda
val
:
int
(
val
)
from_int
=
lambda
val
:
str
(
val
)
int_map
=
AttrMap
(
to_int
,
from_int
)
xml_attribute_map
=
{
xml_attribute_map
=
{
# type conversion: want True/False in python, "true"/"false" in xml
# type conversion: want True/False in python, "true"/"false" in xml
'graded'
:
bool_map
,
'graded'
:
bool_map
,
'hide_progress_tab'
:
bool_map
,
'hide_progress_tab'
:
bool_map
,
'allow_anonymous'
:
bool_map
'allow_anonymous'
:
bool_map
,
'allow_anonymous_to_peers'
:
bool_map
,
'weight'
:
int_map
}
}
...
@@ -364,7 +371,7 @@ class XmlDescriptor(XModuleDescriptor):
...
@@ -364,7 +371,7 @@ class XmlDescriptor(XModuleDescriptor):
# don't want e.g. data_dir
# don't want e.g. data_dir
if
attr
not
in
self
.
metadata_to_strip
and
attr
not
in
self
.
metadata_to_export_to_policy
:
if
attr
not
in
self
.
metadata_to_strip
and
attr
not
in
self
.
metadata_to_export_to_policy
:
val
=
val_for_xml
(
attr
)
val
=
val_for_xml
(
attr
)
#
logging.debug('location.category = {0}, attr = {1}'.format(self.location.category, attr))
#logging.debug('location.category = {0}, attr = {1}'.format(self.location.category, attr))
xml_object
.
set
(
attr
,
val
)
xml_object
.
set
(
attr
,
val
)
if
self
.
export_to_file
():
if
self
.
export_to_file
():
...
...
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