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
5410e161
Commit
5410e161
authored
Sep 25, 2012
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Switch template definitions to yaml, so that they can have multiline strings
parent
022e27e1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
7 deletions
+16
-7
common/lib/xmodule/xmodule/capa_module.py
+2
-0
common/lib/xmodule/xmodule/templates/default/empty.json
+0
-5
common/lib/xmodule/xmodule/templates/default/empty.yaml
+5
-0
common/lib/xmodule/xmodule/templates/problem/multiline.yaml
+7
-0
common/lib/xmodule/xmodule/x_module.py
+2
-2
No files found.
common/lib/xmodule/xmodule/capa_module.py
View file @
5410e161
...
...
@@ -644,6 +644,8 @@ class CapaDescriptor(RawDescriptor):
# actually use type and points?
metadata_attributes
=
RawDescriptor
.
metadata_attributes
+
(
'type'
,
'points'
)
template_dir_name
=
'problem'
# VS[compat]
# TODO (cpennington): Delete this method once all fall 2012 course are being
# edited in the cms
...
...
common/lib/xmodule/xmodule/templates/default/empty.json
deleted
100644 → 0
View file @
022e27e1
{
"metadata"
:
{
"display_name"
:
"Empty"
},
"data"
:
""
,
"children"
:
[]
}
common/lib/xmodule/xmodule/templates/default/empty.yaml
0 → 100644
View file @
5410e161
---
metadata
:
display_name
:
Empty
data
:
"
"
children
:
[]
common/lib/xmodule/xmodule/templates/problem/multiline.yaml
0 → 100644
View file @
5410e161
---
metadata
:
display_name
:
Multiline XML
data
:
|
<problem>
</problem>
children
:
[]
common/lib/xmodule/xmodule/x_module.py
View file @
5410e161
import
logging
import
pkg_resources
import
json
import
yaml
import
os
from
functools
import
partial
...
...
@@ -352,7 +352,7 @@ class ResourceTemplates(object):
for
template_file
in
resource_listdir
(
__name__
,
dirname
):
template_content
=
resource_string
(
__name__
,
os
.
path
.
join
(
dirname
,
template_file
))
template
=
json
.
loads
(
template_content
)
template
=
yaml
.
load
(
template_content
)
templates
.
append
(
Template
(
**
template
))
return
templates
...
...
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