mirror of
https://github.com/alexmickelson/canvasManagement.git
synced 2026-03-25 23:28:33 -06:00
fixing date formatting to month day year
This commit is contained in:
@@ -1,42 +0,0 @@
|
|||||||
"use client";
|
|
||||||
import { getDateFromStringOrThrow } from "@/models/local/timeUtils";
|
|
||||||
import { useCourseContext } from "./context/courseContext";
|
|
||||||
import { getMonthsBetweenDates } from "./calendar/calendarMonthUtils";
|
|
||||||
import CalendarMonth from "./calendar/CalendarMonth";
|
|
||||||
|
|
||||||
export default function CourseDetails() {
|
|
||||||
const context = useCourseContext();
|
|
||||||
|
|
||||||
const startDate = getDateFromStringOrThrow(
|
|
||||||
context.localCourse.settings.startDate,
|
|
||||||
"course start date"
|
|
||||||
);
|
|
||||||
const endDate = getDateFromStringOrThrow(
|
|
||||||
context.localCourse.settings.endDate,
|
|
||||||
"course end date"
|
|
||||||
);
|
|
||||||
|
|
||||||
const months = getMonthsBetweenDates(startDate, endDate);
|
|
||||||
return (
|
|
||||||
<div>
|
|
||||||
{context.localCourse.settings.name}
|
|
||||||
<div className="flex flex-row">
|
|
||||||
<div className="grow">
|
|
||||||
{months.map((month) => (
|
|
||||||
<CalendarMonth
|
|
||||||
key={month.month + "" + month.year}
|
|
||||||
month={month}
|
|
||||||
localCourse={context.localCourse}
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
<div className="w-96">
|
|
||||||
<details>
|
|
||||||
<summary role="button">first module</summary>
|
|
||||||
<div>here are the module items</div>
|
|
||||||
</details>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
8
nextjs/src/app/course/[courseName]/CourseSettings.tsx
Normal file
8
nextjs/src/app/course/[courseName]/CourseSettings.tsx
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import { useCourseContext } from "./context/courseContext";
|
||||||
|
|
||||||
|
export default function CourseSettings() {
|
||||||
|
const context = useCourseContext();
|
||||||
|
return <div>{context.localCourse.settings.name}</div>;
|
||||||
|
}
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
"use client"
|
|
||||||
export default function ModuleList() {
|
export default function ModuleList() {
|
||||||
return <div></div>
|
return <div></div>
|
||||||
}
|
}
|
||||||
@@ -4,13 +4,13 @@ import { CalendarMonthModel } from "./calendarMonthUtils";
|
|||||||
import { DayOfWeek, LocalCourse } from "@/models/local/localCourse";
|
import { DayOfWeek, LocalCourse } from "@/models/local/localCourse";
|
||||||
import Day from "./Day";
|
import Day from "./Day";
|
||||||
|
|
||||||
export default function CalendarMonth({
|
export const CalendarMonth = ({
|
||||||
month,
|
month,
|
||||||
localCourse,
|
localCourse,
|
||||||
}: {
|
}: {
|
||||||
month: CalendarMonthModel;
|
month: CalendarMonthModel;
|
||||||
localCourse: LocalCourse;
|
localCourse: LocalCourse;
|
||||||
}) {
|
}) => {
|
||||||
const [isCollapsed, setIsCollapsed] = useState(false);
|
const [isCollapsed, setIsCollapsed] = useState(false);
|
||||||
|
|
||||||
const isInPast =
|
const isInPast =
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
"use client";
|
||||||
|
import { getDateFromStringOrThrow } from "@/models/local/timeUtils";
|
||||||
|
import { useCourseContext } from "../context/courseContext";
|
||||||
|
import { getMonthsBetweenDates } from "./calendarMonthUtils";
|
||||||
|
import { CalendarMonth } from "./CalendarMonth";
|
||||||
|
|
||||||
|
export default function CourseCalendar() {
|
||||||
|
const context = useCourseContext();
|
||||||
|
|
||||||
|
const startDate = getDateFromStringOrThrow(
|
||||||
|
context.localCourse.settings.startDate,
|
||||||
|
"course start date"
|
||||||
|
);
|
||||||
|
const endDate = getDateFromStringOrThrow(
|
||||||
|
context.localCourse.settings.endDate,
|
||||||
|
"course end date"
|
||||||
|
);
|
||||||
|
|
||||||
|
const months = getMonthsBetweenDates(startDate, endDate);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
{months.map((month) => (
|
||||||
|
<CalendarMonth
|
||||||
|
key={month.month + "" + month.year}
|
||||||
|
month={month}
|
||||||
|
localCourse={context.localCourse}
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,13 +1,68 @@
|
|||||||
"use client"
|
"use client";
|
||||||
|
|
||||||
|
import { getDateFromStringOrThrow } from "@/models/local/timeUtils";
|
||||||
|
import { useCourseContext } from "../context/courseContext";
|
||||||
|
|
||||||
export default function Day({ day, month }: { day: Date; month: number }) {
|
export default function Day({ day, month }: { day: Date; month: number }) {
|
||||||
const classes = "border rounded rounded-3 p-2 pb-4 m-1 ";
|
const context = useCourseContext();
|
||||||
|
|
||||||
const backgroundClass = day.getMonth() + 1 != month ? "" : "bg-slate-900";
|
const backgroundClass = day.getMonth() + 1 != month ? "" : "bg-slate-900";
|
||||||
|
|
||||||
|
const todaysAssignments = context.localCourse.modules
|
||||||
|
.flatMap((m) => m.assignments)
|
||||||
|
.filter((a) => {
|
||||||
|
const dueDate = getDateFromStringOrThrow(
|
||||||
|
a.dueAt,
|
||||||
|
"due at for assignment in day"
|
||||||
|
);
|
||||||
|
|
||||||
|
const isSame =
|
||||||
|
dueDate.getFullYear() === day.getFullYear() &&
|
||||||
|
dueDate.getMonth() === day.getMonth() &&
|
||||||
|
dueDate.getDate() === day.getDate();
|
||||||
|
if (a.name === "Chapter 3") console.log(a.name, dueDate, day, isSame);
|
||||||
|
return isSame;
|
||||||
|
});
|
||||||
|
const todaysQuizzes = context.localCourse.modules
|
||||||
|
.flatMap((m) => m.quizzes)
|
||||||
|
.filter((q) => {
|
||||||
|
const dueDate = getDateFromStringOrThrow(
|
||||||
|
q.dueAt,
|
||||||
|
"due at for quiz in day"
|
||||||
|
);
|
||||||
return (
|
return (
|
||||||
<div className={classes + " " + backgroundClass}>
|
dueDate.getFullYear() === day.getFullYear() &&
|
||||||
|
dueDate.getMonth() === day.getMonth() &&
|
||||||
|
dueDate.getDate() === day.getDate()
|
||||||
|
);
|
||||||
|
});
|
||||||
|
const todaysPages = context.localCourse.modules
|
||||||
|
.flatMap((m) => m.pages)
|
||||||
|
.filter((p) => {
|
||||||
|
const dueDate = getDateFromStringOrThrow(
|
||||||
|
p.dueAt,
|
||||||
|
"due at for page in day"
|
||||||
|
);
|
||||||
|
return (
|
||||||
|
dueDate.getFullYear() === day.getFullYear() &&
|
||||||
|
dueDate.getMonth() === day.getMonth() &&
|
||||||
|
dueDate.getDate() === day.getDate()
|
||||||
|
);
|
||||||
|
});
|
||||||
|
return (
|
||||||
|
<div className={"border rounded rounded-3 p-2 pb-4 m-1 " + backgroundClass}>
|
||||||
{day.getDate()}
|
{day.getDate()}
|
||||||
{/* <div>{day.getMonth()}</div> */}
|
<ul className="list-disc ms-4">
|
||||||
|
{todaysAssignments.map((a) => (
|
||||||
|
<li key={a.name}> {a.name}</li>
|
||||||
|
))}
|
||||||
|
{todaysQuizzes.map((q) => (
|
||||||
|
<li key={q.name}> {q.name}</li>
|
||||||
|
))}
|
||||||
|
{todaysPages.map((p) => (
|
||||||
|
<li key={p.name}> {p.name}</li>
|
||||||
|
))}
|
||||||
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
import { getDehydratedClient } from "@/app/layout";
|
import { getDehydratedClient } from "@/app/layout";
|
||||||
import { HydrationBoundary } from "@tanstack/react-query";
|
|
||||||
import CourseContextProvider from "./context/CourseContextProvider";
|
import CourseContextProvider from "./context/CourseContextProvider";
|
||||||
import CourseDetails from "./CourseDetails";
|
import CourseCalendar from "./calendar/CourseCalendar";
|
||||||
|
import { HydrationBoundary } from "@tanstack/react-query";
|
||||||
|
import CourseSettings from "./CourseSettings";
|
||||||
|
import ModuleList from "./ModuleList";
|
||||||
|
|
||||||
export default async function CoursePage({
|
export default async function CoursePage({
|
||||||
params: { courseName },
|
params: { courseName },
|
||||||
@@ -12,7 +14,17 @@ export default async function CoursePage({
|
|||||||
return (
|
return (
|
||||||
<HydrationBoundary state={dehydratedState}>
|
<HydrationBoundary state={dehydratedState}>
|
||||||
<CourseContextProvider localCourseName={courseName}>
|
<CourseContextProvider localCourseName={courseName}>
|
||||||
<CourseDetails />
|
<div>
|
||||||
|
<CourseSettings />
|
||||||
|
<div className="flex flex-row">
|
||||||
|
<div className="grow">
|
||||||
|
<CourseCalendar />
|
||||||
|
</div>
|
||||||
|
<div className="w-96">
|
||||||
|
<ModuleList />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</CourseContextProvider>
|
</CourseContextProvider>
|
||||||
</HydrationBoundary>
|
</HydrationBoundary>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ import { assignmentMarkdownSerializer } from "./utils/assignmentMarkdownSerializ
|
|||||||
export interface LocalAssignment {
|
export interface LocalAssignment {
|
||||||
name: string;
|
name: string;
|
||||||
description: string;
|
description: string;
|
||||||
lockAt?: string; // 21/08/2023 23:59:00
|
lockAt?: string; // 08/21/2023 23:59:00
|
||||||
dueAt: string; // 21/08/2023 23:59:00
|
dueAt: string; // 08/21/2023 23:59:00
|
||||||
localAssignmentGroupName?: string;
|
localAssignmentGroupName?: string;
|
||||||
submissionTypes: AssignmentSubmissionType[];
|
submissionTypes: AssignmentSubmissionType[];
|
||||||
allowedFileUploadExtensions: string[];
|
allowedFileUploadExtensions: string[];
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ describe("AssignmentMarkdownTests", () => {
|
|||||||
const assignment: LocalAssignment = {
|
const assignment: LocalAssignment = {
|
||||||
name: "test assignment",
|
name: "test assignment",
|
||||||
description: "here is the description",
|
description: "here is the description",
|
||||||
dueAt: "21/08/2023 23:59:00",
|
dueAt: "08/21/2023 23:59:00",
|
||||||
lockAt: "21/08/2023 23:59:00",
|
lockAt: "08/21/2023 23:59:00",
|
||||||
submissionTypes: [AssignmentSubmissionType.ONLINE_UPLOAD],
|
submissionTypes: [AssignmentSubmissionType.ONLINE_UPLOAD],
|
||||||
localAssignmentGroupName: "Final Project",
|
localAssignmentGroupName: "Final Project",
|
||||||
rubric: [
|
rubric: [
|
||||||
@@ -32,8 +32,8 @@ describe("AssignmentMarkdownTests", () => {
|
|||||||
const assignment: LocalAssignment = {
|
const assignment: LocalAssignment = {
|
||||||
name: "test assignment",
|
name: "test assignment",
|
||||||
description: "here is the description",
|
description: "here is the description",
|
||||||
dueAt: "21/08/2023 23:59:00",
|
dueAt: "08/21/2023 23:59:00",
|
||||||
lockAt: "21/08/2023 23:59:00",
|
lockAt: "08/21/2023 23:59:00",
|
||||||
submissionTypes: [AssignmentSubmissionType.ONLINE_UPLOAD],
|
submissionTypes: [AssignmentSubmissionType.ONLINE_UPLOAD],
|
||||||
localAssignmentGroupName: "Final Project",
|
localAssignmentGroupName: "Final Project",
|
||||||
rubric: [],
|
rubric: [],
|
||||||
@@ -52,8 +52,8 @@ describe("AssignmentMarkdownTests", () => {
|
|||||||
const assignment: LocalAssignment = {
|
const assignment: LocalAssignment = {
|
||||||
name: "test assignment",
|
name: "test assignment",
|
||||||
description: "here is the description",
|
description: "here is the description",
|
||||||
dueAt: "21/08/2023 23:59:00",
|
dueAt: "08/21/2023 23:59:00",
|
||||||
lockAt: "21/08/2023 23:59:00",
|
lockAt: "08/21/2023 23:59:00",
|
||||||
submissionTypes: [],
|
submissionTypes: [],
|
||||||
localAssignmentGroupName: "Final Project",
|
localAssignmentGroupName: "Final Project",
|
||||||
rubric: [
|
rubric: [
|
||||||
@@ -75,7 +75,7 @@ describe("AssignmentMarkdownTests", () => {
|
|||||||
const assignment: LocalAssignment = {
|
const assignment: LocalAssignment = {
|
||||||
name: "test assignment",
|
name: "test assignment",
|
||||||
description: "here is the description",
|
description: "here is the description",
|
||||||
dueAt: "21/08/2023 23:59:00",
|
dueAt: "08/21/2023 23:59:00",
|
||||||
lockAt: undefined,
|
lockAt: undefined,
|
||||||
submissionTypes: [],
|
submissionTypes: [],
|
||||||
localAssignmentGroupName: "Final Project",
|
localAssignmentGroupName: "Final Project",
|
||||||
@@ -98,8 +98,8 @@ describe("AssignmentMarkdownTests", () => {
|
|||||||
const assignment: LocalAssignment = {
|
const assignment: LocalAssignment = {
|
||||||
name: "test assignment",
|
name: "test assignment",
|
||||||
description: "",
|
description: "",
|
||||||
dueAt: "21/08/2023 23:59:00",
|
dueAt: "08/21/2023 23:59:00",
|
||||||
lockAt: "21/08/2023 23:59:00",
|
lockAt: "08/21/2023 23:59:00",
|
||||||
submissionTypes: [],
|
submissionTypes: [],
|
||||||
localAssignmentGroupName: "Final Project",
|
localAssignmentGroupName: "Final Project",
|
||||||
rubric: [
|
rubric: [
|
||||||
@@ -121,8 +121,8 @@ describe("AssignmentMarkdownTests", () => {
|
|||||||
const assignment: LocalAssignment = {
|
const assignment: LocalAssignment = {
|
||||||
name: "test assignment",
|
name: "test assignment",
|
||||||
description: "test assignment\n---\nsomestuff",
|
description: "test assignment\n---\nsomestuff",
|
||||||
dueAt: "21/08/2023 23:59:00",
|
dueAt: "08/21/2023 23:59:00",
|
||||||
lockAt: "21/08/2023 23:59:00",
|
lockAt: "08/21/2023 23:59:00",
|
||||||
submissionTypes: [],
|
submissionTypes: [],
|
||||||
localAssignmentGroupName: "Final Project",
|
localAssignmentGroupName: "Final Project",
|
||||||
rubric: [],
|
rubric: [],
|
||||||
@@ -141,8 +141,8 @@ describe("AssignmentMarkdownTests", () => {
|
|||||||
const assignment: LocalAssignment = {
|
const assignment: LocalAssignment = {
|
||||||
name: "test assignment",
|
name: "test assignment",
|
||||||
description: "here is the description",
|
description: "here is the description",
|
||||||
dueAt: "21/08/2023 23:59:00",
|
dueAt: "08/21/2023 23:59:00",
|
||||||
lockAt: "21/08/2023 23:59:00",
|
lockAt: "08/21/2023 23:59:00",
|
||||||
submissionTypes: [AssignmentSubmissionType.ONLINE_UPLOAD],
|
submissionTypes: [AssignmentSubmissionType.ONLINE_UPLOAD],
|
||||||
allowedFileUploadExtensions: ["pdf", "txt"],
|
allowedFileUploadExtensions: ["pdf", "txt"],
|
||||||
localAssignmentGroupName: "Final Project",
|
localAssignmentGroupName: "Final Project",
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ describe("PageMarkdownTests", () => {
|
|||||||
const page: LocalCoursePage = {
|
const page: LocalCoursePage = {
|
||||||
name: "test title",
|
name: "test title",
|
||||||
text: "test text content",
|
text: "test text content",
|
||||||
dueAt: "09/07/2024 23:59:00",
|
dueAt: "07/09/2024 23:59:00",
|
||||||
};
|
};
|
||||||
|
|
||||||
const pageMarkdownString = localPageMarkdownUtils.toMarkdown(page);
|
const pageMarkdownString = localPageMarkdownUtils.toMarkdown(page);
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ describe("MatchingTests", () => {
|
|||||||
Name: Test Quiz
|
Name: Test Quiz
|
||||||
ShuffleAnswers: true
|
ShuffleAnswers: true
|
||||||
OneQuestionAtATime: false
|
OneQuestionAtATime: false
|
||||||
DueAt: 21/08/2023 23:59:00
|
DueAt: 08/21/2023 23:59:00
|
||||||
LockAt: 21/08/2023 23:59:00
|
LockAt: 08/21/2023 23:59:00
|
||||||
AssignmentGroup: Assignments
|
AssignmentGroup: Assignments
|
||||||
AllowedAttempts: -1
|
AllowedAttempts: -1
|
||||||
Description:
|
Description:
|
||||||
@@ -37,8 +37,8 @@ Match the following terms & definitions
|
|||||||
Name: Test Quiz
|
Name: Test Quiz
|
||||||
ShuffleAnswers: true
|
ShuffleAnswers: true
|
||||||
OneQuestionAtATime: false
|
OneQuestionAtATime: false
|
||||||
DueAt: 21/08/2023 23:59:00
|
DueAt: 08/21/2023 23:59:00
|
||||||
LockAt: 21/08/2023 23:59:00
|
LockAt: 08/21/2023 23:59:00
|
||||||
AssignmentGroup: Assignments
|
AssignmentGroup: Assignments
|
||||||
AllowedAttempts: -1
|
AllowedAttempts: -1
|
||||||
Description:
|
Description:
|
||||||
@@ -69,8 +69,8 @@ Match the following terms & definitions
|
|||||||
Name: Test Quiz
|
Name: Test Quiz
|
||||||
ShuffleAnswers: true
|
ShuffleAnswers: true
|
||||||
OneQuestionAtATime: false
|
OneQuestionAtATime: false
|
||||||
DueAt: 21/08/2023 23:59:00
|
DueAt: 08/21/2023 23:59:00
|
||||||
LockAt: 21/08/2023 23:59:00
|
LockAt: 08/21/2023 23:59:00
|
||||||
AssignmentGroup: Assignments
|
AssignmentGroup: Assignments
|
||||||
AllowedAttempts: -1
|
AllowedAttempts: -1
|
||||||
Description:
|
Description:
|
||||||
@@ -89,8 +89,8 @@ Match the following terms & definitions
|
|||||||
Name: Test Quiz
|
Name: Test Quiz
|
||||||
ShuffleAnswers: true
|
ShuffleAnswers: true
|
||||||
OneQuestionAtATime: false
|
OneQuestionAtATime: false
|
||||||
DueAt: 21/08/2023 23:59:00
|
DueAt: 08/21/2023 23:59:00
|
||||||
LockAt: 21/08/2023 23:59:00
|
LockAt: 08/21/2023 23:59:00
|
||||||
AssignmentGroup: Assignments
|
AssignmentGroup: Assignments
|
||||||
AllowedAttempts: -1
|
AllowedAttempts: -1
|
||||||
Description:
|
Description:
|
||||||
@@ -112,8 +112,8 @@ Match the following terms & definitions
|
|||||||
Name: Test Quiz
|
Name: Test Quiz
|
||||||
ShuffleAnswers: true
|
ShuffleAnswers: true
|
||||||
OneQuestionAtATime: false
|
OneQuestionAtATime: false
|
||||||
DueAt: 21/08/2023 23:59:00
|
DueAt: 08/21/2023 23:59:00
|
||||||
LockAt: 21/08/2023 23:59:00
|
LockAt: 08/21/2023 23:59:00
|
||||||
AssignmentGroup: Assignments
|
AssignmentGroup: Assignments
|
||||||
AllowedAttempts: -1
|
AllowedAttempts: -1
|
||||||
Description:
|
Description:
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ describe("MultipleAnswersTests", () => {
|
|||||||
const quiz: LocalQuiz = {
|
const quiz: LocalQuiz = {
|
||||||
name: "Test Quiz",
|
name: "Test Quiz",
|
||||||
description: "desc",
|
description: "desc",
|
||||||
dueAt: "21/08/2023 23:59:00",
|
dueAt: "08/21/2023 23:59:00",
|
||||||
lockAt: "21/08/2023 23:59:00",
|
lockAt: "08/21/2023 23:59:00",
|
||||||
shuffleAnswers: true,
|
shuffleAnswers: true,
|
||||||
oneQuestionAtATime: false,
|
oneQuestionAtATime: false,
|
||||||
showCorrectAnswers: false,
|
showCorrectAnswers: false,
|
||||||
@@ -45,8 +45,8 @@ oneline question
|
|||||||
Name: Test Quiz
|
Name: Test Quiz
|
||||||
ShuffleAnswers: true
|
ShuffleAnswers: true
|
||||||
OneQuestionAtATime: false
|
OneQuestionAtATime: false
|
||||||
DueAt: 21/08/2023 23:59:00
|
DueAt: 08/21/2023 23:59:00
|
||||||
LockAt: 21/08/2023 23:59:00
|
LockAt: 08/21/2023 23:59:00
|
||||||
AssignmentGroup: Assignments
|
AssignmentGroup: Assignments
|
||||||
AllowedAttempts: -1
|
AllowedAttempts: -1
|
||||||
Description: this is the
|
Description: this is the
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ describe("MultipleChoiceTests", () => {
|
|||||||
const quiz: LocalQuiz = {
|
const quiz: LocalQuiz = {
|
||||||
name: "Test Quiz",
|
name: "Test Quiz",
|
||||||
description: "desc",
|
description: "desc",
|
||||||
dueAt: "21/08/2023 23:59:00",
|
dueAt: "08/21/2023 23:59:00",
|
||||||
lockAt: "21/08/2023 23:59:00",
|
lockAt: "08/21/2023 23:59:00",
|
||||||
shuffleAnswers: true,
|
shuffleAnswers: true,
|
||||||
oneQuestionAtATime: false,
|
oneQuestionAtATime: false,
|
||||||
showCorrectAnswers: false,
|
showCorrectAnswers: false,
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ describe("QuizDeterministicChecks", () => {
|
|||||||
const quiz: LocalQuiz = {
|
const quiz: LocalQuiz = {
|
||||||
name: "Test Quiz",
|
name: "Test Quiz",
|
||||||
description: "quiz description",
|
description: "quiz description",
|
||||||
lockAt: "21/08/2023 23:59:00",
|
lockAt: "08/21/2023 23:59:00",
|
||||||
dueAt: "21/08/2023 23:59:00",
|
dueAt: "08/21/2023 23:59:00",
|
||||||
shuffleAnswers: true,
|
shuffleAnswers: true,
|
||||||
oneQuestionAtATime: true,
|
oneQuestionAtATime: true,
|
||||||
localAssignmentGroupName: "Assignments",
|
localAssignmentGroupName: "Assignments",
|
||||||
@@ -29,8 +29,8 @@ describe("QuizDeterministicChecks", () => {
|
|||||||
const quiz: LocalQuiz = {
|
const quiz: LocalQuiz = {
|
||||||
name: "Test Quiz",
|
name: "Test Quiz",
|
||||||
description: "quiz description",
|
description: "quiz description",
|
||||||
lockAt: "21/08/2023 23:59:00",
|
lockAt: "08/21/2023 23:59:00",
|
||||||
dueAt: "21/08/2023 23:59:00",
|
dueAt: "08/21/2023 23:59:00",
|
||||||
showCorrectAnswers: false,
|
showCorrectAnswers: false,
|
||||||
shuffleAnswers: true,
|
shuffleAnswers: true,
|
||||||
oneQuestionAtATime: true,
|
oneQuestionAtATime: true,
|
||||||
@@ -49,8 +49,8 @@ describe("QuizDeterministicChecks", () => {
|
|||||||
const quiz: LocalQuiz = {
|
const quiz: LocalQuiz = {
|
||||||
name: "Test Quiz",
|
name: "Test Quiz",
|
||||||
description: "quiz description",
|
description: "quiz description",
|
||||||
lockAt: "21/08/2023 23:59:00",
|
lockAt: "08/21/2023 23:59:00",
|
||||||
dueAt: "21/08/2023 23:59:00",
|
dueAt: "08/21/2023 23:59:00",
|
||||||
shuffleAnswers: true,
|
shuffleAnswers: true,
|
||||||
oneQuestionAtATime: true,
|
oneQuestionAtATime: true,
|
||||||
localAssignmentGroupName: "Assignments",
|
localAssignmentGroupName: "Assignments",
|
||||||
@@ -77,8 +77,8 @@ describe("QuizDeterministicChecks", () => {
|
|||||||
const quiz: LocalQuiz = {
|
const quiz: LocalQuiz = {
|
||||||
name: "Test Quiz",
|
name: "Test Quiz",
|
||||||
description: "quiz description",
|
description: "quiz description",
|
||||||
lockAt: "21/08/2023 23:59:00",
|
lockAt: "08/21/2023 23:59:00",
|
||||||
dueAt: "21/08/2023 23:59:00",
|
dueAt: "08/21/2023 23:59:00",
|
||||||
shuffleAnswers: true,
|
shuffleAnswers: true,
|
||||||
oneQuestionAtATime: true,
|
oneQuestionAtATime: true,
|
||||||
localAssignmentGroupName: "Assignments",
|
localAssignmentGroupName: "Assignments",
|
||||||
@@ -105,8 +105,8 @@ describe("QuizDeterministicChecks", () => {
|
|||||||
const quiz: LocalQuiz = {
|
const quiz: LocalQuiz = {
|
||||||
name: "Test Quiz",
|
name: "Test Quiz",
|
||||||
description: "quiz description",
|
description: "quiz description",
|
||||||
lockAt: "21/08/2023 23:59:00",
|
lockAt: "08/21/2023 23:59:00",
|
||||||
dueAt: "21/08/2023 23:59:00",
|
dueAt: "08/21/2023 23:59:00",
|
||||||
shuffleAnswers: true,
|
shuffleAnswers: true,
|
||||||
oneQuestionAtATime: true,
|
oneQuestionAtATime: true,
|
||||||
localAssignmentGroupName: "Assignments",
|
localAssignmentGroupName: "Assignments",
|
||||||
@@ -136,8 +136,8 @@ describe("QuizDeterministicChecks", () => {
|
|||||||
const quiz: LocalQuiz = {
|
const quiz: LocalQuiz = {
|
||||||
name: "Test Quiz",
|
name: "Test Quiz",
|
||||||
description: "quiz description",
|
description: "quiz description",
|
||||||
lockAt: "21/08/2023 23:59:00",
|
lockAt: "08/21/2023 23:59:00",
|
||||||
dueAt: "21/08/2023 23:59:00",
|
dueAt: "08/21/2023 23:59:00",
|
||||||
shuffleAnswers: true,
|
shuffleAnswers: true,
|
||||||
oneQuestionAtATime: true,
|
oneQuestionAtATime: true,
|
||||||
password: undefined,
|
password: undefined,
|
||||||
@@ -168,8 +168,8 @@ describe("QuizDeterministicChecks", () => {
|
|||||||
const quiz: LocalQuiz = {
|
const quiz: LocalQuiz = {
|
||||||
name: "Test Quiz",
|
name: "Test Quiz",
|
||||||
description: "quiz description",
|
description: "quiz description",
|
||||||
lockAt: "21/08/2023 23:59:00",
|
lockAt: "08/21/2023 23:59:00",
|
||||||
dueAt: "21/08/2023 23:59:00",
|
dueAt: "08/21/2023 23:59:00",
|
||||||
shuffleAnswers: true,
|
shuffleAnswers: true,
|
||||||
oneQuestionAtATime: true,
|
oneQuestionAtATime: true,
|
||||||
password: undefined,
|
password: undefined,
|
||||||
|
|||||||
@@ -41,8 +41,8 @@ this is my description in markdown
|
|||||||
Name: Test Quiz
|
Name: Test Quiz
|
||||||
ShuffleAnswers: true
|
ShuffleAnswers: true
|
||||||
OneQuestionAtATime: false
|
OneQuestionAtATime: false
|
||||||
DueAt: 21/08/2023 23:59:00
|
DueAt: 08/21/2023 23:59:00
|
||||||
LockAt: 21/08/2023 23:59:00
|
LockAt: 08/21/2023 23:59:00
|
||||||
AssignmentGroup: Assignments
|
AssignmentGroup: Assignments
|
||||||
AllowedAttempts: -1
|
AllowedAttempts: -1
|
||||||
Description: this is the
|
Description: this is the
|
||||||
@@ -72,8 +72,8 @@ Name: Test Quiz
|
|||||||
Password: ${password}
|
Password: ${password}
|
||||||
ShuffleAnswers: true
|
ShuffleAnswers: true
|
||||||
OneQuestionAtATime: false
|
OneQuestionAtATime: false
|
||||||
DueAt: 21/08/2023 23:59:00
|
DueAt: 08/21/2023 23:59:00
|
||||||
LockAt: 21/08/2023 23:59:00
|
LockAt: 08/21/2023 23:59:00
|
||||||
AssignmentGroup: Assignments
|
AssignmentGroup: Assignments
|
||||||
AllowedAttempts: -1
|
AllowedAttempts: -1
|
||||||
Description: this is the
|
Description: this is the
|
||||||
@@ -93,8 +93,8 @@ Name: Test Quiz
|
|||||||
ShuffleAnswers: true
|
ShuffleAnswers: true
|
||||||
OneQuestionAtATime: false
|
OneQuestionAtATime: false
|
||||||
ShowCorrectAnswers: false
|
ShowCorrectAnswers: false
|
||||||
DueAt: 21/08/2023 23:59:00
|
DueAt: 08/21/2023 23:59:00
|
||||||
LockAt: 21/08/2023 23:59:00
|
LockAt: 08/21/2023 23:59:00
|
||||||
AssignmentGroup: Assignments
|
AssignmentGroup: Assignments
|
||||||
AllowedAttempts: -1
|
AllowedAttempts: -1
|
||||||
Description: this is the
|
Description: this is the
|
||||||
@@ -113,8 +113,8 @@ description
|
|||||||
Name: Test Quiz
|
Name: Test Quiz
|
||||||
ShuffleAnswers: true
|
ShuffleAnswers: true
|
||||||
OneQuestionAtATime: false
|
OneQuestionAtATime: false
|
||||||
DueAt: 21/08/2023 23:59:00
|
DueAt: 08/21/2023 23:59:00
|
||||||
LockAt: 21/08/2023 23:59:00
|
LockAt: 08/21/2023 23:59:00
|
||||||
AssignmentGroup: Assignments
|
AssignmentGroup: Assignments
|
||||||
AllowedAttempts: -1
|
AllowedAttempts: -1
|
||||||
Description: this is the
|
Description: this is the
|
||||||
@@ -153,8 +153,8 @@ b) false
|
|||||||
Name: Test Quiz
|
Name: Test Quiz
|
||||||
ShuffleAnswers: true
|
ShuffleAnswers: true
|
||||||
OneQuestionAtATime: false
|
OneQuestionAtATime: false
|
||||||
DueAt: 21/08/2023 23:59:00
|
DueAt: 08/21/2023 23:59:00
|
||||||
LockAt: 21/08/2023 23:59:00
|
LockAt: 08/21/2023 23:59:00
|
||||||
AssignmentGroup: Assignments
|
AssignmentGroup: Assignments
|
||||||
AllowedAttempts: -1
|
AllowedAttempts: -1
|
||||||
Description: this is the
|
Description: this is the
|
||||||
@@ -185,8 +185,8 @@ b) false
|
|||||||
Name: Test Quiz
|
Name: Test Quiz
|
||||||
ShuffleAnswers: true
|
ShuffleAnswers: true
|
||||||
OneQuestionAtATime: false
|
OneQuestionAtATime: false
|
||||||
DueAt: 21/08/2023 23:59:00
|
DueAt: 08/21/2023 23:59:00
|
||||||
LockAt: 21/08/2023 23:59:00
|
LockAt: 08/21/2023 23:59:00
|
||||||
AssignmentGroup: Assignments
|
AssignmentGroup: Assignments
|
||||||
AllowedAttempts: -1
|
AllowedAttempts: -1
|
||||||
Description: this is the
|
Description: this is the
|
||||||
@@ -213,8 +213,8 @@ short_answer`;
|
|||||||
Name: Test Quiz
|
Name: Test Quiz
|
||||||
ShuffleAnswers: true
|
ShuffleAnswers: true
|
||||||
OneQuestionAtATime: false
|
OneQuestionAtATime: false
|
||||||
DueAt: 21/08/2023 23:59:00
|
DueAt: 08/21/2023 23:59:00
|
||||||
LockAt: 21/08/2023 23:59:00
|
LockAt: 08/21/2023 23:59:00
|
||||||
AssignmentGroup: Assignments
|
AssignmentGroup: Assignments
|
||||||
AllowedAttempts: -1
|
AllowedAttempts: -1
|
||||||
Description: this is the
|
Description: this is the
|
||||||
@@ -236,8 +236,8 @@ short answer
|
|||||||
Name: Test Quiz
|
Name: Test Quiz
|
||||||
ShuffleAnswers: true
|
ShuffleAnswers: true
|
||||||
OneQuestionAtATime: false
|
OneQuestionAtATime: false
|
||||||
DueAt: 21/08/2023 23:59:00
|
DueAt: 08/21/2023 23:59:00
|
||||||
LockAt: 21/08/2023 23:59:00
|
LockAt: 08/21/2023 23:59:00
|
||||||
AssignmentGroup: Assignments
|
AssignmentGroup: Assignments
|
||||||
AllowedAttempts: -1
|
AllowedAttempts: -1
|
||||||
Description: this is the
|
Description: this is the
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ describe("TextAnswerTests", () => {
|
|||||||
Name: Test Quiz
|
Name: Test Quiz
|
||||||
ShuffleAnswers: true
|
ShuffleAnswers: true
|
||||||
OneQuestionAtATime: false
|
OneQuestionAtATime: false
|
||||||
DueAt: 21/08/2023 23:59:00
|
DueAt: 08/21/2023 23:59:00
|
||||||
LockAt: 21/08/2023 23:59:00
|
LockAt: 08/21/2023 23:59:00
|
||||||
AssignmentGroup: Assignments
|
AssignmentGroup: Assignments
|
||||||
AllowedAttempts: -1
|
AllowedAttempts: -1
|
||||||
Description: this is the
|
Description: this is the
|
||||||
@@ -34,8 +34,8 @@ essay
|
|||||||
Name: Test Quiz
|
Name: Test Quiz
|
||||||
ShuffleAnswers: true
|
ShuffleAnswers: true
|
||||||
OneQuestionAtATime: false
|
OneQuestionAtATime: false
|
||||||
DueAt: 21/08/2023 23:59:00
|
DueAt: 08/21/2023 23:59:00
|
||||||
LockAt: 21/08/2023 23:59:00
|
LockAt: 08/21/2023 23:59:00
|
||||||
AssignmentGroup: Assignments
|
AssignmentGroup: Assignments
|
||||||
AllowedAttempts: -1
|
AllowedAttempts: -1
|
||||||
Description: this is the
|
Description: this is the
|
||||||
@@ -59,8 +59,8 @@ short answer
|
|||||||
Name: Test Quiz
|
Name: Test Quiz
|
||||||
ShuffleAnswers: true
|
ShuffleAnswers: true
|
||||||
OneQuestionAtATime: false
|
OneQuestionAtATime: false
|
||||||
DueAt: 21/08/2023 23:59:00
|
DueAt: 08/21/2023 23:59:00
|
||||||
LockAt: 21/08/2023 23:59:00
|
LockAt: 08/21/2023 23:59:00
|
||||||
AssignmentGroup: Assignments
|
AssignmentGroup: Assignments
|
||||||
AllowedAttempts: -1
|
AllowedAttempts: -1
|
||||||
Description: this is the
|
Description: this is the
|
||||||
@@ -87,8 +87,8 @@ short_answer`;
|
|||||||
Name: Test Quiz
|
Name: Test Quiz
|
||||||
ShuffleAnswers: true
|
ShuffleAnswers: true
|
||||||
OneQuestionAtATime: false
|
OneQuestionAtATime: false
|
||||||
DueAt: 21/08/2023 23:59:00
|
DueAt: 08/21/2023 23:59:00
|
||||||
LockAt: 21/08/2023 23:59:00
|
LockAt: 08/21/2023 23:59:00
|
||||||
AssignmentGroup: Assignments
|
AssignmentGroup: Assignments
|
||||||
AllowedAttempts: -1
|
AllowedAttempts: -1
|
||||||
Description: this is the
|
Description: this is the
|
||||||
|
|||||||
@@ -1,23 +1,31 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
import { describe, it, expect } from "vitest";
|
import { describe, it, expect } from "vitest";
|
||||||
import { getDateFromString } from "../timeUtils";
|
import { getDateFromString } from "../timeUtils";
|
||||||
|
|
||||||
describe("Can properly handle expected date formats", () => {
|
describe("Can properly handle expected date formats", () => {
|
||||||
it("can use AM/PM dates", () => {
|
it("can use AM/PM dates", () => {
|
||||||
const dateString = "8/27/2024 1:00:00 AM"
|
const dateString = "8/27/2024 1:00:00 AM";
|
||||||
const dateObject = getDateFromString(dateString)
|
const dateObject = getDateFromString(dateString);
|
||||||
expect(dateObject).not.toBeUndefined()
|
expect(dateObject).not.toBeUndefined();
|
||||||
})
|
});
|
||||||
it("can use 24 hour dates", () => {
|
it("can use 24 hour dates", () => {
|
||||||
const dateString = "8/27/2024 23:95:00"
|
const dateString = "8/27/2024 23:95:00";
|
||||||
const dateObject = getDateFromString(dateString)
|
const dateObject = getDateFromString(dateString);
|
||||||
expect(dateObject).not.toBeUndefined()
|
expect(dateObject).not.toBeUndefined();
|
||||||
})
|
});
|
||||||
it("can use ISO format", () => {
|
it("can use ISO format", () => {
|
||||||
const dateString = "2024-08-26T00:00:00.0000000"
|
const dateString = "2024-08-26T00:00:00.0000000";
|
||||||
const dateObject = getDateFromString(dateString)
|
const dateObject = getDateFromString(dateString);
|
||||||
expect(dateObject).not.toBeUndefined()
|
expect(dateObject).not.toBeUndefined();
|
||||||
})
|
});
|
||||||
})
|
it("can get correct time from format", () => {
|
||||||
|
const dateString = "08/28/2024 23:59:00";
|
||||||
|
const dateObject = getDateFromString(dateString);
|
||||||
|
|
||||||
|
expect(dateObject?.getDate()).toBe(28);
|
||||||
|
expect(dateObject?.getMonth()).toBe(8 - 1); // 0 based
|
||||||
|
expect(dateObject?.getFullYear()).toBe(2024);
|
||||||
|
expect(dateObject?.getMinutes()).toBe(59);
|
||||||
|
expect(dateObject?.getHours()).toBe(23);
|
||||||
|
expect(dateObject?.getSeconds()).toBe(0);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ const _getDateFromMilitary = (
|
|||||||
datePart: string,
|
datePart: string,
|
||||||
timePart: string
|
timePart: string
|
||||||
): Date | undefined => {
|
): Date | undefined => {
|
||||||
const [day, month, year] = datePart.split("/").map(Number);
|
const [month, day, year] = datePart.split("/").map(Number);
|
||||||
const [hours, minutes, seconds] = timePart.split(":").map(Number);
|
const [hours, minutes, seconds] = timePart.split(":").map(Number);
|
||||||
|
|
||||||
const date = new Date(year, month - 1, day, hours, minutes, seconds);
|
const date = new Date(year, month - 1, day, hours, minutes, seconds);
|
||||||
@@ -86,5 +86,5 @@ export const dateToMarkdownString = (date: Date) => {
|
|||||||
const stringMinutes = String(date.getMinutes()).padStart(2, "0");
|
const stringMinutes = String(date.getMinutes()).padStart(2, "0");
|
||||||
const stringSeconds = String(date.getSeconds()).padStart(2, "0");
|
const stringSeconds = String(date.getSeconds()).padStart(2, "0");
|
||||||
|
|
||||||
return `${stringDay}/${stringMonth}/${stringYear} ${stringHours}:${stringMinutes}:${stringSeconds}`;
|
return `${stringMonth}/${stringDay}/${stringYear} ${stringHours}:${stringMinutes}:${stringSeconds}`;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ describe("CourseDifferencesChangesTests", () => {
|
|||||||
name: "Test Course",
|
name: "Test Course",
|
||||||
assignmentGroups: [],
|
assignmentGroups: [],
|
||||||
daysOfWeek: [],
|
daysOfWeek: [],
|
||||||
startDate: "09/07/2024 23:59:00",
|
startDate: "07/09/2024 23:59:00",
|
||||||
endDate: "09/07/2024 23:59:00",
|
endDate: "07/09/2024 23:59:00",
|
||||||
defaultDueTime: {
|
defaultDueTime: {
|
||||||
hour: 23,
|
hour: 23,
|
||||||
minute: 59,
|
minute: 59,
|
||||||
@@ -40,8 +40,8 @@ describe("CourseDifferencesChangesTests", () => {
|
|||||||
name: "Test Course",
|
name: "Test Course",
|
||||||
assignmentGroups: [],
|
assignmentGroups: [],
|
||||||
daysOfWeek: [],
|
daysOfWeek: [],
|
||||||
startDate: "09/07/2024 23:59:00",
|
startDate: "07/09/2024 23:59:00",
|
||||||
endDate: "09/07/2024 23:59:00",
|
endDate: "07/09/2024 23:59:00",
|
||||||
defaultDueTime: {
|
defaultDueTime: {
|
||||||
hour: 23,
|
hour: 23,
|
||||||
minute: 59,
|
minute: 59,
|
||||||
@@ -74,8 +74,8 @@ describe("CourseDifferencesChangesTests", () => {
|
|||||||
name: "Test Course",
|
name: "Test Course",
|
||||||
assignmentGroups: [],
|
assignmentGroups: [],
|
||||||
daysOfWeek: [],
|
daysOfWeek: [],
|
||||||
startDate: "09/07/2024 23:59:00",
|
startDate: "07/09/2024 23:59:00",
|
||||||
endDate: "09/07/2024 23:59:00",
|
endDate: "07/09/2024 23:59:00",
|
||||||
defaultDueTime: {
|
defaultDueTime: {
|
||||||
hour: 23,
|
hour: 23,
|
||||||
minute: 59,
|
minute: 59,
|
||||||
@@ -88,7 +88,7 @@ describe("CourseDifferencesChangesTests", () => {
|
|||||||
{
|
{
|
||||||
name: "test assignment",
|
name: "test assignment",
|
||||||
description: "",
|
description: "",
|
||||||
dueAt: "09/07/2024 23:59:00",
|
dueAt: "07/09/2024 23:59:00",
|
||||||
submissionTypes: [],
|
submissionTypes: [],
|
||||||
allowedFileUploadExtensions: [],
|
allowedFileUploadExtensions: [],
|
||||||
rubric: [],
|
rubric: [],
|
||||||
@@ -108,7 +108,7 @@ describe("CourseDifferencesChangesTests", () => {
|
|||||||
{
|
{
|
||||||
name: "test assignment",
|
name: "test assignment",
|
||||||
description: "new description",
|
description: "new description",
|
||||||
dueAt: "09/07/2024 23:59:00",
|
dueAt: "07/09/2024 23:59:00",
|
||||||
submissionTypes: [],
|
submissionTypes: [],
|
||||||
allowedFileUploadExtensions: [],
|
allowedFileUploadExtensions: [],
|
||||||
rubric: [],
|
rubric: [],
|
||||||
@@ -130,7 +130,7 @@ describe("CourseDifferencesChangesTests", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("can properly ignore unchanged modules", () => {
|
it("can properly ignore unchanged modules", () => {
|
||||||
const commonDate = "09/07/2024 23:59:00";
|
const commonDate = "07/09/2024 23:59:00";
|
||||||
const oldCourse: LocalCourse = {
|
const oldCourse: LocalCourse = {
|
||||||
settings: {
|
settings: {
|
||||||
name: "Test Course",
|
name: "Test Course",
|
||||||
@@ -171,7 +171,7 @@ describe("CourseDifferencesChangesTests", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("only changed assignment represented", () => {
|
it("only changed assignment represented", () => {
|
||||||
const commonDate = "09/07/2024 23:59:00";
|
const commonDate = "07/09/2024 23:59:00";
|
||||||
const oldCourse: LocalCourse = {
|
const oldCourse: LocalCourse = {
|
||||||
settings: {
|
settings: {
|
||||||
name: "Test Course",
|
name: "Test Course",
|
||||||
@@ -249,7 +249,7 @@ describe("CourseDifferencesChangesTests", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("identical quizzes ignored", () => {
|
it("identical quizzes ignored", () => {
|
||||||
const commonDate = "09/07/2024 23:59:00";
|
const commonDate = "07/09/2024 23:59:00";
|
||||||
const oldCourse: LocalCourse = {
|
const oldCourse: LocalCourse = {
|
||||||
settings: {
|
settings: {
|
||||||
name: "Test Course",
|
name: "Test Course",
|
||||||
@@ -292,7 +292,7 @@ describe("CourseDifferencesChangesTests", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("can detect different quiz", () => {
|
it("can detect different quiz", () => {
|
||||||
const commonDate = "09/07/2024 23:59:00";
|
const commonDate = "07/09/2024 23:59:00";
|
||||||
const oldCourse: LocalCourse = {
|
const oldCourse: LocalCourse = {
|
||||||
settings: {
|
settings: {
|
||||||
name: "Test Course",
|
name: "Test Course",
|
||||||
@@ -359,7 +359,7 @@ describe("CourseDifferencesChangesTests", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("can detect only different quiz when other quizzes stay", () => {
|
it("can detect only different quiz when other quizzes stay", () => {
|
||||||
const commonDate = "09/07/2024 23:59:00";
|
const commonDate = "07/09/2024 23:59:00";
|
||||||
const oldCourse: LocalCourse = {
|
const oldCourse: LocalCourse = {
|
||||||
settings: {
|
settings: {
|
||||||
name: "Test Course",
|
name: "Test Course",
|
||||||
@@ -433,7 +433,7 @@ describe("CourseDifferencesChangesTests", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("same pages not detected", () => {
|
it("same pages not detected", () => {
|
||||||
const commonDate = "09/07/2024 23:59:00";
|
const commonDate = "07/09/2024 23:59:00";
|
||||||
const oldCourse: LocalCourse = {
|
const oldCourse: LocalCourse = {
|
||||||
settings: {
|
settings: {
|
||||||
name: "Test Course",
|
name: "Test Course",
|
||||||
@@ -471,7 +471,7 @@ describe("CourseDifferencesChangesTests", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("different page detected", () => {
|
it("different page detected", () => {
|
||||||
const commonDate = "09/07/2024 23:59:00";
|
const commonDate = "07/09/2024 23:59:00";
|
||||||
const oldCourse: LocalCourse = {
|
const oldCourse: LocalCourse = {
|
||||||
settings: {
|
settings: {
|
||||||
name: "Test Course",
|
name: "Test Course",
|
||||||
@@ -527,7 +527,7 @@ describe("CourseDifferencesChangesTests", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("different page detected but not same page", () => {
|
it("different page detected but not same page", () => {
|
||||||
const commonDate = "09/07/2024 23:59:00";
|
const commonDate = "07/09/2024 23:59:00";
|
||||||
const oldCourse: LocalCourse = {
|
const oldCourse: LocalCourse = {
|
||||||
settings: {
|
settings: {
|
||||||
name: "Test Course",
|
name: "Test Course",
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ describe("CourseDifferencesDeletionsTests", () => {
|
|||||||
name: "test course",
|
name: "test course",
|
||||||
assignmentGroups: [],
|
assignmentGroups: [],
|
||||||
daysOfWeek: [],
|
daysOfWeek: [],
|
||||||
startDate: "09/07/2024 23:59:00",
|
startDate: "07/09/2024 23:59:00",
|
||||||
endDate: "09/07/2024 23:59:00",
|
endDate: "07/09/2024 23:59:00",
|
||||||
defaultDueTime: {
|
defaultDueTime: {
|
||||||
hour: 23,
|
hour: 23,
|
||||||
minute: 59,
|
minute: 59,
|
||||||
@@ -51,8 +51,8 @@ describe("CourseDifferencesDeletionsTests", () => {
|
|||||||
name: "test course",
|
name: "test course",
|
||||||
assignmentGroups: [],
|
assignmentGroups: [],
|
||||||
daysOfWeek: [],
|
daysOfWeek: [],
|
||||||
startDate: "09/07/2024 23:59:00",
|
startDate: "07/09/2024 23:59:00",
|
||||||
endDate: "09/07/2024 23:59:00",
|
endDate: "07/09/2024 23:59:00",
|
||||||
defaultDueTime: {
|
defaultDueTime: {
|
||||||
hour: 23,
|
hour: 23,
|
||||||
minute: 59,
|
minute: 59,
|
||||||
@@ -94,8 +94,8 @@ describe("CourseDifferencesDeletionsTests", () => {
|
|||||||
name: "test course",
|
name: "test course",
|
||||||
assignmentGroups: [],
|
assignmentGroups: [],
|
||||||
daysOfWeek: [],
|
daysOfWeek: [],
|
||||||
startDate: "09/07/2024 23:59:00",
|
startDate: "07/09/2024 23:59:00",
|
||||||
endDate: "09/07/2024 23:59:00",
|
endDate: "07/09/2024 23:59:00",
|
||||||
defaultDueTime: {
|
defaultDueTime: {
|
||||||
hour: 23,
|
hour: 23,
|
||||||
minute: 59,
|
minute: 59,
|
||||||
@@ -108,7 +108,7 @@ describe("CourseDifferencesDeletionsTests", () => {
|
|||||||
{
|
{
|
||||||
name: "test assignment",
|
name: "test assignment",
|
||||||
description: "test description",
|
description: "test description",
|
||||||
dueAt: "09/07/2024 23:59:00",
|
dueAt: "07/09/2024 23:59:00",
|
||||||
submissionTypes: [],
|
submissionTypes: [],
|
||||||
allowedFileUploadExtensions: [],
|
allowedFileUploadExtensions: [],
|
||||||
rubric: [],
|
rubric: [],
|
||||||
@@ -128,7 +128,7 @@ describe("CourseDifferencesDeletionsTests", () => {
|
|||||||
{
|
{
|
||||||
name: "test assignment changed name",
|
name: "test assignment changed name",
|
||||||
description: "test description",
|
description: "test description",
|
||||||
dueAt: "09/07/2024 23:59:00",
|
dueAt: "07/09/2024 23:59:00",
|
||||||
submissionTypes: [],
|
submissionTypes: [],
|
||||||
allowedFileUploadExtensions: [],
|
allowedFileUploadExtensions: [],
|
||||||
rubric: [],
|
rubric: [],
|
||||||
@@ -159,8 +159,8 @@ describe("CourseDifferencesDeletionsTests", () => {
|
|||||||
name: "test course",
|
name: "test course",
|
||||||
assignmentGroups: [],
|
assignmentGroups: [],
|
||||||
daysOfWeek: [],
|
daysOfWeek: [],
|
||||||
startDate: "09/07/2024 23:59:00",
|
startDate: "07/09/2024 23:59:00",
|
||||||
endDate: "09/07/2024 23:59:00",
|
endDate: "07/09/2024 23:59:00",
|
||||||
defaultDueTime: {
|
defaultDueTime: {
|
||||||
hour: 23,
|
hour: 23,
|
||||||
minute: 59,
|
minute: 59,
|
||||||
@@ -173,7 +173,7 @@ describe("CourseDifferencesDeletionsTests", () => {
|
|||||||
{
|
{
|
||||||
name: "test assignment",
|
name: "test assignment",
|
||||||
description: "test description",
|
description: "test description",
|
||||||
dueAt: "09/07/2024 23:59:00",
|
dueAt: "07/09/2024 23:59:00",
|
||||||
submissionTypes: [],
|
submissionTypes: [],
|
||||||
allowedFileUploadExtensions: [],
|
allowedFileUploadExtensions: [],
|
||||||
rubric: [],
|
rubric: [],
|
||||||
@@ -193,7 +193,7 @@ describe("CourseDifferencesDeletionsTests", () => {
|
|||||||
{
|
{
|
||||||
name: "test assignment",
|
name: "test assignment",
|
||||||
description: "test description",
|
description: "test description",
|
||||||
dueAt: "09/07/2024 23:59:00",
|
dueAt: "07/09/2024 23:59:00",
|
||||||
submissionTypes: [],
|
submissionTypes: [],
|
||||||
allowedFileUploadExtensions: [],
|
allowedFileUploadExtensions: [],
|
||||||
rubric: [],
|
rubric: [],
|
||||||
@@ -219,8 +219,8 @@ describe("CourseDifferencesDeletionsTests", () => {
|
|||||||
name: "test course",
|
name: "test course",
|
||||||
assignmentGroups: [],
|
assignmentGroups: [],
|
||||||
daysOfWeek: [],
|
daysOfWeek: [],
|
||||||
startDate: "09/07/2024 23:59:00",
|
startDate: "07/09/2024 23:59:00",
|
||||||
endDate: "09/07/2024 23:59:00",
|
endDate: "07/09/2024 23:59:00",
|
||||||
defaultDueTime: {
|
defaultDueTime: {
|
||||||
hour: 23,
|
hour: 23,
|
||||||
minute: 59,
|
minute: 59,
|
||||||
@@ -233,7 +233,7 @@ describe("CourseDifferencesDeletionsTests", () => {
|
|||||||
{
|
{
|
||||||
name: "test assignment",
|
name: "test assignment",
|
||||||
description: "test description",
|
description: "test description",
|
||||||
dueAt: "09/07/2024 23:59:00",
|
dueAt: "07/09/2024 23:59:00",
|
||||||
submissionTypes: [],
|
submissionTypes: [],
|
||||||
allowedFileUploadExtensions: [],
|
allowedFileUploadExtensions: [],
|
||||||
rubric: [],
|
rubric: [],
|
||||||
@@ -241,7 +241,7 @@ describe("CourseDifferencesDeletionsTests", () => {
|
|||||||
{
|
{
|
||||||
name: "test assignment 2",
|
name: "test assignment 2",
|
||||||
description: "test description",
|
description: "test description",
|
||||||
dueAt: "09/07/2024 23:59:00",
|
dueAt: "07/09/2024 23:59:00",
|
||||||
submissionTypes: [],
|
submissionTypes: [],
|
||||||
allowedFileUploadExtensions: [],
|
allowedFileUploadExtensions: [],
|
||||||
rubric: [],
|
rubric: [],
|
||||||
@@ -261,7 +261,7 @@ describe("CourseDifferencesDeletionsTests", () => {
|
|||||||
{
|
{
|
||||||
name: "test assignment",
|
name: "test assignment",
|
||||||
description: "test description",
|
description: "test description",
|
||||||
dueAt: "09/07/2024 23:59:00",
|
dueAt: "07/09/2024 23:59:00",
|
||||||
submissionTypes: [],
|
submissionTypes: [],
|
||||||
allowedFileUploadExtensions: [],
|
allowedFileUploadExtensions: [],
|
||||||
rubric: [],
|
rubric: [],
|
||||||
@@ -269,7 +269,7 @@ describe("CourseDifferencesDeletionsTests", () => {
|
|||||||
{
|
{
|
||||||
name: "test assignment 2 changed",
|
name: "test assignment 2 changed",
|
||||||
description: "test description",
|
description: "test description",
|
||||||
dueAt: "09/07/2024 23:59:00",
|
dueAt: "07/09/2024 23:59:00",
|
||||||
submissionTypes: [],
|
submissionTypes: [],
|
||||||
allowedFileUploadExtensions: [],
|
allowedFileUploadExtensions: [],
|
||||||
rubric: [],
|
rubric: [],
|
||||||
@@ -299,8 +299,8 @@ describe("CourseDifferencesDeletionsTests", () => {
|
|||||||
name: "test course",
|
name: "test course",
|
||||||
assignmentGroups: [],
|
assignmentGroups: [],
|
||||||
daysOfWeek: [],
|
daysOfWeek: [],
|
||||||
startDate: "09/07/2024 23:59:00",
|
startDate: "07/09/2024 23:59:00",
|
||||||
endDate: "09/07/2024 23:59:00",
|
endDate: "07/09/2024 23:59:00",
|
||||||
defaultDueTime: {
|
defaultDueTime: {
|
||||||
hour: 23,
|
hour: 23,
|
||||||
minute: 59,
|
minute: 59,
|
||||||
@@ -314,7 +314,7 @@ describe("CourseDifferencesDeletionsTests", () => {
|
|||||||
{
|
{
|
||||||
name: "Test Quiz",
|
name: "Test Quiz",
|
||||||
description: "test description",
|
description: "test description",
|
||||||
dueAt: "09/07/2024 23:59:00",
|
dueAt: "07/09/2024 23:59:00",
|
||||||
shuffleAnswers: false,
|
shuffleAnswers: false,
|
||||||
showCorrectAnswers: false,
|
showCorrectAnswers: false,
|
||||||
oneQuestionAtATime: false,
|
oneQuestionAtATime: false,
|
||||||
@@ -324,7 +324,7 @@ describe("CourseDifferencesDeletionsTests", () => {
|
|||||||
{
|
{
|
||||||
name: "Test Quiz 2",
|
name: "Test Quiz 2",
|
||||||
description: "test description",
|
description: "test description",
|
||||||
dueAt: "09/07/2024 23:59:00",
|
dueAt: "07/09/2024 23:59:00",
|
||||||
shuffleAnswers: false,
|
shuffleAnswers: false,
|
||||||
showCorrectAnswers: false,
|
showCorrectAnswers: false,
|
||||||
oneQuestionAtATime: false,
|
oneQuestionAtATime: false,
|
||||||
@@ -346,7 +346,7 @@ describe("CourseDifferencesDeletionsTests", () => {
|
|||||||
{
|
{
|
||||||
name: "Test Quiz",
|
name: "Test Quiz",
|
||||||
description: "test description",
|
description: "test description",
|
||||||
dueAt: "09/07/2024 23:59:00",
|
dueAt: "07/09/2024 23:59:00",
|
||||||
shuffleAnswers: false,
|
shuffleAnswers: false,
|
||||||
showCorrectAnswers: false,
|
showCorrectAnswers: false,
|
||||||
oneQuestionAtATime: false,
|
oneQuestionAtATime: false,
|
||||||
@@ -356,7 +356,7 @@ describe("CourseDifferencesDeletionsTests", () => {
|
|||||||
{
|
{
|
||||||
name: "Test Quiz 3",
|
name: "Test Quiz 3",
|
||||||
description: "test description",
|
description: "test description",
|
||||||
dueAt: "09/07/2024 23:59:00",
|
dueAt: "07/09/2024 23:59:00",
|
||||||
shuffleAnswers: false,
|
shuffleAnswers: false,
|
||||||
showCorrectAnswers: false,
|
showCorrectAnswers: false,
|
||||||
oneQuestionAtATime: false,
|
oneQuestionAtATime: false,
|
||||||
@@ -387,8 +387,8 @@ describe("CourseDifferencesDeletionsTests", () => {
|
|||||||
name: "test course",
|
name: "test course",
|
||||||
assignmentGroups: [],
|
assignmentGroups: [],
|
||||||
daysOfWeek: [],
|
daysOfWeek: [],
|
||||||
startDate: "09/07/2024 23:59:00",
|
startDate: "07/09/2024 23:59:00",
|
||||||
endDate: "09/07/2024 23:59:00",
|
endDate: "07/09/2024 23:59:00",
|
||||||
defaultDueTime: {
|
defaultDueTime: {
|
||||||
hour: 23,
|
hour: 23,
|
||||||
minute: 59,
|
minute: 59,
|
||||||
@@ -403,12 +403,12 @@ describe("CourseDifferencesDeletionsTests", () => {
|
|||||||
{
|
{
|
||||||
name: "Test Page",
|
name: "Test Page",
|
||||||
text: "test contents",
|
text: "test contents",
|
||||||
dueAt: "09/07/2024 23:59:00",
|
dueAt: "07/09/2024 23:59:00",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Test Page 2",
|
name: "Test Page 2",
|
||||||
text: "test contents",
|
text: "test contents",
|
||||||
dueAt: "09/07/2024 23:59:00",
|
dueAt: "07/09/2024 23:59:00",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -425,12 +425,12 @@ describe("CourseDifferencesDeletionsTests", () => {
|
|||||||
{
|
{
|
||||||
name: "Test Page",
|
name: "Test Page",
|
||||||
text: "test contents",
|
text: "test contents",
|
||||||
dueAt: "09/07/2024 23:59:00",
|
dueAt: "07/09/2024 23:59:00",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Test Page 3",
|
name: "Test Page 3",
|
||||||
text: "test contents",
|
text: "test contents",
|
||||||
dueAt: "09/07/2024 23:59:00",
|
dueAt: "07/09/2024 23:59:00",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -21,8 +21,8 @@ describe("FileStorageTests", () => {
|
|||||||
name: "test empty course",
|
name: "test empty course",
|
||||||
assignmentGroups: [],
|
assignmentGroups: [],
|
||||||
daysOfWeek: [],
|
daysOfWeek: [],
|
||||||
startDate: "09/07/2024 23:59:00",
|
startDate: "07/09/2024 23:59:00",
|
||||||
endDate: "09/07/2024 23:59:00",
|
endDate: "07/09/2024 23:59:00",
|
||||||
defaultDueTime: { hour: 1, minute: 59 },
|
defaultDueTime: { hour: 1, minute: 59 },
|
||||||
},
|
},
|
||||||
modules: [],
|
modules: [],
|
||||||
@@ -44,8 +44,8 @@ describe("FileStorageTests", () => {
|
|||||||
assignmentGroups: [],
|
assignmentGroups: [],
|
||||||
name: "Test Course with settings",
|
name: "Test Course with settings",
|
||||||
daysOfWeek: [DayOfWeek.Monday, DayOfWeek.Wednesday],
|
daysOfWeek: [DayOfWeek.Monday, DayOfWeek.Wednesday],
|
||||||
startDate: "09/07/2024 23:59:00",
|
startDate: "07/09/2024 23:59:00",
|
||||||
endDate: "09/07/2024 23:59:00",
|
endDate: "07/09/2024 23:59:00",
|
||||||
defaultDueTime: { hour: 1, minute: 59 },
|
defaultDueTime: { hour: 1, minute: 59 },
|
||||||
},
|
},
|
||||||
modules: [],
|
modules: [],
|
||||||
@@ -67,8 +67,8 @@ describe("FileStorageTests", () => {
|
|||||||
name: "Test Course with modules",
|
name: "Test Course with modules",
|
||||||
assignmentGroups: [],
|
assignmentGroups: [],
|
||||||
daysOfWeek: [],
|
daysOfWeek: [],
|
||||||
startDate: "09/07/2024 23:59:00",
|
startDate: "07/09/2024 23:59:00",
|
||||||
endDate: "09/07/2024 23:59:00",
|
endDate: "07/09/2024 23:59:00",
|
||||||
defaultDueTime: { hour: 1, minute: 59 },
|
defaultDueTime: { hour: 1, minute: 59 },
|
||||||
},
|
},
|
||||||
modules: [
|
modules: [
|
||||||
@@ -97,8 +97,8 @@ describe("FileStorageTests", () => {
|
|||||||
name: "Test Course with modules and assignments",
|
name: "Test Course with modules and assignments",
|
||||||
assignmentGroups: [],
|
assignmentGroups: [],
|
||||||
daysOfWeek: [],
|
daysOfWeek: [],
|
||||||
startDate: "09/07/2024 23:59:00",
|
startDate: "07/09/2024 23:59:00",
|
||||||
endDate: "09/07/2024 23:59:00",
|
endDate: "07/09/2024 23:59:00",
|
||||||
defaultDueTime: { hour: 1, minute: 59 },
|
defaultDueTime: { hour: 1, minute: 59 },
|
||||||
},
|
},
|
||||||
modules: [
|
modules: [
|
||||||
@@ -108,8 +108,8 @@ describe("FileStorageTests", () => {
|
|||||||
{
|
{
|
||||||
name: "test assignment",
|
name: "test assignment",
|
||||||
description: "here is the description",
|
description: "here is the description",
|
||||||
dueAt: "09/07/2024 23:59:00",
|
dueAt: "07/09/2024 23:59:00",
|
||||||
lockAt: "09/07/2024 23:59:00",
|
lockAt: "07/09/2024 23:59:00",
|
||||||
submissionTypes: [AssignmentSubmissionType.ONLINE_UPLOAD],
|
submissionTypes: [AssignmentSubmissionType.ONLINE_UPLOAD],
|
||||||
localAssignmentGroupName: "Final Project",
|
localAssignmentGroupName: "Final Project",
|
||||||
rubric: [
|
rubric: [
|
||||||
@@ -143,8 +143,8 @@ describe("FileStorageTests", () => {
|
|||||||
name: "Test Course with modules and quiz",
|
name: "Test Course with modules and quiz",
|
||||||
assignmentGroups: [],
|
assignmentGroups: [],
|
||||||
daysOfWeek: [],
|
daysOfWeek: [],
|
||||||
startDate: "09/07/2024 23:59:00",
|
startDate: "07/09/2024 23:59:00",
|
||||||
endDate: "09/07/2024 23:59:00",
|
endDate: "07/09/2024 23:59:00",
|
||||||
defaultDueTime: { hour: 1, minute: 59 },
|
defaultDueTime: { hour: 1, minute: 59 },
|
||||||
},
|
},
|
||||||
modules: [
|
modules: [
|
||||||
@@ -155,8 +155,8 @@ describe("FileStorageTests", () => {
|
|||||||
{
|
{
|
||||||
name: "Test Quiz",
|
name: "Test Quiz",
|
||||||
description: "quiz description",
|
description: "quiz description",
|
||||||
lockAt: "09/07/2024 12:05:00",
|
lockAt: "07/09/2024 12:05:00",
|
||||||
dueAt: "09/07/2024 12:05:00",
|
dueAt: "07/09/2024 12:05:00",
|
||||||
shuffleAnswers: true,
|
shuffleAnswers: true,
|
||||||
oneQuestionAtATime: true,
|
oneQuestionAtATime: true,
|
||||||
localAssignmentGroupName: "Assignments",
|
localAssignmentGroupName: "Assignments",
|
||||||
@@ -196,8 +196,8 @@ describe("FileStorageTests", () => {
|
|||||||
name: "Test Course with lots of data",
|
name: "Test Course with lots of data",
|
||||||
assignmentGroups: [],
|
assignmentGroups: [],
|
||||||
daysOfWeek: [DayOfWeek.Monday, DayOfWeek.Wednesday],
|
daysOfWeek: [DayOfWeek.Monday, DayOfWeek.Wednesday],
|
||||||
startDate: "09/07/2024 23:59:00",
|
startDate: "07/09/2024 23:59:00",
|
||||||
endDate: "09/07/2024 23:59:00",
|
endDate: "07/09/2024 23:59:00",
|
||||||
defaultDueTime: { hour: 1, minute: 59 },
|
defaultDueTime: { hour: 1, minute: 59 },
|
||||||
},
|
},
|
||||||
modules: [
|
modules: [
|
||||||
@@ -207,8 +207,8 @@ describe("FileStorageTests", () => {
|
|||||||
{
|
{
|
||||||
name: "test assignment",
|
name: "test assignment",
|
||||||
description: "here is the description",
|
description: "here is the description",
|
||||||
dueAt: "09/07/2024 23:59:00",
|
dueAt: "07/09/2024 23:59:00",
|
||||||
lockAt: "09/07/2024 23:59:00",
|
lockAt: "07/09/2024 23:59:00",
|
||||||
submissionTypes: [AssignmentSubmissionType.ONLINE_UPLOAD],
|
submissionTypes: [AssignmentSubmissionType.ONLINE_UPLOAD],
|
||||||
localAssignmentGroupName: "Final Project",
|
localAssignmentGroupName: "Final Project",
|
||||||
rubric: [
|
rubric: [
|
||||||
@@ -222,8 +222,8 @@ describe("FileStorageTests", () => {
|
|||||||
{
|
{
|
||||||
name: "Test Quiz",
|
name: "Test Quiz",
|
||||||
description: "quiz description",
|
description: "quiz description",
|
||||||
lockAt: "09/07/2024 23:59:00",
|
lockAt: "07/09/2024 23:59:00",
|
||||||
dueAt: "09/07/2024 23:59:00",
|
dueAt: "07/09/2024 23:59:00",
|
||||||
shuffleAnswers: true,
|
shuffleAnswers: true,
|
||||||
oneQuestionAtATime: false,
|
oneQuestionAtATime: false,
|
||||||
localAssignmentGroupName: "someId",
|
localAssignmentGroupName: "someId",
|
||||||
@@ -261,8 +261,8 @@ describe("FileStorageTests", () => {
|
|||||||
name: "Test Course with page",
|
name: "Test Course with page",
|
||||||
assignmentGroups: [],
|
assignmentGroups: [],
|
||||||
daysOfWeek: [DayOfWeek.Monday, DayOfWeek.Wednesday],
|
daysOfWeek: [DayOfWeek.Monday, DayOfWeek.Wednesday],
|
||||||
startDate: "09/07/2024 23:59:00",
|
startDate: "07/09/2024 23:59:00",
|
||||||
endDate: "09/07/2024 23:59:00",
|
endDate: "07/09/2024 23:59:00",
|
||||||
defaultDueTime: { hour: 1, minute: 59 },
|
defaultDueTime: { hour: 1, minute: 59 },
|
||||||
},
|
},
|
||||||
modules: [
|
modules: [
|
||||||
@@ -273,7 +273,7 @@ describe("FileStorageTests", () => {
|
|||||||
pages: [
|
pages: [
|
||||||
{
|
{
|
||||||
name: "test page persistence",
|
name: "test page persistence",
|
||||||
dueAt: "09/07/2024 23:59:00",
|
dueAt: "07/09/2024 23:59:00",
|
||||||
text: "this is some\n## markdown\n",
|
text: "this is some\n## markdown\n",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user