mirror of
https://github.com/alexmickelson/canvasManagement.git
synced 2026-03-26 15:48:32 -06:00
updating tests
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { LocalQuiz } from "../localQuiz";
|
||||
import { quizQuestionMarkdownUtils } from "./quizQuestionMarkdownUtils";
|
||||
|
||||
const extractLabelValue = (input: string, label: string): string => {
|
||||
|
||||
@@ -153,13 +153,31 @@ export const quizQuestionMarkdownUtils = {
|
||||
|
||||
const linesWithoutPoints = firstLineIsPoints ? lines.slice(1) : lines;
|
||||
|
||||
const linesWithoutAnswers = linesWithoutPoints.filter(
|
||||
(line, index) =>
|
||||
!_validFirstAnswerDelimiters.some((prefix) =>
|
||||
line.trimStart().startsWith(prefix)
|
||||
)
|
||||
);
|
||||
// const linesWithoutAnswers = linesWithoutPoints.filter(
|
||||
// (line, index) =>
|
||||
// !_validFirstAnswerDelimiters.some((prefix) =>
|
||||
// line.trimStart().startsWith(prefix)
|
||||
// )
|
||||
// );
|
||||
|
||||
const { linesWithoutAnswers } = linesWithoutPoints.reduce(
|
||||
({ linesWithoutAnswers, taking }, currentLine) => {
|
||||
if (!taking)
|
||||
return { linesWithoutAnswers: linesWithoutAnswers, taking: false };
|
||||
|
||||
const lineIsAnswer = _validFirstAnswerDelimiters.some((prefix) =>
|
||||
currentLine.trimStart().startsWith(prefix)
|
||||
);
|
||||
if (lineIsAnswer)
|
||||
return { linesWithoutAnswers: linesWithoutAnswers, taking: false };
|
||||
|
||||
return {
|
||||
linesWithoutAnswers: [...linesWithoutAnswers, currentLine],
|
||||
taking: true,
|
||||
};
|
||||
},
|
||||
{ linesWithoutAnswers: [] as string[], taking: true }
|
||||
);
|
||||
const questionType = getQuestionType(linesWithoutPoints, questionIndex);
|
||||
|
||||
const questionTypesWithoutAnswers = [
|
||||
|
||||
Reference in New Issue
Block a user