@pocketprep/types 1.19.31 → 1.19.33
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/Study/Class.d.ts +45 -1
- package/Study/Cloud.d.ts +15 -0
- package/package.json +1 -1
package/Study/Class.d.ts
CHANGED
|
@@ -666,9 +666,10 @@ export type MockExamJSON = ReturnType<MockExam['toJSON']>
|
|
|
666
666
|
export type MockExamPayload = Payload<MockExam>
|
|
667
667
|
|
|
668
668
|
export type Reference = Parse.Object<{
|
|
669
|
-
citationTemplate:
|
|
669
|
+
citationTemplate?: string // DEPRECATED: use source instead
|
|
670
670
|
weaviateCollectionName?: string // DEPRECATED: use documentId instead
|
|
671
671
|
documentId: string
|
|
672
|
+
source: string
|
|
672
673
|
name?: string
|
|
673
674
|
isbn13?: string
|
|
674
675
|
filename?: string
|
|
@@ -940,6 +941,49 @@ export type AggregateStats = Parse.Object<{
|
|
|
940
941
|
export type AggregateStatsPayload = Payload<AggregateStats>
|
|
941
942
|
export type AggregateStatsJSON = ReturnType<AggregateStats['toJSON']>
|
|
942
943
|
|
|
944
|
+
export type LatestAnswerBySerial = { [serial: string]: boolean }
|
|
945
|
+
|
|
946
|
+
export type SubjectStudyStats = {
|
|
947
|
+
subjectId: string
|
|
948
|
+
name: string
|
|
949
|
+
totalAnswersCount: number
|
|
950
|
+
totalCorrectAnswersCount: number
|
|
951
|
+
averageScore: number
|
|
952
|
+
}
|
|
953
|
+
|
|
954
|
+
/**
|
|
955
|
+
* The stats calculated from a user's accumulated answers and the exam's question bank
|
|
956
|
+
*/
|
|
957
|
+
export type ComputedStudyStats = {
|
|
958
|
+
totalAnswersCount: number
|
|
959
|
+
totalCorrectAnswersCount: number
|
|
960
|
+
averageScore: number
|
|
961
|
+
totalQuizzesCount: number // Excludes QotD and Mock Exams
|
|
962
|
+
daysStudyingCount: number
|
|
963
|
+
studyingDurationSeconds: number // Excludes Mock Exams
|
|
964
|
+
subjectStats: SubjectStudyStats[]
|
|
965
|
+
unansweredCount: {
|
|
966
|
+
premium: number
|
|
967
|
+
free: number
|
|
968
|
+
}
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
/**
|
|
972
|
+
* A user's study stats for one exam version, one document per user per version.
|
|
973
|
+
*/
|
|
974
|
+
export type StudyStats = Parse.Object<{
|
|
975
|
+
user: User | Parse.Pointer
|
|
976
|
+
examMetadata: ExamMetadata | Parse.Pointer
|
|
977
|
+
latestAnswerBySerial: LatestAnswerBySerial
|
|
978
|
+
quizCount: number // Excludes QotD and Mock Exams
|
|
979
|
+
studyDays: string[]
|
|
980
|
+
durationSeconds: number // Excludes Mock Exams
|
|
981
|
+
studyStats: ComputedStudyStats
|
|
982
|
+
}>
|
|
983
|
+
|
|
984
|
+
export type StudyStatsPayload = Payload<StudyStats>
|
|
985
|
+
export type StudyStatsJSON = ReturnType<StudyStats['toJSON']>
|
|
986
|
+
|
|
943
987
|
export type PrebuiltQuiz = Parse.Object<{
|
|
944
988
|
name: string
|
|
945
989
|
questionSerials: string[]
|
package/Study/Cloud.d.ts
CHANGED
|
@@ -33,6 +33,7 @@ import {
|
|
|
33
33
|
ConceptQuizJSON,
|
|
34
34
|
QuizJSON,
|
|
35
35
|
CrossPlatformConfig,
|
|
36
|
+
ComputedStudyStats,
|
|
36
37
|
} from './Class'
|
|
37
38
|
|
|
38
39
|
// DEPRECATED - previously used answer package for a quiz or qotd
|
|
@@ -106,6 +107,17 @@ export interface IRecordQuizPayload {
|
|
|
106
107
|
includeRecommendedNext?: boolean
|
|
107
108
|
includeReadiness?: boolean
|
|
108
109
|
includeConceptQuiz?: boolean
|
|
110
|
+
includeStudyStats?: boolean
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* The study stats a client renders on its stats page.
|
|
115
|
+
* Calculated on the server so that all clients show the same values.
|
|
116
|
+
*/
|
|
117
|
+
export type TStudyStats = Omit<ComputedStudyStats, 'unansweredCount'> & {
|
|
118
|
+
totalUnansweredCount: number
|
|
119
|
+
examCommunityAverage: number
|
|
120
|
+
weakestSubjectId?: string
|
|
109
121
|
}
|
|
110
122
|
|
|
111
123
|
export type TLevelUpProgress = NonNullable<UserExamMetadataJSON['levelUpProgress']>
|
|
@@ -193,6 +205,7 @@ export type recordQuizV2 = (
|
|
|
193
205
|
}
|
|
194
206
|
tip: RecommendationTip | null
|
|
195
207
|
recommendedNext: Recommendation | null
|
|
208
|
+
studyStats?: TStudyStats
|
|
196
209
|
}
|
|
197
210
|
|
|
198
211
|
export type recordQuizAnswers = (params: {
|
|
@@ -442,9 +455,11 @@ export type fetchUserDataV2 = (params: {
|
|
|
442
455
|
lastFetchedAt?: string // ISO8901 date string
|
|
443
456
|
version?: string
|
|
444
457
|
includeQuestionMetrics?: boolean
|
|
458
|
+
includeStudyStats?: boolean
|
|
445
459
|
}) => {
|
|
446
460
|
quizzes: QuizJSON[]
|
|
447
461
|
subscriptions: Subscription[]
|
|
462
|
+
studyStats?: TStudyStats
|
|
448
463
|
user: User
|
|
449
464
|
userExamMetadata: UserExamMetadata | undefined
|
|
450
465
|
referralInfo: {
|