@easyedu/js-lsm-api 1.35.0 → 1.37.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 +18 -0
- package/README.md +12 -2
- package/dist/apis/QuizApi.d.ts +20 -1
- package/dist/apis/QuizApi.js +49 -0
- package/dist/esm/apis/QuizApi.d.ts +20 -1
- package/dist/esm/apis/QuizApi.js +50 -1
- package/dist/esm/models/CriteriaBasedSelectionCriteria.d.ts +3 -0
- package/dist/esm/models/CriteriaBasedSelectionCriteria.js +4 -1
- package/dist/esm/models/Essay.d.ts +45 -0
- package/dist/esm/models/Essay.js +53 -0
- package/dist/esm/models/Essay1.d.ts +45 -0
- package/dist/esm/models/Essay1.js +53 -0
- package/dist/esm/models/GetCourseExport.d.ts +19 -7
- package/dist/esm/models/GetCourseExport.js +12 -4
- package/dist/esm/models/GetQuestion.d.ts +4 -1
- package/dist/esm/models/GetQuestion.js +4 -1
- package/dist/esm/models/GetQuestionListFilters.d.ts +3 -0
- package/dist/esm/models/GetQuestionListFilters.js +4 -1
- package/dist/esm/models/GetQuizAttemptAnalyticsPerformanceBreakdownByQuestionTypeInner.d.ts +3 -0
- package/dist/esm/models/GetQuizAttemptAnalyticsPerformanceBreakdownByQuestionTypeInner.js +4 -1
- package/dist/esm/models/GetQuizAttemptAnalyticsQuestionAnalysisInner.d.ts +3 -0
- package/dist/esm/models/GetQuizAttemptAnalyticsQuestionAnalysisInner.js +4 -1
- package/dist/esm/models/GetQuizAttemptQuestionsInner.d.ts +3 -0
- package/dist/esm/models/GetQuizAttemptQuestionsInner.js +4 -1
- package/dist/esm/models/GetQuizCriteriaItem.d.ts +3 -0
- package/dist/esm/models/GetQuizCriteriaItem.js +4 -1
- package/dist/esm/models/GetQuizCriteriaListItemsInner.d.ts +3 -0
- package/dist/esm/models/GetQuizCriteriaListItemsInner.js +4 -1
- package/dist/esm/models/GetQuizQuestionsItemsInnerQuestionDetails.d.ts +3 -0
- package/dist/esm/models/GetQuizQuestionsItemsInnerQuestionDetails.js +4 -1
- package/dist/esm/models/GetQuizResultsQuestionsInner.d.ts +3 -0
- package/dist/esm/models/GetQuizResultsQuestionsInner.js +4 -1
- package/dist/esm/models/Matching.d.ts +46 -0
- package/dist/esm/models/Matching.js +54 -0
- package/dist/esm/models/Matching1.d.ts +46 -0
- package/dist/esm/models/Matching1.js +54 -0
- package/dist/esm/models/Matching1PairsInner.d.ts +38 -0
- package/dist/esm/models/Matching1PairsInner.js +47 -0
- package/dist/esm/models/MatchingPairsInner.d.ts +38 -0
- package/dist/esm/models/MatchingPairsInner.js +47 -0
- package/dist/esm/models/PostCourseExport.d.ts +12 -6
- package/dist/esm/models/PostCourseExport.js +8 -4
- package/dist/esm/models/PostQuestion.d.ts +4 -1
- package/dist/esm/models/PostQuestion.js +4 -1
- package/dist/esm/models/PostQuizAttemptQuestionsInner.d.ts +3 -0
- package/dist/esm/models/PostQuizAttemptQuestionsInner.js +4 -1
- package/dist/esm/models/PostQuizAttemptSubmitFinalAnswersInnerAnswer.d.ts +4 -1
- package/dist/esm/models/PostQuizAttemptSubmitFinalAnswersInnerAnswer.js +21 -0
- package/dist/esm/models/PostQuizCriteriaCriteriaInner.d.ts +3 -0
- package/dist/esm/models/PostQuizCriteriaCriteriaInner.js +4 -1
- package/dist/esm/models/PutQuestion.d.ts +4 -1
- package/dist/esm/models/PutQuestion.js +4 -1
- package/dist/esm/models/PutQuizAnswerAnswer.d.ts +4 -1
- package/dist/esm/models/PutQuizAnswerAnswer.js +21 -0
- package/dist/esm/models/PutQuizAnswerGrade.d.ts +38 -0
- package/dist/esm/models/PutQuizAnswerGrade.js +45 -0
- package/dist/esm/models/ShortAnswer.d.ts +45 -0
- package/dist/esm/models/ShortAnswer.js +53 -0
- package/dist/esm/models/ShortAnswer1.d.ts +45 -0
- package/dist/esm/models/ShortAnswer1.js +53 -0
- package/dist/esm/models/index.d.ts +9 -0
- package/dist/esm/models/index.js +9 -0
- package/dist/models/CriteriaBasedSelectionCriteria.d.ts +3 -0
- package/dist/models/CriteriaBasedSelectionCriteria.js +4 -1
- package/dist/models/Essay.d.ts +45 -0
- package/dist/models/Essay.js +61 -0
- package/dist/models/Essay1.d.ts +45 -0
- package/dist/models/Essay1.js +61 -0
- package/dist/models/GetCourseExport.d.ts +19 -7
- package/dist/models/GetCourseExport.js +13 -5
- package/dist/models/GetQuestion.d.ts +4 -1
- package/dist/models/GetQuestion.js +4 -1
- package/dist/models/GetQuestionListFilters.d.ts +3 -0
- package/dist/models/GetQuestionListFilters.js +4 -1
- package/dist/models/GetQuizAttemptAnalyticsPerformanceBreakdownByQuestionTypeInner.d.ts +3 -0
- package/dist/models/GetQuizAttemptAnalyticsPerformanceBreakdownByQuestionTypeInner.js +4 -1
- package/dist/models/GetQuizAttemptAnalyticsQuestionAnalysisInner.d.ts +3 -0
- package/dist/models/GetQuizAttemptAnalyticsQuestionAnalysisInner.js +4 -1
- package/dist/models/GetQuizAttemptQuestionsInner.d.ts +3 -0
- package/dist/models/GetQuizAttemptQuestionsInner.js +4 -1
- package/dist/models/GetQuizCriteriaItem.d.ts +3 -0
- package/dist/models/GetQuizCriteriaItem.js +4 -1
- package/dist/models/GetQuizCriteriaListItemsInner.d.ts +3 -0
- package/dist/models/GetQuizCriteriaListItemsInner.js +4 -1
- package/dist/models/GetQuizQuestionsItemsInnerQuestionDetails.d.ts +3 -0
- package/dist/models/GetQuizQuestionsItemsInnerQuestionDetails.js +4 -1
- package/dist/models/GetQuizResultsQuestionsInner.d.ts +3 -0
- package/dist/models/GetQuizResultsQuestionsInner.js +4 -1
- package/dist/models/Matching.d.ts +46 -0
- package/dist/models/Matching.js +62 -0
- package/dist/models/Matching1.d.ts +46 -0
- package/dist/models/Matching1.js +62 -0
- package/dist/models/Matching1PairsInner.d.ts +38 -0
- package/dist/models/Matching1PairsInner.js +54 -0
- package/dist/models/MatchingPairsInner.d.ts +38 -0
- package/dist/models/MatchingPairsInner.js +54 -0
- package/dist/models/PostCourseExport.d.ts +12 -6
- package/dist/models/PostCourseExport.js +9 -5
- package/dist/models/PostQuestion.d.ts +4 -1
- package/dist/models/PostQuestion.js +4 -1
- package/dist/models/PostQuizAttemptQuestionsInner.d.ts +3 -0
- package/dist/models/PostQuizAttemptQuestionsInner.js +4 -1
- package/dist/models/PostQuizAttemptSubmitFinalAnswersInnerAnswer.d.ts +4 -1
- package/dist/models/PostQuizAttemptSubmitFinalAnswersInnerAnswer.js +21 -0
- package/dist/models/PostQuizCriteriaCriteriaInner.d.ts +3 -0
- package/dist/models/PostQuizCriteriaCriteriaInner.js +4 -1
- package/dist/models/PutQuestion.d.ts +4 -1
- package/dist/models/PutQuestion.js +4 -1
- package/dist/models/PutQuizAnswerAnswer.d.ts +4 -1
- package/dist/models/PutQuizAnswerAnswer.js +21 -0
- package/dist/models/PutQuizAnswerGrade.d.ts +38 -0
- package/dist/models/PutQuizAnswerGrade.js +52 -0
- package/dist/models/ShortAnswer.d.ts +45 -0
- package/dist/models/ShortAnswer.js +61 -0
- package/dist/models/ShortAnswer1.d.ts +45 -0
- package/dist/models/ShortAnswer1.js +61 -0
- package/dist/models/index.d.ts +9 -0
- package/dist/models/index.js +9 -0
- package/docs/Essay.md +36 -0
- package/docs/Essay1.md +36 -0
- package/docs/GetCourseExport.md +7 -3
- package/docs/Matching.md +36 -0
- package/docs/Matching1.md +36 -0
- package/docs/Matching1PairsInner.md +36 -0
- package/docs/MatchingPairsInner.md +36 -0
- package/docs/PostCourseExport.md +5 -3
- package/docs/PostQuizAttemptSubmitFinalAnswersInnerAnswer.md +2 -0
- package/docs/PutQuizAnswerAnswer.md +2 -0
- package/docs/PutQuizAnswerGrade.md +36 -0
- package/docs/QuizApi.md +77 -0
- package/docs/ShortAnswer.md +36 -0
- package/docs/ShortAnswer1.md +36 -0
- package/package.json +1 -1
- package/src/apis/QuizApi.ts +73 -0
- package/src/models/CriteriaBasedSelectionCriteria.ts +4 -1
- package/src/models/Essay.ts +85 -0
- package/src/models/Essay1.ts +85 -0
- package/src/models/GetCourseExport.ts +28 -10
- package/src/models/GetQuestion.ts +5 -2
- package/src/models/GetQuestionListFilters.ts +4 -1
- package/src/models/GetQuizAttemptAnalyticsPerformanceBreakdownByQuestionTypeInner.ts +4 -1
- package/src/models/GetQuizAttemptAnalyticsQuestionAnalysisInner.ts +4 -1
- package/src/models/GetQuizAttemptQuestionsInner.ts +4 -1
- package/src/models/GetQuizCriteriaItem.ts +4 -1
- package/src/models/GetQuizCriteriaListItemsInner.ts +4 -1
- package/src/models/GetQuizQuestionsItemsInnerQuestionDetails.ts +4 -1
- package/src/models/GetQuizResultsQuestionsInner.ts +4 -1
- package/src/models/Matching.ts +93 -0
- package/src/models/Matching1.ts +93 -0
- package/src/models/Matching1PairsInner.ts +75 -0
- package/src/models/MatchingPairsInner.ts +75 -0
- package/src/models/PostCourseExport.ts +18 -9
- package/src/models/PostQuestion.ts +5 -2
- package/src/models/PostQuizAttemptQuestionsInner.ts +4 -1
- package/src/models/PostQuizAttemptSubmitFinalAnswersInnerAnswer.ts +40 -1
- package/src/models/PostQuizCriteriaCriteriaInner.ts +4 -1
- package/src/models/PutQuestion.ts +5 -2
- package/src/models/PutQuizAnswerAnswer.ts +40 -1
- package/src/models/PutQuizAnswerGrade.ts +74 -0
- package/src/models/ShortAnswer.ts +85 -0
- package/src/models/ShortAnswer1.ts +85 -0
- package/src/models/index.ts +9 -0
package/docs/PostCourseExport.md
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
|
|
2
2
|
# PostCourseExport
|
|
3
3
|
|
|
4
|
-
Request to create a new
|
|
4
|
+
Request to create a new export for a course
|
|
5
5
|
|
|
6
6
|
## Properties
|
|
7
7
|
|
|
8
8
|
Name | Type
|
|
9
9
|
------------ | -------------
|
|
10
|
-
`
|
|
10
|
+
`exportType` | string
|
|
11
|
+
`moduleIds` | Array<string>
|
|
11
12
|
|
|
12
13
|
## Example
|
|
13
14
|
|
|
@@ -16,7 +17,8 @@ import type { PostCourseExport } from '@easyedu/js-lsm-api'
|
|
|
16
17
|
|
|
17
18
|
// TODO: Update the object below with actual values
|
|
18
19
|
const example = {
|
|
19
|
-
"
|
|
20
|
+
"exportType": null,
|
|
21
|
+
"moduleIds": null,
|
|
20
22
|
} satisfies PostCourseExport
|
|
21
23
|
|
|
22
24
|
console.log(example)
|
|
@@ -11,6 +11,7 @@ Name | Type
|
|
|
11
11
|
`answerChoiceId` | string
|
|
12
12
|
`answerChoiceIds` | Array<string>
|
|
13
13
|
`textAnswer` | string
|
|
14
|
+
`pairs` | [Array<Matching1PairsInner>](Matching1PairsInner.md)
|
|
14
15
|
|
|
15
16
|
## Example
|
|
16
17
|
|
|
@@ -23,6 +24,7 @@ const example = {
|
|
|
23
24
|
"answerChoiceId": null,
|
|
24
25
|
"answerChoiceIds": null,
|
|
25
26
|
"textAnswer": null,
|
|
27
|
+
"pairs": null,
|
|
26
28
|
} satisfies PostQuizAttemptSubmitFinalAnswersInnerAnswer
|
|
27
29
|
|
|
28
30
|
console.log(example)
|
|
@@ -11,6 +11,7 @@ Name | Type
|
|
|
11
11
|
`answerChoiceId` | string
|
|
12
12
|
`answerChoiceIds` | Array<string>
|
|
13
13
|
`textAnswer` | string
|
|
14
|
+
`pairs` | [Array<MatchingPairsInner>](MatchingPairsInner.md)
|
|
14
15
|
|
|
15
16
|
## Example
|
|
16
17
|
|
|
@@ -23,6 +24,7 @@ const example = {
|
|
|
23
24
|
"answerChoiceId": null,
|
|
24
25
|
"answerChoiceIds": null,
|
|
25
26
|
"textAnswer": null,
|
|
27
|
+
"pairs": null,
|
|
26
28
|
} satisfies PutQuizAnswerAnswer
|
|
27
29
|
|
|
28
30
|
console.log(example)
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
|
|
2
|
+
# PutQuizAnswerGrade
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`pointsEarned` | number
|
|
10
|
+
`feedback` | string
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
import type { PutQuizAnswerGrade } from '@easyedu/js-lsm-api'
|
|
16
|
+
|
|
17
|
+
// TODO: Update the object below with actual values
|
|
18
|
+
const example = {
|
|
19
|
+
"pointsEarned": null,
|
|
20
|
+
"feedback": null,
|
|
21
|
+
} satisfies PutQuizAnswerGrade
|
|
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 PutQuizAnswerGrade
|
|
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/docs/QuizApi.md
CHANGED
|
@@ -23,6 +23,7 @@ All URIs are relative to *https://sbzw93t49b.execute-api.us-east-2.amazonaws.com
|
|
|
23
23
|
| [**getQuizManualQuestionSelectionList**](QuizApi.md#getquizmanualquestionselectionlist) | **GET** /quizzes/{quizId}/manual-question-selection | Get manually selected questions for quiz |
|
|
24
24
|
| [**getQuizQuestions**](QuizApi.md#getquizquestions) | **GET** /quizzes/{quizId}/questions | Get quiz questions (paginated) |
|
|
25
25
|
| [**getUserQuizAttempts**](QuizApi.md#getuserquizattempts) | **GET** /users/{userId}/quiz-attempts | Get user\'s quiz attempts across all quizzes |
|
|
26
|
+
| [**gradeQuizAnswer**](QuizApi.md#gradequizanswer) | **PUT** /quiz-attempts/{attemptId}/answers/{questionId}/grade | Grade or override score for a question answer |
|
|
26
27
|
| [**removeQuizQuestion**](QuizApi.md#removequizquestion) | **DELETE** /quizzes/{quizId}/questions/{questionId} | Remove question from quiz |
|
|
27
28
|
| [**saveQuizAnswer**](QuizApi.md#savequizanswer) | **PUT** /quiz-attempts/{attemptId}/answers/{questionId} | Save answer for a specific question |
|
|
28
29
|
| [**startQuizAttempt**](QuizApi.md#startquizattempt) | **POST** /quizzes/{quizId}/attempts | Start a new quiz attempt |
|
|
@@ -1369,6 +1370,82 @@ No authorization required
|
|
|
1369
1370
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
1370
1371
|
|
|
1371
1372
|
|
|
1373
|
+
## gradeQuizAnswer
|
|
1374
|
+
|
|
1375
|
+
> gradeQuizAnswer(attemptId, questionId, putQuizAnswerGrade)
|
|
1376
|
+
|
|
1377
|
+
Grade or override score for a question answer
|
|
1378
|
+
|
|
1379
|
+
Allows an instructor to grade an essay or override the score for any question type.
|
|
1380
|
+
|
|
1381
|
+
### Example
|
|
1382
|
+
|
|
1383
|
+
```ts
|
|
1384
|
+
import {
|
|
1385
|
+
Configuration,
|
|
1386
|
+
QuizApi,
|
|
1387
|
+
} from '@easyedu/js-lsm-api';
|
|
1388
|
+
import type { GradeQuizAnswerRequest } from '@easyedu/js-lsm-api';
|
|
1389
|
+
|
|
1390
|
+
async function example() {
|
|
1391
|
+
console.log("🚀 Testing @easyedu/js-lsm-api SDK...");
|
|
1392
|
+
const api = new QuizApi();
|
|
1393
|
+
|
|
1394
|
+
const body = {
|
|
1395
|
+
// string
|
|
1396
|
+
attemptId: attemptId_example,
|
|
1397
|
+
// string
|
|
1398
|
+
questionId: questionId_example,
|
|
1399
|
+
// PutQuizAnswerGrade
|
|
1400
|
+
putQuizAnswerGrade: ...,
|
|
1401
|
+
} satisfies GradeQuizAnswerRequest;
|
|
1402
|
+
|
|
1403
|
+
try {
|
|
1404
|
+
const data = await api.gradeQuizAnswer(body);
|
|
1405
|
+
console.log(data);
|
|
1406
|
+
} catch (error) {
|
|
1407
|
+
console.error(error);
|
|
1408
|
+
}
|
|
1409
|
+
}
|
|
1410
|
+
|
|
1411
|
+
// Run the test
|
|
1412
|
+
example().catch(console.error);
|
|
1413
|
+
```
|
|
1414
|
+
|
|
1415
|
+
### Parameters
|
|
1416
|
+
|
|
1417
|
+
|
|
1418
|
+
| Name | Type | Description | Notes |
|
|
1419
|
+
|------------- | ------------- | ------------- | -------------|
|
|
1420
|
+
| **attemptId** | `string` | | [Defaults to `undefined`] |
|
|
1421
|
+
| **questionId** | `string` | | [Defaults to `undefined`] |
|
|
1422
|
+
| **putQuizAnswerGrade** | [PutQuizAnswerGrade](PutQuizAnswerGrade.md) | | |
|
|
1423
|
+
|
|
1424
|
+
### Return type
|
|
1425
|
+
|
|
1426
|
+
`void` (Empty response body)
|
|
1427
|
+
|
|
1428
|
+
### Authorization
|
|
1429
|
+
|
|
1430
|
+
No authorization required
|
|
1431
|
+
|
|
1432
|
+
### HTTP request headers
|
|
1433
|
+
|
|
1434
|
+
- **Content-Type**: `application/json`
|
|
1435
|
+
- **Accept**: Not defined
|
|
1436
|
+
|
|
1437
|
+
|
|
1438
|
+
### HTTP response details
|
|
1439
|
+
| Status code | Description | Response headers |
|
|
1440
|
+
|-------------|-------------|------------------|
|
|
1441
|
+
| **200** | Answer graded successfully | - |
|
|
1442
|
+
| **400** | Invalid grade (points out of range) | - |
|
|
1443
|
+
| **403** | Not authorized to grade answers | - |
|
|
1444
|
+
| **404** | Attempt, question, or answer not found | - |
|
|
1445
|
+
|
|
1446
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
1447
|
+
|
|
1448
|
+
|
|
1372
1449
|
## removeQuizQuestion
|
|
1373
1450
|
|
|
1374
1451
|
> removeQuizQuestion(quizId, questionId)
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
|
|
2
|
+
# ShortAnswer
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`type` | string
|
|
10
|
+
`textAnswer` | string
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
import type { ShortAnswer } from '@easyedu/js-lsm-api'
|
|
16
|
+
|
|
17
|
+
// TODO: Update the object below with actual values
|
|
18
|
+
const example = {
|
|
19
|
+
"type": null,
|
|
20
|
+
"textAnswer": null,
|
|
21
|
+
} satisfies ShortAnswer
|
|
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 ShortAnswer
|
|
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
|
+
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
|
|
2
|
+
# ShortAnswer1
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`type` | string
|
|
10
|
+
`textAnswer` | string
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
import type { ShortAnswer1 } from '@easyedu/js-lsm-api'
|
|
16
|
+
|
|
17
|
+
// TODO: Update the object below with actual values
|
|
18
|
+
const example = {
|
|
19
|
+
"type": null,
|
|
20
|
+
"textAnswer": null,
|
|
21
|
+
} satisfies ShortAnswer1
|
|
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 ShortAnswer1
|
|
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
package/src/apis/QuizApi.ts
CHANGED
|
@@ -36,6 +36,7 @@ import type {
|
|
|
36
36
|
PostQuizQuestions,
|
|
37
37
|
PutQuiz,
|
|
38
38
|
PutQuizAnswer,
|
|
39
|
+
PutQuizAnswerGrade,
|
|
39
40
|
} from '../models/index';
|
|
40
41
|
import {
|
|
41
42
|
GetManualQuestionSelectionItemFromJSON,
|
|
@@ -80,6 +81,8 @@ import {
|
|
|
80
81
|
PutQuizToJSON,
|
|
81
82
|
PutQuizAnswerFromJSON,
|
|
82
83
|
PutQuizAnswerToJSON,
|
|
84
|
+
PutQuizAnswerGradeFromJSON,
|
|
85
|
+
PutQuizAnswerGradeToJSON,
|
|
83
86
|
} from '../models/index';
|
|
84
87
|
|
|
85
88
|
export interface AddQuizCriteriaQuestionSelectionRequest {
|
|
@@ -183,6 +186,12 @@ export interface GetUserQuizAttemptsRequest {
|
|
|
183
186
|
status?: GetUserQuizAttemptsStatusEnum;
|
|
184
187
|
}
|
|
185
188
|
|
|
189
|
+
export interface GradeQuizAnswerRequest {
|
|
190
|
+
attemptId: string;
|
|
191
|
+
questionId: string;
|
|
192
|
+
putQuizAnswerGrade: PutQuizAnswerGrade;
|
|
193
|
+
}
|
|
194
|
+
|
|
186
195
|
export interface RemoveQuizQuestionRequest {
|
|
187
196
|
quizId: string;
|
|
188
197
|
questionId: string;
|
|
@@ -1202,6 +1211,70 @@ export class QuizApi extends runtime.BaseAPI {
|
|
|
1202
1211
|
return await response.value();
|
|
1203
1212
|
}
|
|
1204
1213
|
|
|
1214
|
+
/**
|
|
1215
|
+
* Creates request options for gradeQuizAnswer without sending the request
|
|
1216
|
+
*/
|
|
1217
|
+
async gradeQuizAnswerRequestOpts(requestParameters: GradeQuizAnswerRequest): Promise<runtime.RequestOpts> {
|
|
1218
|
+
if (requestParameters['attemptId'] == null) {
|
|
1219
|
+
throw new runtime.RequiredError(
|
|
1220
|
+
'attemptId',
|
|
1221
|
+
'Required parameter "attemptId" was null or undefined when calling gradeQuizAnswer().'
|
|
1222
|
+
);
|
|
1223
|
+
}
|
|
1224
|
+
|
|
1225
|
+
if (requestParameters['questionId'] == null) {
|
|
1226
|
+
throw new runtime.RequiredError(
|
|
1227
|
+
'questionId',
|
|
1228
|
+
'Required parameter "questionId" was null or undefined when calling gradeQuizAnswer().'
|
|
1229
|
+
);
|
|
1230
|
+
}
|
|
1231
|
+
|
|
1232
|
+
if (requestParameters['putQuizAnswerGrade'] == null) {
|
|
1233
|
+
throw new runtime.RequiredError(
|
|
1234
|
+
'putQuizAnswerGrade',
|
|
1235
|
+
'Required parameter "putQuizAnswerGrade" was null or undefined when calling gradeQuizAnswer().'
|
|
1236
|
+
);
|
|
1237
|
+
}
|
|
1238
|
+
|
|
1239
|
+
const queryParameters: any = {};
|
|
1240
|
+
|
|
1241
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
1242
|
+
|
|
1243
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
1244
|
+
|
|
1245
|
+
|
|
1246
|
+
let urlPath = `/quiz-attempts/{attemptId}/answers/{questionId}/grade`;
|
|
1247
|
+
urlPath = urlPath.replace(`{${"attemptId"}}`, encodeURIComponent(String(requestParameters['attemptId'])));
|
|
1248
|
+
urlPath = urlPath.replace(`{${"questionId"}}`, encodeURIComponent(String(requestParameters['questionId'])));
|
|
1249
|
+
|
|
1250
|
+
return {
|
|
1251
|
+
path: urlPath,
|
|
1252
|
+
method: 'PUT',
|
|
1253
|
+
headers: headerParameters,
|
|
1254
|
+
query: queryParameters,
|
|
1255
|
+
body: PutQuizAnswerGradeToJSON(requestParameters['putQuizAnswerGrade']),
|
|
1256
|
+
};
|
|
1257
|
+
}
|
|
1258
|
+
|
|
1259
|
+
/**
|
|
1260
|
+
* Allows an instructor to grade an essay or override the score for any question type.
|
|
1261
|
+
* Grade or override score for a question answer
|
|
1262
|
+
*/
|
|
1263
|
+
async gradeQuizAnswerRaw(requestParameters: GradeQuizAnswerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
|
1264
|
+
const requestOptions = await this.gradeQuizAnswerRequestOpts(requestParameters);
|
|
1265
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
1266
|
+
|
|
1267
|
+
return new runtime.VoidApiResponse(response);
|
|
1268
|
+
}
|
|
1269
|
+
|
|
1270
|
+
/**
|
|
1271
|
+
* Allows an instructor to grade an essay or override the score for any question type.
|
|
1272
|
+
* Grade or override score for a question answer
|
|
1273
|
+
*/
|
|
1274
|
+
async gradeQuizAnswer(requestParameters: GradeQuizAnswerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
|
1275
|
+
await this.gradeQuizAnswerRaw(requestParameters, initOverrides);
|
|
1276
|
+
}
|
|
1277
|
+
|
|
1205
1278
|
/**
|
|
1206
1279
|
* Creates request options for removeQuizQuestion without sending the request
|
|
1207
1280
|
*/
|
|
@@ -68,7 +68,10 @@ export type CriteriaBasedSelectionCriteriaDifficultyLevelsEnum = typeof Criteria
|
|
|
68
68
|
export const CriteriaBasedSelectionCriteriaQuestionTypesEnum = {
|
|
69
69
|
SingleAnswer: 'single_answer',
|
|
70
70
|
MultipleAnswer: 'multiple_answer',
|
|
71
|
-
FillInBlank: 'fill_in_blank'
|
|
71
|
+
FillInBlank: 'fill_in_blank',
|
|
72
|
+
ShortAnswer: 'short_answer',
|
|
73
|
+
Matching: 'matching',
|
|
74
|
+
Essay: 'essay'
|
|
72
75
|
} as const;
|
|
73
76
|
export type CriteriaBasedSelectionCriteriaQuestionTypesEnum = typeof CriteriaBasedSelectionCriteriaQuestionTypesEnum[keyof typeof CriteriaBasedSelectionCriteriaQuestionTypesEnum];
|
|
74
77
|
|
|
@@ -0,0 +1,85 @@
|
|
|
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 Essay
|
|
20
|
+
*/
|
|
21
|
+
export interface Essay {
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @type {EssayTypeEnum}
|
|
25
|
+
* @memberof Essay
|
|
26
|
+
*/
|
|
27
|
+
type: EssayTypeEnum;
|
|
28
|
+
/**
|
|
29
|
+
* Essay response text
|
|
30
|
+
* @type {string}
|
|
31
|
+
* @memberof Essay
|
|
32
|
+
*/
|
|
33
|
+
textAnswer: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* @export
|
|
39
|
+
*/
|
|
40
|
+
export const EssayTypeEnum = {
|
|
41
|
+
Essay: 'essay'
|
|
42
|
+
} as const;
|
|
43
|
+
export type EssayTypeEnum = typeof EssayTypeEnum[keyof typeof EssayTypeEnum];
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Check if a given object implements the Essay interface.
|
|
48
|
+
*/
|
|
49
|
+
export function instanceOfEssay(value: object): value is Essay {
|
|
50
|
+
if (!('type' in value) || value['type'] === undefined) return false;
|
|
51
|
+
if (!('textAnswer' in value) || value['textAnswer'] === undefined) return false;
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function EssayFromJSON(json: any): Essay {
|
|
56
|
+
return EssayFromJSONTyped(json, false);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function EssayFromJSONTyped(json: any, ignoreDiscriminator: boolean): Essay {
|
|
60
|
+
if (json == null) {
|
|
61
|
+
return json;
|
|
62
|
+
}
|
|
63
|
+
return {
|
|
64
|
+
|
|
65
|
+
'type': json['type'],
|
|
66
|
+
'textAnswer': json['text_answer'],
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export function EssayToJSON(json: any): Essay {
|
|
71
|
+
return EssayToJSONTyped(json, false);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export function EssayToJSONTyped(value?: Essay | null, ignoreDiscriminator: boolean = false): any {
|
|
75
|
+
if (value == null) {
|
|
76
|
+
return value;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return {
|
|
80
|
+
|
|
81
|
+
'type': value['type'],
|
|
82
|
+
'text_answer': value['textAnswer'],
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
|
|
@@ -0,0 +1,85 @@
|
|
|
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 Essay1
|
|
20
|
+
*/
|
|
21
|
+
export interface Essay1 {
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @type {Essay1TypeEnum}
|
|
25
|
+
* @memberof Essay1
|
|
26
|
+
*/
|
|
27
|
+
type: Essay1TypeEnum;
|
|
28
|
+
/**
|
|
29
|
+
* Essay response text
|
|
30
|
+
* @type {string}
|
|
31
|
+
* @memberof Essay1
|
|
32
|
+
*/
|
|
33
|
+
textAnswer: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* @export
|
|
39
|
+
*/
|
|
40
|
+
export const Essay1TypeEnum = {
|
|
41
|
+
Essay: 'essay'
|
|
42
|
+
} as const;
|
|
43
|
+
export type Essay1TypeEnum = typeof Essay1TypeEnum[keyof typeof Essay1TypeEnum];
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Check if a given object implements the Essay1 interface.
|
|
48
|
+
*/
|
|
49
|
+
export function instanceOfEssay1(value: object): value is Essay1 {
|
|
50
|
+
if (!('type' in value) || value['type'] === undefined) return false;
|
|
51
|
+
if (!('textAnswer' in value) || value['textAnswer'] === undefined) return false;
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function Essay1FromJSON(json: any): Essay1 {
|
|
56
|
+
return Essay1FromJSONTyped(json, false);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function Essay1FromJSONTyped(json: any, ignoreDiscriminator: boolean): Essay1 {
|
|
60
|
+
if (json == null) {
|
|
61
|
+
return json;
|
|
62
|
+
}
|
|
63
|
+
return {
|
|
64
|
+
|
|
65
|
+
'type': json['type'],
|
|
66
|
+
'textAnswer': json['text_answer'],
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export function Essay1ToJSON(json: any): Essay1 {
|
|
71
|
+
return Essay1ToJSONTyped(json, false);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export function Essay1ToJSONTyped(value?: Essay1 | null, ignoreDiscriminator: boolean = false): any {
|
|
75
|
+
if (value == null) {
|
|
76
|
+
return value;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return {
|
|
80
|
+
|
|
81
|
+
'type': value['type'],
|
|
82
|
+
'text_answer': value['textAnswer'],
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
import { mapValues } from '../runtime';
|
|
16
16
|
/**
|
|
17
|
-
* Details of a course
|
|
17
|
+
* Details of a course export
|
|
18
18
|
* @export
|
|
19
19
|
* @interface GetCourseExport
|
|
20
20
|
*/
|
|
@@ -32,11 +32,23 @@ export interface GetCourseExport {
|
|
|
32
32
|
*/
|
|
33
33
|
courseId: string;
|
|
34
34
|
/**
|
|
35
|
-
* The
|
|
36
|
-
* @type {
|
|
35
|
+
* The export format type
|
|
36
|
+
* @type {GetCourseExportExportTypeEnum}
|
|
37
37
|
* @memberof GetCourseExport
|
|
38
38
|
*/
|
|
39
|
-
|
|
39
|
+
exportType: GetCourseExportExportTypeEnum;
|
|
40
|
+
/**
|
|
41
|
+
* IDs of the modules included in the export
|
|
42
|
+
* @type {Array<string>}
|
|
43
|
+
* @memberof GetCourseExport
|
|
44
|
+
*/
|
|
45
|
+
moduleIds: Array<string>;
|
|
46
|
+
/**
|
|
47
|
+
* ID of the user who requested the export
|
|
48
|
+
* @type {number}
|
|
49
|
+
* @memberof GetCourseExport
|
|
50
|
+
*/
|
|
51
|
+
createdBy: number;
|
|
40
52
|
/**
|
|
41
53
|
* Current status of the export generation
|
|
42
54
|
* @type {GetCourseExportStatusEnum}
|
|
@@ -44,7 +56,7 @@ export interface GetCourseExport {
|
|
|
44
56
|
*/
|
|
45
57
|
status: GetCourseExportStatusEnum;
|
|
46
58
|
/**
|
|
47
|
-
* URL to download the export
|
|
59
|
+
* URL to download the export file (null if not yet completed)
|
|
48
60
|
* @type {string}
|
|
49
61
|
* @memberof GetCourseExport
|
|
50
62
|
*/
|
|
@@ -73,12 +85,12 @@ export interface GetCourseExport {
|
|
|
73
85
|
/**
|
|
74
86
|
* @export
|
|
75
87
|
*/
|
|
76
|
-
export const
|
|
88
|
+
export const GetCourseExportExportTypeEnum = {
|
|
77
89
|
Scorm12: 'SCORM_1_2',
|
|
78
90
|
Scorm20043RdEdition: 'SCORM_2004_3RD_EDITION',
|
|
79
91
|
Scorm20044ThEdition: 'SCORM_2004_4TH_EDITION'
|
|
80
92
|
} as const;
|
|
81
|
-
export type
|
|
93
|
+
export type GetCourseExportExportTypeEnum = typeof GetCourseExportExportTypeEnum[keyof typeof GetCourseExportExportTypeEnum];
|
|
82
94
|
|
|
83
95
|
/**
|
|
84
96
|
* @export
|
|
@@ -98,7 +110,9 @@ export type GetCourseExportStatusEnum = typeof GetCourseExportStatusEnum[keyof t
|
|
|
98
110
|
export function instanceOfGetCourseExport(value: object): value is GetCourseExport {
|
|
99
111
|
if (!('id' in value) || value['id'] === undefined) return false;
|
|
100
112
|
if (!('courseId' in value) || value['courseId'] === undefined) return false;
|
|
101
|
-
if (!('
|
|
113
|
+
if (!('exportType' in value) || value['exportType'] === undefined) return false;
|
|
114
|
+
if (!('moduleIds' in value) || value['moduleIds'] === undefined) return false;
|
|
115
|
+
if (!('createdBy' in value) || value['createdBy'] === undefined) return false;
|
|
102
116
|
if (!('status' in value) || value['status'] === undefined) return false;
|
|
103
117
|
if (!('createdAt' in value) || value['createdAt'] === undefined) return false;
|
|
104
118
|
return true;
|
|
@@ -116,7 +130,9 @@ export function GetCourseExportFromJSONTyped(json: any, ignoreDiscriminator: boo
|
|
|
116
130
|
|
|
117
131
|
'id': json['id'],
|
|
118
132
|
'courseId': json['course_id'],
|
|
119
|
-
'
|
|
133
|
+
'exportType': json['export_type'],
|
|
134
|
+
'moduleIds': json['module_ids'],
|
|
135
|
+
'createdBy': json['created_by'],
|
|
120
136
|
'status': json['status'],
|
|
121
137
|
'downloadUrl': json['download_url'] == null ? undefined : json['download_url'],
|
|
122
138
|
'fileSize': json['file_size'] == null ? undefined : json['file_size'],
|
|
@@ -138,7 +154,9 @@ export function GetCourseExportToJSONTyped(value?: GetCourseExport | null, ignor
|
|
|
138
154
|
|
|
139
155
|
'id': value['id'],
|
|
140
156
|
'course_id': value['courseId'],
|
|
141
|
-
'
|
|
157
|
+
'export_type': value['exportType'],
|
|
158
|
+
'module_ids': value['moduleIds'],
|
|
159
|
+
'created_by': value['createdBy'],
|
|
142
160
|
'status': value['status'],
|
|
143
161
|
'download_url': value['downloadUrl'],
|
|
144
162
|
'file_size': value['fileSize'],
|
|
@@ -40,7 +40,7 @@ export interface GetQuestion {
|
|
|
40
40
|
*/
|
|
41
41
|
questionText: string;
|
|
42
42
|
/**
|
|
43
|
-
* Type of question
|
|
43
|
+
* Type of question
|
|
44
44
|
* @type {GetQuestionQuestionTypeEnum}
|
|
45
45
|
* @memberof GetQuestion
|
|
46
46
|
*/
|
|
@@ -126,7 +126,10 @@ export interface GetQuestion {
|
|
|
126
126
|
export const GetQuestionQuestionTypeEnum = {
|
|
127
127
|
SingleAnswer: 'single_answer',
|
|
128
128
|
MultipleAnswer: 'multiple_answer',
|
|
129
|
-
FillInBlank: 'fill_in_blank'
|
|
129
|
+
FillInBlank: 'fill_in_blank',
|
|
130
|
+
ShortAnswer: 'short_answer',
|
|
131
|
+
Matching: 'matching',
|
|
132
|
+
Essay: 'essay'
|
|
130
133
|
} as const;
|
|
131
134
|
export type GetQuestionQuestionTypeEnum = typeof GetQuestionQuestionTypeEnum[keyof typeof GetQuestionQuestionTypeEnum];
|
|
132
135
|
|
|
@@ -76,7 +76,10 @@ export interface GetQuestionListFilters {
|
|
|
76
76
|
export const GetQuestionListFiltersQuestionTypeEnum = {
|
|
77
77
|
SingleAnswer: 'single_answer',
|
|
78
78
|
MultipleAnswer: 'multiple_answer',
|
|
79
|
-
FillInBlank: 'fill_in_blank'
|
|
79
|
+
FillInBlank: 'fill_in_blank',
|
|
80
|
+
ShortAnswer: 'short_answer',
|
|
81
|
+
Matching: 'matching',
|
|
82
|
+
Essay: 'essay'
|
|
80
83
|
} as const;
|
|
81
84
|
export type GetQuestionListFiltersQuestionTypeEnum = typeof GetQuestionListFiltersQuestionTypeEnum[keyof typeof GetQuestionListFiltersQuestionTypeEnum];
|
|
82
85
|
|