Skip to content
This repository was archived by the owner on Jun 7, 2023. It is now read-only.

Commit 77e8193

Browse files
committed
map from data-component names to question_types :-(
1 parent 0e22894 commit 77e8193

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

runestone/pretext/chapter_pop.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,14 @@
1111

1212
logger = logging.getLogger(__name__)
1313

14-
14+
QT_MAP = {
15+
"multiplechoice": "mchoice",
16+
"parsons": "parsonsprob",
17+
}
1518
# manifest_data_to_db(course_name, manifest_path)
1619
# -----------------------------------------------
20+
21+
1722
def manifest_data_to_db(course_name, manifest_path):
1823
"""Read the runestone-manifest.xml file generated by PreTeXt and populate the
1924
chapters, subchapters, and questions table so that PreTeXt books can be used on
@@ -136,6 +141,8 @@ def manifest_data_to_db(course_name, manifest_path):
136141
el = question.find("./div")
137142
try:
138143
qtype = el.attrib["data-component"]
144+
# translate qtype to question_type
145+
qtype = QT_MAP.get(qtype, qtype)
139146
except:
140147
qtype = "webwork"
141148
valudict = dict(

0 commit comments

Comments
 (0)