@memberjunction/actions-bizapps-lms 5.3.1 → 5.4.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/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +16 -0
- package/LEARNWORLDS_SIDECAR_PLAN.md +845 -0
- package/dist/base/base-lms.action.d.ts +26 -4
- package/dist/base/base-lms.action.d.ts.map +1 -1
- package/dist/base/base-lms.action.js +73 -17
- package/dist/base/base-lms.action.js.map +1 -1
- package/dist/providers/learnworlds/actions/attach-tags.action.d.ts +26 -0
- package/dist/providers/learnworlds/actions/attach-tags.action.d.ts.map +1 -0
- package/dist/providers/learnworlds/actions/attach-tags.action.js +79 -0
- package/dist/providers/learnworlds/actions/attach-tags.action.js.map +1 -0
- package/dist/providers/learnworlds/actions/create-user.action.d.ts +24 -1
- package/dist/providers/learnworlds/actions/create-user.action.d.ts.map +1 -1
- package/dist/providers/learnworlds/actions/create-user.action.js +166 -142
- package/dist/providers/learnworlds/actions/create-user.action.js.map +1 -1
- package/dist/providers/learnworlds/actions/detach-tags.action.d.ts +26 -0
- package/dist/providers/learnworlds/actions/detach-tags.action.d.ts.map +1 -0
- package/dist/providers/learnworlds/actions/detach-tags.action.js +79 -0
- package/dist/providers/learnworlds/actions/detach-tags.action.js.map +1 -0
- package/dist/providers/learnworlds/actions/enroll-user.action.d.ts +31 -3
- package/dist/providers/learnworlds/actions/enroll-user.action.d.ts.map +1 -1
- package/dist/providers/learnworlds/actions/enroll-user.action.js +179 -125
- package/dist/providers/learnworlds/actions/enroll-user.action.js.map +1 -1
- package/dist/providers/learnworlds/actions/get-bulk-data.action.d.ts +79 -0
- package/dist/providers/learnworlds/actions/get-bulk-data.action.d.ts.map +1 -0
- package/dist/providers/learnworlds/actions/get-bulk-data.action.js +359 -0
- package/dist/providers/learnworlds/actions/get-bulk-data.action.js.map +1 -0
- package/dist/providers/learnworlds/actions/get-bundles.action.d.ts +34 -0
- package/dist/providers/learnworlds/actions/get-bundles.action.d.ts.map +1 -0
- package/dist/providers/learnworlds/actions/get-bundles.action.js +107 -0
- package/dist/providers/learnworlds/actions/get-bundles.action.js.map +1 -0
- package/dist/providers/learnworlds/actions/get-certificates.action.d.ts +33 -2
- package/dist/providers/learnworlds/actions/get-certificates.action.d.ts.map +1 -1
- package/dist/providers/learnworlds/actions/get-certificates.action.js +311 -244
- package/dist/providers/learnworlds/actions/get-certificates.action.js.map +1 -1
- package/dist/providers/learnworlds/actions/get-course-analytics.action.d.ts +14 -14
- package/dist/providers/learnworlds/actions/get-course-analytics.action.d.ts.map +1 -1
- package/dist/providers/learnworlds/actions/get-course-analytics.action.js +234 -226
- package/dist/providers/learnworlds/actions/get-course-analytics.action.js.map +1 -1
- package/dist/providers/learnworlds/actions/get-course-details.action.d.ts +42 -6
- package/dist/providers/learnworlds/actions/get-course-details.action.d.ts.map +1 -1
- package/dist/providers/learnworlds/actions/get-course-details.action.js +182 -148
- package/dist/providers/learnworlds/actions/get-course-details.action.js.map +1 -1
- package/dist/providers/learnworlds/actions/get-courses.action.d.ts +29 -82
- package/dist/providers/learnworlds/actions/get-courses.action.d.ts.map +1 -1
- package/dist/providers/learnworlds/actions/get-courses.action.js +188 -207
- package/dist/providers/learnworlds/actions/get-courses.action.js.map +1 -1
- package/dist/providers/learnworlds/actions/get-quiz-results.action.d.ts +22 -2
- package/dist/providers/learnworlds/actions/get-quiz-results.action.d.ts.map +1 -1
- package/dist/providers/learnworlds/actions/get-quiz-results.action.js +316 -294
- package/dist/providers/learnworlds/actions/get-quiz-results.action.js.map +1 -1
- package/dist/providers/learnworlds/actions/get-user-details.action.d.ts +23 -59
- package/dist/providers/learnworlds/actions/get-user-details.action.d.ts.map +1 -1
- package/dist/providers/learnworlds/actions/get-user-details.action.js +113 -114
- package/dist/providers/learnworlds/actions/get-user-details.action.js.map +1 -1
- package/dist/providers/learnworlds/actions/get-user-enrollments.action.d.ts +43 -5
- package/dist/providers/learnworlds/actions/get-user-enrollments.action.d.ts.map +1 -1
- package/dist/providers/learnworlds/actions/get-user-enrollments.action.js +191 -147
- package/dist/providers/learnworlds/actions/get-user-enrollments.action.js.map +1 -1
- package/dist/providers/learnworlds/actions/get-user-progress.action.d.ts +21 -92
- package/dist/providers/learnworlds/actions/get-user-progress.action.d.ts.map +1 -1
- package/dist/providers/learnworlds/actions/get-user-progress.action.js +145 -166
- package/dist/providers/learnworlds/actions/get-user-progress.action.js.map +1 -1
- package/dist/providers/learnworlds/actions/get-users.action.d.ts +14 -28
- package/dist/providers/learnworlds/actions/get-users.action.d.ts.map +1 -1
- package/dist/providers/learnworlds/actions/get-users.action.js +122 -143
- package/dist/providers/learnworlds/actions/get-users.action.js.map +1 -1
- package/dist/providers/learnworlds/actions/index.d.ts +7 -0
- package/dist/providers/learnworlds/actions/index.d.ts.map +1 -1
- package/dist/providers/learnworlds/actions/index.js +7 -0
- package/dist/providers/learnworlds/actions/index.js.map +1 -1
- package/dist/providers/learnworlds/actions/onboard-learner.action.d.ts +53 -0
- package/dist/providers/learnworlds/actions/onboard-learner.action.d.ts.map +1 -0
- package/dist/providers/learnworlds/actions/onboard-learner.action.js +236 -0
- package/dist/providers/learnworlds/actions/onboard-learner.action.js.map +1 -0
- package/dist/providers/learnworlds/actions/sso-login.action.d.ts +35 -0
- package/dist/providers/learnworlds/actions/sso-login.action.d.ts.map +1 -0
- package/dist/providers/learnworlds/actions/sso-login.action.js +101 -0
- package/dist/providers/learnworlds/actions/sso-login.action.js.map +1 -0
- package/dist/providers/learnworlds/actions/update-user-progress.action.d.ts +12 -1
- package/dist/providers/learnworlds/actions/update-user-progress.action.d.ts.map +1 -1
- package/dist/providers/learnworlds/actions/update-user-progress.action.js +167 -210
- package/dist/providers/learnworlds/actions/update-user-progress.action.js.map +1 -1
- package/dist/providers/learnworlds/actions/update-user.action.d.ts +39 -0
- package/dist/providers/learnworlds/actions/update-user.action.d.ts.map +1 -0
- package/dist/providers/learnworlds/actions/update-user.action.js +168 -0
- package/dist/providers/learnworlds/actions/update-user.action.js.map +1 -0
- package/dist/providers/learnworlds/index.d.ts +1 -0
- package/dist/providers/learnworlds/index.d.ts.map +1 -1
- package/dist/providers/learnworlds/index.js +2 -0
- package/dist/providers/learnworlds/index.js.map +1 -1
- package/dist/providers/learnworlds/interfaces/bundle.types.d.ts +16 -0
- package/dist/providers/learnworlds/interfaces/bundle.types.d.ts.map +1 -0
- package/dist/providers/learnworlds/interfaces/bundle.types.js +2 -0
- package/dist/providers/learnworlds/interfaces/bundle.types.js.map +1 -0
- package/dist/providers/learnworlds/interfaces/certificate.types.d.ts +66 -0
- package/dist/providers/learnworlds/interfaces/certificate.types.d.ts.map +1 -0
- package/dist/providers/learnworlds/interfaces/certificate.types.js +2 -0
- package/dist/providers/learnworlds/interfaces/certificate.types.js.map +1 -0
- package/dist/providers/learnworlds/interfaces/common.types.d.ts +221 -0
- package/dist/providers/learnworlds/interfaces/common.types.d.ts.map +1 -0
- package/dist/providers/learnworlds/interfaces/common.types.js +2 -0
- package/dist/providers/learnworlds/interfaces/common.types.js.map +1 -0
- package/dist/providers/learnworlds/interfaces/course.types.d.ts +393 -0
- package/dist/providers/learnworlds/interfaces/course.types.d.ts.map +1 -0
- package/dist/providers/learnworlds/interfaces/course.types.js +2 -0
- package/dist/providers/learnworlds/interfaces/course.types.js.map +1 -0
- package/dist/providers/learnworlds/interfaces/enrollment.types.d.ts +165 -0
- package/dist/providers/learnworlds/interfaces/enrollment.types.d.ts.map +1 -0
- package/dist/providers/learnworlds/interfaces/enrollment.types.js +2 -0
- package/dist/providers/learnworlds/interfaces/enrollment.types.js.map +1 -0
- package/dist/providers/learnworlds/interfaces/index.d.ts +12 -0
- package/dist/providers/learnworlds/interfaces/index.d.ts.map +1 -0
- package/dist/providers/learnworlds/interfaces/index.js +13 -0
- package/dist/providers/learnworlds/interfaces/index.js.map +1 -0
- package/dist/providers/learnworlds/interfaces/onboarding.types.d.ts +39 -0
- package/dist/providers/learnworlds/interfaces/onboarding.types.d.ts.map +1 -0
- package/dist/providers/learnworlds/interfaces/onboarding.types.js +2 -0
- package/dist/providers/learnworlds/interfaces/onboarding.types.js.map +1 -0
- package/dist/providers/learnworlds/interfaces/quiz.types.d.ts +108 -0
- package/dist/providers/learnworlds/interfaces/quiz.types.d.ts.map +1 -0
- package/dist/providers/learnworlds/interfaces/quiz.types.js +2 -0
- package/dist/providers/learnworlds/interfaces/quiz.types.js.map +1 -0
- package/dist/providers/learnworlds/interfaces/sso.types.d.ts +18 -0
- package/dist/providers/learnworlds/interfaces/sso.types.d.ts.map +1 -0
- package/dist/providers/learnworlds/interfaces/sso.types.js +2 -0
- package/dist/providers/learnworlds/interfaces/sso.types.js.map +1 -0
- package/dist/providers/learnworlds/interfaces/sync.types.d.ts +44 -0
- package/dist/providers/learnworlds/interfaces/sync.types.d.ts.map +1 -0
- package/dist/providers/learnworlds/interfaces/sync.types.js +2 -0
- package/dist/providers/learnworlds/interfaces/sync.types.js.map +1 -0
- package/dist/providers/learnworlds/interfaces/tag.types.d.ts +17 -0
- package/dist/providers/learnworlds/interfaces/tag.types.d.ts.map +1 -0
- package/dist/providers/learnworlds/interfaces/tag.types.js +2 -0
- package/dist/providers/learnworlds/interfaces/tag.types.js.map +1 -0
- package/dist/providers/learnworlds/interfaces/user.types.d.ts +198 -0
- package/dist/providers/learnworlds/interfaces/user.types.d.ts.map +1 -0
- package/dist/providers/learnworlds/interfaces/user.types.js +2 -0
- package/dist/providers/learnworlds/interfaces/user.types.js.map +1 -0
- package/dist/providers/learnworlds/learnworlds-base.action.d.ts +111 -7
- package/dist/providers/learnworlds/learnworlds-base.action.d.ts.map +1 -1
- package/dist/providers/learnworlds/learnworlds-base.action.js +293 -56
- package/dist/providers/learnworlds/learnworlds-base.action.js.map +1 -1
- package/package.json +8 -7
- package/src/__tests__/attach-tags.action.test.ts +137 -0
- package/src/__tests__/create-user.action.test.ts +311 -0
- package/src/__tests__/detach-tags.action.test.ts +136 -0
- package/src/__tests__/enroll-user.action.test.ts +283 -0
- package/src/__tests__/get-bulk-data.action.test.ts +649 -0
- package/src/__tests__/get-bundles.action.test.ts +215 -0
- package/src/__tests__/lms.test.ts +275 -184
- package/src/__tests__/onboard-learner.action.test.ts +455 -0
- package/src/__tests__/sso-login.action.test.ts +256 -0
- package/src/__tests__/update-user.action.test.ts +350 -0
- package/src/base/base-lms.action.ts +226 -163
- package/src/providers/learnworlds/actions/attach-tags.action.ts +90 -0
- package/src/providers/learnworlds/actions/create-user.action.ts +291 -235
- package/src/providers/learnworlds/actions/detach-tags.action.ts +90 -0
- package/src/providers/learnworlds/actions/enroll-user.action.ts +326 -220
- package/src/providers/learnworlds/actions/get-bulk-data.action.ts +438 -0
- package/src/providers/learnworlds/actions/get-bundles.action.ts +139 -0
- package/src/providers/learnworlds/actions/get-certificates.action.ts +499 -309
- package/src/providers/learnworlds/actions/get-course-analytics.action.ts +470 -337
- package/src/providers/learnworlds/actions/get-course-details.action.ts +395 -249
- package/src/providers/learnworlds/actions/get-courses.action.ts +508 -565
- package/src/providers/learnworlds/actions/get-quiz-results.action.ts +606 -381
- package/src/providers/learnworlds/actions/get-user-details.action.ts +335 -349
- package/src/providers/learnworlds/actions/get-user-enrollments.action.ts +328 -228
- package/src/providers/learnworlds/actions/get-user-progress.action.ts +522 -571
- package/src/providers/learnworlds/actions/get-users.action.ts +231 -282
- package/src/providers/learnworlds/actions/index.ts +8 -1
- package/src/providers/learnworlds/actions/onboard-learner.action.ts +286 -0
- package/src/providers/learnworlds/actions/sso-login.action.ts +116 -0
- package/src/providers/learnworlds/actions/update-user-progress.action.ts +301 -263
- package/src/providers/learnworlds/actions/update-user.action.ts +181 -0
- package/src/providers/learnworlds/index.ts +4 -1
- package/src/providers/learnworlds/interfaces/bundle.types.ts +17 -0
- package/src/providers/learnworlds/interfaces/certificate.types.ts +69 -0
- package/src/providers/learnworlds/interfaces/common.types.ts +233 -0
- package/src/providers/learnworlds/interfaces/course.types.ts +411 -0
- package/src/providers/learnworlds/interfaces/enrollment.types.ts +176 -0
- package/src/providers/learnworlds/interfaces/index.ts +12 -0
- package/src/providers/learnworlds/interfaces/onboarding.types.ts +41 -0
- package/src/providers/learnworlds/interfaces/quiz.types.ts +118 -0
- package/src/providers/learnworlds/interfaces/sso.types.ts +19 -0
- package/src/providers/learnworlds/interfaces/sync.types.ts +46 -0
- package/src/providers/learnworlds/interfaces/tag.types.ts +18 -0
- package/src/providers/learnworlds/interfaces/user.types.ts +204 -0
- package/src/providers/learnworlds/learnworlds-base.action.ts +468 -210
- package/tsconfig.json +1 -1
- package/dist/__tests__/lms.test.d.ts +0 -2
- package/dist/__tests__/lms.test.d.ts.map +0 -1
- package/dist/__tests__/lms.test.js +0 -232
- package/dist/__tests__/lms.test.js.map +0 -1
|
@@ -11,249 +11,250 @@ import { BaseAction } from '@memberjunction/actions';
|
|
|
11
11
|
* Action to retrieve quiz/assessment results from LearnWorlds
|
|
12
12
|
*/
|
|
13
13
|
let GetQuizResultsAction = class GetQuizResultsAction extends LearnWorldsBaseAction {
|
|
14
|
+
// ----------------------------------------------------------------
|
|
15
|
+
// Typed public method – can be called directly from code
|
|
16
|
+
// ----------------------------------------------------------------
|
|
14
17
|
/**
|
|
15
|
-
* Get quiz results for a user, course, or specific quiz
|
|
18
|
+
* Get quiz results for a user, course, or specific quiz.
|
|
19
|
+
* Throws on any error.
|
|
16
20
|
*/
|
|
21
|
+
async GetQuizResults(params, contextUser) {
|
|
22
|
+
this.SetCompanyContext(params.CompanyID);
|
|
23
|
+
const { UserID: userId, CourseID: courseId, QuizID: quizId, IncludeQuestions: includeQuestionsRaw, IncludeAnswers: includeAnswersRaw, PassingOnly: passingOnly = false, DateFrom: dateFrom, DateTo: dateTo, SortBy: sortBy = 'completed_at', SortOrder: sortOrder = 'desc', MaxResults: maxResults = 100, } = params;
|
|
24
|
+
const includeQuestions = includeQuestionsRaw !== false;
|
|
25
|
+
const includeAnswers = includeAnswersRaw !== false;
|
|
26
|
+
// Require at least one identifier
|
|
27
|
+
if (!userId && !courseId && !quizId) {
|
|
28
|
+
throw new Error('At least one of UserID, CourseID, or QuizID is required');
|
|
29
|
+
}
|
|
30
|
+
// Build query parameters
|
|
31
|
+
const queryParams = this.buildQuizQueryParams(userId, quizId, passingOnly, dateFrom, dateTo, sortBy, sortOrder, maxResults);
|
|
32
|
+
// Validate path segments before URL interpolation
|
|
33
|
+
if (userId)
|
|
34
|
+
this.validatePathSegment(userId, 'UserID');
|
|
35
|
+
if (courseId)
|
|
36
|
+
this.validatePathSegment(courseId, 'CourseID');
|
|
37
|
+
if (quizId)
|
|
38
|
+
this.validatePathSegment(quizId, 'QuizID');
|
|
39
|
+
// Determine endpoint
|
|
40
|
+
const endpoint = this.buildQuizEndpoint(userId, courseId, quizId);
|
|
41
|
+
// Build query string
|
|
42
|
+
const queryString = this.buildQueryString(queryParams);
|
|
43
|
+
// Fetch quiz results
|
|
44
|
+
const resultsResponse = await this.makeLearnWorldsRequest(endpoint + queryString, 'GET', null, contextUser);
|
|
45
|
+
if (resultsResponse.success === false) {
|
|
46
|
+
throw new Error(resultsResponse.message || 'Failed to retrieve quiz results');
|
|
47
|
+
}
|
|
48
|
+
// Normalize results
|
|
49
|
+
const rawResults = this.extractQuizResultsArray(resultsResponse);
|
|
50
|
+
// Process each quiz result
|
|
51
|
+
const formattedResults = await this.processQuizResults(rawResults, userId, courseId, quizId, includeQuestions, includeAnswers, contextUser);
|
|
52
|
+
// Calculate summary
|
|
53
|
+
const summary = this.buildQuizResultsSummary(formattedResults, userId, courseId, quizId, dateFrom, dateTo);
|
|
54
|
+
return {
|
|
55
|
+
QuizResults: formattedResults,
|
|
56
|
+
TotalCount: formattedResults.length,
|
|
57
|
+
Summary: summary,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
// ----------------------------------------------------------------
|
|
61
|
+
// Framework wrapper – thin delegation to the public method
|
|
62
|
+
// ----------------------------------------------------------------
|
|
17
63
|
async InternalRunAction(params) {
|
|
18
64
|
const { Params, ContextUser } = params;
|
|
19
65
|
this.params = Params;
|
|
20
66
|
try {
|
|
21
|
-
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
67
|
+
const typedParams = this.extractQuizResultsParams(Params);
|
|
68
|
+
const result = await this.GetQuizResults(typedParams, ContextUser);
|
|
69
|
+
this.setOutputParam(Params, 'QuizResults', result.QuizResults);
|
|
70
|
+
this.setOutputParam(Params, 'TotalCount', result.TotalCount);
|
|
71
|
+
this.setOutputParam(Params, 'Summary', result.Summary);
|
|
72
|
+
return this.buildSuccessResult(`Retrieved ${result.TotalCount} quiz result(s)`, Params);
|
|
73
|
+
}
|
|
74
|
+
catch (error) {
|
|
75
|
+
const msg = error instanceof Error ? error.message : 'Unknown error';
|
|
76
|
+
return this.buildErrorResult('ERROR', `Error retrieving quiz results: ${msg}`, Params);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
// ----------------------------------------------------------------
|
|
80
|
+
// Private helpers – parameter extraction
|
|
81
|
+
// ----------------------------------------------------------------
|
|
82
|
+
extractQuizResultsParams(params) {
|
|
83
|
+
return {
|
|
84
|
+
CompanyID: this.getRequiredStringParam(params, 'CompanyID'),
|
|
85
|
+
UserID: this.getOptionalStringParam(params, 'UserID'),
|
|
86
|
+
CourseID: this.getOptionalStringParam(params, 'CourseID'),
|
|
87
|
+
QuizID: this.getOptionalStringParam(params, 'QuizID'),
|
|
88
|
+
IncludeQuestions: this.getOptionalBooleanParam(params, 'IncludeQuestions', true),
|
|
89
|
+
IncludeAnswers: this.getOptionalBooleanParam(params, 'IncludeAnswers', true),
|
|
90
|
+
PassingOnly: this.getOptionalBooleanParam(params, 'PassingOnly', false),
|
|
91
|
+
DateFrom: this.getOptionalStringParam(params, 'DateFrom'),
|
|
92
|
+
DateTo: this.getOptionalStringParam(params, 'DateTo'),
|
|
93
|
+
SortBy: this.getOptionalStringParam(params, 'SortBy'),
|
|
94
|
+
SortOrder: (this.getOptionalStringParam(params, 'SortOrder') || 'desc'),
|
|
95
|
+
MaxResults: this.getOptionalNumberParam(params, 'MaxResults', LearnWorldsBaseAction.LW_MAX_PAGE_SIZE),
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
// ----------------------------------------------------------------
|
|
99
|
+
// Private helpers – query building
|
|
100
|
+
// ----------------------------------------------------------------
|
|
101
|
+
buildQuizQueryParams(userId, quizId, passingOnly, dateFrom, dateTo, sortBy, sortOrder, maxResults) {
|
|
102
|
+
const queryParams = {
|
|
103
|
+
limit: Math.min(maxResults, LearnWorldsBaseAction.LW_MAX_PAGE_SIZE),
|
|
104
|
+
sort: sortBy,
|
|
105
|
+
order: sortOrder,
|
|
106
|
+
};
|
|
107
|
+
if (passingOnly) {
|
|
108
|
+
queryParams.passed = true;
|
|
109
|
+
}
|
|
110
|
+
const parsedFrom = this.safeParseDateToISO(dateFrom);
|
|
111
|
+
if (parsedFrom) {
|
|
112
|
+
queryParams.completed_after = parsedFrom;
|
|
113
|
+
}
|
|
114
|
+
const parsedTo = this.safeParseDateToISO(dateTo);
|
|
115
|
+
if (parsedTo) {
|
|
116
|
+
queryParams.completed_before = parsedTo;
|
|
117
|
+
}
|
|
118
|
+
if (quizId && userId) {
|
|
119
|
+
queryParams.user_id = userId;
|
|
120
|
+
}
|
|
121
|
+
return queryParams;
|
|
122
|
+
}
|
|
123
|
+
buildQuizEndpoint(userId, courseId, quizId) {
|
|
124
|
+
if (quizId) {
|
|
125
|
+
return `/quizzes/${quizId}/results`;
|
|
126
|
+
}
|
|
127
|
+
else if (userId && courseId) {
|
|
128
|
+
return `/users/${userId}/courses/${courseId}/quiz-results`;
|
|
129
|
+
}
|
|
130
|
+
else if (userId) {
|
|
131
|
+
return `/users/${userId}/quiz-results`;
|
|
132
|
+
}
|
|
133
|
+
else if (courseId) {
|
|
134
|
+
return `/courses/${courseId}/quiz-results`;
|
|
135
|
+
}
|
|
136
|
+
return '/quiz-results';
|
|
137
|
+
}
|
|
138
|
+
buildQueryString(queryParams) {
|
|
139
|
+
const filtered = {};
|
|
140
|
+
for (const [key, value] of Object.entries(queryParams)) {
|
|
141
|
+
if (value !== undefined) {
|
|
142
|
+
filtered[key] = String(value);
|
|
87
143
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
144
|
+
}
|
|
145
|
+
const keys = Object.keys(filtered);
|
|
146
|
+
if (keys.length === 0)
|
|
147
|
+
return '';
|
|
148
|
+
return '?' + new URLSearchParams(filtered).toString();
|
|
149
|
+
}
|
|
150
|
+
extractQuizResultsArray(response) {
|
|
151
|
+
const data = response.data;
|
|
152
|
+
if (Array.isArray(data)) {
|
|
153
|
+
return data;
|
|
154
|
+
}
|
|
155
|
+
if (data && typeof data === 'object' && 'data' in data && Array.isArray(data.data)) {
|
|
156
|
+
return data.data;
|
|
157
|
+
}
|
|
158
|
+
return [];
|
|
159
|
+
}
|
|
160
|
+
// ----------------------------------------------------------------
|
|
161
|
+
// Private helpers – processing
|
|
162
|
+
// ----------------------------------------------------------------
|
|
163
|
+
async processQuizResults(rawResults, userId, courseId, quizId, includeQuestions, includeAnswers, contextUser) {
|
|
164
|
+
const formatted = [];
|
|
165
|
+
for (const result of rawResults) {
|
|
166
|
+
const formattedResult = this.buildBaseQuizResult(result, userId, courseId, quizId);
|
|
167
|
+
// Attach user info if available
|
|
168
|
+
if (result.user) {
|
|
169
|
+
formattedResult.user = {
|
|
170
|
+
id: result.user.id || '',
|
|
171
|
+
email: result.user.email || '',
|
|
172
|
+
name: result.user.name || `${result.user.first_name || ''} ${result.user.last_name || ''}`.trim(),
|
|
107
173
|
};
|
|
108
|
-
// Add user info if available
|
|
109
|
-
if (result.user && !formattedResult.user) {
|
|
110
|
-
formattedResult.user = {
|
|
111
|
-
id: result.user.id,
|
|
112
|
-
email: result.user.email,
|
|
113
|
-
name: result.user.name || `${result.user.first_name || ''} ${result.user.last_name || ''}`.trim()
|
|
114
|
-
};
|
|
115
|
-
}
|
|
116
|
-
// Add quiz info if available
|
|
117
|
-
if (result.quiz) {
|
|
118
|
-
formattedResult.quiz = {
|
|
119
|
-
id: result.quiz.id,
|
|
120
|
-
title: result.quiz.title || result.quiz.name,
|
|
121
|
-
type: result.quiz.type || 'quiz',
|
|
122
|
-
questionCount: result.quiz.question_count || result.quiz.total_questions
|
|
123
|
-
};
|
|
124
|
-
}
|
|
125
|
-
else if (!quizId && result.quiz_id) {
|
|
126
|
-
// Try to get quiz info
|
|
127
|
-
const quizResponse = await this.makeLearnWorldsRequest(`/quizzes/${result.quiz_id}`, 'GET', null, ContextUser);
|
|
128
|
-
if (quizResponse.success && quizResponse.data) {
|
|
129
|
-
const quiz = quizResponse.data;
|
|
130
|
-
formattedResult.quiz = {
|
|
131
|
-
id: quiz.id,
|
|
132
|
-
title: quiz.title || quiz.name,
|
|
133
|
-
type: quiz.type || 'quiz',
|
|
134
|
-
questionCount: quiz.question_count || quiz.total_questions
|
|
135
|
-
};
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
// Add questions and answers if requested
|
|
139
|
-
if (includeQuestions || includeAnswers) {
|
|
140
|
-
const detailsResponse = await this.makeLearnWorldsRequest(`/quiz-results/${formattedResult.id}/details`, 'GET', null, ContextUser);
|
|
141
|
-
if (detailsResponse.success && detailsResponse.data) {
|
|
142
|
-
const details = detailsResponse.data;
|
|
143
|
-
if (includeQuestions) {
|
|
144
|
-
formattedResult.questions = this.formatQuestions(details.questions || details.answers || []);
|
|
145
|
-
}
|
|
146
|
-
if (includeAnswers) {
|
|
147
|
-
formattedResult.answers = this.formatAnswers(details.answers || details.questions || []);
|
|
148
|
-
// Calculate additional metrics
|
|
149
|
-
const answers = formattedResult.answers || [];
|
|
150
|
-
formattedResult.metrics = {
|
|
151
|
-
correctAnswers: answers.filter((a) => a.isCorrect).length,
|
|
152
|
-
incorrectAnswers: answers.filter((a) => !a.isCorrect).length,
|
|
153
|
-
totalQuestions: answers.length,
|
|
154
|
-
accuracyRate: answers.length > 0
|
|
155
|
-
? (answers.filter((a) => a.isCorrect).length / answers.length * 100).toFixed(1)
|
|
156
|
-
: 0
|
|
157
|
-
};
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
formattedResults.push(formattedResult);
|
|
162
|
-
}
|
|
163
|
-
// Calculate summary statistics
|
|
164
|
-
const totalResults = formattedResults.length;
|
|
165
|
-
const passedResults = formattedResults.filter(r => r.passed).length;
|
|
166
|
-
const averageScore = totalResults > 0
|
|
167
|
-
? formattedResults.reduce((sum, r) => sum + r.percentage, 0) / totalResults
|
|
168
|
-
: 0;
|
|
169
|
-
const averageDuration = totalResults > 0
|
|
170
|
-
? formattedResults.reduce((sum, r) => sum + (r.duration || 0), 0) / totalResults
|
|
171
|
-
: 0;
|
|
172
|
-
// Group results by quiz if multiple quizzes
|
|
173
|
-
const resultsByQuiz = {};
|
|
174
|
-
if (!quizId) {
|
|
175
|
-
formattedResults.forEach(result => {
|
|
176
|
-
const quizTitle = result.quiz?.title || 'Unknown Quiz';
|
|
177
|
-
if (!resultsByQuiz[quizTitle]) {
|
|
178
|
-
resultsByQuiz[quizTitle] = {
|
|
179
|
-
results: [],
|
|
180
|
-
stats: {
|
|
181
|
-
attempts: 0,
|
|
182
|
-
averageScore: 0,
|
|
183
|
-
passRate: 0
|
|
184
|
-
}
|
|
185
|
-
};
|
|
186
|
-
}
|
|
187
|
-
resultsByQuiz[quizTitle].results.push(result);
|
|
188
|
-
});
|
|
189
|
-
// Calculate stats for each quiz
|
|
190
|
-
Object.keys(resultsByQuiz).forEach(quizTitle => {
|
|
191
|
-
const quizResults = resultsByQuiz[quizTitle].results;
|
|
192
|
-
resultsByQuiz[quizTitle].stats = {
|
|
193
|
-
attempts: quizResults.length,
|
|
194
|
-
averageScore: (quizResults.reduce((sum, r) => sum + r.percentage, 0) / quizResults.length).toFixed(1),
|
|
195
|
-
passRate: ((quizResults.filter((r) => r.passed).length / quizResults.length) * 100).toFixed(1)
|
|
196
|
-
};
|
|
197
|
-
});
|
|
198
|
-
}
|
|
199
|
-
// Create summary
|
|
200
|
-
const summary = {
|
|
201
|
-
totalResults: totalResults,
|
|
202
|
-
passedResults: passedResults,
|
|
203
|
-
failedResults: totalResults - passedResults,
|
|
204
|
-
passRate: totalResults > 0 ? ((passedResults / totalResults) * 100).toFixed(1) : 0,
|
|
205
|
-
averageScore: averageScore.toFixed(1),
|
|
206
|
-
averageDuration: averageDuration,
|
|
207
|
-
averageDurationText: this.formatDuration(Math.round(averageDuration)),
|
|
208
|
-
dateRange: {
|
|
209
|
-
from: dateFrom || 'all-time',
|
|
210
|
-
to: dateTo || 'current'
|
|
211
|
-
},
|
|
212
|
-
filterType: userId ? (courseId ? 'user-course' : 'user') : (courseId ? 'course' : 'all'),
|
|
213
|
-
quizBreakdown: !quizId ? resultsByQuiz : null
|
|
214
|
-
};
|
|
215
|
-
// Update output parameters
|
|
216
|
-
const outputParams = [...Params];
|
|
217
|
-
const quizResultsParam = outputParams.find(p => p.Name === 'QuizResults');
|
|
218
|
-
if (quizResultsParam) {
|
|
219
|
-
quizResultsParam.Value = formattedResults;
|
|
220
|
-
}
|
|
221
|
-
const totalCountParam = outputParams.find(p => p.Name === 'TotalCount');
|
|
222
|
-
if (totalCountParam) {
|
|
223
|
-
totalCountParam.Value = totalResults;
|
|
224
174
|
}
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
175
|
+
// Attach quiz info
|
|
176
|
+
formattedResult.quiz = await this.resolveQuizInfo(result, quizId, contextUser);
|
|
177
|
+
// Attach questions & answers if requested
|
|
178
|
+
if (includeQuestions || includeAnswers) {
|
|
179
|
+
await this.attachDetailedResults(formattedResult, includeQuestions, includeAnswers, contextUser);
|
|
228
180
|
}
|
|
229
|
-
|
|
230
|
-
Success: true,
|
|
231
|
-
ResultCode: 'SUCCESS',
|
|
232
|
-
Message: `Retrieved ${totalResults} quiz result(s)`,
|
|
233
|
-
Params: outputParams
|
|
234
|
-
};
|
|
181
|
+
formatted.push(formattedResult);
|
|
235
182
|
}
|
|
236
|
-
|
|
237
|
-
|
|
183
|
+
return formatted;
|
|
184
|
+
}
|
|
185
|
+
buildBaseQuizResult(result, userId, courseId, quizId) {
|
|
186
|
+
const score = result.score || 0;
|
|
187
|
+
const maxScore = result.max_score || result.total_points || 100;
|
|
188
|
+
return {
|
|
189
|
+
id: result.id || result.result_id || '',
|
|
190
|
+
userId: result.user_id || userId || '',
|
|
191
|
+
courseId: result.course_id || courseId || '',
|
|
192
|
+
quizId: result.quiz_id || quizId || '',
|
|
193
|
+
attemptNumber: result.attempt_number || result.attempt || 1,
|
|
194
|
+
score,
|
|
195
|
+
maxScore,
|
|
196
|
+
percentage: result.percentage || (score / (maxScore || 100)) * 100,
|
|
197
|
+
passed: result.passed || result.is_passing || false,
|
|
198
|
+
passingScore: result.passing_score || result.passing_percentage || 70,
|
|
199
|
+
startedAt: result.started_at,
|
|
200
|
+
completedAt: result.completed_at || result.submitted_at,
|
|
201
|
+
duration: result.duration || result.time_spent || 0,
|
|
202
|
+
durationText: this.formatDuration(result.duration || result.time_spent || 0),
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
async resolveQuizInfo(result, filterQuizId, contextUser) {
|
|
206
|
+
if (result.quiz) {
|
|
238
207
|
return {
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
208
|
+
id: result.quiz.id || '',
|
|
209
|
+
title: result.quiz.title || result.quiz.name || '',
|
|
210
|
+
type: result.quiz.type || 'quiz',
|
|
211
|
+
questionCount: result.quiz.question_count || result.quiz.total_questions,
|
|
243
212
|
};
|
|
244
213
|
}
|
|
214
|
+
if (!filterQuizId && result.quiz_id) {
|
|
215
|
+
const quizResponse = await this.makeLearnWorldsRequest(`/quizzes/${result.quiz_id}`, 'GET', null, contextUser);
|
|
216
|
+
if (quizResponse.success !== false && quizResponse.data) {
|
|
217
|
+
const quiz = quizResponse.data;
|
|
218
|
+
return {
|
|
219
|
+
id: quiz.id || '',
|
|
220
|
+
title: quiz.title || quiz.name || '',
|
|
221
|
+
type: quiz.type || 'quiz',
|
|
222
|
+
questionCount: quiz.question_count || quiz.total_questions,
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
return undefined;
|
|
227
|
+
}
|
|
228
|
+
async attachDetailedResults(formattedResult, includeQuestions, includeAnswers, contextUser) {
|
|
229
|
+
const detailsResponse = await this.makeLearnWorldsRequest(`/quiz-results/${formattedResult.id}/details`, 'GET', null, contextUser);
|
|
230
|
+
if (detailsResponse.success === false || !detailsResponse.data) {
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
233
|
+
const details = detailsResponse.data;
|
|
234
|
+
if (includeQuestions) {
|
|
235
|
+
formattedResult.questions = this.formatQuestions(details.questions || details.answers || []);
|
|
236
|
+
}
|
|
237
|
+
if (includeAnswers) {
|
|
238
|
+
formattedResult.answers = this.formatAnswers(details.answers || details.questions || []);
|
|
239
|
+
// Calculate additional metrics
|
|
240
|
+
const answers = formattedResult.answers;
|
|
241
|
+
formattedResult.metrics = this.calculateQuizMetrics(answers);
|
|
242
|
+
}
|
|
245
243
|
}
|
|
244
|
+
// ----------------------------------------------------------------
|
|
245
|
+
// Private helpers – formatting
|
|
246
|
+
// ----------------------------------------------------------------
|
|
246
247
|
/**
|
|
247
248
|
* Format quiz questions
|
|
248
249
|
*/
|
|
249
250
|
formatQuestions(questions) {
|
|
250
251
|
return questions.map((q, index) => ({
|
|
251
252
|
questionNumber: q.question_number || index + 1,
|
|
252
|
-
questionId: q.question_id || q.id,
|
|
253
|
-
questionText: q.question_text || q.question || q.text,
|
|
253
|
+
questionId: q.question_id || q.id || '',
|
|
254
|
+
questionText: q.question_text || q.question || q.text || '',
|
|
254
255
|
questionType: q.question_type || q.type || 'multiple-choice',
|
|
255
256
|
points: q.points || q.score || 1,
|
|
256
|
-
difficulty: q.difficulty || 'medium'
|
|
257
|
+
difficulty: q.difficulty || 'medium',
|
|
257
258
|
}));
|
|
258
259
|
}
|
|
259
260
|
/**
|
|
@@ -263,92 +264,113 @@ let GetQuizResultsAction = class GetQuizResultsAction extends LearnWorldsBaseAct
|
|
|
263
264
|
return answers.map((a, index) => ({
|
|
264
265
|
questionNumber: a.question_number || index + 1,
|
|
265
266
|
questionId: a.question_id,
|
|
266
|
-
userAnswer: a.user_answer || a.answer || a.selected_answer,
|
|
267
|
-
correctAnswer: a.correct_answer,
|
|
267
|
+
userAnswer: this.coerceAnswerValue(a.user_answer || a.answer || a.selected_answer),
|
|
268
|
+
correctAnswer: this.coerceAnswerValue(a.correct_answer),
|
|
268
269
|
isCorrect: a.is_correct || a.correct || false,
|
|
269
|
-
pointsEarned: a.points_earned || (a.is_correct ?
|
|
270
|
+
pointsEarned: a.points_earned || (a.is_correct ? a.points || 1 : 0),
|
|
270
271
|
pointsPossible: a.points_possible || a.points || 1,
|
|
271
272
|
feedback: a.feedback,
|
|
272
273
|
timeSpent: a.time_spent,
|
|
273
|
-
answeredAt: a.answered_at
|
|
274
|
+
answeredAt: a.answered_at,
|
|
274
275
|
}));
|
|
275
276
|
}
|
|
277
|
+
/**
|
|
278
|
+
* Coerce a raw answer value from the API to a typed QuizAnswerValue.
|
|
279
|
+
*/
|
|
280
|
+
coerceAnswerValue(value) {
|
|
281
|
+
if (value === undefined || value === null)
|
|
282
|
+
return undefined;
|
|
283
|
+
if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean')
|
|
284
|
+
return value;
|
|
285
|
+
if (Array.isArray(value))
|
|
286
|
+
return value.map(String);
|
|
287
|
+
return String(value);
|
|
288
|
+
}
|
|
289
|
+
calculateQuizMetrics(answers) {
|
|
290
|
+
const correctCount = answers.filter((a) => a.isCorrect).length;
|
|
291
|
+
return {
|
|
292
|
+
correctAnswers: correctCount,
|
|
293
|
+
incorrectAnswers: answers.filter((a) => !a.isCorrect).length,
|
|
294
|
+
totalQuestions: answers.length,
|
|
295
|
+
accuracyRate: answers.length > 0 ? Number(((correctCount / answers.length) * 100).toFixed(1)) : 0,
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
// ----------------------------------------------------------------
|
|
299
|
+
// Private helpers – summary
|
|
300
|
+
// ----------------------------------------------------------------
|
|
301
|
+
buildQuizResultsSummary(formattedResults, userId, courseId, quizId, dateFrom, dateTo) {
|
|
302
|
+
const totalResults = formattedResults.length;
|
|
303
|
+
const passedResults = formattedResults.filter((r) => r.passed).length;
|
|
304
|
+
const averageScore = totalResults > 0 ? formattedResults.reduce((sum, r) => sum + r.percentage, 0) / totalResults : 0;
|
|
305
|
+
const averageDuration = totalResults > 0 ? formattedResults.reduce((sum, r) => sum + (r.duration || 0), 0) / totalResults : 0;
|
|
306
|
+
// Group results by quiz if multiple quizzes
|
|
307
|
+
const quizBreakdown = !quizId ? this.buildQuizBreakdown(formattedResults) : null;
|
|
308
|
+
const filterType = userId ? (courseId ? 'user-course' : 'user') : courseId ? 'course' : 'all';
|
|
309
|
+
return {
|
|
310
|
+
totalResults,
|
|
311
|
+
passedResults,
|
|
312
|
+
failedResults: totalResults - passedResults,
|
|
313
|
+
passRate: totalResults > 0 ? Number(((passedResults / totalResults) * 100).toFixed(1)) : 0,
|
|
314
|
+
averageScore: Number(averageScore.toFixed(1)),
|
|
315
|
+
averageDuration,
|
|
316
|
+
averageDurationText: this.formatDuration(Math.round(averageDuration)),
|
|
317
|
+
dateRange: {
|
|
318
|
+
from: dateFrom || 'all-time',
|
|
319
|
+
to: dateTo || 'current',
|
|
320
|
+
},
|
|
321
|
+
filterType,
|
|
322
|
+
quizBreakdown,
|
|
323
|
+
};
|
|
324
|
+
}
|
|
325
|
+
buildQuizBreakdown(formattedResults) {
|
|
326
|
+
const resultsByQuiz = {};
|
|
327
|
+
for (const result of formattedResults) {
|
|
328
|
+
const quizTitle = result.quiz?.title || 'Unknown Quiz';
|
|
329
|
+
if (!resultsByQuiz[quizTitle]) {
|
|
330
|
+
resultsByQuiz[quizTitle] = {
|
|
331
|
+
results: [],
|
|
332
|
+
stats: { attempts: 0, averageScore: 0, passRate: 0 },
|
|
333
|
+
};
|
|
334
|
+
}
|
|
335
|
+
resultsByQuiz[quizTitle].results.push(result);
|
|
336
|
+
}
|
|
337
|
+
// Calculate stats for each quiz
|
|
338
|
+
for (const quizTitle of Object.keys(resultsByQuiz)) {
|
|
339
|
+
const quizResults = resultsByQuiz[quizTitle].results;
|
|
340
|
+
const qTotal = quizResults.length;
|
|
341
|
+
const qPassed = quizResults.filter((r) => r.passed).length;
|
|
342
|
+
const qAvgScore = quizResults.reduce((sum, r) => sum + r.percentage, 0) / qTotal;
|
|
343
|
+
resultsByQuiz[quizTitle].stats = {
|
|
344
|
+
attempts: qTotal,
|
|
345
|
+
averageScore: Number(qAvgScore.toFixed(1)),
|
|
346
|
+
passRate: Number(((qPassed / qTotal) * 100).toFixed(1)),
|
|
347
|
+
};
|
|
348
|
+
}
|
|
349
|
+
return resultsByQuiz;
|
|
350
|
+
}
|
|
351
|
+
// ----------------------------------------------------------------
|
|
352
|
+
// Params & Description metadata
|
|
353
|
+
// ----------------------------------------------------------------
|
|
276
354
|
/**
|
|
277
355
|
* Define the parameters this action expects
|
|
278
356
|
*/
|
|
279
357
|
get Params() {
|
|
280
358
|
const baseParams = this.getCommonLMSParams();
|
|
281
359
|
const specificParams = [
|
|
282
|
-
{
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
},
|
|
287
|
-
{
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
},
|
|
292
|
-
{
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
},
|
|
297
|
-
{
|
|
298
|
-
Name: 'IncludeQuestions',
|
|
299
|
-
Type: 'Input',
|
|
300
|
-
Value: true
|
|
301
|
-
},
|
|
302
|
-
{
|
|
303
|
-
Name: 'IncludeAnswers',
|
|
304
|
-
Type: 'Input',
|
|
305
|
-
Value: true
|
|
306
|
-
},
|
|
307
|
-
{
|
|
308
|
-
Name: 'PassingOnly',
|
|
309
|
-
Type: 'Input',
|
|
310
|
-
Value: false
|
|
311
|
-
},
|
|
312
|
-
{
|
|
313
|
-
Name: 'DateFrom',
|
|
314
|
-
Type: 'Input',
|
|
315
|
-
Value: null
|
|
316
|
-
},
|
|
317
|
-
{
|
|
318
|
-
Name: 'DateTo',
|
|
319
|
-
Type: 'Input',
|
|
320
|
-
Value: null
|
|
321
|
-
},
|
|
322
|
-
{
|
|
323
|
-
Name: 'SortBy',
|
|
324
|
-
Type: 'Input',
|
|
325
|
-
Value: 'completed_at'
|
|
326
|
-
},
|
|
327
|
-
{
|
|
328
|
-
Name: 'SortOrder',
|
|
329
|
-
Type: 'Input',
|
|
330
|
-
Value: 'desc'
|
|
331
|
-
},
|
|
332
|
-
{
|
|
333
|
-
Name: 'MaxResults',
|
|
334
|
-
Type: 'Input',
|
|
335
|
-
Value: 100
|
|
336
|
-
},
|
|
337
|
-
{
|
|
338
|
-
Name: 'QuizResults',
|
|
339
|
-
Type: 'Output',
|
|
340
|
-
Value: null
|
|
341
|
-
},
|
|
342
|
-
{
|
|
343
|
-
Name: 'TotalCount',
|
|
344
|
-
Type: 'Output',
|
|
345
|
-
Value: null
|
|
346
|
-
},
|
|
347
|
-
{
|
|
348
|
-
Name: 'Summary',
|
|
349
|
-
Type: 'Output',
|
|
350
|
-
Value: null
|
|
351
|
-
}
|
|
360
|
+
{ Name: 'UserID', Type: 'Input', Value: null },
|
|
361
|
+
{ Name: 'CourseID', Type: 'Input', Value: null },
|
|
362
|
+
{ Name: 'QuizID', Type: 'Input', Value: null },
|
|
363
|
+
{ Name: 'IncludeQuestions', Type: 'Input', Value: true },
|
|
364
|
+
{ Name: 'IncludeAnswers', Type: 'Input', Value: true },
|
|
365
|
+
{ Name: 'PassingOnly', Type: 'Input', Value: false },
|
|
366
|
+
{ Name: 'DateFrom', Type: 'Input', Value: null },
|
|
367
|
+
{ Name: 'DateTo', Type: 'Input', Value: null },
|
|
368
|
+
{ Name: 'SortBy', Type: 'Input', Value: 'completed_at' },
|
|
369
|
+
{ Name: 'SortOrder', Type: 'Input', Value: 'desc' },
|
|
370
|
+
{ Name: 'MaxResults', Type: 'Input', Value: 100 },
|
|
371
|
+
{ Name: 'QuizResults', Type: 'Output', Value: null },
|
|
372
|
+
{ Name: 'TotalCount', Type: 'Output', Value: null },
|
|
373
|
+
{ Name: 'Summary', Type: 'Output', Value: null },
|
|
352
374
|
];
|
|
353
375
|
return [...baseParams, ...specificParams];
|
|
354
376
|
}
|