-
Notifications
You must be signed in to change notification settings - Fork 530
Expand file tree
/
Copy pathprogressTypes.ts
More file actions
153 lines (139 loc) · 3.62 KB
/
Copy pathprogressTypes.ts
File metadata and controls
153 lines (139 loc) · 3.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
// Typescript definitions for types relating to progress. Note that many
// of these are "duplicated" by `/templates/progress/progressTypes, which defined
// these using PropTypes for usage in Javascript React components. As we move towards
// typescript we can deprecate the PropTypes definitions and use these instead.
/**
* See ApplicationHelper::PUZZLE_PAGE_NONE.
*/
export const PUZZLE_PAGE_NONE = -1;
export type LessonBackground = 'light' | 'dark' | null;
export interface Lesson {
assessment: boolean;
description_student: string;
description_teacher: string;
hasLessonPlan: boolean;
id: number;
key: string;
lessonEditPath: string;
lessonNumber: number | undefined;
lessonStartUrl: string;
lesson_extras_level_url: string;
lesson_group_display_name: string;
levels: Level[];
lockable: boolean;
name: string;
num_script_lessons: number;
numberedLesson: boolean;
position: number;
relative_position: number;
script_id: number;
script_name: string;
title: string;
unplugged: boolean | null;
background: LessonBackground;
}
export interface LessonGroup {
big_questions: string | null;
description: string | null;
display_name: string;
id: number;
key: string;
position: number;
user_facing: boolean;
}
export interface Level {
activeId: string;
app: string;
bonus: boolean;
display_as_unplugged: boolean;
freePlay: boolean;
icon: string | null;
id: string;
ids: string[];
inactiveIds: string[];
is_concept_level: boolean;
kind: string;
levelNumber: number;
position: number;
title: number;
url: string;
path: string;
scriptLevelId: string;
status?: string;
sublevels?: Level[];
usesLab2: boolean;
parentLevelId?: string;
}
export interface LevelWithProgress extends Level {
status: string;
paired?: boolean;
isLocked?: boolean;
isCurrentLevel?: boolean;
sublevels?: LevelWithProgress[];
}
export interface UnitProgress {
lastTimestamp: number | undefined;
locked: boolean;
pages: UnitProgress[] | null;
paired: boolean;
result: number;
status: string;
teacherFeedbackReviewState: keyof typeof ReviewStates | undefined;
teacherFeedbackNew: boolean;
timeSpent: number | undefined;
}
export interface PeerReviewLessonInfo {
name: string;
lesson_group_display_name: string;
levels: PeerReviewLevelInfo[];
lockable: boolean;
}
export interface PeerReviewLevelInfo {
id: number;
kind: string;
title: string;
url: string;
name: string;
icon: string;
locked: boolean;
status?: string;
}
export interface PeerReviewSummary {
status: string;
name: string;
result: string;
icon: string;
locked: boolean;
}
export const ReviewStates = {
completed: 'completed',
keepWorking: 'keepWorking',
awaitingReview: 'awaitingReview',
};
export interface InitProgressPayload {
currentLevelId: string | null;
deeperLearningCourse: boolean;
saveAnswersBeforeNavigation: boolean | null;
lessons: Lesson[];
lessonGroups: LessonGroup[] | null;
scriptId: number | null;
scriptName: string | null;
scriptDisplayName: string | undefined;
unitTitle: string | null;
unitDescription: string | undefined;
unitStudentDescription: string | undefined;
unitHasUnnumberedLessons: boolean;
courseId: number | null;
courseVersionId: number | undefined;
isLessonExtras: boolean;
peerReviewLessonInfo: PeerReviewLessonInfo | null;
isFullProgress: boolean;
currentPageNumber: number;
courseName: string | null;
}
// LevelResults is a map of levelId -> TestResult. TestResult is a number.
export type LevelResults = {[key: number]: number};
export const ViewType = {
Participant: 'Participant',
Instructor: 'Instructor',
};