@speakableio/core 1.0.12 → 1.0.13
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.
- package/dist/index.native.d.mts +13 -1
- package/dist/index.native.d.ts +13 -1
- package/dist/index.native.js +49 -0
- package/dist/index.native.js.map +1 -1
- package/dist/index.native.mjs +49 -0
- package/dist/index.native.mjs.map +1 -1
- package/dist/index.web.d.mts +13 -1
- package/dist/index.web.js +49 -0
- package/dist/index.web.js.map +1 -1
- package/package.json +1 -1
package/dist/index.native.d.mts
CHANGED
|
@@ -1007,6 +1007,18 @@ declare function useClearScore(): {
|
|
|
1007
1007
|
activityId: string;
|
|
1008
1008
|
}, unknown>;
|
|
1009
1009
|
};
|
|
1010
|
+
declare function useClearScoreV2(): {
|
|
1011
|
+
mutationClearScore: _tanstack_react_query.UseMutationResult<{
|
|
1012
|
+
update: Partial<Score>;
|
|
1013
|
+
activityId: string;
|
|
1014
|
+
}, Error, {
|
|
1015
|
+
isAssignment: boolean;
|
|
1016
|
+
cardId: string;
|
|
1017
|
+
cardScores: PageScore;
|
|
1018
|
+
userId: string;
|
|
1019
|
+
activityId: string;
|
|
1020
|
+
}, unknown>;
|
|
1021
|
+
};
|
|
1010
1022
|
declare function useSubmitAssignmentScore({ onAssignmentSubmitted, studentName, }: {
|
|
1011
1023
|
onAssignmentSubmitted: (assignmentId: string) => void;
|
|
1012
1024
|
studentName: string;
|
|
@@ -3242,4 +3254,4 @@ declare const createFsClientNative: ({ db, httpsCallable, logEvent }: FsClientPa
|
|
|
3242
3254
|
};
|
|
3243
3255
|
};
|
|
3244
3256
|
|
|
3245
|
-
export { ActivityPageType, type Assignment, type AssignmentAnalyticsType$1 as AssignmentAnalyticsType, 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, getLabelPage, getPagePrompt, getPhraseLength, getRespondCardTool, getSetFromCache, getTotalCompletedCards, 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 };
|
|
3257
|
+
export { ActivityPageType, type Assignment, type AssignmentAnalyticsType$1 as AssignmentAnalyticsType, 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, getLabelPage, getPagePrompt, getPhraseLength, getRespondCardTool, getSetFromCache, getTotalCompletedCards, getWordHash, purify, refsCardsFiresotre, refsSetsFirestore, scoreQueryKeys, setsQueryKeys, updateCardInCache, updateSetInCache, useActivity, useActivityFeedbackAccess, useAssignment, useBaseOpenAI, useCards, useClearScore, useClearScoreV2, useCreateCard, useCreateCards, useCreateNotification, useGetCard, useOrganizationAccess, useScore, useSet, useSpeakableApi, useSubmitAssignmentScore, useSubmitPracticeScore, useUpdateCardScore, useUpdateScore, useUpdateStudentVocab, useUserCredits };
|
package/dist/index.native.d.ts
CHANGED
|
@@ -1007,6 +1007,18 @@ declare function useClearScore(): {
|
|
|
1007
1007
|
activityId: string;
|
|
1008
1008
|
}, unknown>;
|
|
1009
1009
|
};
|
|
1010
|
+
declare function useClearScoreV2(): {
|
|
1011
|
+
mutationClearScore: _tanstack_react_query.UseMutationResult<{
|
|
1012
|
+
update: Partial<Score>;
|
|
1013
|
+
activityId: string;
|
|
1014
|
+
}, Error, {
|
|
1015
|
+
isAssignment: boolean;
|
|
1016
|
+
cardId: string;
|
|
1017
|
+
cardScores: PageScore;
|
|
1018
|
+
userId: string;
|
|
1019
|
+
activityId: string;
|
|
1020
|
+
}, unknown>;
|
|
1021
|
+
};
|
|
1010
1022
|
declare function useSubmitAssignmentScore({ onAssignmentSubmitted, studentName, }: {
|
|
1011
1023
|
onAssignmentSubmitted: (assignmentId: string) => void;
|
|
1012
1024
|
studentName: string;
|
|
@@ -3242,4 +3254,4 @@ declare const createFsClientNative: ({ db, httpsCallable, logEvent }: FsClientPa
|
|
|
3242
3254
|
};
|
|
3243
3255
|
};
|
|
3244
3256
|
|
|
3245
|
-
export { ActivityPageType, type Assignment, type AssignmentAnalyticsType$1 as AssignmentAnalyticsType, 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, getLabelPage, getPagePrompt, getPhraseLength, getRespondCardTool, getSetFromCache, getTotalCompletedCards, 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 };
|
|
3257
|
+
export { ActivityPageType, type Assignment, type AssignmentAnalyticsType$1 as AssignmentAnalyticsType, 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, getLabelPage, getPagePrompt, getPhraseLength, getRespondCardTool, getSetFromCache, getTotalCompletedCards, getWordHash, purify, refsCardsFiresotre, refsSetsFirestore, scoreQueryKeys, setsQueryKeys, updateCardInCache, updateSetInCache, useActivity, useActivityFeedbackAccess, useAssignment, useBaseOpenAI, useCards, useClearScore, useClearScoreV2, useCreateCard, useCreateCards, useCreateNotification, useGetCard, useOrganizationAccess, useScore, useSet, useSpeakableApi, useSubmitAssignmentScore, useSubmitPracticeScore, useUpdateCardScore, useUpdateScore, useUpdateStudentVocab, useUserCredits };
|
package/dist/index.native.js
CHANGED
|
@@ -86,6 +86,7 @@ __export(index_native_exports, {
|
|
|
86
86
|
useBaseOpenAI: () => useBaseOpenAI,
|
|
87
87
|
useCards: () => useCards,
|
|
88
88
|
useClearScore: () => useClearScore,
|
|
89
|
+
useClearScoreV2: () => useClearScoreV2,
|
|
89
90
|
useCreateCard: () => useCreateCard,
|
|
90
91
|
useCreateCards: () => useCreateCards,
|
|
91
92
|
useCreateNotification: () => useCreateNotification,
|
|
@@ -1248,6 +1249,39 @@ async function clearScore(params) {
|
|
|
1248
1249
|
activityId: params.activityId
|
|
1249
1250
|
};
|
|
1250
1251
|
}
|
|
1252
|
+
async function clearScoreV2(params) {
|
|
1253
|
+
var _a, _b, _c, _d, _e;
|
|
1254
|
+
const update = {
|
|
1255
|
+
[`cards.${params.cardId}`]: {
|
|
1256
|
+
...params.cardScores,
|
|
1257
|
+
attempts: ((_a = params.cardScores.attempts) != null ? _a : 1) + 1,
|
|
1258
|
+
correct: (_b = params.cardScores.correct) != null ? _b : 0,
|
|
1259
|
+
history: [
|
|
1260
|
+
{
|
|
1261
|
+
...params.cardScores,
|
|
1262
|
+
attempts: (_c = params.cardScores.attempts) != null ? _c : 1,
|
|
1263
|
+
correct: (_d = params.cardScores.correct) != null ? _d : 0,
|
|
1264
|
+
retryTime: (0, import_dayjs3.default)().format("YYYY-MM-DD HH:mm:ss"),
|
|
1265
|
+
history: null
|
|
1266
|
+
},
|
|
1267
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
1268
|
+
...(_e = params.cardScores.history) != null ? _e : []
|
|
1269
|
+
]
|
|
1270
|
+
}
|
|
1271
|
+
};
|
|
1272
|
+
const path = params.isAssignment ? refsAssignmentFiresotre.assignmentScores({
|
|
1273
|
+
id: params.activityId,
|
|
1274
|
+
userId: params.userId
|
|
1275
|
+
}) : refsScoresPractice.practiceScores({
|
|
1276
|
+
setId: params.activityId,
|
|
1277
|
+
userId: params.userId
|
|
1278
|
+
});
|
|
1279
|
+
await api.updateDoc(path, update);
|
|
1280
|
+
return {
|
|
1281
|
+
update,
|
|
1282
|
+
activityId: params.activityId
|
|
1283
|
+
};
|
|
1284
|
+
}
|
|
1251
1285
|
|
|
1252
1286
|
// src/domains/assignment/services/submit-assignment-score.service.ts
|
|
1253
1287
|
var import_dayjs4 = __toESM(require("dayjs"));
|
|
@@ -1516,6 +1550,21 @@ function useClearScore() {
|
|
|
1516
1550
|
mutationClearScore: mutation
|
|
1517
1551
|
};
|
|
1518
1552
|
}
|
|
1553
|
+
function useClearScoreV2() {
|
|
1554
|
+
const { queryClient } = useSpeakableApi();
|
|
1555
|
+
const mutation = (0, import_react_query2.useMutation)({
|
|
1556
|
+
mutationFn: clearScoreV2,
|
|
1557
|
+
onSettled: (result) => {
|
|
1558
|
+
var _a;
|
|
1559
|
+
queryClient.invalidateQueries({
|
|
1560
|
+
queryKey: scoreQueryKeys.byId((_a = result == null ? void 0 : result.activityId) != null ? _a : "")
|
|
1561
|
+
});
|
|
1562
|
+
}
|
|
1563
|
+
});
|
|
1564
|
+
return {
|
|
1565
|
+
mutationClearScore: mutation
|
|
1566
|
+
};
|
|
1567
|
+
}
|
|
1519
1568
|
function useSubmitAssignmentScore({
|
|
1520
1569
|
onAssignmentSubmitted,
|
|
1521
1570
|
studentName
|