@easyedu/js-lsm-api 1.67.0 → 1.69.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.
Files changed (86) hide show
  1. package/.openapi-generator/FILES +12 -0
  2. package/README.md +10 -2
  3. package/dist/apis/ContentApi.d.ts +56 -0
  4. package/dist/apis/ContentApi.js +121 -1
  5. package/dist/esm/apis/ContentApi.d.ts +56 -0
  6. package/dist/esm/apis/ContentApi.js +120 -0
  7. package/dist/esm/models/ContentAttemptItem.d.ts +69 -0
  8. package/dist/esm/models/ContentAttemptItem.js +68 -0
  9. package/dist/esm/models/ContentAttemptRollupScore.d.ts +38 -0
  10. package/dist/esm/models/ContentAttemptRollupScore.js +47 -0
  11. package/dist/esm/models/ContentAttemptScore.d.ts +50 -0
  12. package/dist/esm/models/ContentAttemptScore.js +47 -0
  13. package/dist/esm/models/ContentAttemptSettings.d.ts +46 -0
  14. package/dist/esm/models/ContentAttemptSettings.js +54 -0
  15. package/dist/esm/models/GetContent.d.ts +7 -0
  16. package/dist/esm/models/GetContent.js +5 -0
  17. package/dist/esm/models/GetContentAttempts.d.ts +90 -0
  18. package/dist/esm/models/GetContentAttempts.js +84 -0
  19. package/dist/esm/models/GetContentSession.d.ts +12 -0
  20. package/dist/esm/models/GetContentSession.js +8 -0
  21. package/dist/esm/models/GetContentSessionDetail.d.ts +12 -0
  22. package/dist/esm/models/GetContentSessionDetail.js +8 -0
  23. package/dist/esm/models/GetContentSessionListItem.d.ts +24 -0
  24. package/dist/esm/models/GetContentSessionListItem.js +16 -0
  25. package/dist/esm/models/PostContentSession.d.ts +12 -0
  26. package/dist/esm/models/PostContentSession.js +8 -0
  27. package/dist/esm/models/PutContent.d.ts +7 -0
  28. package/dist/esm/models/PutContent.js +3 -0
  29. package/dist/esm/models/PutContentAttemptSettings.d.ts +46 -0
  30. package/dist/esm/models/PutContentAttemptSettings.js +50 -0
  31. package/dist/esm/models/index.d.ts +6 -0
  32. package/dist/esm/models/index.js +6 -0
  33. package/dist/models/ContentAttemptItem.d.ts +69 -0
  34. package/dist/models/ContentAttemptItem.js +75 -0
  35. package/dist/models/ContentAttemptRollupScore.d.ts +38 -0
  36. package/dist/models/ContentAttemptRollupScore.js +54 -0
  37. package/dist/models/ContentAttemptScore.d.ts +50 -0
  38. package/dist/models/ContentAttemptScore.js +54 -0
  39. package/dist/models/ContentAttemptSettings.d.ts +46 -0
  40. package/dist/models/ContentAttemptSettings.js +62 -0
  41. package/dist/models/GetContent.d.ts +7 -0
  42. package/dist/models/GetContent.js +5 -0
  43. package/dist/models/GetContentAttempts.d.ts +90 -0
  44. package/dist/models/GetContentAttempts.js +92 -0
  45. package/dist/models/GetContentSession.d.ts +12 -0
  46. package/dist/models/GetContentSession.js +8 -0
  47. package/dist/models/GetContentSessionDetail.d.ts +12 -0
  48. package/dist/models/GetContentSessionDetail.js +8 -0
  49. package/dist/models/GetContentSessionListItem.d.ts +24 -0
  50. package/dist/models/GetContentSessionListItem.js +16 -0
  51. package/dist/models/PostContentSession.d.ts +12 -0
  52. package/dist/models/PostContentSession.js +8 -0
  53. package/dist/models/PutContent.d.ts +7 -0
  54. package/dist/models/PutContent.js +3 -0
  55. package/dist/models/PutContentAttemptSettings.d.ts +46 -0
  56. package/dist/models/PutContentAttemptSettings.js +58 -0
  57. package/dist/models/index.d.ts +6 -0
  58. package/dist/models/index.js +6 -0
  59. package/docs/ContentApi.md +159 -0
  60. package/docs/ContentAttemptItem.md +47 -0
  61. package/docs/ContentAttemptRollupScore.md +37 -0
  62. package/docs/ContentAttemptScore.md +41 -0
  63. package/docs/ContentAttemptSettings.md +36 -0
  64. package/docs/GetContent.md +2 -0
  65. package/docs/GetContentAttempts.md +51 -0
  66. package/docs/GetContentSession.md +4 -0
  67. package/docs/GetContentSessionDetail.md +4 -0
  68. package/docs/GetContentSessionListItem.md +8 -0
  69. package/docs/PostContentSession.md +4 -0
  70. package/docs/PutContent.md +2 -0
  71. package/docs/PutContentAttemptSettings.md +36 -0
  72. package/package.json +1 -1
  73. package/src/apis/ContentApi.ts +172 -0
  74. package/src/models/ContentAttemptItem.ts +128 -0
  75. package/src/models/ContentAttemptRollupScore.ts +75 -0
  76. package/src/models/ContentAttemptScore.ts +89 -0
  77. package/src/models/ContentAttemptSettings.ts +86 -0
  78. package/src/models/GetContent.ts +16 -0
  79. package/src/models/GetContentAttempts.ts +164 -0
  80. package/src/models/GetContentSession.ts +18 -0
  81. package/src/models/GetContentSessionDetail.ts +18 -0
  82. package/src/models/GetContentSessionListItem.ts +36 -0
  83. package/src/models/PostContentSession.ts +18 -0
  84. package/src/models/PutContent.ts +15 -0
  85. package/src/models/PutContentAttemptSettings.ts +84 -0
  86. package/src/models/index.ts +6 -0
@@ -13,6 +13,8 @@ Name | Type
13
13
  `launchMode` | [ContentLaunchMode](ContentLaunchMode.md)
14
14
  `createdAt` | number
15
15
  `playerSessionId` | string
16
+ `attemptNumber` | number
17
+ `isCurrent` | boolean
16
18
 
17
19
  ## Example
18
20
 
@@ -27,6 +29,8 @@ const example = {
27
29
  "launchMode": null,
28
30
  "createdAt": null,
29
31
  "playerSessionId": null,
32
+ "attemptNumber": null,
33
+ "isCurrent": null,
30
34
  } satisfies PostContentSession
31
35
 
32
36
  console.log(example)
@@ -9,6 +9,7 @@ Name | Type
9
9
  `name` | string
10
10
  `published` | boolean
11
11
  `launchMode` | [ContentLaunchMode](ContentLaunchMode.md)
12
+ `attemptSettings` | [PutContentAttemptSettings](PutContentAttemptSettings.md)
12
13
 
13
14
  ## Example
14
15
 
@@ -20,6 +21,7 @@ const example = {
20
21
  "name": null,
21
22
  "published": null,
22
23
  "launchMode": null,
24
+ "attemptSettings": null,
23
25
  } satisfies PutContent
24
26
 
25
27
  console.log(example)
@@ -0,0 +1,36 @@
1
+
2
+ # PutContentAttemptSettings
3
+
4
+
5
+ ## Properties
6
+
7
+ Name | Type
8
+ ------------ | -------------
9
+ `maxAttempts` | number
10
+ `scoreRollupStrategy` | string
11
+
12
+ ## Example
13
+
14
+ ```typescript
15
+ import type { PutContentAttemptSettings } from '@easyedu/js-lsm-api'
16
+
17
+ // TODO: Update the object below with actual values
18
+ const example = {
19
+ "maxAttempts": null,
20
+ "scoreRollupStrategy": null,
21
+ } satisfies PutContentAttemptSettings
22
+
23
+ console.log(example)
24
+
25
+ // Convert the instance to a JSON string
26
+ const exampleJSON: string = JSON.stringify(example)
27
+ console.log(exampleJSON)
28
+
29
+ // Parse the JSON string back to an object
30
+ const exampleParsed = JSON.parse(exampleJSON) as PutContentAttemptSettings
31
+ console.log(exampleParsed)
32
+ ```
33
+
34
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
35
+
36
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easyedu/js-lsm-api",
3
- "version": "1.67.0",
3
+ "version": "1.69.0",
4
4
  "description": "OpenAPI client for @easyedu/js-lsm-api",
5
5
  "author": "OpenAPI-Generator",
6
6
  "repository": {
@@ -18,6 +18,11 @@ import {
18
18
  GetContentFromJSON,
19
19
  GetContentToJSON,
20
20
  } from '../models/GetContent';
21
+ import {
22
+ type GetContentAttempts,
23
+ GetContentAttemptsFromJSON,
24
+ GetContentAttemptsToJSON,
25
+ } from '../models/GetContentAttempts';
21
26
  import {
22
27
  type GetContentList,
23
28
  GetContentListFromJSON,
@@ -147,6 +152,14 @@ export interface GetContentRequest {
147
152
  courseId: string;
148
153
  }
149
154
 
155
+ export interface GetContentAttemptsRequest {
156
+ contentId: string;
157
+ moduleId: string;
158
+ courseId: string;
159
+ userId?: number;
160
+ environment?: GetContentAttemptsEnvironmentEnum;
161
+ }
162
+
150
163
  export interface GetContentListRequest {
151
164
  moduleId: string;
152
165
  courseId: string;
@@ -239,6 +252,13 @@ export interface PostContentSessionRequest {
239
252
  environment?: PostContentSessionEnvironmentEnum;
240
253
  }
241
254
 
255
+ export interface PostContentSessionRetakeRequest {
256
+ contentId: string;
257
+ moduleId: string;
258
+ courseId: string;
259
+ environment?: PostContentSessionRetakeEnvironmentEnum;
260
+ }
261
+
242
262
  export interface PostContentUploadRequest {
243
263
  moduleId: string;
244
264
  courseId: string;
@@ -528,6 +548,77 @@ export class ContentApi extends runtime.BaseAPI {
528
548
  return await response.value();
529
549
  }
530
550
 
551
+ /**
552
+ * Creates request options for getContentAttempts without sending the request
553
+ */
554
+ async getContentAttemptsRequestOpts(requestParameters: GetContentAttemptsRequest): Promise<runtime.RequestOpts> {
555
+ if (requestParameters['contentId'] == null) {
556
+ throw new runtime.RequiredError(
557
+ 'contentId',
558
+ 'Required parameter "contentId" was null or undefined when calling getContentAttempts().'
559
+ );
560
+ }
561
+
562
+ if (requestParameters['moduleId'] == null) {
563
+ throw new runtime.RequiredError(
564
+ 'moduleId',
565
+ 'Required parameter "moduleId" was null or undefined when calling getContentAttempts().'
566
+ );
567
+ }
568
+
569
+ if (requestParameters['courseId'] == null) {
570
+ throw new runtime.RequiredError(
571
+ 'courseId',
572
+ 'Required parameter "courseId" was null or undefined when calling getContentAttempts().'
573
+ );
574
+ }
575
+
576
+ const queryParameters: any = {};
577
+
578
+ if (requestParameters['userId'] != null) {
579
+ queryParameters['user_id'] = requestParameters['userId'];
580
+ }
581
+
582
+ if (requestParameters['environment'] != null) {
583
+ queryParameters['environment'] = requestParameters['environment'];
584
+ }
585
+
586
+ const headerParameters: runtime.HTTPHeaders = {};
587
+
588
+
589
+ let urlPath = `/courses/{courseId}/modules/{moduleId}/contents/{contentId}/attempts`;
590
+ urlPath = urlPath.replace('{contentId}', encodeURIComponent(String(requestParameters['contentId'])));
591
+ urlPath = urlPath.replace('{moduleId}', encodeURIComponent(String(requestParameters['moduleId'])));
592
+ urlPath = urlPath.replace('{courseId}', encodeURIComponent(String(requestParameters['courseId'])));
593
+
594
+ return {
595
+ path: urlPath,
596
+ method: 'GET',
597
+ headers: headerParameters,
598
+ query: queryParameters,
599
+ };
600
+ }
601
+
602
+ /**
603
+ * Lists content attempts and score rollup for the current learner. Instructors may pass user_id to inspect another learner.
604
+ * Get content attempts
605
+ */
606
+ async getContentAttemptsRaw(requestParameters: GetContentAttemptsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetContentAttempts>> {
607
+ const requestOptions = await this.getContentAttemptsRequestOpts(requestParameters);
608
+ const response = await this.request(requestOptions, initOverrides);
609
+
610
+ return new runtime.JSONApiResponse(response, (jsonValue) => GetContentAttemptsFromJSON(jsonValue));
611
+ }
612
+
613
+ /**
614
+ * Lists content attempts and score rollup for the current learner. Instructors may pass user_id to inspect another learner.
615
+ * Get content attempts
616
+ */
617
+ async getContentAttempts(requestParameters: GetContentAttemptsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetContentAttempts> {
618
+ const response = await this.getContentAttemptsRaw(requestParameters, initOverrides);
619
+ return await response.value();
620
+ }
621
+
531
622
  /**
532
623
  * Creates request options for getContentList without sending the request
533
624
  */
@@ -1445,6 +1536,71 @@ export class ContentApi extends runtime.BaseAPI {
1445
1536
  return await response.value();
1446
1537
  }
1447
1538
 
1539
+ /**
1540
+ * Creates request options for postContentSessionRetake without sending the request
1541
+ */
1542
+ async postContentSessionRetakeRequestOpts(requestParameters: PostContentSessionRetakeRequest): Promise<runtime.RequestOpts> {
1543
+ if (requestParameters['contentId'] == null) {
1544
+ throw new runtime.RequiredError(
1545
+ 'contentId',
1546
+ 'Required parameter "contentId" was null or undefined when calling postContentSessionRetake().'
1547
+ );
1548
+ }
1549
+
1550
+ if (requestParameters['moduleId'] == null) {
1551
+ throw new runtime.RequiredError(
1552
+ 'moduleId',
1553
+ 'Required parameter "moduleId" was null or undefined when calling postContentSessionRetake().'
1554
+ );
1555
+ }
1556
+
1557
+ if (requestParameters['courseId'] == null) {
1558
+ throw new runtime.RequiredError(
1559
+ 'courseId',
1560
+ 'Required parameter "courseId" was null or undefined when calling postContentSessionRetake().'
1561
+ );
1562
+ }
1563
+
1564
+ const queryParameters: any = {};
1565
+
1566
+ if (requestParameters['environment'] != null) {
1567
+ queryParameters['environment'] = requestParameters['environment'];
1568
+ }
1569
+
1570
+ const headerParameters: runtime.HTTPHeaders = {};
1571
+
1572
+
1573
+ let urlPath = `/courses/{courseId}/modules/{moduleId}/contents/{contentId}/session/retake`;
1574
+ urlPath = urlPath.replace('{contentId}', encodeURIComponent(String(requestParameters['contentId'])));
1575
+ urlPath = urlPath.replace('{moduleId}', encodeURIComponent(String(requestParameters['moduleId'])));
1576
+ urlPath = urlPath.replace('{courseId}', encodeURIComponent(String(requestParameters['courseId'])));
1577
+
1578
+ return {
1579
+ path: urlPath,
1580
+ method: 'POST',
1581
+ headers: headerParameters,
1582
+ query: queryParameters,
1583
+ };
1584
+ }
1585
+
1586
+ /**
1587
+ * Create a new retake content session
1588
+ */
1589
+ async postContentSessionRetakeRaw(requestParameters: PostContentSessionRetakeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PostContentSession>> {
1590
+ const requestOptions = await this.postContentSessionRetakeRequestOpts(requestParameters);
1591
+ const response = await this.request(requestOptions, initOverrides);
1592
+
1593
+ return new runtime.JSONApiResponse(response, (jsonValue) => PostContentSessionFromJSON(jsonValue));
1594
+ }
1595
+
1596
+ /**
1597
+ * Create a new retake content session
1598
+ */
1599
+ async postContentSessionRetake(requestParameters: PostContentSessionRetakeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PostContentSession> {
1600
+ const response = await this.postContentSessionRetakeRaw(requestParameters, initOverrides);
1601
+ return await response.value();
1602
+ }
1603
+
1448
1604
  /**
1449
1605
  * Creates request options for postContentUpload without sending the request
1450
1606
  */
@@ -1946,6 +2102,14 @@ export class ContentApi extends runtime.BaseAPI {
1946
2102
 
1947
2103
  }
1948
2104
 
2105
+ /**
2106
+ * @export
2107
+ */
2108
+ export const GetContentAttemptsEnvironmentEnum = {
2109
+ Sandbox: 'sandbox',
2110
+ Live: 'live'
2111
+ } as const;
2112
+ export type GetContentAttemptsEnvironmentEnum = typeof GetContentAttemptsEnvironmentEnum[keyof typeof GetContentAttemptsEnvironmentEnum];
1949
2113
  /**
1950
2114
  * @export
1951
2115
  */
@@ -1962,3 +2126,11 @@ export const PostContentSessionEnvironmentEnum = {
1962
2126
  Live: 'live'
1963
2127
  } as const;
1964
2128
  export type PostContentSessionEnvironmentEnum = typeof PostContentSessionEnvironmentEnum[keyof typeof PostContentSessionEnvironmentEnum];
2129
+ /**
2130
+ * @export
2131
+ */
2132
+ export const PostContentSessionRetakeEnvironmentEnum = {
2133
+ Sandbox: 'sandbox',
2134
+ Live: 'live'
2135
+ } as const;
2136
+ export type PostContentSessionRetakeEnvironmentEnum = typeof PostContentSessionRetakeEnvironmentEnum[keyof typeof PostContentSessionRetakeEnvironmentEnum];
@@ -0,0 +1,128 @@
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
+ import type { ContentAttemptScore } from './ContentAttemptScore';
17
+ import {
18
+ ContentAttemptScoreFromJSON,
19
+ ContentAttemptScoreFromJSONTyped,
20
+ ContentAttemptScoreToJSON,
21
+ ContentAttemptScoreToJSONTyped,
22
+ } from './ContentAttemptScore';
23
+
24
+ /**
25
+ * A single learner attempt for a content item
26
+ * @export
27
+ * @interface ContentAttemptItem
28
+ */
29
+ export interface ContentAttemptItem {
30
+ /**
31
+ * Content session UUID for this attempt
32
+ * @type {string}
33
+ * @memberof ContentAttemptItem
34
+ */
35
+ sessionId: string;
36
+ /**
37
+ * Learner attempt number for this content item
38
+ * @type {number}
39
+ * @memberof ContentAttemptItem
40
+ */
41
+ attemptNumber: number;
42
+ /**
43
+ * Completion status for this attempt
44
+ * @type {string}
45
+ * @memberof ContentAttemptItem
46
+ */
47
+ completionStatus: string;
48
+ /**
49
+ * Grade status for this attempt
50
+ * @type {string}
51
+ * @memberof ContentAttemptItem
52
+ */
53
+ gradeStatus: string;
54
+ /**
55
+ *
56
+ * @type {ContentAttemptScore}
57
+ * @memberof ContentAttemptItem
58
+ */
59
+ score: ContentAttemptScore | null;
60
+ /**
61
+ * Attempt creation time as a Unix timestamp in seconds
62
+ * @type {number}
63
+ * @memberof ContentAttemptItem
64
+ */
65
+ createdAt: number;
66
+ /**
67
+ * Attempt update time as a Unix timestamp in seconds
68
+ * @type {number}
69
+ * @memberof ContentAttemptItem
70
+ */
71
+ updatedAt: number;
72
+ }
73
+
74
+ /**
75
+ * Check if a given object implements the ContentAttemptItem interface.
76
+ */
77
+ export function instanceOfContentAttemptItem(value: object): value is ContentAttemptItem {
78
+ if (!('sessionId' in value) || value['sessionId'] === undefined) return false;
79
+ if (!('attemptNumber' in value) || value['attemptNumber'] === undefined) return false;
80
+ if (!('completionStatus' in value) || value['completionStatus'] === undefined) return false;
81
+ if (!('gradeStatus' in value) || value['gradeStatus'] === undefined) return false;
82
+ if (!('score' in value) || value['score'] === undefined) return false;
83
+ if (!('createdAt' in value) || value['createdAt'] === undefined) return false;
84
+ if (!('updatedAt' in value) || value['updatedAt'] === undefined) return false;
85
+ return true;
86
+ }
87
+
88
+ export function ContentAttemptItemFromJSON(json: any): ContentAttemptItem {
89
+ return ContentAttemptItemFromJSONTyped(json, false);
90
+ }
91
+
92
+ export function ContentAttemptItemFromJSONTyped(json: any, ignoreDiscriminator: boolean): ContentAttemptItem {
93
+ if (json == null) {
94
+ return json;
95
+ }
96
+ return {
97
+
98
+ 'sessionId': json['session_id'],
99
+ 'attemptNumber': json['attempt_number'],
100
+ 'completionStatus': json['completion_status'],
101
+ 'gradeStatus': json['grade_status'],
102
+ 'score': ContentAttemptScoreFromJSON(json['score']),
103
+ 'createdAt': json['created_at'],
104
+ 'updatedAt': json['updated_at'],
105
+ };
106
+ }
107
+
108
+ export function ContentAttemptItemToJSON(json: any): ContentAttemptItem {
109
+ return ContentAttemptItemToJSONTyped(json, false);
110
+ }
111
+
112
+ export function ContentAttemptItemToJSONTyped(value?: ContentAttemptItem | null, ignoreDiscriminator: boolean = false): any {
113
+ if (value == null) {
114
+ return value;
115
+ }
116
+
117
+ return {
118
+
119
+ 'session_id': value['sessionId'],
120
+ 'attempt_number': value['attemptNumber'],
121
+ 'completion_status': value['completionStatus'],
122
+ 'grade_status': value['gradeStatus'],
123
+ 'score': ContentAttemptScoreToJSON(value['score']),
124
+ 'created_at': value['createdAt'],
125
+ 'updated_at': value['updatedAt'],
126
+ };
127
+ }
128
+
@@ -0,0 +1,75 @@
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
+ * Rolled-up score for a content item
18
+ * @export
19
+ * @interface ContentAttemptRollupScore
20
+ */
21
+ export interface ContentAttemptRollupScore {
22
+ /**
23
+ * Rolled-up score normalized to a 0-100 percentage
24
+ * @type {number}
25
+ * @memberof ContentAttemptRollupScore
26
+ */
27
+ percentage: number;
28
+ /**
29
+ * Attempt number that supplied the rolled-up score
30
+ * @type {number}
31
+ * @memberof ContentAttemptRollupScore
32
+ */
33
+ sourceAttemptNumber: number;
34
+ }
35
+
36
+ /**
37
+ * Check if a given object implements the ContentAttemptRollupScore interface.
38
+ */
39
+ export function instanceOfContentAttemptRollupScore(value: object): value is ContentAttemptRollupScore {
40
+ if (!('percentage' in value) || value['percentage'] === undefined) return false;
41
+ if (!('sourceAttemptNumber' in value) || value['sourceAttemptNumber'] === undefined) return false;
42
+ return true;
43
+ }
44
+
45
+ export function ContentAttemptRollupScoreFromJSON(json: any): ContentAttemptRollupScore {
46
+ return ContentAttemptRollupScoreFromJSONTyped(json, false);
47
+ }
48
+
49
+ export function ContentAttemptRollupScoreFromJSONTyped(json: any, ignoreDiscriminator: boolean): ContentAttemptRollupScore {
50
+ if (json == null) {
51
+ return json;
52
+ }
53
+ return {
54
+
55
+ 'percentage': json['percentage'],
56
+ 'sourceAttemptNumber': json['source_attempt_number'],
57
+ };
58
+ }
59
+
60
+ export function ContentAttemptRollupScoreToJSON(json: any): ContentAttemptRollupScore {
61
+ return ContentAttemptRollupScoreToJSONTyped(json, false);
62
+ }
63
+
64
+ export function ContentAttemptRollupScoreToJSONTyped(value?: ContentAttemptRollupScore | null, ignoreDiscriminator: boolean = false): any {
65
+ if (value == null) {
66
+ return value;
67
+ }
68
+
69
+ return {
70
+
71
+ 'percentage': value['percentage'],
72
+ 'source_attempt_number': value['sourceAttemptNumber'],
73
+ };
74
+ }
75
+
@@ -0,0 +1,89 @@
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
+ * Normalized score data for a content attempt
18
+ * @export
19
+ * @interface ContentAttemptScore
20
+ */
21
+ export interface ContentAttemptScore {
22
+ /**
23
+ * Raw score reported by the content, if available
24
+ * @type {number}
25
+ * @memberof ContentAttemptScore
26
+ */
27
+ raw?: number | null;
28
+ /**
29
+ * Minimum possible score, if available
30
+ * @type {number}
31
+ * @memberof ContentAttemptScore
32
+ */
33
+ min?: number | null;
34
+ /**
35
+ * Maximum possible score, if available
36
+ * @type {number}
37
+ * @memberof ContentAttemptScore
38
+ */
39
+ max?: number | null;
40
+ /**
41
+ * Score normalized to a 0-100 percentage, if available
42
+ * @type {number}
43
+ * @memberof ContentAttemptScore
44
+ */
45
+ percentage?: number | null;
46
+ }
47
+
48
+ /**
49
+ * Check if a given object implements the ContentAttemptScore interface.
50
+ */
51
+ export function instanceOfContentAttemptScore(value: object): value is ContentAttemptScore {
52
+ return true;
53
+ }
54
+
55
+ export function ContentAttemptScoreFromJSON(json: any): ContentAttemptScore {
56
+ return ContentAttemptScoreFromJSONTyped(json, false);
57
+ }
58
+
59
+ export function ContentAttemptScoreFromJSONTyped(json: any, ignoreDiscriminator: boolean): ContentAttemptScore {
60
+ if (json == null) {
61
+ return json;
62
+ }
63
+ return {
64
+
65
+ 'raw': json['raw'] == null ? undefined : json['raw'],
66
+ 'min': json['min'] == null ? undefined : json['min'],
67
+ 'max': json['max'] == null ? undefined : json['max'],
68
+ 'percentage': json['percentage'] == null ? undefined : json['percentage'],
69
+ };
70
+ }
71
+
72
+ export function ContentAttemptScoreToJSON(json: any): ContentAttemptScore {
73
+ return ContentAttemptScoreToJSONTyped(json, false);
74
+ }
75
+
76
+ export function ContentAttemptScoreToJSONTyped(value?: ContentAttemptScore | null, ignoreDiscriminator: boolean = false): any {
77
+ if (value == null) {
78
+ return value;
79
+ }
80
+
81
+ return {
82
+
83
+ 'raw': value['raw'],
84
+ 'min': value['min'],
85
+ 'max': value['max'],
86
+ 'percentage': value['percentage'],
87
+ };
88
+ }
89
+
@@ -0,0 +1,86 @@
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
+ *
18
+ * @export
19
+ * @interface ContentAttemptSettings
20
+ */
21
+ export interface ContentAttemptSettings {
22
+ /**
23
+ * Maximum allowed attempts for this content
24
+ * @type {number}
25
+ * @memberof ContentAttemptSettings
26
+ */
27
+ maxAttempts: number;
28
+ /**
29
+ * Strategy used to calculate the content rollup score
30
+ * @type {ContentAttemptSettingsScoreRollupStrategyEnum}
31
+ * @memberof ContentAttemptSettings
32
+ */
33
+ scoreRollupStrategy: ContentAttemptSettingsScoreRollupStrategyEnum;
34
+ }
35
+
36
+
37
+ /**
38
+ * @export
39
+ */
40
+ export const ContentAttemptSettingsScoreRollupStrategyEnum = {
41
+ Latest: 'Latest',
42
+ Best: 'Best'
43
+ } as const;
44
+ export type ContentAttemptSettingsScoreRollupStrategyEnum = typeof ContentAttemptSettingsScoreRollupStrategyEnum[keyof typeof ContentAttemptSettingsScoreRollupStrategyEnum];
45
+
46
+
47
+ /**
48
+ * Check if a given object implements the ContentAttemptSettings interface.
49
+ */
50
+ export function instanceOfContentAttemptSettings(value: object): value is ContentAttemptSettings {
51
+ if (!('maxAttempts' in value) || value['maxAttempts'] === undefined) return false;
52
+ if (!('scoreRollupStrategy' in value) || value['scoreRollupStrategy'] === undefined) return false;
53
+ return true;
54
+ }
55
+
56
+ export function ContentAttemptSettingsFromJSON(json: any): ContentAttemptSettings {
57
+ return ContentAttemptSettingsFromJSONTyped(json, false);
58
+ }
59
+
60
+ export function ContentAttemptSettingsFromJSONTyped(json: any, ignoreDiscriminator: boolean): ContentAttemptSettings {
61
+ if (json == null) {
62
+ return json;
63
+ }
64
+ return {
65
+
66
+ 'maxAttempts': json['max_attempts'],
67
+ 'scoreRollupStrategy': json['score_rollup_strategy'],
68
+ };
69
+ }
70
+
71
+ export function ContentAttemptSettingsToJSON(json: any): ContentAttemptSettings {
72
+ return ContentAttemptSettingsToJSONTyped(json, false);
73
+ }
74
+
75
+ export function ContentAttemptSettingsToJSONTyped(value?: ContentAttemptSettings | null, ignoreDiscriminator: boolean = false): any {
76
+ if (value == null) {
77
+ return value;
78
+ }
79
+
80
+ return {
81
+
82
+ 'max_attempts': value['maxAttempts'],
83
+ 'score_rollup_strategy': value['scoreRollupStrategy'],
84
+ };
85
+ }
86
+