feat: error on funky multiple choice tags. (#288)
This change increases the frequency at which odd tags (like shuffle) on multiple choice problems don't go to the visual editor. Instead, they will now divert to the advanced editor. There might be other places where we need to follow a similar pattern, but we don't know those yet.
This commit is contained in:
@@ -72,6 +72,10 @@ export class OLXParser {
|
||||
const answers = [];
|
||||
let data = {};
|
||||
const widget = _.get(this.problem, `${problemType}.${widgetName}`);
|
||||
const permissableTags = ['choice', '@_type', 'compoundhint', 'option', '#text'];
|
||||
if (_.keys(widget).some((tag) => !permissableTags.includes(tag))) {
|
||||
throw new Error('Misc Tags, reverting to Advanced Editor');
|
||||
}
|
||||
const choice = _.get(widget, option);
|
||||
const isComplexAnswer = [ProblemTypeKeys.SINGLESELECT, ProblemTypeKeys.MULTISELECT].includes(problemType);
|
||||
if (_.isEmpty(choice)) {
|
||||
|
||||
Reference in New Issue
Block a user