This commit is contained in:
2024-10-09 12:12:51 -06:00
parent 527029fa52
commit 67a52e86ce
2 changed files with 16 additions and 4 deletions

View File

@@ -95,7 +95,8 @@ export default function NewCourseForm() {
AssignmentSubmissionType.ONLINE_UPLOAD, AssignmentSubmissionType.ONLINE_UPLOAD,
], ],
defaultFileUploadTypes: ["pdf", "png", "jpg", "jpeg"], defaultFileUploadTypes: ["pdf", "png", "jpg", "jpeg"],
defaultLockHoursOffset: 0 defaultLockHoursOffset: 0,
holidays: {}
}, },
}) })
.then(() => { .then(() => {

View File

@@ -3,7 +3,18 @@ import { LocalQuizQuestion, QuestionType } from "../localQuizQuestion";
import { LocalQuizQuestionAnswer } from "../localQuizQuestionAnswer"; import { LocalQuizQuestionAnswer } from "../localQuizQuestionAnswer";
import { quizQuestionAnswerMarkdownUtils } from "./quizQuestionAnswerMarkdownUtils"; import { quizQuestionAnswerMarkdownUtils } from "./quizQuestionAnswerMarkdownUtils";
const _validFirstAnswerDelimiters = ["*a)", "a)", "*)", ")", "[ ]", "[]", "[*]", "^"]; const _validFirstAnswerDelimiters = [
"*a)",
"a)",
"*)",
")",
"[ ]",
"[]",
"[*]",
"^",
];
const _multipleChoicePrefix = ["a)", "*a)", "*)", ")"];
const _multipleAnswerPrefix = ["[ ]", "[*]", "[]"];
const getAnswerStringsWithMultilineSupport = ( const getAnswerStringsWithMultilineSupport = (
linesWithoutPoints: string[], linesWithoutPoints: string[],
@@ -64,13 +75,13 @@ const getQuestionType = (
questionIndex questionIndex
); );
const firstAnswerLine = answerLines[0]; const firstAnswerLine = answerLines[0];
const isMultipleChoice = ["a)", "*a)", "*)", ")"].some((prefix) => const isMultipleChoice = _multipleChoicePrefix.some((prefix) =>
firstAnswerLine.startsWith(prefix) firstAnswerLine.startsWith(prefix)
); );
if (isMultipleChoice) return QuestionType.MULTIPLE_CHOICE; if (isMultipleChoice) return QuestionType.MULTIPLE_CHOICE;
const isMultipleAnswer = ["[ ]", "[*]", "[]"].some((prefix) => const isMultipleAnswer = _multipleAnswerPrefix.some((prefix) =>
firstAnswerLine.startsWith(prefix) firstAnswerLine.startsWith(prefix)
); );
if (isMultipleAnswer) return QuestionType.MULTIPLE_ANSWERS; if (isMultipleAnswer) return QuestionType.MULTIPLE_ANSWERS;