@speakableio/core 0.1.64 → 0.1.66

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,7 +3,7 @@ import React from 'react';
3
3
  import * as _tanstack_react_query from '@tanstack/react-query';
4
4
  import { QueryClient } from '@tanstack/react-query';
5
5
  import { FirebaseFirestoreTypes, Timestamp } from '@react-native-firebase/firestore';
6
- import { Firestore, getDoc, getDocs, addDoc, setDoc, updateDoc, deleteDoc, runTransaction, writeBatch, doc, collection, query, serverTimestamp, orderBy, limit, startAt, startAfter, endAt, endBefore, where, Timestamp as Timestamp$1, FieldValue } from 'firebase/firestore';
6
+ import { Firestore, getDoc, getDocs, addDoc, setDoc, updateDoc, deleteDoc, runTransaction, writeBatch, doc, collection, query, serverTimestamp, orderBy, limit, startAt, startAfter, endAt, endBefore, where, increment, Timestamp as Timestamp$1, FieldValue } from 'firebase/firestore';
7
7
 
8
8
  type FirebaseInstance = FirebaseFirestoreTypes.Module | Firestore;
9
9
  interface FirestoreHelpers {
@@ -26,10 +26,358 @@ interface FirestoreHelpers {
26
26
  endAt: typeof endAt;
27
27
  endBefore: typeof endBefore;
28
28
  where: typeof where;
29
+ increment: typeof increment;
29
30
  }
30
31
  type CustomTimestamp = Timestamp | Timestamp$1;
31
32
  type CallableFunction<T = any, R = any> = (data: T) => Promise<R>;
32
33
 
34
+ declare const enum FeedbackTypesCard {
35
+ SuggestedResponse = "suggested_response",
36
+ Wida = "wida",
37
+ GrammarInsights = "grammar_insights",
38
+ Actfl = "actfl",
39
+ ProficiencyLevel = "proficiency_level"
40
+ }
41
+ declare const enum LeniencyCard {
42
+ CONFIDENCE = "confidence",
43
+ EASY = "easy",
44
+ NORMAL = "normal",
45
+ HARD = "hard"
46
+ }
47
+ declare const LENIENCY_OPTIONS: {
48
+ label: string;
49
+ value: LeniencyCard;
50
+ }[];
51
+ declare const STUDENT_LEVELS_OPTIONS: {
52
+ label: string;
53
+ description: string;
54
+ value: string;
55
+ }[];
56
+ declare const BASE_RESPOND_FIELD_VALUES: {
57
+ title: string;
58
+ allowRetries: boolean;
59
+ respondTime: number;
60
+ maxCharacters: number;
61
+ };
62
+ declare const BASE_REPEAT_FIELD_VALUES: {
63
+ repeat: number;
64
+ };
65
+ declare const BASE_MULTIPLE_CHOICE_FIELD_VALUES: {
66
+ MCQType: string;
67
+ answer: string[];
68
+ choices: {
69
+ option: string;
70
+ value: string;
71
+ }[];
72
+ };
73
+ declare const enum VerificationCardStatus {
74
+ VERIFIED = "VERIFIED",
75
+ WARNING = "WARNING",
76
+ NOT_RECOMMENDED = "NOT_RECOMMENDED",
77
+ NOT_WORKING = "NOT_WORKING",
78
+ NOT_CHECKED = "NOT_CHECKED"
79
+ }
80
+ declare const CARDS_COLLECTION = "flashcards";
81
+ type RefsCardsFiresotre = `${typeof CARDS_COLLECTION}/${string}`;
82
+ declare const refsCardsFiresotre: {
83
+ allCards: string;
84
+ card: (id: string) => `flashcards/${string}`;
85
+ };
86
+
87
+ interface PageActivityWithId extends PageActivity {
88
+ id: string;
89
+ }
90
+ interface PageActivity {
91
+ owners: string[];
92
+ checked?: boolean;
93
+ completed?: boolean;
94
+ media_area_id?: string | null;
95
+ media_area_layout?: 'left' | 'right' | null;
96
+ score?: number;
97
+ verificationStatus?: VerificationCardStatus;
98
+ native_text?: string;
99
+ repeat?: number;
100
+ language?: string | null;
101
+ image?: {
102
+ path?: string | null;
103
+ url?: string;
104
+ };
105
+ audio?: {
106
+ path?: string | null;
107
+ url?: string;
108
+ } | null;
109
+ notes?: string;
110
+ difficulty?: string;
111
+ default_language?: string;
112
+ target_text?: string;
113
+ type: ActivityPageType;
114
+ grading_criteria?: string;
115
+ scoring_type?: string;
116
+ grading_method?: 'simple' | 'rubric' | 'manual' | 'standards_based';
117
+ feedback_types?: string[];
118
+ rubricId?: string;
119
+ prompt?: string;
120
+ title?: string;
121
+ passing_score?: number;
122
+ maxCharacters?: number;
123
+ answer?: string[];
124
+ choices?: {
125
+ value: string;
126
+ option: string;
127
+ }[];
128
+ MCQType?: string;
129
+ multipleAttemptsAllowed?: boolean;
130
+ allowRetries?: boolean;
131
+ question?: string;
132
+ respondTime?: number;
133
+ hidePrompt?: boolean;
134
+ videoUrl?: string;
135
+ link?: string;
136
+ text?: string;
137
+ isListenAloud?: boolean;
138
+ embedCode?: string;
139
+ attempt?: number;
140
+ correct?: number;
141
+ autoGrade?: boolean;
142
+ points?: number;
143
+ shuffle?: boolean;
144
+ translation?: string;
145
+ includeAIContext?: boolean;
146
+ media_area_context_ref?: string | null;
147
+ standardId?: string;
148
+ target_proficiency_level?: string;
149
+ allowTTS?: boolean;
150
+ }
151
+ declare const enum ActivityPageType {
152
+ READ_REPEAT = "READ_REPEAT",
153
+ VIDEO = "VIDEO",
154
+ TEXT = "TEXT",
155
+ READ_RESPOND = "READ_RESPOND",
156
+ FREE_RESPONSE = "FREE_RESPONSE",
157
+ REPEAT = "REPEAT",
158
+ RESPOND = "RESPOND",
159
+ RESPOND_WRITE = "RESPOND_WRITE",
160
+ TEXT_TO_SPEECH = "TEXT_TO_SPEECH",
161
+ MULTIPLE_CHOICE = "MULTIPLE_CHOICE",
162
+ PODCAST = "PODCAST",
163
+ MEDIA_PAGE = "MEDIA_PAGE",
164
+ WRITE = "WRITE",
165
+ SHORT_ANSWER = "SHORT_ANSWER",
166
+ SHORT_STORY = "SHORT_STORY",
167
+ SPEAK = "SPEAK",
168
+ CONVERSATION = "CONVERSATION",
169
+ CONVERSATION_WRITE = "CONVERSATION_WRITE",
170
+ DIALOGUE = "DIALOGUE",
171
+ INSTRUCTION = "INSTRUCTION",
172
+ LISTEN = "LISTEN",
173
+ READ = "READ",
174
+ ANSWER = "ANSWER"
175
+ }
176
+ declare const RESPOND_PAGE_ACTIVITY_TYPES: ActivityPageType[];
177
+ declare const MULTIPLE_CHOICE_PAGE_ACTIVITY_TYPES: ActivityPageType[];
178
+ declare const REPEAT_PAGE_ACTIVITY_TYPES: ActivityPageType[];
179
+ declare const RESPOND_WRITE_PAGE_ACTIVITY_TYPES: ActivityPageType[];
180
+ declare const RESPOND_AUDIO_PAGE_ACTIVITY_TYPES: ActivityPageType[];
181
+
182
+ declare const cardsQueryKeys: {
183
+ all: string[];
184
+ one: (params: {
185
+ cardId: string;
186
+ }) => string[];
187
+ };
188
+ declare function useCards({ cardIds, enabled, asObject, }: {
189
+ cardIds: string[];
190
+ enabled: boolean;
191
+ asObject?: boolean;
192
+ }): {
193
+ cards: PageActivityWithId[];
194
+ cardsObject: Record<string, PageActivityWithId> | null;
195
+ cardsQueries: _tanstack_react_query.UseQueryResult<PageActivityWithId | null, Error>[];
196
+ };
197
+ declare function useCreateCard(): {
198
+ mutationCreateCard: _tanstack_react_query.UseMutationResult<{
199
+ id: string;
200
+ } & Partial<PageActivity>, Error, {
201
+ data: Partial<PageActivity>;
202
+ }, unknown>;
203
+ };
204
+ declare function useCreateCards(): {
205
+ mutationCreateCards: _tanstack_react_query.UseMutationResult<{
206
+ id: string;
207
+ owners: string[];
208
+ checked?: boolean;
209
+ completed?: boolean;
210
+ media_area_id?: string | null;
211
+ media_area_layout?: "left" | "right" | null;
212
+ score?: number;
213
+ verificationStatus?: VerificationCardStatus;
214
+ native_text?: string;
215
+ repeat?: number;
216
+ language?: string | null;
217
+ image?: {
218
+ path?: string | null;
219
+ url?: string;
220
+ };
221
+ audio?: {
222
+ path?: string | null;
223
+ url?: string;
224
+ } | null;
225
+ notes?: string;
226
+ difficulty?: string;
227
+ default_language?: string;
228
+ target_text?: string;
229
+ type: ActivityPageType;
230
+ grading_criteria?: string;
231
+ scoring_type?: string;
232
+ grading_method?: "simple" | "rubric" | "manual" | "standards_based";
233
+ feedback_types?: string[];
234
+ rubricId?: string;
235
+ prompt?: string;
236
+ title?: string;
237
+ passing_score?: number;
238
+ maxCharacters?: number;
239
+ answer?: string[];
240
+ choices?: {
241
+ value: string;
242
+ option: string;
243
+ }[];
244
+ MCQType?: string;
245
+ multipleAttemptsAllowed?: boolean;
246
+ allowRetries?: boolean;
247
+ question?: string;
248
+ respondTime?: number;
249
+ hidePrompt?: boolean;
250
+ videoUrl?: string;
251
+ link?: string;
252
+ text?: string;
253
+ isListenAloud?: boolean;
254
+ embedCode?: string;
255
+ attempt?: number;
256
+ correct?: number;
257
+ autoGrade?: boolean;
258
+ points?: number;
259
+ shuffle?: boolean;
260
+ translation?: string;
261
+ includeAIContext?: boolean;
262
+ media_area_context_ref?: string | null;
263
+ standardId?: string;
264
+ target_proficiency_level?: string;
265
+ allowTTS?: boolean;
266
+ }[], Error, {
267
+ cards: PageActivity[];
268
+ }, unknown>;
269
+ };
270
+ declare function getCardFromCache({ cardId, queryClient, }: {
271
+ cardId: string;
272
+ queryClient: QueryClient;
273
+ }): PageActivityWithId | undefined;
274
+ declare function updateCardInCache({ cardId, card, queryClient, }: {
275
+ cardId: string;
276
+ card: PageActivityWithId | null;
277
+ queryClient: QueryClient;
278
+ }): void;
279
+ declare function useGetCard({ cardId, enabled }: {
280
+ cardId: string;
281
+ enabled?: boolean;
282
+ }): _tanstack_react_query.UseQueryResult<PageActivityWithId | null, Error>;
283
+
284
+ declare const createCardRepo: () => {
285
+ createCard: (args_0: {
286
+ data: Partial<PageActivity>;
287
+ }) => Promise<{
288
+ id: string;
289
+ } & Partial<PageActivity>>;
290
+ createCards: (args_0: {
291
+ cards: PageActivity[];
292
+ }) => Promise<{
293
+ id: string;
294
+ owners: string[];
295
+ checked?: boolean;
296
+ completed?: boolean;
297
+ media_area_id?: string | null;
298
+ media_area_layout?: "left" | "right" | null;
299
+ score?: number;
300
+ verificationStatus?: VerificationCardStatus;
301
+ native_text?: string;
302
+ repeat?: number;
303
+ language?: string | null;
304
+ image?: {
305
+ path?: string | null;
306
+ url?: string;
307
+ };
308
+ audio?: {
309
+ path?: string | null;
310
+ url?: string;
311
+ } | null;
312
+ notes?: string;
313
+ difficulty?: string;
314
+ default_language?: string;
315
+ target_text?: string;
316
+ type: ActivityPageType;
317
+ grading_criteria?: string;
318
+ scoring_type?: string;
319
+ grading_method?: "simple" | "rubric" | "manual" | "standards_based";
320
+ feedback_types?: string[];
321
+ rubricId?: string;
322
+ prompt?: string;
323
+ title?: string;
324
+ passing_score?: number;
325
+ maxCharacters?: number;
326
+ answer?: string[];
327
+ choices?: {
328
+ value: string;
329
+ option: string;
330
+ }[];
331
+ MCQType?: string;
332
+ multipleAttemptsAllowed?: boolean;
333
+ allowRetries?: boolean;
334
+ question?: string;
335
+ respondTime?: number;
336
+ hidePrompt?: boolean;
337
+ videoUrl?: string;
338
+ link?: string;
339
+ text?: string;
340
+ isListenAloud?: boolean;
341
+ embedCode?: string;
342
+ attempt?: number;
343
+ correct?: number;
344
+ autoGrade?: boolean;
345
+ points?: number;
346
+ shuffle?: boolean;
347
+ translation?: string;
348
+ includeAIContext?: boolean;
349
+ media_area_context_ref?: string | null;
350
+ standardId?: string;
351
+ target_proficiency_level?: string;
352
+ allowTTS?: boolean;
353
+ }[]>;
354
+ getCard: (params: {
355
+ cardId: string;
356
+ }) => Promise<PageActivityWithId | null>;
357
+ };
358
+
359
+ declare function checkIsRepeatPage(cardType: ActivityPageType | undefined): boolean;
360
+ declare function checkIsMCPage(cardType: ActivityPageType | undefined): boolean;
361
+ declare function checkIsRespondPage(cardType: ActivityPageType | undefined): boolean;
362
+ declare function checkIsRespondWrittenPage(cardType: ActivityPageType | undefined): boolean;
363
+ declare function checkIsRespondAudioPage(cardType: ActivityPageType | undefined): boolean;
364
+ declare const checkIsMediaPage: (cardType: ActivityPageType | undefined) => boolean;
365
+ declare const checkIsShortAnswerPage: (cardType: ActivityPageType | undefined) => boolean;
366
+ declare const checkTypePageActivity: (cardType: ActivityPageType | undefined) => {
367
+ isRespondAudio: boolean;
368
+ isRespondWritten: boolean;
369
+ isRespond: boolean;
370
+ isMC: boolean;
371
+ isRepeat: boolean;
372
+ isMediaPage: boolean;
373
+ isShortAnswer: boolean;
374
+ };
375
+
376
+ declare function getPagePrompt(card: PageActivityWithId | undefined): {
377
+ has: boolean;
378
+ text: string | undefined;
379
+ };
380
+
33
381
  interface Assignment {
34
382
  name: string;
35
383
  description: string;
@@ -69,6 +417,9 @@ interface Assignment {
69
417
  content?: string[];
70
418
  weights?: Record<string, number>;
71
419
  language?: string;
420
+ types?: {
421
+ [key in ActivityPageType]?: number;
422
+ };
72
423
  }
73
424
  interface AssignmentWithId extends Assignment {
74
425
  id: string;
@@ -81,7 +432,7 @@ interface Score {
81
432
  progress: number;
82
433
  score: number;
83
434
  cards?: {
84
- [cardId: string]: CardScore;
435
+ [cardId: string]: PageScore;
85
436
  };
86
437
  courseId?: string;
87
438
  firstLoad?: boolean;
@@ -96,7 +447,7 @@ interface Score {
96
447
  total_voiceSuccess?: number;
97
448
  total_voice_attempts?: number;
98
449
  total_words_spoken?: number;
99
- history?: CardScore[];
450
+ history?: PageScore[];
100
451
  attempts?: number;
101
452
  assignmentId?: string;
102
453
  setId?: string;
@@ -104,7 +455,7 @@ interface Score {
104
455
  interface ScoreWithId extends Score {
105
456
  id: string;
106
457
  }
107
- interface CardScore {
458
+ interface PageScore {
108
459
  voiceSuccess?: number;
109
460
  voiceAttempts?: number;
110
461
  voiceFail?: number;
@@ -153,7 +504,7 @@ interface CardScore {
153
504
  title: string;
154
505
  }[];
155
506
  scoring_type?: string;
156
- history?: CardScore[];
507
+ history?: PageScore[];
157
508
  media_area_opened?: boolean;
158
509
  noFeedbackAvailable?: boolean;
159
510
  proficiency_level?: {
@@ -221,6 +572,7 @@ declare const createAssignmentRepo: () => {
221
572
  content?: string[];
222
573
  weights?: Record<string, number>;
223
574
  language?: string;
575
+ types?: { [key in ActivityPageType]?: number; };
224
576
  } | null>;
225
577
  attachScoresAssignment: (args_0: {
226
578
  assignments: AssignmentWithId[];
@@ -268,6 +620,7 @@ declare const createAssignmentRepo: () => {
268
620
  content?: string[];
269
621
  weights?: Record<string, number>;
270
622
  language?: string;
623
+ types?: { [key in ActivityPageType]?: number; };
271
624
  }[]>;
272
625
  getAssignmentScores: (args_0: {
273
626
  assignmentId: string;
@@ -334,6 +687,7 @@ declare function useAssignment({ assignmentId, enabled, analyticType, userId, }:
334
687
  content?: string[];
335
688
  weights?: Record<string, number>;
336
689
  language?: string;
690
+ types?: { [key in ActivityPageType]?: number; };
337
691
  } | null, Error>;
338
692
 
339
693
  declare const scoreQueryKeys: {
@@ -344,432 +698,85 @@ declare const scoreQueryKeys: {
344
698
  declare function useScore({ isAssignment, activityId, userId, courseId, enabled, googleClassroomUserId, }: {
345
699
  userId: string;
346
700
  isAssignment: boolean;
347
- activityId: string;
348
- courseId?: string;
349
- enabled?: boolean;
350
- googleClassroomUserId?: string;
351
- }): _tanstack_react_query.UseQueryResult<ScoreWithId, Error>;
352
- declare function useUpdateScore(): {
353
- mutationUpdateScore: _tanstack_react_query.UseMutationResult<Promise<void>, Error, {
354
- userId: string;
355
- data: Partial<Score>;
356
- isAssignment: boolean;
357
- activityId: string;
358
- }, {
359
- previousData: Partial<Score> | undefined;
360
- }>;
361
- };
362
- declare function useUpdateCardScore({ isAssignment, activityId, userId, cardIds, weights, }: {
363
- isAssignment: boolean;
364
- userId: string;
365
- activityId: string;
366
- cardIds: string[];
367
- weights: Record<string, number>;
368
- }): {
369
- mutationUpdateCardScore: _tanstack_react_query.UseMutationResult<{
370
- cardId: string;
371
- scoresUpdated: Score;
372
- }, Error, {
373
- cardId: string;
374
- cardScore: CardScore;
375
- }, void>;
376
- };
377
- declare function useClearScore(): {
378
- mutationClearScore: _tanstack_react_query.UseMutationResult<{
379
- update: Partial<Score>;
380
- activityId: string;
381
- }, Error, {
382
- isAssignment: boolean;
383
- cardId: string;
384
- cardScores: CardScore;
385
- userId: string;
386
- activityId: string;
387
- }, unknown>;
388
- };
389
- declare function useSubmitAssignmentScore({ onAssignmentSubmitted, studentName, }: {
390
- onAssignmentSubmitted: (assignmentId: string) => void;
391
- studentName: string;
392
- }): {
393
- submitAssignmentScore: _tanstack_react_query.UseMutateAsyncFunction<{
394
- success: boolean;
395
- message: string;
396
- error?: undefined;
397
- } | {
398
- success: boolean;
399
- error: unknown;
400
- message?: undefined;
401
- }, Error, {
402
- assignment: AssignmentWithId;
403
- userId: string;
404
- cardIds: string[];
405
- weights: Record<string, number>;
406
- scores: Score;
407
- status: "FINALIZED" | "IN_PROGRESS" | "PENDING_REVIEW";
408
- }, unknown>;
409
- isLoading: boolean;
410
- };
411
- declare function useSubmitPracticeScore(): {
412
- submitPracticeScore: _tanstack_react_query.UseMutateAsyncFunction<{
413
- success: boolean;
414
- message: string;
415
- error?: undefined;
416
- } | {
417
- success: boolean;
418
- error: unknown;
419
- message?: undefined;
420
- }, Error, {
421
- setId: string;
422
- userId: string;
423
- scores: Score;
424
- }, unknown>;
425
- isLoading: boolean;
426
- };
427
-
428
- declare const enum FeedbackTypesCard {
429
- SuggestedResponse = "suggested_response",
430
- Wida = "wida",
431
- GrammarInsights = "grammar_insights",
432
- Actfl = "actfl",
433
- ProficiencyLevel = "proficiency_level"
434
- }
435
- declare const enum LeniencyCard {
436
- CONFIDENCE = "confidence",
437
- EASY = "easy",
438
- NORMAL = "normal",
439
- HARD = "hard"
440
- }
441
- declare const LENIENCY_OPTIONS: {
442
- label: string;
443
- value: LeniencyCard;
444
- }[];
445
- declare const STUDENT_LEVELS_OPTIONS: {
446
- label: string;
447
- description: string;
448
- value: string;
449
- }[];
450
- declare const BASE_RESPOND_FIELD_VALUES: {
451
- title: string;
452
- allowRetries: boolean;
453
- respondTime: number;
454
- maxCharacters: number;
455
- };
456
- declare const BASE_REPEAT_FIELD_VALUES: {
457
- repeat: number;
458
- };
459
- declare const BASE_MULTIPLE_CHOICE_FIELD_VALUES: {
460
- MCQType: string;
461
- answer: string[];
462
- choices: {
463
- option: string;
464
- value: string;
465
- }[];
466
- };
467
- declare const enum VerificationCardStatus {
468
- VERIFIED = "VERIFIED",
469
- WARNING = "WARNING",
470
- NOT_RECOMMENDED = "NOT_RECOMMENDED",
471
- NOT_WORKING = "NOT_WORKING",
472
- NOT_CHECKED = "NOT_CHECKED"
473
- }
474
- declare const CARDS_COLLECTION = "flashcards";
475
- type RefsCardsFiresotre = `${typeof CARDS_COLLECTION}/${string}`;
476
- declare const refsCardsFiresotre: {
477
- allCards: string;
478
- card: (id: string) => `flashcards/${string}`;
479
- };
480
-
481
- interface PageActivityWithId extends PageActivity {
482
- id: string;
483
- }
484
- interface PageActivity {
485
- owners: string[];
486
- checked?: boolean;
487
- completed?: boolean;
488
- media_area_id?: string | null;
489
- media_area_layout?: 'left' | 'right' | null;
490
- score?: number;
491
- verificationStatus?: VerificationCardStatus;
492
- native_text?: string;
493
- repeat?: number;
494
- language?: string | null;
495
- image?: {
496
- path?: string | null;
497
- url?: string;
498
- };
499
- audio?: {
500
- path?: string | null;
501
- url?: string;
502
- } | null;
503
- notes?: string;
504
- difficulty?: string;
505
- default_language?: string;
506
- target_text?: string;
507
- type: ActivityPageType;
508
- grading_criteria?: string;
509
- scoring_type?: string;
510
- grading_method?: 'simple' | 'rubric' | 'manual' | 'standards_based';
511
- feedback_types?: string[];
512
- rubricId?: string;
513
- prompt?: string;
514
- title?: string;
515
- passing_score?: number;
516
- maxCharacters?: number;
517
- answer?: string[];
518
- choices?: {
519
- value: string;
520
- option: string;
521
- }[];
522
- MCQType?: string;
523
- multipleAttemptsAllowed?: boolean;
524
- allowRetries?: boolean;
525
- question?: string;
526
- respondTime?: number;
527
- hidePrompt?: boolean;
528
- videoUrl?: string;
529
- link?: string;
530
- text?: string;
531
- isListenAloud?: boolean;
532
- embedCode?: string;
533
- attempt?: number;
534
- correct?: number;
535
- autoGrade?: boolean;
536
- points?: number;
537
- shuffle?: boolean;
538
- translation?: string;
539
- includeAIContext?: boolean;
540
- media_area_context_ref?: string | null;
541
- standardId?: string;
542
- target_proficiency_level?: string;
543
- allowTTS?: boolean;
544
- }
545
- declare const enum ActivityPageType {
546
- READ_REPEAT = "READ_REPEAT",
547
- VIDEO = "VIDEO",
548
- TEXT = "TEXT",
549
- READ_RESPOND = "READ_RESPOND",
550
- FREE_RESPONSE = "FREE_RESPONSE",
551
- REPEAT = "REPEAT",
552
- RESPOND = "RESPOND",
553
- RESPOND_WRITE = "RESPOND_WRITE",
554
- TEXT_TO_SPEECH = "TEXT_TO_SPEECH",
555
- MULTIPLE_CHOICE = "MULTIPLE_CHOICE",
556
- PODCAST = "PODCAST",
557
- MEDIA_PAGE = "MEDIA_PAGE",
558
- WRITE = "WRITE",
559
- SHORT_ANSWER = "SHORT_ANSWER",
560
- SHORT_STORY = "SHORT_STORY",
561
- SPEAK = "SPEAK",
562
- CONVERSATION = "CONVERSATION",
563
- CONVERSATION_WRITE = "CONVERSATION_WRITE",
564
- DIALOGUE = "DIALOGUE",
565
- INSTRUCTION = "INSTRUCTION",
566
- LISTEN = "LISTEN",
567
- READ = "READ",
568
- ANSWER = "ANSWER"
569
- }
570
- declare const RESPOND_PAGE_ACTIVITY_TYPES: ActivityPageType[];
571
- declare const MULTIPLE_CHOICE_PAGE_ACTIVITY_TYPES: ActivityPageType[];
572
- declare const REPEAT_PAGE_ACTIVITY_TYPES: ActivityPageType[];
573
- declare const RESPOND_WRITE_PAGE_ACTIVITY_TYPES: ActivityPageType[];
574
- declare const RESPOND_AUDIO_PAGE_ACTIVITY_TYPES: ActivityPageType[];
575
-
576
- declare const cardsQueryKeys: {
577
- all: string[];
578
- one: (params: {
579
- cardId: string;
580
- }) => string[];
701
+ activityId: string;
702
+ courseId?: string;
703
+ enabled?: boolean;
704
+ googleClassroomUserId?: string;
705
+ }): _tanstack_react_query.UseQueryResult<ScoreWithId, Error>;
706
+ declare function useUpdateScore(): {
707
+ mutationUpdateScore: _tanstack_react_query.UseMutationResult<Promise<void>, Error, {
708
+ userId: string;
709
+ data: Partial<Score>;
710
+ isAssignment: boolean;
711
+ activityId: string;
712
+ }, {
713
+ previousData: Partial<Score> | undefined;
714
+ }>;
581
715
  };
582
- declare function useCards({ cardIds, enabled, asObject, }: {
716
+ declare function useUpdateCardScore({ isAssignment, activityId, userId, cardIds, weights, }: {
717
+ isAssignment: boolean;
718
+ userId: string;
719
+ activityId: string;
583
720
  cardIds: string[];
584
- enabled: boolean;
585
- asObject?: boolean;
721
+ weights: Record<string, number>;
586
722
  }): {
587
- cards: PageActivityWithId[];
588
- cardsObject: Record<string, PageActivityWithId> | null;
589
- cardsQueries: _tanstack_react_query.UseQueryResult<PageActivityWithId | null, Error>[];
723
+ mutationUpdateCardScore: _tanstack_react_query.UseMutationResult<{
724
+ cardId: string;
725
+ scoresUpdated: Score;
726
+ }, Error, {
727
+ cardId: string;
728
+ cardScore: PageScore;
729
+ }, void>;
590
730
  };
591
- declare function useCreateCard(): {
592
- mutationCreateCard: _tanstack_react_query.UseMutationResult<{
593
- id: string;
594
- } & Partial<PageActivity>, Error, {
595
- data: Partial<PageActivity>;
731
+ declare function useClearScore(): {
732
+ mutationClearScore: _tanstack_react_query.UseMutationResult<{
733
+ update: Partial<Score>;
734
+ activityId: string;
735
+ }, Error, {
736
+ isAssignment: boolean;
737
+ cardId: string;
738
+ cardScores: PageScore;
739
+ userId: string;
740
+ activityId: string;
596
741
  }, unknown>;
597
742
  };
598
- declare function useCreateCards(): {
599
- mutationCreateCards: _tanstack_react_query.UseMutationResult<{
600
- id: string;
601
- owners: string[];
602
- checked?: boolean;
603
- completed?: boolean;
604
- media_area_id?: string | null;
605
- media_area_layout?: "left" | "right" | null;
606
- score?: number;
607
- verificationStatus?: VerificationCardStatus;
608
- native_text?: string;
609
- repeat?: number;
610
- language?: string | null;
611
- image?: {
612
- path?: string | null;
613
- url?: string;
614
- };
615
- audio?: {
616
- path?: string | null;
617
- url?: string;
618
- } | null;
619
- notes?: string;
620
- difficulty?: string;
621
- default_language?: string;
622
- target_text?: string;
623
- type: ActivityPageType;
624
- grading_criteria?: string;
625
- scoring_type?: string;
626
- grading_method?: "simple" | "rubric" | "manual" | "standards_based";
627
- feedback_types?: string[];
628
- rubricId?: string;
629
- prompt?: string;
630
- title?: string;
631
- passing_score?: number;
632
- maxCharacters?: number;
633
- answer?: string[];
634
- choices?: {
635
- value: string;
636
- option: string;
637
- }[];
638
- MCQType?: string;
639
- multipleAttemptsAllowed?: boolean;
640
- allowRetries?: boolean;
641
- question?: string;
642
- respondTime?: number;
643
- hidePrompt?: boolean;
644
- videoUrl?: string;
645
- link?: string;
646
- text?: string;
647
- isListenAloud?: boolean;
648
- embedCode?: string;
649
- attempt?: number;
650
- correct?: number;
651
- autoGrade?: boolean;
652
- points?: number;
653
- shuffle?: boolean;
654
- translation?: string;
655
- includeAIContext?: boolean;
656
- media_area_context_ref?: string | null;
657
- standardId?: string;
658
- target_proficiency_level?: string;
659
- allowTTS?: boolean;
660
- }[], Error, {
661
- cards: PageActivity[];
743
+ declare function useSubmitAssignmentScore({ onAssignmentSubmitted, studentName, }: {
744
+ onAssignmentSubmitted: (assignmentId: string) => void;
745
+ studentName: string;
746
+ }): {
747
+ submitAssignmentScore: _tanstack_react_query.UseMutateAsyncFunction<{
748
+ success: boolean;
749
+ message: string;
750
+ error?: undefined;
751
+ } | {
752
+ success: boolean;
753
+ error: unknown;
754
+ message?: undefined;
755
+ }, Error, {
756
+ assignment: AssignmentWithId;
757
+ userId: string;
758
+ cardIds: string[];
759
+ weights: Record<string, number>;
760
+ scores: Score;
761
+ status: "FINALIZED" | "IN_PROGRESS" | "PENDING_REVIEW";
662
762
  }, unknown>;
763
+ isLoading: boolean;
663
764
  };
664
- declare function getCardFromCache({ cardId, queryClient, }: {
665
- cardId: string;
666
- queryClient: QueryClient;
667
- }): PageActivityWithId | undefined;
668
- declare function updateCardInCache({ cardId, card, queryClient, }: {
669
- cardId: string;
670
- card: PageActivityWithId | null;
671
- queryClient: QueryClient;
672
- }): void;
673
- declare function useGetCard({ cardId, enabled }: {
674
- cardId: string;
675
- enabled?: boolean;
676
- }): _tanstack_react_query.UseQueryResult<PageActivityWithId | null, Error>;
677
-
678
- declare const createCardRepo: () => {
679
- createCard: (args_0: {
680
- data: Partial<PageActivity>;
681
- }) => Promise<{
682
- id: string;
683
- } & Partial<PageActivity>>;
684
- createCards: (args_0: {
685
- cards: PageActivity[];
686
- }) => Promise<{
687
- id: string;
688
- owners: string[];
689
- checked?: boolean;
690
- completed?: boolean;
691
- media_area_id?: string | null;
692
- media_area_layout?: "left" | "right" | null;
693
- score?: number;
694
- verificationStatus?: VerificationCardStatus;
695
- native_text?: string;
696
- repeat?: number;
697
- language?: string | null;
698
- image?: {
699
- path?: string | null;
700
- url?: string;
701
- };
702
- audio?: {
703
- path?: string | null;
704
- url?: string;
705
- } | null;
706
- notes?: string;
707
- difficulty?: string;
708
- default_language?: string;
709
- target_text?: string;
710
- type: ActivityPageType;
711
- grading_criteria?: string;
712
- scoring_type?: string;
713
- grading_method?: "simple" | "rubric" | "manual" | "standards_based";
714
- feedback_types?: string[];
715
- rubricId?: string;
716
- prompt?: string;
717
- title?: string;
718
- passing_score?: number;
719
- maxCharacters?: number;
720
- answer?: string[];
721
- choices?: {
722
- value: string;
723
- option: string;
724
- }[];
725
- MCQType?: string;
726
- multipleAttemptsAllowed?: boolean;
727
- allowRetries?: boolean;
728
- question?: string;
729
- respondTime?: number;
730
- hidePrompt?: boolean;
731
- videoUrl?: string;
732
- link?: string;
733
- text?: string;
734
- isListenAloud?: boolean;
735
- embedCode?: string;
736
- attempt?: number;
737
- correct?: number;
738
- autoGrade?: boolean;
739
- points?: number;
740
- shuffle?: boolean;
741
- translation?: string;
742
- includeAIContext?: boolean;
743
- media_area_context_ref?: string | null;
744
- standardId?: string;
745
- target_proficiency_level?: string;
746
- allowTTS?: boolean;
747
- }[]>;
748
- getCard: (params: {
749
- cardId: string;
750
- }) => Promise<PageActivityWithId | null>;
751
- };
752
-
753
- declare function checkIsRepeatPage(cardType: ActivityPageType | undefined): boolean;
754
- declare function checkIsMCPage(cardType: ActivityPageType | undefined): boolean;
755
- declare function checkIsRespondPage(cardType: ActivityPageType | undefined): boolean;
756
- declare function checkIsRespondWrittenPage(cardType: ActivityPageType | undefined): boolean;
757
- declare function checkIsRespondAudioPage(cardType: ActivityPageType | undefined): boolean;
758
- declare const checkIsMediaPage: (cardType: ActivityPageType | undefined) => boolean;
759
- declare const checkIsShortAnswerPage: (cardType: ActivityPageType | undefined) => boolean;
760
- declare const checkTypePageActivity: (cardType: ActivityPageType | undefined) => {
761
- isRespondAudio: boolean;
762
- isRespondWritten: boolean;
763
- isRespond: boolean;
764
- isMC: boolean;
765
- isRepeat: boolean;
766
- isMediaPage: boolean;
767
- isShortAnswer: boolean;
768
- };
769
-
770
- declare function getPagePrompt(card: PageActivityWithId | undefined): {
771
- has: boolean;
772
- text: string | undefined;
765
+ declare function useSubmitPracticeScore(): {
766
+ submitPracticeScore: _tanstack_react_query.UseMutateAsyncFunction<{
767
+ success: boolean;
768
+ message: string;
769
+ error?: undefined;
770
+ } | {
771
+ success: boolean;
772
+ error: unknown;
773
+ message?: undefined;
774
+ }, Error, {
775
+ setId: string;
776
+ userId: string;
777
+ scores: Score;
778
+ }, unknown>;
779
+ isLoading: boolean;
773
780
  };
774
781
 
775
782
  interface SetWithId extends Set {
@@ -932,6 +939,7 @@ declare function createFsClientBase({ db, helpers, httpsCallable, logEvent, }: {
932
939
  content?: string[];
933
940
  weights?: Record<string, number>;
934
941
  language?: string;
942
+ types?: { [key in ActivityPageType]?: number; };
935
943
  } | null>;
936
944
  attachScoresAssignment: (args_0: {
937
945
  assignments: AssignmentWithId[];
@@ -979,6 +987,7 @@ declare function createFsClientBase({ db, helpers, httpsCallable, logEvent, }: {
979
987
  content?: string[];
980
988
  weights?: Record<string, number>;
981
989
  language?: string;
990
+ types?: { [key in ActivityPageType]?: number; };
982
991
  }[]>;
983
992
  getAssignmentScores: (args_0: {
984
993
  assignmentId: string;
@@ -1220,6 +1229,7 @@ declare function debounce<T extends (...args: any[]) => Promise<any>>(func: T, w
1220
1229
  declare const purify: (word: string) => string;
1221
1230
  declare const cleanString: (words: string) => string | string[];
1222
1231
  declare const getWordHash: (word: string, language: string) => string;
1232
+ declare function getPhraseLength(phrase: string, input?: string): number;
1223
1233
 
1224
1234
  declare function useActivity({ id, isAssignment, onAssignmentSubmitted, ltiData, }: {
1225
1235
  id: string;
@@ -1282,6 +1292,7 @@ declare function useActivity({ id, isAssignment, onAssignmentSubmitted, ltiData,
1282
1292
  content?: string[];
1283
1293
  weights?: Record<string, number>;
1284
1294
  language?: string;
1295
+ types?: { [key in ActivityPageType]?: number; };
1285
1296
  } | null | undefined;
1286
1297
  query: _tanstack_react_query.UseQueryResult<AssignmentWithId | {
1287
1298
  scores: any;
@@ -1324,6 +1335,7 @@ declare function useActivity({ id, isAssignment, onAssignmentSubmitted, ltiData,
1324
1335
  content?: string[];
1325
1336
  weights?: Record<string, number>;
1326
1337
  language?: string;
1338
+ types?: { [key in ActivityPageType]?: number; };
1327
1339
  } | null, Error>;
1328
1340
  };
1329
1341
  scores: {
@@ -1344,7 +1356,7 @@ declare function useActivity({ id, isAssignment, onAssignmentSubmitted, ltiData,
1344
1356
  error: unknown;
1345
1357
  message?: undefined;
1346
1358
  }>;
1347
- updateCard: (cardId: string, cardScore: CardScore) => void;
1359
+ updateCard: (cardId: string, cardScore: PageScore) => void;
1348
1360
  logGradingStandardEntry: ({ cardId, gradingStandard, type, }: {
1349
1361
  cardId: string;
1350
1362
  gradingStandard: {
@@ -2300,6 +2312,18 @@ declare const useOrganizationAccess: () => {
2300
2312
  promise: Promise<OrganizationAccess>;
2301
2313
  };
2302
2314
 
2315
+ declare const useUpdateStudentVocab: (page: PageActivityWithId | null) => {
2316
+ markVoiceSuccess: undefined;
2317
+ markVoiceFail: undefined;
2318
+ studentVocabMarkVoiceSuccess?: undefined;
2319
+ studentVocabMarkVoiceFail?: undefined;
2320
+ } | {
2321
+ studentVocabMarkVoiceSuccess: () => Promise<void>;
2322
+ studentVocabMarkVoiceFail: () => Promise<void>;
2323
+ markVoiceSuccess?: undefined;
2324
+ markVoiceFail?: undefined;
2325
+ };
2326
+
2303
2327
  declare const useBaseOpenAI: ({ onTranscriptSuccess, onTranscriptError, onCompletionSuccess, onCompletionError, aiEnabled, submitAudioResponse, uploadAudioAndGetTranscript, }: {
2304
2328
  onTranscriptSuccess: (transcript: string) => void;
2305
2329
  onTranscriptError: ({ type, message }: {
@@ -2572,6 +2596,7 @@ declare const createFsClientNative: ({ db, httpsCallable, logEvent }: FsClientPa
2572
2596
  content?: string[];
2573
2597
  weights?: Record<string, number>;
2574
2598
  language?: string;
2599
+ types?: { [key in ActivityPageType]?: number; };
2575
2600
  } | null>;
2576
2601
  attachScoresAssignment: (args_0: {
2577
2602
  assignments: AssignmentWithId[];
@@ -2619,6 +2644,7 @@ declare const createFsClientNative: ({ db, httpsCallable, logEvent }: FsClientPa
2619
2644
  content?: string[];
2620
2645
  weights?: Record<string, number>;
2621
2646
  language?: string;
2647
+ types?: { [key in ActivityPageType]?: number; };
2622
2648
  }[]>;
2623
2649
  getAssignmentScores: (args_0: {
2624
2650
  assignmentId: string;
@@ -2709,4 +2735,4 @@ declare const createFsClientNative: ({ db, httpsCallable, logEvent }: FsClientPa
2709
2735
  };
2710
2736
  };
2711
2737
 
2712
- export { ActivityPageType, type Assignment, type AssignmentWithId, BASE_MULTIPLE_CHOICE_FIELD_VALUES, BASE_REPEAT_FIELD_VALUES, BASE_RESPOND_FIELD_VALUES, type CardScore, type CreditContract, FeedbackTypesCard, FsCtx, type InstitutionSubscription, LENIENCY_OPTIONS, LeniencyCard, MULTIPLE_CHOICE_PAGE_ACTIVITY_TYPES, type Organization, type OrganizationAccess, type PageActivity, type PageActivityWithId, REPEAT_PAGE_ACTIVITY_TYPES, RESPOND_AUDIO_PAGE_ACTIVITY_TYPES, RESPOND_PAGE_ACTIVITY_TYPES, RESPOND_WRITE_PAGE_ACTIVITY_TYPES, type RefsCardsFiresotre, type RefsSetsFirestore, SPEAKABLE_NOTIFICATIONS, STUDENT_LEVELS_OPTIONS, type Score, type ScoreWithId, type Set, type SetWithId, type SpeakableNotificationType, SpeakableNotificationTypes, SpeakableProvider, VerificationCardStatus, assignmentQueryKeys, cardsQueryKeys, checkIsMCPage, checkIsMediaPage, checkIsRepeatPage, checkIsRespondAudioPage, checkIsRespondPage, checkIsRespondWrittenPage, checkIsShortAnswerPage, checkTypePageActivity, cleanString, createAssignmentRepo, createCardRepo, createFsClientNative as createFsClient, createSetRepo, creditQueryKeys, debounce, getCardFromCache, getPagePrompt, getRespondCardTool, getSetFromCache, getWordHash, purify, refsCardsFiresotre, refsSetsFirestore, scoreQueryKeys, setsQueryKeys, updateCardInCache, updateSetInCache, useActivity, useActivityFeedbackAccess, useAssignment, useBaseOpenAI, useCards, useClearScore, useCreateCard, useCreateCards, useCreateNotification, useGetCard, useOrganizationAccess, useScore, useSet, useSpeakableApi, useSubmitAssignmentScore, useSubmitPracticeScore, useUpdateCardScore, useUpdateScore, useUserCredits };
2738
+ export { ActivityPageType, type Assignment, type AssignmentWithId, BASE_MULTIPLE_CHOICE_FIELD_VALUES, BASE_REPEAT_FIELD_VALUES, BASE_RESPOND_FIELD_VALUES, type CreditContract, FeedbackTypesCard, FsCtx, type InstitutionSubscription, LENIENCY_OPTIONS, LeniencyCard, MULTIPLE_CHOICE_PAGE_ACTIVITY_TYPES, type Organization, type OrganizationAccess, type PageActivity, type PageActivityWithId, type PageScore, REPEAT_PAGE_ACTIVITY_TYPES, RESPOND_AUDIO_PAGE_ACTIVITY_TYPES, RESPOND_PAGE_ACTIVITY_TYPES, RESPOND_WRITE_PAGE_ACTIVITY_TYPES, type RefsCardsFiresotre, type RefsSetsFirestore, SPEAKABLE_NOTIFICATIONS, STUDENT_LEVELS_OPTIONS, type Score, type ScoreWithId, type Set, type SetWithId, type SpeakableNotificationType, SpeakableNotificationTypes, SpeakableProvider, VerificationCardStatus, assignmentQueryKeys, cardsQueryKeys, checkIsMCPage, checkIsMediaPage, checkIsRepeatPage, checkIsRespondAudioPage, checkIsRespondPage, checkIsRespondWrittenPage, checkIsShortAnswerPage, checkTypePageActivity, cleanString, createAssignmentRepo, createCardRepo, createFsClientNative as createFsClient, createSetRepo, creditQueryKeys, debounce, getCardFromCache, getPagePrompt, getPhraseLength, getRespondCardTool, getSetFromCache, getWordHash, purify, refsCardsFiresotre, refsSetsFirestore, scoreQueryKeys, setsQueryKeys, updateCardInCache, updateSetInCache, useActivity, useActivityFeedbackAccess, useAssignment, useBaseOpenAI, useCards, useClearScore, useCreateCard, useCreateCards, useCreateNotification, useGetCard, useOrganizationAccess, useScore, useSet, useSpeakableApi, useSubmitAssignmentScore, useSubmitPracticeScore, useUpdateCardScore, useUpdateScore, useUpdateStudentVocab, useUserCredits };