Commit bddc0e9d authored by snehar-nd's avatar snehar-nd
Browse files

SB-29684- Instructions values null

Showing with 15 additions and 7 deletions
+15 -7
......@@ -295,7 +295,8 @@ function create(data, paperData) {
function instructions(data) {
const arr = [];
data
if(data !== undefined){
data
.map((text) => {
arr.push(
new TextRun({
......@@ -313,6 +314,16 @@ function instructions(data) {
},
children: arr,
});
} else {
return new Paragraph({
alignment: AlignmentType.LEFT,
indent: {
left: 720,
},
children: arr,
});
}
}
function displayMTFHeader(data) {
return new TableCell({
......
......@@ -67,7 +67,7 @@ const getQuestionSet = async (id) => {
}); // Hierarchy
const instructions = await getQuestionForSet(id);
const promiseMap = questionIds.map((sec) =>
sec.map((question) => {
if (question !== undefined) {
......@@ -94,13 +94,10 @@ const getQuestionSet = async (id) => {
questions: questions,
};
});
return {
sectionData,
paperData: data,
instructions: instructions.instructions.default
instructions: instructions.instructions === undefined ? undefined:instructions.instructions.default
};
});
})
......
......@@ -33,7 +33,7 @@ const buildDOCX_1_WithCallback = async (id, callback) => {
examName: examName,
className: grade,
subject: subject,
instructions: instructions.split(/\n/),
instructions: instructions == undefined ? undefined : instructions.split(/\n/),
};
let questionCounter = 0;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment