2022-09-07 01:04:11 +08:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2022 - present Instructure, Inc.
|
|
|
|
*
|
|
|
|
* This file is part of Canvas.
|
|
|
|
*
|
|
|
|
* Canvas is free software: you can redistribute it and/or modify it under
|
|
|
|
* the terms of the GNU Affero General Public License as published by the Free
|
|
|
|
* Software Foundation, version 3 of the License.
|
|
|
|
*
|
|
|
|
* Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
|
|
* A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
|
|
|
* details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Affero General Public License along
|
|
|
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
export type Course = {
|
|
|
|
id: string
|
|
|
|
}
|
|
|
|
|
|
|
|
export type Enrollment = {
|
|
|
|
course_section_id: string
|
|
|
|
type: string
|
|
|
|
grades: {
|
|
|
|
html_url: string
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export type Student = {
|
|
|
|
id: string
|
|
|
|
name: string
|
|
|
|
displayName: string
|
|
|
|
sortable_name: string
|
|
|
|
avatar_url: string
|
|
|
|
enrollments: Enrollment[]
|
|
|
|
loaded: boolean
|
|
|
|
initialized: boolean
|
|
|
|
isConcluded: boolean
|
|
|
|
total_grade: number
|
|
|
|
} & {
|
|
|
|
// computed values
|
|
|
|
computed_current_score: number
|
|
|
|
computed_final_score: number
|
|
|
|
isInactive: boolean
|
|
|
|
cssClass: string
|
|
|
|
sections: string[]
|
|
|
|
}
|
|
|
|
|
|
|
|
export type StudentMap = {
|
|
|
|
[id: string]: Student
|
|
|
|
}
|
|
|
|
|
|
|
|
export type StudentGroup = Partial<
|
|
|
|
{
|
|
|
|
avatar_url: null | string
|
|
|
|
concluded: boolean
|
|
|
|
context_type: string
|
|
|
|
course_id: string
|
|
|
|
created_at: string
|
|
|
|
description: null | string
|
|
|
|
group_category_id: string
|
|
|
|
has_submission: boolean
|
|
|
|
id: string
|
|
|
|
is_public: boolean
|
|
|
|
join_level: string
|
|
|
|
leader: null | string
|
|
|
|
max_membership: null | string
|
|
|
|
members_count: string
|
|
|
|
name: string
|
|
|
|
role: null | string
|
|
|
|
sis_group_id: null | string
|
|
|
|
sis_import_id: null | string
|
|
|
|
storage_quota_mb: string
|
|
|
|
},
|
|
|
|
'id' | 'name'
|
|
|
|
>
|
|
|
|
|
2022-09-13 05:27:16 +08:00
|
|
|
export type StudentGroupCategory = {
|
|
|
|
allows_multiple_memberships: boolean
|
|
|
|
auto_leader: null | string
|
|
|
|
context_type: string
|
|
|
|
course_id: string
|
|
|
|
created_at: string
|
|
|
|
group_limit: null
|
|
|
|
groups: StudentGroup[]
|
|
|
|
id: string
|
|
|
|
is_member: boolean
|
|
|
|
name: string
|
|
|
|
protected: boolean
|
|
|
|
role: null | string
|
|
|
|
self_signup: null | string
|
|
|
|
sis_group_category_id: null | string
|
|
|
|
sis_import_id: null | string
|
|
|
|
}
|
2022-09-07 01:04:11 +08:00
|
|
|
|
|
|
|
export type StudentGroupMap = {
|
|
|
|
[id: string]: StudentGroup
|
|
|
|
}
|
|
|
|
|
|
|
|
export type StudentGroupCategoryMap = {
|
|
|
|
[id: string]: StudentGroupCategory
|
|
|
|
}
|
|
|
|
|
2022-09-10 06:25:04 +08:00
|
|
|
export type DueDate = {
|
|
|
|
due_at: string | null
|
2022-09-07 01:04:11 +08:00
|
|
|
grading_period_id: string | null
|
|
|
|
in_closed_grading_period: boolean
|
|
|
|
}
|
|
|
|
|
2022-09-10 06:25:04 +08:00
|
|
|
export type UserDueDateMap = {
|
|
|
|
[user_id: string]: DueDate
|
2022-09-07 01:04:11 +08:00
|
|
|
}
|
|
|
|
|
2022-09-10 06:25:04 +08:00
|
|
|
export type AssignmentUserDueDateMap = {
|
|
|
|
[assignment_id: string]: UserDueDateMap
|
|
|
|
}
|
|
|
|
|
|
|
|
export type Override = {
|
|
|
|
title: string
|
|
|
|
id: string
|
|
|
|
due_at: string | null
|
|
|
|
course_section_id: string | null
|
2022-09-07 01:04:11 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export type Assignment = {
|
2022-09-10 06:25:04 +08:00
|
|
|
anonymous_grading: boolean
|
2022-09-07 01:04:11 +08:00
|
|
|
anonymize_students: boolean
|
2022-09-10 01:34:46 +08:00
|
|
|
anonymous_peer_reviews?: boolean
|
|
|
|
assessment_requests: AssessmentRequest[]
|
2022-09-07 01:04:11 +08:00
|
|
|
assignment_group_id: string
|
2022-09-10 04:42:21 +08:00
|
|
|
assignment_group_position: number
|
2022-09-07 01:04:11 +08:00
|
|
|
assignment_id: string
|
|
|
|
assignment_visibility: string[]
|
2022-09-10 06:25:04 +08:00
|
|
|
effectiveDueDates: UserDueDateMap
|
|
|
|
grades_published: boolean
|
2022-09-07 01:04:11 +08:00
|
|
|
grading_standard_id: string | null
|
|
|
|
grading_type: string
|
|
|
|
hasDownloadedSubmissions: boolean
|
|
|
|
hidden: boolean
|
|
|
|
id: string
|
|
|
|
inClosedGradingPeriod: boolean
|
2022-09-10 06:25:04 +08:00
|
|
|
moderated_grading: boolean
|
2022-09-07 01:04:11 +08:00
|
|
|
module_ids: string[]
|
|
|
|
name: string
|
|
|
|
omit_from_final_grade: boolean
|
|
|
|
only_visible_to_overrides: boolean
|
2022-09-10 06:25:04 +08:00
|
|
|
overrides: Override[]
|
2022-09-07 01:04:11 +08:00
|
|
|
points_possible: number
|
2022-09-10 06:25:04 +08:00
|
|
|
position: number
|
|
|
|
post_manually: boolean
|
2022-09-07 01:04:11 +08:00
|
|
|
published: boolean
|
|
|
|
submission_types: string
|
|
|
|
user_id: string
|
|
|
|
}
|
|
|
|
|
|
|
|
export type AssignmentMap = {
|
|
|
|
[id: string]: Assignment
|
|
|
|
}
|
|
|
|
|
|
|
|
export type AssignmentGroup = {
|
|
|
|
id: string
|
|
|
|
name: string
|
|
|
|
position: number
|
|
|
|
group_weight: number
|
|
|
|
assignments: Assignment[]
|
|
|
|
}
|
|
|
|
|
|
|
|
export type AssignmentGroupMap = {
|
|
|
|
[id: string]: AssignmentGroup
|
|
|
|
}
|
|
|
|
|
2022-09-10 01:34:46 +08:00
|
|
|
export type AssessmentRequest = {
|
|
|
|
anonymous_id?: string
|
|
|
|
user_id?: string
|
|
|
|
user_name?: string
|
|
|
|
available: boolean
|
|
|
|
}
|
|
|
|
|
2022-09-07 01:04:11 +08:00
|
|
|
export type AttachmentData = {
|
|
|
|
attachment: Attachment
|
|
|
|
}
|
|
|
|
|
|
|
|
export type Attachment = {
|
|
|
|
id: string
|
|
|
|
updated_at: string
|
|
|
|
created_at: string
|
|
|
|
}
|
|
|
|
|
|
|
|
export type Module = {
|
|
|
|
id: string
|
|
|
|
name: string
|
|
|
|
position: number
|
|
|
|
}
|
|
|
|
|
2022-09-10 06:25:04 +08:00
|
|
|
export type ModuleMap = {
|
|
|
|
[id: string]: Module
|
|
|
|
}
|
|
|
|
|
2022-09-07 01:04:11 +08:00
|
|
|
export type Section = {
|
|
|
|
id: string
|
|
|
|
name: string
|
|
|
|
}
|
|
|
|
|
|
|
|
export type SectionMap = {
|
|
|
|
[id: string]: Section
|
|
|
|
}
|
|
|
|
|
|
|
|
export type GradingType = 'points' | 'percent' | 'letter_grade' | 'gpa_scale' | 'pass_fail'
|
|
|
|
|
|
|
|
export type SubmissionType =
|
|
|
|
| null
|
|
|
|
| 'basic_lti_launch'
|
|
|
|
| 'discussion_topic'
|
|
|
|
| 'external_tool'
|
|
|
|
| 'media_recording'
|
|
|
|
| 'on_paper'
|
|
|
|
| 'online_quiz'
|
|
|
|
| 'online_text_entry'
|
|
|
|
| 'online_upload'
|
|
|
|
| 'online_url'
|
|
|
|
| 'wiki_page'
|
|
|
|
|
|
|
|
export type WorkflowState =
|
|
|
|
| 'assigned'
|
|
|
|
| 'complete'
|
|
|
|
| 'deleted'
|
|
|
|
| 'graded'
|
|
|
|
| 'not_graded'
|
|
|
|
| 'settings_only'
|
|
|
|
| 'pending_review'
|
|
|
|
| 'submitted'
|
|
|
|
| 'unsubmitted'
|
|
|
|
| 'untaken'
|
|
|
|
|
|
|
|
export type Submission = {
|
|
|
|
anonymous_id: string
|
|
|
|
assignment_id: string
|
|
|
|
assignment_visible?: boolean
|
|
|
|
attempt: number | null
|
|
|
|
cached_due_date: null | string
|
|
|
|
drop?: boolean
|
|
|
|
entered_grade: null | string
|
|
|
|
entered_score: null | number
|
|
|
|
excused: boolean
|
|
|
|
grade_matches_current_submission: boolean
|
|
|
|
grade: string | null
|
|
|
|
gradeLocked: boolean
|
|
|
|
grading_period_id: string
|
|
|
|
gradingType: GradingType
|
|
|
|
has_postable_comments: boolean
|
|
|
|
hidden: boolean
|
|
|
|
id: string
|
|
|
|
late_policy_status: null | string
|
|
|
|
late: boolean
|
|
|
|
missing: boolean
|
|
|
|
points_deducted: null | number
|
|
|
|
posted_at: null | Date
|
|
|
|
rawGrade: string | null
|
|
|
|
redo_request: boolean
|
|
|
|
score: null | number
|
|
|
|
seconds_late: number
|
|
|
|
submission_type: SubmissionType
|
|
|
|
submitted_at: null | Date
|
|
|
|
url: null | string
|
|
|
|
user_id: string
|
|
|
|
workflow_state: WorkflowState
|
|
|
|
}
|
|
|
|
|
|
|
|
export type UserSubmissionGroup = {
|
|
|
|
user_id: string
|
|
|
|
submissions: Submission[]
|
|
|
|
}
|
|
|
|
|
|
|
|
export type SubmissionCommentData = {
|
|
|
|
group_comment: 1 | 0
|
|
|
|
text_comment: string
|
|
|
|
attempt?: number
|
|
|
|
}
|
2022-09-10 06:25:04 +08:00
|
|
|
|
|
|
|
export type GradingPeriod = {
|
|
|
|
id: string
|
|
|
|
title: string
|
|
|
|
startDate: Date
|
|
|
|
endDate: Date
|
|
|
|
isClosed: boolean
|
|
|
|
}
|
|
|
|
|
|
|
|
export type GradingPeriodSet = {
|
|
|
|
gradingPeriods: GradingPeriod[]
|
|
|
|
displayTotalsForAllGradingPeriods: boolean
|
|
|
|
weighted: boolean
|
|
|
|
}
|