mirror of
https://github.com/alexmickelson/canvasManagement.git
synced 2026-03-25 23:28:33 -06:00
moving name out of file, will mirror file system name
This commit is contained in:
@@ -21,6 +21,7 @@ import { LocalCourseSettings } from "@/models/local/localCourseSettings";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { AssignmentButtons } from "./AssignmentButtons";
|
||||
import { useAuthoritativeUpdates } from "@/app/course/[courseName]/utils/useAuthoritativeUpdates";
|
||||
import { extractLabelValue } from "@/models/local/assignment/utils/markdownUtils";
|
||||
|
||||
export default function EditAssignment({
|
||||
moduleName,
|
||||
@@ -64,8 +65,9 @@ export default function EditAssignment({
|
||||
return;
|
||||
}
|
||||
|
||||
const name = extractLabelValue(text, "Name");
|
||||
const updatedAssignment: LocalAssignment =
|
||||
localAssignmentMarkdown.parseMarkdown(text);
|
||||
localAssignmentMarkdown.parseMarkdown(text, name);
|
||||
if (
|
||||
localAssignmentMarkdown.toMarkdown(assignment) !==
|
||||
localAssignmentMarkdown.toMarkdown(updatedAssignment)
|
||||
|
||||
@@ -14,6 +14,7 @@ import {
|
||||
useUpdateQuizMutation,
|
||||
} from "@/hooks/localCourse/quizHooks";
|
||||
import { useAuthoritativeUpdates } from "../../../../utils/useAuthoritativeUpdates";
|
||||
import { extractLabelValue } from "@/models/local/assignment/utils/markdownUtils";
|
||||
|
||||
const helpString = `QUESTION REFERENCE
|
||||
---
|
||||
@@ -85,12 +86,19 @@ export default function EditQuiz({
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const name = extractLabelValue(text, "Name");
|
||||
if (
|
||||
quizMarkdownUtils.toMarkdown(quiz) !==
|
||||
quizMarkdownUtils.toMarkdown(quizMarkdownUtils.parseMarkdown(text))
|
||||
quizMarkdownUtils.toMarkdown(
|
||||
quizMarkdownUtils.parseMarkdown(text, name)
|
||||
)
|
||||
) {
|
||||
if (clientIsAuthoritative) {
|
||||
const updatedQuiz = quizMarkdownUtils.parseMarkdown(text);
|
||||
const updatedName = extractLabelValue(text, "Name");
|
||||
const updatedQuiz = quizMarkdownUtils.parseMarkdown(
|
||||
text,
|
||||
updatedName
|
||||
);
|
||||
await updateQuizMutation
|
||||
.mutateAsync({
|
||||
quiz: updatedQuiz,
|
||||
|
||||
Reference in New Issue
Block a user