From 3725d40e6ea2166db1b74c50734bd44f8be104cf Mon Sep 17 00:00:00 2001 From: Alex Mickelson Date: Fri, 15 Nov 2024 13:29:52 -0700 Subject: [PATCH] updates --- .../utils/useAuthoritativeUpdates.tsx | 2 +- .../tests/quizMarkdown/testAnswer.test.ts | 25 +++++++++++++++++++ .../services/serverFunctions/TrpcProvider.tsx | 2 +- 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/nextjs/src/app/course/[courseName]/utils/useAuthoritativeUpdates.tsx b/nextjs/src/app/course/[courseName]/utils/useAuthoritativeUpdates.tsx index 139b549..0254919 100644 --- a/nextjs/src/app/course/[courseName]/utils/useAuthoritativeUpdates.tsx +++ b/nextjs/src/app/course/[courseName]/utils/useAuthoritativeUpdates.tsx @@ -18,7 +18,7 @@ export function useAuthoritativeUpdates({ [clientDataUpdatedAt, serverUpdatedAt] ); - console.log("client is authoritative", clientIsAuthoritative); + // console.log("client is authoritative", clientIsAuthoritative); const textUpdate = useCallback((t: string, updateMonaco: boolean = false) => { setText(t); setClientDataUpdatedAt(Date.now()); diff --git a/nextjs/src/models/local/tests/quizMarkdown/testAnswer.test.ts b/nextjs/src/models/local/tests/quizMarkdown/testAnswer.test.ts index 3f3e270..3422776 100644 --- a/nextjs/src/models/local/tests/quizMarkdown/testAnswer.test.ts +++ b/nextjs/src/models/local/tests/quizMarkdown/testAnswer.test.ts @@ -109,4 +109,29 @@ Which events are triggered when the user clicks on an input field? essay`; expect(questionMarkdown).toContain(expectedMarkdown); }); + +// it("Can parse short answer with auto graded answers", () => { +// const rawMarkdownQuiz = ` +// Name: Test Quiz +// ShuffleAnswers: true +// OneQuestionAtATime: false +// DueAt: 08/21/2023 23:59:00 +// LockAt: 08/21/2023 23:59:00 +// AssignmentGroup: Assignments +// AllowedAttempts: -1 +// Description: this is the +// multi line +// description +// --- +// Which events are triggered when the user clicks on an input field? +// *a) test +// short_answer= +// `; + +// const quiz = quizMarkdownUtils.parseMarkdown(rawMarkdownQuiz); +// const firstQuestion = quiz.questions[0]; + + +// expect(firstQuestion.questionType).toBe(QuestionType.SHORT_ANSWER_WITH_ANSWERS) +// }); }); diff --git a/nextjs/src/services/serverFunctions/TrpcProvider.tsx b/nextjs/src/services/serverFunctions/TrpcProvider.tsx index 2443c13..339cf7b 100644 --- a/nextjs/src/services/serverFunctions/TrpcProvider.tsx +++ b/nextjs/src/services/serverFunctions/TrpcProvider.tsx @@ -1,7 +1,7 @@ "use client"; import { useState } from "react"; import superjson from "superjson"; -import { httpBatchLink, httpLink } from "@trpc/client"; +import { httpBatchLink } from "@trpc/client"; import { trpc } from "./trpcClient"; import { getQueryClient } from "@/app/providersQueryClientUtils"; import { isServer } from "@tanstack/react-query";