mirror of
https://github.com/alexmickelson/canvasManagement.git
synced 2026-03-26 07:38:33 -06:00
moving name out of file, will mirror file system name
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { CanvasModuleItem } from "@/models/canvas/modules/canvasModuleItems";
|
||||
import { CanvasPage } from "@/models/canvas/pages/canvasPageModel";
|
||||
import { axiosClient } from "../axiosUtils";
|
||||
import { canvasApi } from "./canvasServiceUtils";
|
||||
import { canvasApi, paginatedRequest } from "./canvasServiceUtils";
|
||||
import { CanvasModule } from "@/models/canvas/modules/canvasModule";
|
||||
|
||||
export const canvasModuleService = {
|
||||
@@ -49,8 +49,8 @@ export const canvasModuleService = {
|
||||
|
||||
async getCourseModules(canvasCourseId: number) {
|
||||
const url = `${canvasApi}/courses/${canvasCourseId}/modules`;
|
||||
const response = await axiosClient.get<CanvasModule[]>(url);
|
||||
return response.data;
|
||||
const response = await paginatedRequest<CanvasModule[]>({ url });
|
||||
return response
|
||||
},
|
||||
|
||||
async createModule(canvasCourseId: number, moduleName: string) {
|
||||
|
||||
@@ -34,8 +34,9 @@ const getAssignment = async (
|
||||
assignmentName + ".md"
|
||||
);
|
||||
const rawFile = (await fs.readFile(filePath, "utf-8")).replace(/\r\n/g, "\n");
|
||||
return localAssignmentMarkdown.parseMarkdown(rawFile);
|
||||
return localAssignmentMarkdown.parseMarkdown(rawFile, assignmentName);
|
||||
};
|
||||
|
||||
export const assignmentsFileStorageService = {
|
||||
getAssignmentNames,
|
||||
getAssignment,
|
||||
@@ -72,7 +73,6 @@ export const assignmentsFileStorageService = {
|
||||
assignmentMarkdownSerializer.toMarkdown(assignment);
|
||||
console.log(`Saving assignment ${filePath}`);
|
||||
|
||||
|
||||
await fs.writeFile(filePath, assignmentMarkdown);
|
||||
},
|
||||
async delete({
|
||||
|
||||
@@ -56,11 +56,12 @@ const getItem = async <T extends CourseItemType>(
|
||||
const rawFile = (await fs.readFile(filePath, "utf-8")).replace(/\r\n/g, "\n");
|
||||
if (type === "Assignment") {
|
||||
return localAssignmentMarkdown.parseMarkdown(
|
||||
rawFile
|
||||
rawFile,
|
||||
name
|
||||
) as CourseItemReturnType<T>;
|
||||
} else if (type === "Quiz") {
|
||||
return localQuizMarkdownUtils.parseMarkdown(
|
||||
rawFile
|
||||
rawFile, name
|
||||
) as CourseItemReturnType<T>;
|
||||
} else if (type === "Page") {
|
||||
return localPageMarkdownUtils.parseMarkdown(
|
||||
|
||||
@@ -98,7 +98,7 @@ SubmissionTypes:
|
||||
AllowedFileUploadExtensions:
|
||||
- pdf
|
||||
---
|
||||
description
|
||||
this is the test description
|
||||
## Rubric
|
||||
- 2pts: animation has at least 5 transition states
|
||||
`;
|
||||
|
||||
Reference in New Issue
Block a user