This PR aims to fix the commit mistakes I made when trying to merge with a refactored fork. This will keep the changes I made in the refactor.
This commit is contained in:
@@ -280,7 +280,7 @@ export class OLXParser {
|
||||
the parsed OLX.
|
||||
*/
|
||||
const tagMap = {
|
||||
label: 'bold',
|
||||
label: 'strong',
|
||||
description: 'em',
|
||||
};
|
||||
|
||||
@@ -331,10 +331,16 @@ export class OLXParser {
|
||||
getProblemType() {
|
||||
const problemKeys = Object.keys(this.problem);
|
||||
const intersectedProblems = _.intersection(Object.values(ProblemTypeKeys), problemKeys);
|
||||
|
||||
if (intersectedProblems.length === 0) {
|
||||
return null;
|
||||
// a blank problem is a problem which contains only `<problem></problem>` as it's olx.
|
||||
// blank problems are not given types, so that a type may be selected.
|
||||
if (problemKeys.length === 1 && problemKeys[0] === '#text' && this.problem[problemKeys[0]] === '') {
|
||||
return null;
|
||||
}
|
||||
// if we have no matching problem type, the problem is advanced.
|
||||
return ProblemTypeKeys.ADVANCED;
|
||||
}
|
||||
// make sure compound problems are treated as advanced
|
||||
if (intersectedProblems.length > 1) {
|
||||
return ProblemTypeKeys.ADVANCED;
|
||||
}
|
||||
@@ -369,7 +375,10 @@ export class OLXParser {
|
||||
answersObject = this.parseMultipleChoiceAnswers(ProblemTypeKeys.SINGLESELECT, 'choicegroup', 'choice');
|
||||
break;
|
||||
case ProblemTypeKeys.ADVANCED:
|
||||
break;
|
||||
return {
|
||||
problemType,
|
||||
settings: {},
|
||||
};
|
||||
default:
|
||||
// if problem is unset, return null
|
||||
return {};
|
||||
|
||||
Reference in New Issue
Block a user