working pages and app router

This commit is contained in:
2024-09-07 08:52:03 -06:00
parent 3c86d3be88
commit 5b610e2777
135 changed files with 16129 additions and 4 deletions

View File

@@ -0,0 +1,82 @@
import { CanvasDiscussionTopicModel } from "../discussions/canvasDiscussionModelTopic";
import { CanvasSubmissionModel } from "../submissions/canvasSubmissionModel";
import { CanvasAssignmentDate } from "./canvasAssignmentDate";
import { CanvasAssignmentOverride } from "./canvasAssignmentOverride";
import { CanvasExternalToolTagAttributes } from "./canvasExternalToolTagAttributes";
import { CanvasLockInfo } from "./canvasLockInfo";
import { CanvasRubricCriteria } from "./canvasRubricCriteria";
import { CanvasTurnitinSettings } from "./canvasTurnitinSettings";
export interface CanvasAssignment {
id: number;
name: string;
description: string;
created_at: string; // ISO 8601 date string
has_overrides: boolean;
course_id: number;
html_url: string;
submissions_download_url: string;
assignment_group_id: number;
due_date_required: boolean;
max_name_length: number;
peer_reviews: boolean;
automatic_peer_reviews: boolean;
position: number;
grading_type: string;
published: boolean;
unpublishable: boolean;
only_visible_to_overrides: boolean;
locked_for_user: boolean;
moderated_grading: boolean;
grader_count: number;
allowed_attempts: number;
is_quiz_assignment: boolean;
submission_types: string[];
updated_at?: string; // ISO 8601 date string
due_at?: string; // ISO 8601 date string
lock_at?: string; // ISO 8601 date string
unlock_at?: string; // ISO 8601 date string
all_dates?: CanvasAssignmentDate[];
allowed_extensions?: string[];
turnitin_enabled?: boolean;
vericite_enabled?: boolean;
turnitin_settings?: CanvasTurnitinSettings;
grade_group_students_individually?: boolean;
external_tool_tag_attributes?: CanvasExternalToolTagAttributes;
peer_review_count?: number;
peer_reviews_assign_at?: string; // ISO 8601 date string
intra_group_peer_reviews?: boolean;
group_category_id?: number;
needs_grading_count?: number;
needs_grading_count_by_section?: {
section_id: string;
needs_grading_count: number;
}[];
post_to_sis?: boolean;
integration_id?: string;
integration_data?: any;
muted?: boolean;
points_possible?: number;
has_submitted_submissions?: boolean;
grading_standard_id?: number;
lock_info?: CanvasLockInfo;
lock_explanation?: string;
quiz_id?: number;
anonymous_submissions?: boolean;
discussion_topic?: CanvasDiscussionTopicModel;
freeze_on_copy?: boolean;
frozen?: boolean;
frozen_attributes?: string[];
submission?: CanvasSubmissionModel;
use_rubric_for_grading?: boolean;
rubric_settings?: any;
rubric?: CanvasRubricCriteria[];
assignment_visibility?: number[];
overrides?: CanvasAssignmentOverride[];
omit_from_final_grade?: boolean;
final_grader_id?: number;
grader_comments_visible_to_graders?: boolean;
graders_anonymous_to_graders?: boolean;
grader_names_visible_to_final_grader?: boolean;
anonymous_grading?: boolean;
}

View File

@@ -0,0 +1,8 @@
export interface CanvasAssignmentDate {
title: string;
id?: number;
base?: boolean;
due_at?: string; // ISO 8601 date string
unlock_at?: string; // ISO 8601 date string
lock_at?: string; // ISO 8601 date string
}

View File

@@ -0,0 +1,13 @@
export interface CanvasAssignmentOverride {
id: number;
assignment_id: number;
course_section_id: number;
title: string;
student_ids?: number[];
group_id?: number;
due_at?: string; // ISO 8601 date string
all_day?: boolean;
all_day_date?: string; // ISO 8601 date string
unlock_at?: string; // ISO 8601 date string
lock_at?: string; // ISO 8601 date string
}

View File

@@ -0,0 +1,5 @@
export interface CanvasExternalToolTagAttributes {
url: string;
resource_link_id: string;
new_tab?: boolean;
}

View File

@@ -0,0 +1,7 @@
export interface CanvasLockInfo {
asset_string: string;
unlock_at?: string; // ISO 8601 date string
lock_at?: string; // ISO 8601 date string
context_module?: any;
manually_locked?: boolean;
}

View File

@@ -0,0 +1,13 @@
export interface CanvasRubric {
id?: number;
title: string;
context_id: number;
context_type: string;
points_possible: number;
reusable: boolean;
read_only: boolean;
hide_score_total?: boolean;
// Uncomment and define if needed
// data: CanvasRubricCriteria[];
// free_form_criterion_comments?: boolean;
}

View File

@@ -0,0 +1,12 @@
export interface CanvasRubricAssociation {
id: number;
rubric_id: number;
association_id: number;
association_type: string;
use_for_grading: boolean;
summary_data?: string;
purpose: string;
hide_score_total?: boolean;
hide_points: boolean;
hide_outcome_results: boolean;
}

View File

@@ -0,0 +1,16 @@
export interface CanvasRubricCriteria {
id: string;
description: string;
long_description: string;
points?: number;
learning_outcome_id?: string;
vendor_guid?: string;
criterion_use_range?: boolean;
ratings?: {
points: number;
id: string;
description: string;
long_description: string;
}[];
ignore_for_scoring?: boolean;
}

View File

@@ -0,0 +1,10 @@
export interface CanvasTurnitinSettings {
originality_report_visibility: string;
s_paper_check: boolean;
internet_check: boolean;
journal_check: boolean;
exclude_biblio: boolean;
exclude_quoted: boolean;
exclude_small_matches_type?: boolean;
exclude_small_matches_value?: number;
}

View File

@@ -0,0 +1,3 @@
export interface CanvasCalendarLinkModel {
ics: string;
}

View File

@@ -0,0 +1,56 @@
import { CanvasEnrollmentModel } from "../enrollments/canvasEnrollmentModel";
import { CanvasCalendarLinkModel } from "./canvasCalendarLinkModel";
import { CanvasCourseProgressModel } from "./canvasCourseProgressModel";
import { CanvasTermModel } from "./canvasTermModel";
export interface CanvasCourseModel {
id: number;
sis_course_id: string;
uuid: string;
integration_id: string;
name: string;
course_code: string;
workflow_state: string;
account_id: number;
root_account_id: number;
enrollment_term_id: number;
created_at: string; // ISO 8601 date string
locale: string;
calendar: CanvasCalendarLinkModel;
default_view: string;
syllabus_body: string;
permissions: { [key: string]: boolean };
storage_quota_mb: number;
storage_quota_used_mb: number;
license: string;
course_format: string;
time_zone: string;
sis_import_id?: number;
grading_standard_id?: number;
start_at?: string; // ISO 8601 date string
end_at?: string; // ISO 8601 date string
enrollments?: CanvasEnrollmentModel[];
total_students?: number;
needs_grading_count?: number;
term?: CanvasTermModel;
course_progress?: CanvasCourseProgressModel;
apply_assignment_group_weights?: boolean;
is_public?: boolean;
is_public_to_auth_users?: boolean;
public_syllabus?: boolean;
public_syllabus_to_auth?: boolean;
public_description?: string;
hide_final_grades?: boolean;
allow_student_assignment_edits?: boolean;
allow_wiki_comments?: boolean;
allow_student_forum_attachments?: boolean;
open_enrollment?: boolean;
self_enrollment?: boolean;
restrict_enrollments_to_course_dates?: boolean;
access_restricted_by_date?: boolean;
blueprint?: boolean;
blueprint_restrictions?: { [key: string]: boolean };
blueprint_restrictions_by_object_type?: {
[key: string]: { [key: string]: boolean };
};
}

View File

@@ -0,0 +1,6 @@
export interface CanvasCourseProgressModel {
requirement_count?: number;
requirement_completed_count?: number;
next_requirement_url?: string;
completed_at?: string; // ISO 8601 date string
}

View File

@@ -0,0 +1,16 @@
export interface CanvasCourseSettingsModel {
allow_final_grade_override: boolean;
allow_student_discussion_topics: boolean;
allow_student_forum_attachments: boolean;
allow_student_discussion_editing: boolean;
grading_standard_enabled: boolean;
allow_student_organized_groups: boolean;
hide_final_grades: boolean;
hide_distribution_graphs: boolean;
lock_all_announcements: boolean;
restrict_student_past_view: boolean;
restrict_student_future_view: boolean;
show_announcements_on_home_page: boolean;
home_page_announcement_limit: number;
grading_standard_id?: number;
}

View File

@@ -0,0 +1,6 @@
export interface CanvasTermModel {
id: number;
name: string;
start_at?: string; // ISO 8601 date string
end_at?: string; // ISO 8601 date string
}

View File

@@ -0,0 +1,40 @@
import { CanvasUserDisplayModel } from "../users/userDisplayModel";
import { CanvasFileAttachmentModel } from "./canvasFileAttachmentModel";
export interface CanvasDiscussionTopicModel {
id: number;
title: string;
message: string;
html_url: string;
read_state: string;
subscription_hold: string;
assignment_id: number;
lock_explanation: string;
user_name: string;
topic_children: number[];
podcast_url: string;
discussion_type: string;
attachments: CanvasFileAttachmentModel[];
permissions: { [key: string]: boolean };
author: CanvasUserDisplayModel;
unread_count?: number;
subscribed?: boolean;
posted_at?: string; // ISO 8601 date string
last_reply_at?: string; // ISO 8601 date string
require_initial_post?: boolean;
user_can_see_posts?: boolean;
discussion_subentry_count?: number;
delayed_post_at?: string; // ISO 8601 date string
published?: boolean;
lock_at?: string; // ISO 8601 date string
locked?: boolean;
pinned?: boolean;
locked_for_user?: boolean;
lock_info?: any;
group_topic_children?: any;
root_topic_id?: number;
group_category_id?: number;
allow_rating?: boolean;
only_graders_can_rate?: boolean;
sort_by_rating?: boolean;
}

View File

@@ -0,0 +1,6 @@
export interface CanvasFileAttachmentModel {
content_type: string;
url: string;
filename: string;
display_name: string;
}

View File

@@ -0,0 +1,16 @@
export interface CanvasEnrollmentTermModel {
id: number;
name: string;
sis_term_id?: string;
sis_import_id?: number;
start_at?: string; // ISO 8601 date string
end_at?: string; // ISO 8601 date string
grading_period_group_id?: number;
workflow_state?: string;
overrides?: {
[key: string]: {
start_at?: string; // ISO 8601 date string
end_at?: string; // ISO 8601 date string
};
};
}

View File

@@ -0,0 +1,48 @@
import { CanvasUserDisplayModel } from "../users/userDisplayModel";
import { CanvasGradeModel } from "./canvasGradeModel";
export interface CanvasEnrollmentModel {
id: number;
course_id: number;
enrollment_state: string;
type: string;
user_id: number;
role: string;
role_id: number;
html_url: string;
grades: CanvasGradeModel;
user: CanvasUserDisplayModel;
override_grade: string;
sis_course_id?: string;
course_integration_id?: string;
course_section_id?: number;
section_integration_id?: string;
sis_account_id?: string;
sis_section_id?: string;
sis_user_id?: string;
limit_privileges_to_course_section?: boolean;
sis_import_id?: number;
root_account_id?: number;
associated_user_id?: number;
created_at?: string; // ISO 8601 date string
updated_at?: string; // ISO 8601 date string
start_at?: string; // ISO 8601 date string
end_at?: string; // ISO 8601 date string
last_activity_at?: string; // ISO 8601 date string
last_attended_at?: string; // ISO 8601 date string
total_activity_time?: number;
override_score?: number;
unposted_current_grade?: string;
unposted_final_grade?: string;
unposted_current_score?: string;
unposted_final_score?: string;
has_grading_periods?: boolean;
totals_for_all_grading_periods_option?: boolean;
current_grading_period_title?: string;
current_grading_period_id?: number;
current_period_override_grade?: string;
current_period_override_score?: number;
current_period_unposted_final_score?: number;
current_period_unposted_current_grade?: string;
current_period_unposted_final_grade?: string;
}

View File

@@ -0,0 +1,11 @@
export interface CanvasGradeModel {
html_url?: string;
current_grade?: number;
final_grade?: number;
current_score?: number;
final_score?: number;
unposted_current_grade?: number;
unposted_final_grade?: number;
unposted_current_score?: number;
unposted_final_score?: number;
}

View File

@@ -0,0 +1,18 @@
import { CanvasModuleItem } from "./canvasModuleItems";
export interface CanvasModule {
id: number;
workflow_state: string;
position: number;
name: string;
unlock_at?: string; // ISO 8601 date string
require_sequential_progress?: boolean;
prerequisite_module_ids?: number[];
items_count: number;
items_url: string;
items?: CanvasModuleItem[];
state?: string;
completed_at?: string; // ISO 8601 date string
publish_final_grade?: boolean;
published?: boolean;
}

View File

@@ -0,0 +1,26 @@
export interface CanvasModuleItem {
id: number;
module_id: number;
position: number;
title: string;
indent?: number;
type: string;
content_id?: number;
html_url: string;
url?: string;
page_url?: string;
external_url?: string;
new_tab: boolean;
completion_requirement?: {
type: string;
min_score?: number;
completed?: boolean;
};
published?: boolean;
content_details?: {
due_at?: string; // ISO 8601 date string
lock_at?: string; // ISO 8601 date string
points_possible: number;
locked_for_user: boolean;
};
}

View File

@@ -0,0 +1,16 @@
export interface CanvasPage {
page_id: number;
url: string;
title: string;
published: boolean;
front_page: boolean;
body?: string;
// Uncomment and define if needed
// created_at: string; // ISO 8601 date string
// updated_at: string; // ISO 8601 date string
// editing_roles: string;
// last_edited_by: UserDisplayModel;
// locked_for_user: boolean;
// lock_info?: LockInfoModel;
// lock_explanation?: string;
}

View File

@@ -0,0 +1,44 @@
import { CanvasLockInfo } from "../assignments/canvasLockInfo";
import { CanvasQuizPermissions } from "./canvasQuizPermission";
export interface CanvasQuiz {
id: number;
title: string;
html_url: string;
mobile_url: string;
preview_url?: string;
description: string;
quiz_type: string;
assignment_group_id?: number;
time_limit?: number;
shuffle_answers?: boolean;
hide_results?: string;
show_correct_answers?: boolean;
show_correct_answers_last_attempt?: boolean;
show_correct_answers_at?: string; // ISO 8601 date string
hide_correct_answers_at?: string; // ISO 8601 date string
one_time_results?: boolean;
scoring_policy?: string;
allowed_attempts: number;
one_question_at_a_time?: boolean;
question_count?: number;
points_possible?: number;
cant_go_back?: boolean;
access_code?: string;
ip_filter?: string;
due_at?: string; // ISO 8601 date string
lock_at?: string; // ISO 8601 date string
unlock_at?: string; // ISO 8601 date string
published?: boolean;
unpublishable?: boolean;
locked_for_user?: boolean;
lock_info?: CanvasLockInfo;
lock_explanation?: string;
speedgrader_url?: string;
quiz_extensions_url?: string;
permissions: CanvasQuizPermissions;
all_dates?: any; // Depending on the structure of the dates, this could be further specified
version_number?: number;
question_types?: string[];
anonymous_submissions?: boolean;
}

View File

@@ -0,0 +1,9 @@
export interface CanvasQuizPermissions {
read: boolean;
submit: boolean;
create: boolean;
manage: boolean;
read_statistics: boolean;
review_grades: boolean;
update: boolean;
}

View File

@@ -0,0 +1,50 @@
import { CanvasAssignment } from "../assignments/canvasAssignment";
import { CanvasCourseModel } from "../courses/canvasCourseModel";
import { CanvasUserModel } from "../users/canvasUserModel";
import { CanvasUserDisplayModel } from "../users/userDisplayModel";
export interface CanvasSubmissionModel {
assignment_id: number;
grade: string;
html_url: string;
preview_url: string;
submission_type: string;
user_id: number;
user: CanvasUserModel;
workflow_state: string;
late_policy_status: string;
assignment?: CanvasAssignment;
course?: CanvasCourseModel;
attempt?: number;
body?: string;
grade_matches_current_submission?: boolean;
score?: number;
submission_comments?: {
id: number;
author_id: number;
author_name: string;
author: CanvasUserDisplayModel;
comment: string;
created_at: string; // ISO 8601 date string
edited_at?: string; // ISO 8601 date string
media_comment?: {
content_type: string;
display_name: string;
media_id: string;
media_type: string;
url: string;
};
}[];
submitted_at?: string; // ISO 8601 date string
url?: string;
grader_id?: number;
graded_at?: string; // ISO 8601 date string
late?: boolean;
assignment_visible?: boolean;
excused?: boolean;
missing?: boolean;
points_deducted?: number;
seconds_late?: number;
extra_attempts?: number;
anonymous_id?: string;
}

View File

@@ -0,0 +1,21 @@
import { CanvasEnrollmentModel } from "../enrollments/canvasEnrollmentModel";
export interface CanvasUserModel {
id: number;
name: string;
sortable_name: string;
short_name: string;
sis_user_id: string;
integration_id: string;
login_id: string;
avatar_url: string;
enrollments: CanvasEnrollmentModel[];
email: string;
locale: string;
effective_locale: string;
time_zone: string;
bio: string;
permissions: { [key: string]: boolean };
sis_import_id?: number;
last_login?: string; // ISO 8601 date string
}

View File

@@ -0,0 +1,9 @@
export interface CanvasUserDisplayModel {
avatar_image_url: string;
html_url: string;
anonymous_id: string;
id?: number;
short_name?: string;
display_name?: string;
pronouns?: string;
}