Commit 5410e161 by Calen Pennington

Switch template definitions to yaml, so that they can have multiline strings

parent 022e27e1
......@@ -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
......
{
"metadata": { "display_name": "Empty" },
"data": "",
"children": []
}
---
metadata:
display_name: Empty
data: ""
children: []
---
metadata:
display_name: Multiline XML
data: |
<problem>
</problem>
children: []
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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment