@easyedu/js-lsm-api 1.98.0 → 1.100.0
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/.openapi-generator/FILES +22 -0
- package/README.md +21 -2
- package/dist/apis/ContentLibraryQuizApi.d.ts +17 -0
- package/dist/apis/ContentLibraryQuizApi.js +45 -0
- package/dist/apis/CourseApi.d.ts +60 -0
- package/dist/apis/CourseApi.js +167 -0
- package/dist/apis/PlayerApi.d.ts +74 -0
- package/dist/apis/PlayerApi.js +193 -0
- package/dist/esm/apis/ContentLibraryQuizApi.d.ts +17 -0
- package/dist/esm/apis/ContentLibraryQuizApi.js +45 -0
- package/dist/esm/apis/CourseApi.d.ts +60 -0
- package/dist/esm/apis/CourseApi.js +167 -0
- package/dist/esm/apis/PlayerApi.d.ts +74 -0
- package/dist/esm/apis/PlayerApi.js +193 -0
- package/dist/esm/models/GetAttemptAllowance.d.ts +80 -0
- package/dist/esm/models/GetAttemptAllowance.js +75 -0
- package/dist/esm/models/GetCourseVersionItemSession.d.ts +6 -0
- package/dist/esm/models/GetCourseVersionItemSession.js +4 -0
- package/dist/esm/models/GetLibraryQuizSession.d.ts +6 -0
- package/dist/esm/models/GetLibraryQuizSession.js +4 -0
- package/dist/esm/models/GetResourceSession.d.ts +6 -0
- package/dist/esm/models/GetResourceSession.js +4 -0
- package/dist/esm/models/GetResourceSessionActivity.d.ts +125 -0
- package/dist/esm/models/GetResourceSessionActivity.js +97 -0
- package/dist/esm/models/GetResourceSessionActivityEvent.d.ts +62 -0
- package/dist/esm/models/GetResourceSessionActivityEvent.js +61 -0
- package/dist/esm/models/GetResourceSessionActivityEventList.d.ts +33 -0
- package/dist/esm/models/GetResourceSessionActivityEventList.js +44 -0
- package/dist/esm/models/GetResourceSessionActivityList.d.ts +33 -0
- package/dist/esm/models/GetResourceSessionActivityList.js +44 -0
- package/dist/esm/models/PostClearSessions.d.ts +32 -0
- package/dist/esm/models/PostClearSessions.js +43 -0
- package/dist/esm/models/PostClearSessionsResponse.d.ts +44 -0
- package/dist/esm/models/PostClearSessionsResponse.js +51 -0
- package/dist/esm/models/PostResourceSessionActivityEvent.d.ts +62 -0
- package/dist/esm/models/PostResourceSessionActivityEvent.js +66 -0
- package/dist/esm/models/PutAttemptAllowance.d.ts +38 -0
- package/dist/esm/models/PutAttemptAllowance.js +47 -0
- package/dist/esm/models/PutLibraryQuizSessionOverride.d.ts +57 -0
- package/dist/esm/models/PutLibraryQuizSessionOverride.js +55 -0
- package/dist/esm/models/PutResourceSessionOverride.d.ts +69 -0
- package/dist/esm/models/PutResourceSessionOverride.js +66 -0
- package/dist/esm/models/index.d.ts +11 -0
- package/dist/esm/models/index.js +11 -0
- package/dist/models/GetAttemptAllowance.d.ts +80 -0
- package/dist/models/GetAttemptAllowance.js +82 -0
- package/dist/models/GetCourseVersionItemSession.d.ts +6 -0
- package/dist/models/GetCourseVersionItemSession.js +4 -0
- package/dist/models/GetLibraryQuizSession.d.ts +6 -0
- package/dist/models/GetLibraryQuizSession.js +4 -0
- package/dist/models/GetResourceSession.d.ts +6 -0
- package/dist/models/GetResourceSession.js +4 -0
- package/dist/models/GetResourceSessionActivity.d.ts +125 -0
- package/dist/models/GetResourceSessionActivity.js +105 -0
- package/dist/models/GetResourceSessionActivityEvent.d.ts +62 -0
- package/dist/models/GetResourceSessionActivityEvent.js +68 -0
- package/dist/models/GetResourceSessionActivityEventList.d.ts +33 -0
- package/dist/models/GetResourceSessionActivityEventList.js +51 -0
- package/dist/models/GetResourceSessionActivityList.d.ts +33 -0
- package/dist/models/GetResourceSessionActivityList.js +51 -0
- package/dist/models/PostClearSessions.d.ts +32 -0
- package/dist/models/PostClearSessions.js +50 -0
- package/dist/models/PostClearSessionsResponse.d.ts +44 -0
- package/dist/models/PostClearSessionsResponse.js +58 -0
- package/dist/models/PostResourceSessionActivityEvent.d.ts +62 -0
- package/dist/models/PostResourceSessionActivityEvent.js +74 -0
- package/dist/models/PutAttemptAllowance.d.ts +38 -0
- package/dist/models/PutAttemptAllowance.js +54 -0
- package/dist/models/PutLibraryQuizSessionOverride.d.ts +57 -0
- package/dist/models/PutLibraryQuizSessionOverride.js +63 -0
- package/dist/models/PutResourceSessionOverride.d.ts +69 -0
- package/dist/models/PutResourceSessionOverride.js +74 -0
- package/dist/models/index.d.ts +11 -0
- package/dist/models/index.js +11 -0
- package/docs/ContentLibraryQuizApi.md +73 -2
- package/docs/CourseApi.md +236 -0
- package/docs/GetAttemptAllowance.md +51 -0
- package/docs/GetCourseVersionItemSession.md +2 -0
- package/docs/GetLibraryQuizSession.md +2 -0
- package/docs/GetResourceSession.md +2 -0
- package/docs/GetResourceSessionActivity.md +63 -0
- package/docs/GetResourceSessionActivityEvent.md +45 -0
- package/docs/GetResourceSessionActivityEventList.md +35 -0
- package/docs/GetResourceSessionActivityList.md +35 -0
- package/docs/PlayerApi.md +302 -6
- package/docs/PostClearSessions.md +34 -0
- package/docs/PostClearSessionsResponse.md +38 -0
- package/docs/PostResourceSessionActivityEvent.md +39 -0
- package/docs/PutAttemptAllowance.md +36 -0
- package/docs/PutLibraryQuizSessionOverride.md +41 -0
- package/docs/PutResourceSessionOverride.md +41 -0
- package/package.json +1 -1
- package/src/apis/ContentLibraryQuizApi.ts +65 -0
- package/src/apis/CourseApi.ts +270 -0
- package/src/apis/PlayerApi.ts +282 -0
- package/src/models/GetAttemptAllowance.ts +138 -0
- package/src/models/GetCourseVersionItemSession.ts +9 -0
- package/src/models/GetLibraryQuizSession.ts +9 -0
- package/src/models/GetResourceSession.ts +9 -0
- package/src/models/GetResourceSessionActivity.ts +199 -0
- package/src/models/GetResourceSessionActivityEvent.ts +110 -0
- package/src/models/GetResourceSessionActivityEventList.ts +74 -0
- package/src/models/GetResourceSessionActivityList.ts +74 -0
- package/src/models/PostClearSessions.ts +66 -0
- package/src/models/PostClearSessionsResponse.ts +84 -0
- package/src/models/PostResourceSessionActivityEvent.ts +104 -0
- package/src/models/PutAttemptAllowance.ts +75 -0
- package/src/models/PutLibraryQuizSessionOverride.ts +100 -0
- package/src/models/PutResourceSessionOverride.ts +113 -0
- package/src/models/index.ts +11 -0
package/src/apis/PlayerApi.ts
CHANGED
|
@@ -18,6 +18,21 @@ import {
|
|
|
18
18
|
GetResourceSessionFromJSON,
|
|
19
19
|
GetResourceSessionToJSON,
|
|
20
20
|
} from '../models/GetResourceSession';
|
|
21
|
+
import {
|
|
22
|
+
type GetResourceSessionActivity,
|
|
23
|
+
GetResourceSessionActivityFromJSON,
|
|
24
|
+
GetResourceSessionActivityToJSON,
|
|
25
|
+
} from '../models/GetResourceSessionActivity';
|
|
26
|
+
import {
|
|
27
|
+
type GetResourceSessionActivityEventList,
|
|
28
|
+
GetResourceSessionActivityEventListFromJSON,
|
|
29
|
+
GetResourceSessionActivityEventListToJSON,
|
|
30
|
+
} from '../models/GetResourceSessionActivityEventList';
|
|
31
|
+
import {
|
|
32
|
+
type GetResourceSessionActivityList,
|
|
33
|
+
GetResourceSessionActivityListFromJSON,
|
|
34
|
+
GetResourceSessionActivityListToJSON,
|
|
35
|
+
} from '../models/GetResourceSessionActivityList';
|
|
21
36
|
import {
|
|
22
37
|
type GetResourceSessionDiagnostics,
|
|
23
38
|
GetResourceSessionDiagnosticsFromJSON,
|
|
@@ -38,6 +53,16 @@ import {
|
|
|
38
53
|
GetResourceSessionScormDataFromJSON,
|
|
39
54
|
GetResourceSessionScormDataToJSON,
|
|
40
55
|
} from '../models/GetResourceSessionScormData';
|
|
56
|
+
import {
|
|
57
|
+
type PostResourceSessionActivityEvent,
|
|
58
|
+
PostResourceSessionActivityEventFromJSON,
|
|
59
|
+
PostResourceSessionActivityEventToJSON,
|
|
60
|
+
} from '../models/PostResourceSessionActivityEvent';
|
|
61
|
+
import {
|
|
62
|
+
type PutResourceSessionOverride,
|
|
63
|
+
PutResourceSessionOverrideFromJSON,
|
|
64
|
+
PutResourceSessionOverrideToJSON,
|
|
65
|
+
} from '../models/PutResourceSessionOverride';
|
|
41
66
|
import {
|
|
42
67
|
type ResourceSessionEnvironment,
|
|
43
68
|
ResourceSessionEnvironmentFromJSON,
|
|
@@ -66,6 +91,7 @@ import {
|
|
|
66
91
|
|
|
67
92
|
export interface CommitResourceScormSessionRequest {
|
|
68
93
|
sessionId: string;
|
|
94
|
+
activityId?: string;
|
|
69
95
|
}
|
|
70
96
|
|
|
71
97
|
export interface GetCourseVersionResourceAssetRequest {
|
|
@@ -81,12 +107,21 @@ export interface GetLibraryQuizSessionPlayerRequest {
|
|
|
81
107
|
export interface GetResourceScormValueRequest {
|
|
82
108
|
sessionId: string;
|
|
83
109
|
key: string;
|
|
110
|
+
activityId?: string;
|
|
84
111
|
}
|
|
85
112
|
|
|
86
113
|
export interface GetResourceSessionRequest {
|
|
87
114
|
sessionId: string;
|
|
88
115
|
}
|
|
89
116
|
|
|
117
|
+
export interface GetResourceSessionActivitiesRequest {
|
|
118
|
+
sessionId: string;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export interface GetResourceSessionActivityEventsRequest {
|
|
122
|
+
sessionId: string;
|
|
123
|
+
}
|
|
124
|
+
|
|
90
125
|
export interface GetResourceSessionAssetRequest {
|
|
91
126
|
sessionId: string;
|
|
92
127
|
assetPath: string;
|
|
@@ -135,23 +170,38 @@ export interface GetResourceSessionScormApiLogsRequest {
|
|
|
135
170
|
|
|
136
171
|
export interface GetResourceSessionScormDataRequest {
|
|
137
172
|
sessionId: string;
|
|
173
|
+
activityId?: string;
|
|
138
174
|
}
|
|
139
175
|
|
|
140
176
|
export interface InitializeResourceScormSessionRequest {
|
|
141
177
|
sessionId: string;
|
|
178
|
+
activityId?: string;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
export interface PostResourceSessionActivityEventRequest {
|
|
182
|
+
sessionId: string;
|
|
183
|
+
activityId: string;
|
|
184
|
+
postResourceSessionActivityEvent: PostResourceSessionActivityEvent;
|
|
142
185
|
}
|
|
143
186
|
|
|
144
187
|
export interface PostResourceSessionCompleteRequest {
|
|
145
188
|
sessionId: string;
|
|
146
189
|
}
|
|
147
190
|
|
|
191
|
+
export interface PutResourceSessionOverrideRequest {
|
|
192
|
+
sessionId: string;
|
|
193
|
+
putResourceSessionOverride: PutResourceSessionOverride;
|
|
194
|
+
}
|
|
195
|
+
|
|
148
196
|
export interface SetResourceScormValueRequest {
|
|
149
197
|
sessionId: string;
|
|
150
198
|
scormSetValueRequest: ScormSetValueRequest;
|
|
199
|
+
activityId?: string;
|
|
151
200
|
}
|
|
152
201
|
|
|
153
202
|
export interface TerminateResourceScormSessionRequest {
|
|
154
203
|
sessionId: string;
|
|
204
|
+
activityId?: string;
|
|
155
205
|
}
|
|
156
206
|
|
|
157
207
|
/**
|
|
@@ -172,6 +222,10 @@ export class PlayerApi extends runtime.BaseAPI {
|
|
|
172
222
|
|
|
173
223
|
const queryParameters: any = {};
|
|
174
224
|
|
|
225
|
+
if (requestParameters['activityId'] != null) {
|
|
226
|
+
queryParameters['activity_id'] = requestParameters['activityId'];
|
|
227
|
+
}
|
|
228
|
+
|
|
175
229
|
const headerParameters: runtime.HTTPHeaders = {};
|
|
176
230
|
|
|
177
231
|
|
|
@@ -337,6 +391,10 @@ export class PlayerApi extends runtime.BaseAPI {
|
|
|
337
391
|
queryParameters['key'] = requestParameters['key'];
|
|
338
392
|
}
|
|
339
393
|
|
|
394
|
+
if (requestParameters['activityId'] != null) {
|
|
395
|
+
queryParameters['activity_id'] = requestParameters['activityId'];
|
|
396
|
+
}
|
|
397
|
+
|
|
340
398
|
const headerParameters: runtime.HTTPHeaders = {};
|
|
341
399
|
|
|
342
400
|
|
|
@@ -414,6 +472,96 @@ export class PlayerApi extends runtime.BaseAPI {
|
|
|
414
472
|
return await response.value();
|
|
415
473
|
}
|
|
416
474
|
|
|
475
|
+
/**
|
|
476
|
+
* Creates request options for getResourceSessionActivities without sending the request
|
|
477
|
+
*/
|
|
478
|
+
async getResourceSessionActivitiesRequestOpts(requestParameters: GetResourceSessionActivitiesRequest): Promise<runtime.RequestOpts> {
|
|
479
|
+
if (requestParameters['sessionId'] == null) {
|
|
480
|
+
throw new runtime.RequiredError(
|
|
481
|
+
'sessionId',
|
|
482
|
+
'Required parameter "sessionId" was null or undefined when calling getResourceSessionActivities().'
|
|
483
|
+
);
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
const queryParameters: any = {};
|
|
487
|
+
|
|
488
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
489
|
+
|
|
490
|
+
|
|
491
|
+
let urlPath = `/resource/sessions/{sessionId}/activities`;
|
|
492
|
+
urlPath = urlPath.replace('{sessionId}', encodeURIComponent(String(requestParameters['sessionId'])));
|
|
493
|
+
|
|
494
|
+
return {
|
|
495
|
+
path: urlPath,
|
|
496
|
+
method: 'GET',
|
|
497
|
+
headers: headerParameters,
|
|
498
|
+
query: queryParameters,
|
|
499
|
+
};
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
/**
|
|
503
|
+
* List tracked activities for a resource session
|
|
504
|
+
*/
|
|
505
|
+
async getResourceSessionActivitiesRaw(requestParameters: GetResourceSessionActivitiesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetResourceSessionActivityList>> {
|
|
506
|
+
const requestOptions = await this.getResourceSessionActivitiesRequestOpts(requestParameters);
|
|
507
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
508
|
+
|
|
509
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => GetResourceSessionActivityListFromJSON(jsonValue));
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
/**
|
|
513
|
+
* List tracked activities for a resource session
|
|
514
|
+
*/
|
|
515
|
+
async getResourceSessionActivities(requestParameters: GetResourceSessionActivitiesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetResourceSessionActivityList> {
|
|
516
|
+
const response = await this.getResourceSessionActivitiesRaw(requestParameters, initOverrides);
|
|
517
|
+
return await response.value();
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
/**
|
|
521
|
+
* Creates request options for getResourceSessionActivityEvents without sending the request
|
|
522
|
+
*/
|
|
523
|
+
async getResourceSessionActivityEventsRequestOpts(requestParameters: GetResourceSessionActivityEventsRequest): Promise<runtime.RequestOpts> {
|
|
524
|
+
if (requestParameters['sessionId'] == null) {
|
|
525
|
+
throw new runtime.RequiredError(
|
|
526
|
+
'sessionId',
|
|
527
|
+
'Required parameter "sessionId" was null or undefined when calling getResourceSessionActivityEvents().'
|
|
528
|
+
);
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
const queryParameters: any = {};
|
|
532
|
+
|
|
533
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
534
|
+
|
|
535
|
+
|
|
536
|
+
let urlPath = `/resource/sessions/{sessionId}/activity-events`;
|
|
537
|
+
urlPath = urlPath.replace('{sessionId}', encodeURIComponent(String(requestParameters['sessionId'])));
|
|
538
|
+
|
|
539
|
+
return {
|
|
540
|
+
path: urlPath,
|
|
541
|
+
method: 'GET',
|
|
542
|
+
headers: headerParameters,
|
|
543
|
+
query: queryParameters,
|
|
544
|
+
};
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
/**
|
|
548
|
+
* List recorded learner activity events for a resource session
|
|
549
|
+
*/
|
|
550
|
+
async getResourceSessionActivityEventsRaw(requestParameters: GetResourceSessionActivityEventsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetResourceSessionActivityEventList>> {
|
|
551
|
+
const requestOptions = await this.getResourceSessionActivityEventsRequestOpts(requestParameters);
|
|
552
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
553
|
+
|
|
554
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => GetResourceSessionActivityEventListFromJSON(jsonValue));
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
/**
|
|
558
|
+
* List recorded learner activity events for a resource session
|
|
559
|
+
*/
|
|
560
|
+
async getResourceSessionActivityEvents(requestParameters: GetResourceSessionActivityEventsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetResourceSessionActivityEventList> {
|
|
561
|
+
const response = await this.getResourceSessionActivityEventsRaw(requestParameters, initOverrides);
|
|
562
|
+
return await response.value();
|
|
563
|
+
}
|
|
564
|
+
|
|
417
565
|
/**
|
|
418
566
|
* Creates request options for getResourceSessionAsset without sending the request
|
|
419
567
|
*/
|
|
@@ -760,6 +908,10 @@ export class PlayerApi extends runtime.BaseAPI {
|
|
|
760
908
|
|
|
761
909
|
const queryParameters: any = {};
|
|
762
910
|
|
|
911
|
+
if (requestParameters['activityId'] != null) {
|
|
912
|
+
queryParameters['activity_id'] = requestParameters['activityId'];
|
|
913
|
+
}
|
|
914
|
+
|
|
763
915
|
const headerParameters: runtime.HTTPHeaders = {};
|
|
764
916
|
|
|
765
917
|
|
|
@@ -805,6 +957,10 @@ export class PlayerApi extends runtime.BaseAPI {
|
|
|
805
957
|
|
|
806
958
|
const queryParameters: any = {};
|
|
807
959
|
|
|
960
|
+
if (requestParameters['activityId'] != null) {
|
|
961
|
+
queryParameters['activity_id'] = requestParameters['activityId'];
|
|
962
|
+
}
|
|
963
|
+
|
|
808
964
|
const headerParameters: runtime.HTTPHeaders = {};
|
|
809
965
|
|
|
810
966
|
|
|
@@ -836,6 +992,69 @@ export class PlayerApi extends runtime.BaseAPI {
|
|
|
836
992
|
await this.initializeResourceScormSessionRaw(requestParameters, initOverrides);
|
|
837
993
|
}
|
|
838
994
|
|
|
995
|
+
/**
|
|
996
|
+
* Creates request options for postResourceSessionActivityEvent without sending the request
|
|
997
|
+
*/
|
|
998
|
+
async postResourceSessionActivityEventRequestOpts(requestParameters: PostResourceSessionActivityEventRequest): Promise<runtime.RequestOpts> {
|
|
999
|
+
if (requestParameters['sessionId'] == null) {
|
|
1000
|
+
throw new runtime.RequiredError(
|
|
1001
|
+
'sessionId',
|
|
1002
|
+
'Required parameter "sessionId" was null or undefined when calling postResourceSessionActivityEvent().'
|
|
1003
|
+
);
|
|
1004
|
+
}
|
|
1005
|
+
|
|
1006
|
+
if (requestParameters['activityId'] == null) {
|
|
1007
|
+
throw new runtime.RequiredError(
|
|
1008
|
+
'activityId',
|
|
1009
|
+
'Required parameter "activityId" was null or undefined when calling postResourceSessionActivityEvent().'
|
|
1010
|
+
);
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
if (requestParameters['postResourceSessionActivityEvent'] == null) {
|
|
1014
|
+
throw new runtime.RequiredError(
|
|
1015
|
+
'postResourceSessionActivityEvent',
|
|
1016
|
+
'Required parameter "postResourceSessionActivityEvent" was null or undefined when calling postResourceSessionActivityEvent().'
|
|
1017
|
+
);
|
|
1018
|
+
}
|
|
1019
|
+
|
|
1020
|
+
const queryParameters: any = {};
|
|
1021
|
+
|
|
1022
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
1023
|
+
|
|
1024
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
1025
|
+
|
|
1026
|
+
|
|
1027
|
+
let urlPath = `/resource/sessions/{sessionId}/activities/{activityId}/events`;
|
|
1028
|
+
urlPath = urlPath.replace('{sessionId}', encodeURIComponent(String(requestParameters['sessionId'])));
|
|
1029
|
+
urlPath = urlPath.replace('{activityId}', encodeURIComponent(String(requestParameters['activityId'])));
|
|
1030
|
+
|
|
1031
|
+
return {
|
|
1032
|
+
path: urlPath,
|
|
1033
|
+
method: 'POST',
|
|
1034
|
+
headers: headerParameters,
|
|
1035
|
+
query: queryParameters,
|
|
1036
|
+
body: PostResourceSessionActivityEventToJSON(requestParameters['postResourceSessionActivityEvent']),
|
|
1037
|
+
};
|
|
1038
|
+
}
|
|
1039
|
+
|
|
1040
|
+
/**
|
|
1041
|
+
* Record learner activity and update active time
|
|
1042
|
+
*/
|
|
1043
|
+
async postResourceSessionActivityEventRaw(requestParameters: PostResourceSessionActivityEventRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetResourceSessionActivity>> {
|
|
1044
|
+
const requestOptions = await this.postResourceSessionActivityEventRequestOpts(requestParameters);
|
|
1045
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
1046
|
+
|
|
1047
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => GetResourceSessionActivityFromJSON(jsonValue));
|
|
1048
|
+
}
|
|
1049
|
+
|
|
1050
|
+
/**
|
|
1051
|
+
* Record learner activity and update active time
|
|
1052
|
+
*/
|
|
1053
|
+
async postResourceSessionActivityEvent(requestParameters: PostResourceSessionActivityEventRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetResourceSessionActivity> {
|
|
1054
|
+
const response = await this.postResourceSessionActivityEventRaw(requestParameters, initOverrides);
|
|
1055
|
+
return await response.value();
|
|
1056
|
+
}
|
|
1057
|
+
|
|
839
1058
|
/**
|
|
840
1059
|
* Creates request options for postResourceSessionComplete without sending the request
|
|
841
1060
|
*/
|
|
@@ -881,6 +1100,61 @@ export class PlayerApi extends runtime.BaseAPI {
|
|
|
881
1100
|
return await response.value();
|
|
882
1101
|
}
|
|
883
1102
|
|
|
1103
|
+
/**
|
|
1104
|
+
* Creates request options for putResourceSessionOverride without sending the request
|
|
1105
|
+
*/
|
|
1106
|
+
async putResourceSessionOverrideRequestOpts(requestParameters: PutResourceSessionOverrideRequest): Promise<runtime.RequestOpts> {
|
|
1107
|
+
if (requestParameters['sessionId'] == null) {
|
|
1108
|
+
throw new runtime.RequiredError(
|
|
1109
|
+
'sessionId',
|
|
1110
|
+
'Required parameter "sessionId" was null or undefined when calling putResourceSessionOverride().'
|
|
1111
|
+
);
|
|
1112
|
+
}
|
|
1113
|
+
|
|
1114
|
+
if (requestParameters['putResourceSessionOverride'] == null) {
|
|
1115
|
+
throw new runtime.RequiredError(
|
|
1116
|
+
'putResourceSessionOverride',
|
|
1117
|
+
'Required parameter "putResourceSessionOverride" was null or undefined when calling putResourceSessionOverride().'
|
|
1118
|
+
);
|
|
1119
|
+
}
|
|
1120
|
+
|
|
1121
|
+
const queryParameters: any = {};
|
|
1122
|
+
|
|
1123
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
1124
|
+
|
|
1125
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
1126
|
+
|
|
1127
|
+
|
|
1128
|
+
let urlPath = `/resource/sessions/{sessionId}/override`;
|
|
1129
|
+
urlPath = urlPath.replace('{sessionId}', encodeURIComponent(String(requestParameters['sessionId'])));
|
|
1130
|
+
|
|
1131
|
+
return {
|
|
1132
|
+
path: urlPath,
|
|
1133
|
+
method: 'PUT',
|
|
1134
|
+
headers: headerParameters,
|
|
1135
|
+
query: queryParameters,
|
|
1136
|
+
body: PutResourceSessionOverrideToJSON(requestParameters['putResourceSessionOverride']),
|
|
1137
|
+
};
|
|
1138
|
+
}
|
|
1139
|
+
|
|
1140
|
+
/**
|
|
1141
|
+
* Override a learner\'s live resource-session progress
|
|
1142
|
+
*/
|
|
1143
|
+
async putResourceSessionOverrideRaw(requestParameters: PutResourceSessionOverrideRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetResourceSession>> {
|
|
1144
|
+
const requestOptions = await this.putResourceSessionOverrideRequestOpts(requestParameters);
|
|
1145
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
1146
|
+
|
|
1147
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => GetResourceSessionFromJSON(jsonValue));
|
|
1148
|
+
}
|
|
1149
|
+
|
|
1150
|
+
/**
|
|
1151
|
+
* Override a learner\'s live resource-session progress
|
|
1152
|
+
*/
|
|
1153
|
+
async putResourceSessionOverride(requestParameters: PutResourceSessionOverrideRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetResourceSession> {
|
|
1154
|
+
const response = await this.putResourceSessionOverrideRaw(requestParameters, initOverrides);
|
|
1155
|
+
return await response.value();
|
|
1156
|
+
}
|
|
1157
|
+
|
|
884
1158
|
/**
|
|
885
1159
|
* Creates request options for setResourceScormValue without sending the request
|
|
886
1160
|
*/
|
|
@@ -901,6 +1175,10 @@ export class PlayerApi extends runtime.BaseAPI {
|
|
|
901
1175
|
|
|
902
1176
|
const queryParameters: any = {};
|
|
903
1177
|
|
|
1178
|
+
if (requestParameters['activityId'] != null) {
|
|
1179
|
+
queryParameters['activity_id'] = requestParameters['activityId'];
|
|
1180
|
+
}
|
|
1181
|
+
|
|
904
1182
|
const headerParameters: runtime.HTTPHeaders = {};
|
|
905
1183
|
|
|
906
1184
|
headerParameters['Content-Type'] = 'application/json';
|
|
@@ -949,6 +1227,10 @@ export class PlayerApi extends runtime.BaseAPI {
|
|
|
949
1227
|
|
|
950
1228
|
const queryParameters: any = {};
|
|
951
1229
|
|
|
1230
|
+
if (requestParameters['activityId'] != null) {
|
|
1231
|
+
queryParameters['activity_id'] = requestParameters['activityId'];
|
|
1232
|
+
}
|
|
1233
|
+
|
|
952
1234
|
const headerParameters: runtime.HTTPHeaders = {};
|
|
953
1235
|
|
|
954
1236
|
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* LMS API
|
|
5
|
+
* LMS API
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0.0
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { mapValues } from '../runtime';
|
|
16
|
+
/**
|
|
17
|
+
* The effective attempt limit for one learner and course-version item.
|
|
18
|
+
* @export
|
|
19
|
+
* @interface GetAttemptAllowance
|
|
20
|
+
*/
|
|
21
|
+
export interface GetAttemptAllowance {
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @type {string}
|
|
25
|
+
* @memberof GetAttemptAllowance
|
|
26
|
+
*/
|
|
27
|
+
courseId: string;
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @type {string}
|
|
31
|
+
* @memberof GetAttemptAllowance
|
|
32
|
+
*/
|
|
33
|
+
courseVersionId: string;
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
* @type {string}
|
|
37
|
+
* @memberof GetAttemptAllowance
|
|
38
|
+
*/
|
|
39
|
+
itemId: string;
|
|
40
|
+
/**
|
|
41
|
+
*
|
|
42
|
+
* @type {string}
|
|
43
|
+
* @memberof GetAttemptAllowance
|
|
44
|
+
*/
|
|
45
|
+
userId: string;
|
|
46
|
+
/**
|
|
47
|
+
*
|
|
48
|
+
* @type {number}
|
|
49
|
+
* @memberof GetAttemptAllowance
|
|
50
|
+
*/
|
|
51
|
+
baseMaxAttempts: number;
|
|
52
|
+
/**
|
|
53
|
+
*
|
|
54
|
+
* @type {number}
|
|
55
|
+
* @memberof GetAttemptAllowance
|
|
56
|
+
*/
|
|
57
|
+
additionalAttempts: number;
|
|
58
|
+
/**
|
|
59
|
+
*
|
|
60
|
+
* @type {number}
|
|
61
|
+
* @memberof GetAttemptAllowance
|
|
62
|
+
*/
|
|
63
|
+
effectiveMaxAttempts: number;
|
|
64
|
+
/**
|
|
65
|
+
*
|
|
66
|
+
* @type {number}
|
|
67
|
+
* @memberof GetAttemptAllowance
|
|
68
|
+
*/
|
|
69
|
+
attemptsUsed: number;
|
|
70
|
+
/**
|
|
71
|
+
*
|
|
72
|
+
* @type {number}
|
|
73
|
+
* @memberof GetAttemptAllowance
|
|
74
|
+
*/
|
|
75
|
+
attemptsRemaining: number;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Check if a given object implements the GetAttemptAllowance interface.
|
|
80
|
+
*/
|
|
81
|
+
export function instanceOfGetAttemptAllowance(value: object): value is GetAttemptAllowance {
|
|
82
|
+
if (!('courseId' in value) || value['courseId'] === undefined) return false;
|
|
83
|
+
if (!('courseVersionId' in value) || value['courseVersionId'] === undefined) return false;
|
|
84
|
+
if (!('itemId' in value) || value['itemId'] === undefined) return false;
|
|
85
|
+
if (!('userId' in value) || value['userId'] === undefined) return false;
|
|
86
|
+
if (!('baseMaxAttempts' in value) || value['baseMaxAttempts'] === undefined) return false;
|
|
87
|
+
if (!('additionalAttempts' in value) || value['additionalAttempts'] === undefined) return false;
|
|
88
|
+
if (!('effectiveMaxAttempts' in value) || value['effectiveMaxAttempts'] === undefined) return false;
|
|
89
|
+
if (!('attemptsUsed' in value) || value['attemptsUsed'] === undefined) return false;
|
|
90
|
+
if (!('attemptsRemaining' in value) || value['attemptsRemaining'] === undefined) return false;
|
|
91
|
+
return true;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export function GetAttemptAllowanceFromJSON(json: any): GetAttemptAllowance {
|
|
95
|
+
return GetAttemptAllowanceFromJSONTyped(json, false);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export function GetAttemptAllowanceFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetAttemptAllowance {
|
|
99
|
+
if (json == null) {
|
|
100
|
+
return json;
|
|
101
|
+
}
|
|
102
|
+
return {
|
|
103
|
+
|
|
104
|
+
'courseId': json['course_id'],
|
|
105
|
+
'courseVersionId': json['course_version_id'],
|
|
106
|
+
'itemId': json['item_id'],
|
|
107
|
+
'userId': json['user_id'],
|
|
108
|
+
'baseMaxAttempts': json['base_max_attempts'],
|
|
109
|
+
'additionalAttempts': json['additional_attempts'],
|
|
110
|
+
'effectiveMaxAttempts': json['effective_max_attempts'],
|
|
111
|
+
'attemptsUsed': json['attempts_used'],
|
|
112
|
+
'attemptsRemaining': json['attempts_remaining'],
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export function GetAttemptAllowanceToJSON(json: any): GetAttemptAllowance {
|
|
117
|
+
return GetAttemptAllowanceToJSONTyped(json, false);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export function GetAttemptAllowanceToJSONTyped(value?: GetAttemptAllowance | null, ignoreDiscriminator: boolean = false): any {
|
|
121
|
+
if (value == null) {
|
|
122
|
+
return value;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
return {
|
|
126
|
+
|
|
127
|
+
'course_id': value['courseId'],
|
|
128
|
+
'course_version_id': value['courseVersionId'],
|
|
129
|
+
'item_id': value['itemId'],
|
|
130
|
+
'user_id': value['userId'],
|
|
131
|
+
'base_max_attempts': value['baseMaxAttempts'],
|
|
132
|
+
'additional_attempts': value['additionalAttempts'],
|
|
133
|
+
'effective_max_attempts': value['effectiveMaxAttempts'],
|
|
134
|
+
'attempts_used': value['attemptsUsed'],
|
|
135
|
+
'attempts_remaining': value['attemptsRemaining'],
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
|
|
@@ -125,6 +125,12 @@ export interface GetCourseVersionItemSession {
|
|
|
125
125
|
* @memberof GetCourseVersionItemSession
|
|
126
126
|
*/
|
|
127
127
|
scoreRaw?: number | null;
|
|
128
|
+
/**
|
|
129
|
+
* Accumulated active learner time across this session's activities.
|
|
130
|
+
* @type {number}
|
|
131
|
+
* @memberof GetCourseVersionItemSession
|
|
132
|
+
*/
|
|
133
|
+
durationSeconds: number;
|
|
128
134
|
/**
|
|
129
135
|
*
|
|
130
136
|
* @type {number}
|
|
@@ -164,6 +170,7 @@ export function instanceOfGetCourseVersionItemSession(value: object): value is G
|
|
|
164
170
|
if (!('isCurrent' in value) || value['isCurrent'] === undefined) return false;
|
|
165
171
|
if (!('completionStatus' in value) || value['completionStatus'] === undefined) return false;
|
|
166
172
|
if (!('gradeStatus' in value) || value['gradeStatus'] === undefined) return false;
|
|
173
|
+
if (!('durationSeconds' in value) || value['durationSeconds'] === undefined) return false;
|
|
167
174
|
if (!('createdAt' in value) || value['createdAt'] === undefined) return false;
|
|
168
175
|
if (!('updatedAt' in value) || value['updatedAt'] === undefined) return false;
|
|
169
176
|
return true;
|
|
@@ -193,6 +200,7 @@ export function GetCourseVersionItemSessionFromJSONTyped(json: any, ignoreDiscri
|
|
|
193
200
|
'completionStatus': json['completion_status'],
|
|
194
201
|
'gradeStatus': json['grade_status'],
|
|
195
202
|
'scoreRaw': json['score_raw'] == null ? undefined : json['score_raw'],
|
|
203
|
+
'durationSeconds': json['duration_seconds'],
|
|
196
204
|
'createdAt': json['created_at'],
|
|
197
205
|
'updatedAt': json['updated_at'],
|
|
198
206
|
'completedAt': json['completed_at'] == null ? undefined : json['completed_at'],
|
|
@@ -224,6 +232,7 @@ export function GetCourseVersionItemSessionToJSONTyped(value?: GetCourseVersionI
|
|
|
224
232
|
'completion_status': value['completionStatus'],
|
|
225
233
|
'grade_status': value['gradeStatus'],
|
|
226
234
|
'score_raw': value['scoreRaw'],
|
|
235
|
+
'duration_seconds': value['durationSeconds'],
|
|
227
236
|
'created_at': value['createdAt'],
|
|
228
237
|
'updated_at': value['updatedAt'],
|
|
229
238
|
'completed_at': value['completedAt'],
|
|
@@ -172,6 +172,12 @@ export interface GetLibraryQuizSession {
|
|
|
172
172
|
* @memberof GetLibraryQuizSession
|
|
173
173
|
*/
|
|
174
174
|
completedAt?: number | null;
|
|
175
|
+
/**
|
|
176
|
+
* Elapsed attempt time from start through completion, submission, or the latest saved activity.
|
|
177
|
+
* @type {number}
|
|
178
|
+
* @memberof GetLibraryQuizSession
|
|
179
|
+
*/
|
|
180
|
+
durationSeconds: number;
|
|
175
181
|
}
|
|
176
182
|
|
|
177
183
|
|
|
@@ -208,6 +214,7 @@ export function instanceOfGetLibraryQuizSession(value: object): value is GetLibr
|
|
|
208
214
|
if (!('questions' in value) || value['questions'] === undefined) return false;
|
|
209
215
|
if (!('createdAt' in value) || value['createdAt'] === undefined) return false;
|
|
210
216
|
if (!('updatedAt' in value) || value['updatedAt'] === undefined) return false;
|
|
217
|
+
if (!('durationSeconds' in value) || value['durationSeconds'] === undefined) return false;
|
|
211
218
|
return true;
|
|
212
219
|
}
|
|
213
220
|
|
|
@@ -244,6 +251,7 @@ export function GetLibraryQuizSessionFromJSONTyped(json: any, ignoreDiscriminato
|
|
|
244
251
|
'createdAt': json['created_at'],
|
|
245
252
|
'updatedAt': json['updated_at'],
|
|
246
253
|
'completedAt': json['completed_at'] == null ? undefined : json['completed_at'],
|
|
254
|
+
'durationSeconds': json['duration_seconds'],
|
|
247
255
|
};
|
|
248
256
|
}
|
|
249
257
|
|
|
@@ -281,6 +289,7 @@ export function GetLibraryQuizSessionToJSONTyped(value?: GetLibraryQuizSession |
|
|
|
281
289
|
'created_at': value['createdAt'],
|
|
282
290
|
'updated_at': value['updatedAt'],
|
|
283
291
|
'completed_at': value['completedAt'],
|
|
292
|
+
'duration_seconds': value['durationSeconds'],
|
|
284
293
|
};
|
|
285
294
|
}
|
|
286
295
|
|
|
@@ -173,6 +173,12 @@ export interface GetResourceSession {
|
|
|
173
173
|
* @memberof GetResourceSession
|
|
174
174
|
*/
|
|
175
175
|
scoreRaw?: number | null;
|
|
176
|
+
/**
|
|
177
|
+
* Accumulated active learner time across this session's activities.
|
|
178
|
+
* @type {number}
|
|
179
|
+
* @memberof GetResourceSession
|
|
180
|
+
*/
|
|
181
|
+
durationSeconds: number;
|
|
176
182
|
/**
|
|
177
183
|
*
|
|
178
184
|
* @type {number}
|
|
@@ -225,6 +231,7 @@ export function instanceOfGetResourceSession(value: object): value is GetResourc
|
|
|
225
231
|
if (!('isCurrent' in value) || value['isCurrent'] === undefined) return false;
|
|
226
232
|
if (!('completionStatus' in value) || value['completionStatus'] === undefined) return false;
|
|
227
233
|
if (!('gradeStatus' in value) || value['gradeStatus'] === undefined) return false;
|
|
234
|
+
if (!('durationSeconds' in value) || value['durationSeconds'] === undefined) return false;
|
|
228
235
|
if (!('createdAt' in value) || value['createdAt'] === undefined) return false;
|
|
229
236
|
if (!('updatedAt' in value) || value['updatedAt'] === undefined) return false;
|
|
230
237
|
return true;
|
|
@@ -262,6 +269,7 @@ export function GetResourceSessionFromJSONTyped(json: any, ignoreDiscriminator:
|
|
|
262
269
|
'completionStatus': json['completion_status'],
|
|
263
270
|
'gradeStatus': json['grade_status'],
|
|
264
271
|
'scoreRaw': json['score_raw'] == null ? undefined : json['score_raw'],
|
|
272
|
+
'durationSeconds': json['duration_seconds'],
|
|
265
273
|
'initializedAt': json['initialized_at'] == null ? undefined : json['initialized_at'],
|
|
266
274
|
'terminatedAt': json['terminated_at'] == null ? undefined : json['terminated_at'],
|
|
267
275
|
'createdAt': json['created_at'],
|
|
@@ -303,6 +311,7 @@ export function GetResourceSessionToJSONTyped(value?: GetResourceSession | null,
|
|
|
303
311
|
'completion_status': value['completionStatus'],
|
|
304
312
|
'grade_status': value['gradeStatus'],
|
|
305
313
|
'score_raw': value['scoreRaw'],
|
|
314
|
+
'duration_seconds': value['durationSeconds'],
|
|
306
315
|
'initialized_at': value['initializedAt'],
|
|
307
316
|
'terminated_at': value['terminatedAt'],
|
|
308
317
|
'created_at': value['createdAt'],
|