Commit 8d2164d1 authored by snehar-nd's avatar snehar-nd
Browse files

added brackets to nest conditions

Showing with 8 additions and 8 deletions
+8 -8
......@@ -329,8 +329,8 @@ async function renderMCQ(question, questionCounter, marks) {
qoBody.search("img") >= 0 ||
qoBody.search("sup") >= 0 ||
qoBody.search("sub") >= 0 ||
qoBody.match(/<p>/g) && qoBody.match(/<p>/g).length > 1 ||
qoBody.match(/<ol>/g) && qoBody.match(/<ol>/g).length >= 1
(qoBody.match(/<p>/g) && qoBody.match(/<p>/g).length > 1) ||
(qoBody.match(/<ol>/g) && qoBody.match(/<ol>/g).length >= 1)
? await getStack(qoBody, answerOptions[index])
: [`${answerOptions[index]}. ${cleanHTML(qoBody)}`];
questionOptions.push(qoData);
......@@ -340,8 +340,8 @@ async function renderMCQ(question, questionCounter, marks) {
q.search("img") >= 0 ||
q.search("sub") >= 0 ||
q.search("sup") >= 0 ||
q.match(/<p>/g) && q.match(/<p>/g).length > 1 ||
q.match(/<ol>/g) && q.match(/<ol>/g).length > 1
(q.match(/<p>/g) && q.match(/<p>/g).length > 1) ||
(q.match(/<ol>/g) && q.match(/<ol>/g).length > 1)
? await getStack(q, questionCounter)
: [`${questionCounter}. ${cleanHTML(q)}`];
......@@ -434,8 +434,8 @@ async function renderQuestion(question, questionCounter, marks, Type) {
question.editorState.question.search("sup") >= 0 ||
question.editorState.question.search("ol") >= 0 ||
question.editorState.question.search("ul") >= 0 ||
question.editorState.question.match(/<p>/g) && question.editorState.question.match(/<p>/g).length > 1 ||
question.editorState.question.match(/<ol>/g) && question.editorState.question.match(/<ol>/g).length > 1
(question.editorState.question.match(/<p>/g) && question.editorState.question.match(/<p>/g).length > 1) ||
(question.editorState.question.match(/<ol>/g) && question.editorState.question.match(/<ol>/g).length > 1)
) {
data = await getStack(question.editorState.question, questionCounter);
} else {
......@@ -460,8 +460,8 @@ async function renderComprehension(question, questionCounter, marks, Type) {
question.editorState.question.search("sup") >= 0 ||
question.editorState.question.search("ol") >= 0 ||
question.editorState.question.search("ul") >= 0 ||
question.editorState.question.match(/<p>/g) && question.editorState.question.match(/<p>/g).length > 1||
question.editorState.question.match(/<ol>/g) && question.editorState.question.match(/<ol>/g).length > 1
(question.editorState.question.match(/<p>/g) && question.editorState.question.match(/<p>/g).length > 1)||
(question.editorState.question.match(/<ol>/g) && question.editorState.question.match(/<ol>/g).length > 1)
) {
data = await getStack(question.editorState.question, questionCounter);
} else {
......
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