Add question generator functions

This commit is contained in:
Thomas A. Christensen II 2022-09-24 18:02:35 -05:00
parent 9b7d1f56cd
commit 7deca98922

View file

@ -87,6 +87,44 @@
}, },
}; };
function structure_question(structure, props) {
let quiz_list = [];
quiz_list.push(`id: ${structure}`);
if ("features" in props) {
for (feature in props["features"]) {
let questions = feature_question(
`${feature} of ${structure}`,
props["features"][feature]
);
for (const question of questions) {
quiz_list.push(question);
}
}
}
return quiz_list;
}
function feature_question(feature, props) {
let quiz_list = [];
quiz_list.push(`id: ${feature}`);
for (const prop in props) {
if (prop != "asymmetric") {
quiz_list.push(property_question(feature, prop, props[prop]));
}
}
return quiz_list;
}
function property_question(feature, prop_name, prop_content) {
return `${prop_name}: ${feature} (${prop_content})`;
}
const terms = [ const terms = [
"scapula: glenoid cavity", "scapula: glenoid cavity",
"scapula: neck", "scapula: neck",