fix: question field uses real placeholder instead of template. fixed blank question handling. TNL-10395, TNL-10411.
This commit is contained in:
@@ -21,6 +21,10 @@ export const nonQuestionKeys = [
|
||||
'@_type',
|
||||
'formulaequationinput',
|
||||
'numericalresponse',
|
||||
'stringresponse',
|
||||
'multiplechoiceresponse',
|
||||
'choiceresponse',
|
||||
'optionresponse',
|
||||
'demandhint',
|
||||
];
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ import {
|
||||
advancedProblemOlX,
|
||||
multipleProblemOlX,
|
||||
blankProblemOLX,
|
||||
blankQuestionOLX,
|
||||
} from './mockData/olxTestData';
|
||||
import { ProblemTypeKeys } from '../../../data/constants/problem';
|
||||
|
||||
@@ -153,4 +154,10 @@ describe('Check OLXParser for question parsing', () => {
|
||||
const question = olxparser.parseQuestions('numericalresponse');
|
||||
expect(question).toEqual(numericInputWithFeedbackAndHintsOLXException.question);
|
||||
});
|
||||
test('Test OLX with no question content should have empty string for question', () => {
|
||||
const olxparser = new OLXParser(blankQuestionOLX.rawOLX);
|
||||
const problemType = olxparser.getProblemType();
|
||||
const question = olxparser.parseQuestions(problemType);
|
||||
expect(question).toBe(blankQuestionOLX.question);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -577,3 +577,12 @@ export const multipleProblemOlX = {
|
||||
export const blankProblemOLX = {
|
||||
rawOLX: '<problem></problem>',
|
||||
};
|
||||
export const blankQuestionOLX = {
|
||||
rawOLX: `<problem>
|
||||
<stringresponse type="ci">
|
||||
<additional_answer />
|
||||
<textline size="20"/>
|
||||
</stringresponse>
|
||||
</problem>`,
|
||||
question: '',
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user