@edx/frontend-app-subscription-learner-dashboard 1.27.2 → 1.29.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/dist/routes.js +3 -3
- package/dist/routes.js.map +1 -1
- package/dist/widgets/ProgressiveProfilingQuiz/ProgressiveProfilingQuizProvider.d.ts +3 -2
- package/dist/widgets/ProgressiveProfilingQuiz/ProgressiveProfilingQuizProvider.js +4 -4
- package/dist/widgets/ProgressiveProfilingQuiz/ProgressiveProfilingQuizProvider.js.map +1 -1
- package/dist/widgets/ProgressiveProfilingQuiz/data/schemaUtils.d.ts +10 -0
- package/dist/widgets/ProgressiveProfilingQuiz/data/schemaUtils.js +17 -0
- package/dist/widgets/ProgressiveProfilingQuiz/data/schemaUtils.js.map +1 -0
- package/dist/widgets/ProgressiveProfilingQuiz/data/types.d.ts +40 -0
- package/dist/widgets/ProgressiveProfilingQuiz/data/types.js.map +1 -1
- package/dist/widgets/ProgressiveProfilingQuiz/modal/index.js +9 -1
- package/dist/widgets/ProgressiveProfilingQuiz/modal/index.js.map +1 -1
- package/dist/widgets/ProgressiveProfilingQuiz/modal/index.scss +2 -0
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/BaseStep.js +1 -1
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/BaseStep.js.map +1 -1
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/messages.js +1 -1
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/messages.js.map +1 -1
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-goal/index.d.ts +1 -0
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-goal/index.js +18 -3
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-goal/index.js.map +1 -1
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-goal/index.scss +4 -0
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-goal/messages.d.ts +30 -0
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-goal/messages.js +30 -0
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-goal/messages.js.map +1 -1
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-goal/schema.d.ts +8 -0
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-goal/schema.js +21 -0
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-goal/schema.js.map +1 -0
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-motivation/index.d.ts +1 -0
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-motivation/index.js +22 -3
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-motivation/index.js.map +1 -1
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-motivation/index.scss +4 -0
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-motivation/messages.d.ts +30 -0
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-motivation/messages.js +30 -0
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-motivation/messages.js.map +1 -1
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-motivation/schema.d.ts +8 -0
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-motivation/schema.js +21 -0
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-motivation/schema.js.map +1 -0
- package/package.json +1 -1
package/dist/routes.js
CHANGED
|
@@ -7,15 +7,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import { authenticatedLoader, getAuthenticatedHttpClient } from '@openedx/frontend-base';
|
|
11
|
-
import { subscriptionDashboardRole, subscriptionDashboardUrlPath, subscriptionProgramProgressRole } from './constants';
|
|
10
|
+
import { authenticatedLoader, getAuthenticatedHttpClient, getAppConfig } from '@openedx/frontend-base';
|
|
11
|
+
import { appId, subscriptionDashboardRole, subscriptionDashboardUrlPath, subscriptionProgramProgressRole } from './constants';
|
|
12
12
|
import { getSubsInitApiUrl } from './data/services/subs/urls';
|
|
13
13
|
import { redirect } from 'react-router-dom';
|
|
14
14
|
// loader to check if the user has subscription access
|
|
15
15
|
const subscriptionAccessLoader = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
16
|
try {
|
|
17
17
|
const { data } = yield getAuthenticatedHttpClient().get(getSubsInitApiUrl());
|
|
18
|
-
if (!(data === null || data === void 0 ? void 0 : data.userSubscription) || !data.userSubscription.isSubscriber) {
|
|
18
|
+
if (!(data === null || data === void 0 ? void 0 : data.userSubscription) || !data.userSubscription.isSubscriber || !getAppConfig(appId).ENABLE_SUBSCRIPTION_SITE) {
|
|
19
19
|
throw redirect('/learner-dashboard'); //redirect to learner dashboard if user does not have subscription access
|
|
20
20
|
}
|
|
21
21
|
return null;
|
package/dist/routes.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.js","sourceRoot":"","sources":["../src/routes.jsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,mBAAmB,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"routes.js","sourceRoot":"","sources":["../src/routes.jsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,mBAAmB,EAAE,0BAA0B,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEvG,OAAO,EAAE,KAAK,EAAE,yBAAyB,EAAE,4BAA4B,EAAE,+BAA+B,EAAE,MAAM,aAAa,CAAC;AAC9H,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,sDAAsD;AACtD,MAAM,wBAAwB,GAAG,GAAS,EAAE;IAC1C,IAAI,CAAC;QACH,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,0BAA0B,EAAE,CAAC,GAAG,CAAC,iBAAiB,EAAE,CAAC,CAAC;QAE7E,IAAI,CAAC,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,gBAAgB,CAAA,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,YAAY,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,wBAAwB,EAAE,CAAC;YACpH,MAAM,QAAQ,CAAC,oBAAoB,CAAC,CAAC,CAAE,yEAAyE;QAClH,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,mCAAmC;QACnC,IAAI,KAAK,YAAY,QAAQ,EAAE,CAAC;YAC9B,MAAM,KAAK,CAAC;QACd,CAAC;QAED,MAAM,QAAQ,CAAC,oBAAoB,CAAC,CAAC,CAAC,mDAAmD;IAC3F,CAAC;AACH,CAAC,CAAA,CAAC;AAEF,yEAAyE;AACzE,MAAM,eAAe,GAAG,CAAO,IAAI,EAAE,EAAE;IACrC,MAAM,mBAAmB,CAAC,IAAI,CAAC,CAAC;IAChC,MAAM,wBAAwB,EAAE,CAAC;IAEjC,OAAO,IAAI,CAAC;AACd,CAAC,CAAA,CAAC;AAEF,MAAM,MAAM,GAAG;IACb;QACE,EAAE,EAAE,kDAAkD;QACtD,IAAI,EAAE,4BAA4B;QAClC,MAAM,EAAE,eAAe;QACvB,MAAM,EAAE;YACN,IAAI,EAAE,yBAAyB;SAChC;QACK,IAAI;;gBACR,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,CAAC;gBACtC,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC;YACvC,CAAC;SAAA;KACF;IACD;QACE,EAAE,EAAE,6DAA6D;QACjE,IAAI,EAAE,sCAAsC;QAC5C,MAAM,EAAE,eAAe;QACvB,MAAM,EAAE;YACN,IAAI,EAAE,+BAA+B;SACtC;QACK,IAAI;;gBACR,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,qDAAqD,CAAC,CAAC;gBACnF,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC;YACvC,CAAC;SAAA;KACF;CACF,CAAC;AAEF,eAAe,MAAM,CAAC","sourcesContent":["import { authenticatedLoader, getAuthenticatedHttpClient, getAppConfig } from '@openedx/frontend-base';\n\nimport { appId, subscriptionDashboardRole, subscriptionDashboardUrlPath, subscriptionProgramProgressRole } from './constants';\nimport { getSubsInitApiUrl } from './data/services/subs/urls';\nimport { redirect } from 'react-router-dom';\n\n// loader to check if the user has subscription access\nconst subscriptionAccessLoader = async () => {\n try {\n const { data } = await getAuthenticatedHttpClient().get(getSubsInitApiUrl());\n\n if (!data?.userSubscription || !data.userSubscription.isSubscriber || !getAppConfig(appId).ENABLE_SUBSCRIPTION_SITE) {\n throw redirect('/learner-dashboard'); //redirect to learner dashboard if user does not have subscription access\n }\n \n return null;\n } catch (error) {\n // Let redirect responses bubble up\n if (error instanceof Response) {\n throw error;\n }\n\n throw redirect('/learner-dashboard'); // redirect to learner dashboard if an error occurs\n }\n};\n\n// composed loader that checks for authentication and subscription access\nconst protectedLoader = async (args) => {\n await authenticatedLoader(args);\n await subscriptionAccessLoader();\n\n return null;\n};\n\nconst routes = [\n {\n id: 'org.edx.frontend.route.subsLearnerDashboard.main',\n path: subscriptionDashboardUrlPath,\n loader: protectedLoader,\n handle: {\n role: subscriptionDashboardRole\n },\n async lazy () {\n const module = await import('./Main');\n return { Component: module.default };\n },\n },\n {\n id: 'org.edx.frontend.route.subsLearnerDashboard.programProgress',\n path: '/subscription-program-progress/:uuid',\n loader: protectedLoader,\n handle: {\n role: subscriptionProgramProgressRole\n },\n async lazy () {\n const module = await import('./containers/ProgramDashboard/ProgramProgress/index');\n return { Component: module.default };\n },\n }\n];\n\nexport default routes;\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
|
+
import { QuizAnswerRecord } from './data/types';
|
|
2
3
|
interface ProgressiveProfilingQuizContextType {
|
|
3
4
|
isModalOpen: boolean;
|
|
4
5
|
openModal: () => void;
|
|
@@ -7,8 +8,8 @@ interface ProgressiveProfilingQuizContextType {
|
|
|
7
8
|
setCurrentStep: (step: number) => void;
|
|
8
9
|
goToNextStep: () => void;
|
|
9
10
|
goToPreviousStep: () => void;
|
|
10
|
-
answers: Record<string,
|
|
11
|
-
|
|
11
|
+
answers: Record<string, QuizAnswerRecord>;
|
|
12
|
+
recordAnswer: (answer: QuizAnswerRecord) => void;
|
|
12
13
|
isComplete: boolean;
|
|
13
14
|
setIsComplete: (isComplete: boolean) => void;
|
|
14
15
|
}
|
|
@@ -10,8 +10,8 @@ export const ProgressiveProfilingQuizProvider = ({ children }) => {
|
|
|
10
10
|
const closeModal = useCallback(() => setIsModalOpen(false), []);
|
|
11
11
|
const goToNextStep = useCallback(() => setCurrentStep(prev => prev + 1), []);
|
|
12
12
|
const goToPreviousStep = useCallback(() => setCurrentStep(prev => Math.max(0, prev - 1)), []);
|
|
13
|
-
const
|
|
14
|
-
setAnswers(prev => (Object.assign(Object.assign({}, prev), { [
|
|
13
|
+
const recordAnswer = useCallback((answer) => {
|
|
14
|
+
setAnswers(prev => (Object.assign(Object.assign({}, prev), { [answer.questionId]: answer })));
|
|
15
15
|
}, []);
|
|
16
16
|
const contextValue = useMemo(() => ({
|
|
17
17
|
isModalOpen,
|
|
@@ -22,13 +22,13 @@ export const ProgressiveProfilingQuizProvider = ({ children }) => {
|
|
|
22
22
|
goToNextStep,
|
|
23
23
|
goToPreviousStep,
|
|
24
24
|
answers,
|
|
25
|
-
|
|
25
|
+
recordAnswer,
|
|
26
26
|
isComplete,
|
|
27
27
|
setIsComplete,
|
|
28
28
|
}), [
|
|
29
29
|
isModalOpen, openModal, closeModal,
|
|
30
30
|
currentStep, goToNextStep, goToPreviousStep,
|
|
31
|
-
answers,
|
|
31
|
+
answers, recordAnswer,
|
|
32
32
|
isComplete,
|
|
33
33
|
]);
|
|
34
34
|
return (_jsx(ProgressiveProfilingQuizContext.Provider, { value: contextValue, children: children }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressiveProfilingQuizProvider.js","sourceRoot":"","sources":["../../../src/widgets/ProgressiveProfilingQuiz/ProgressiveProfilingQuizProvider.tsx"],"names":[],"mappings":";AAAA,OAAc,EACZ,aAAa,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAa,WAAW,GACrE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ProgressiveProfilingQuizProvider.js","sourceRoot":"","sources":["../../../src/widgets/ProgressiveProfilingQuiz/ProgressiveProfilingQuizProvider.tsx"],"names":[],"mappings":";AAAA,OAAc,EACZ,aAAa,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAa,WAAW,GACrE,MAAM,OAAO,CAAC;AAkBf,MAAM,+BAA+B,GAAG,aAAa,CAA6C,IAAI,CAAC,CAAC;AAMxG,MAAM,CAAC,MAAM,gCAAgC,GAAoD,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IAChH,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACtD,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAClD,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAmC,EAAE,CAAC,CAAC;IAC7E,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAEpD,MAAM,SAAS,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;IAC9D,MAAM,UAAU,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC;IAEhE,MAAM,YAAY,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAC7E,MAAM,gBAAgB,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAE9F,MAAM,YAAY,GAAG,WAAW,CAAC,CAAC,MAAwB,EAAE,EAAE;QAC5D,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC,iCAAM,IAAI,KAAE,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,MAAM,IAAG,CAAC,CAAC;IACjE,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;QAClC,WAAW;QACX,SAAS;QACT,UAAU;QACV,WAAW;QACX,cAAc;QACd,YAAY;QACZ,gBAAgB;QAChB,OAAO;QACP,YAAY;QACZ,UAAU;QACV,aAAa;KACd,CAAC,EAAE;QACF,WAAW,EAAE,SAAS,EAAE,UAAU;QAClC,WAAW,EAAE,YAAY,EAAE,gBAAgB;QAC3C,OAAO,EAAE,YAAY;QACrB,UAAU;KACX,CAAC,CAAC;IAEH,OAAO,CACL,KAAC,+BAA+B,CAAC,QAAQ,IAAC,KAAK,EAAE,YAAY,YAC1D,QAAQ,GACgC,CAC5C,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,2BAA2B,GAAG,GAAwC,EAAE;IACnF,MAAM,OAAO,GAAG,UAAU,CAAC,+BAA+B,CAAC,CAAC;IAC5D,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,oFAAoF,CAAC,CAAC;IACxG,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC","sourcesContent":["import React, {\n createContext, useContext, useMemo, useState, ReactNode, useCallback,\n} from 'react';\n\nimport { QuizAnswerRecord } from './data/types';\n\ninterface ProgressiveProfilingQuizContextType {\n isModalOpen: boolean,\n openModal: () => void,\n closeModal: () => void,\n currentStep: number,\n setCurrentStep: (step: number) => void,\n goToNextStep: () => void,\n goToPreviousStep: () => void,\n answers: Record<string, QuizAnswerRecord>,\n recordAnswer: (answer: QuizAnswerRecord) => void,\n isComplete: boolean,\n setIsComplete: (isComplete: boolean) => void,\n}\n\nconst ProgressiveProfilingQuizContext = createContext<ProgressiveProfilingQuizContextType | null>(null);\n\ninterface ProgressiveProfilingQuizProviderProps {\n children: ReactNode,\n}\n\nexport const ProgressiveProfilingQuizProvider: React.FC<ProgressiveProfilingQuizProviderProps> = ({ children }) => {\n const [isModalOpen, setIsModalOpen] = useState(false);\n const [currentStep, setCurrentStep] = useState(0);\n const [answers, setAnswers] = useState<Record<string, QuizAnswerRecord>>({});\n const [isComplete, setIsComplete] = useState(false);\n\n const openModal = useCallback(() => setIsModalOpen(true), []);\n const closeModal = useCallback(() => setIsModalOpen(false), []);\n\n const goToNextStep = useCallback(() => setCurrentStep(prev => prev + 1), []);\n const goToPreviousStep = useCallback(() => setCurrentStep(prev => Math.max(0, prev - 1)), []);\n\n const recordAnswer = useCallback((answer: QuizAnswerRecord) => {\n setAnswers(prev => ({ ...prev, [answer.questionId]: answer }));\n }, []);\n\n const contextValue = useMemo(() => ({\n isModalOpen,\n openModal,\n closeModal,\n currentStep,\n setCurrentStep,\n goToNextStep,\n goToPreviousStep,\n answers,\n recordAnswer,\n isComplete,\n setIsComplete,\n }), [\n isModalOpen, openModal, closeModal,\n currentStep, goToNextStep, goToPreviousStep,\n answers, recordAnswer,\n isComplete,\n ]);\n\n return (\n <ProgressiveProfilingQuizContext.Provider value={contextValue}>\n {children}\n </ProgressiveProfilingQuizContext.Provider>\n );\n};\n\nexport const useProgressiveProfilingQuiz = (): ProgressiveProfilingQuizContextType => {\n const context = useContext(ProgressiveProfilingQuizContext);\n if (!context) {\n throw new Error('useProgressiveProfilingQuiz must be used within a ProgressiveProfilingQuizProvider');\n }\n return context;\n};\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { QuizAnswerRecord, QuizMessageDescriptor, QuizQuestionSchema } from './types';
|
|
2
|
+
type FormatMessage = (descriptor: QuizMessageDescriptor) => string;
|
|
3
|
+
/**
|
|
4
|
+
* Resolves a question schema and the user's selection into a self-describing record: the exact
|
|
5
|
+
* question and option text shown at answer time, not just the keys used to look them up. This is
|
|
6
|
+
* what should be persisted, so later copy edits to `messages.ts` can't retroactively change what
|
|
7
|
+
* a historical answer appears to have been a response to.
|
|
8
|
+
*/
|
|
9
|
+
export declare const buildAnswerRecord: (schema: QuizQuestionSchema, selectedValues: string[], formatMessage: FormatMessage) => QuizAnswerRecord;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolves a question schema and the user's selection into a self-describing record: the exact
|
|
3
|
+
* question and option text shown at answer time, not just the keys used to look them up. This is
|
|
4
|
+
* what should be persisted, so later copy edits to `messages.ts` can't retroactively change what
|
|
5
|
+
* a historical answer appears to have been a response to.
|
|
6
|
+
*/
|
|
7
|
+
export const buildAnswerRecord = (schema, selectedValues, formatMessage) => ({
|
|
8
|
+
questionId: schema.questionId,
|
|
9
|
+
version: schema.version,
|
|
10
|
+
question: formatMessage(schema.question),
|
|
11
|
+
options: schema.options.map(option => ({
|
|
12
|
+
value: option.value,
|
|
13
|
+
label: formatMessage(option.message),
|
|
14
|
+
})),
|
|
15
|
+
selectedValues,
|
|
16
|
+
});
|
|
17
|
+
//# sourceMappingURL=schemaUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemaUtils.js","sourceRoot":"","sources":["../../../../src/widgets/ProgressiveProfilingQuiz/data/schemaUtils.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,MAA0B,EAC1B,cAAwB,EACxB,aAA4B,EACV,EAAE,CAAC,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC,UAAU;IAC7B,OAAO,EAAE,MAAM,CAAC,OAAO;IACvB,QAAQ,EAAE,aAAa,CAAC,MAAM,CAAC,QAAQ,CAAC;IACxC,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QACrC,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,OAAO,CAAC;KACrC,CAAC,CAAC;IACH,cAAc;CACf,CAAC,CAAC","sourcesContent":["import { QuizAnswerRecord, QuizMessageDescriptor, QuizQuestionSchema } from './types';\n\ntype FormatMessage = (descriptor: QuizMessageDescriptor) => string;\n\n/**\n * Resolves a question schema and the user's selection into a self-describing record: the exact\n * question and option text shown at answer time, not just the keys used to look them up. This is\n * what should be persisted, so later copy edits to `messages.ts` can't retroactively change what\n * a historical answer appears to have been a response to.\n */\nexport const buildAnswerRecord = (\n schema: QuizQuestionSchema,\n selectedValues: string[],\n formatMessage: FormatMessage,\n): QuizAnswerRecord => ({\n questionId: schema.questionId,\n version: schema.version,\n question: formatMessage(schema.question),\n options: schema.options.map(option => ({\n value: option.value,\n label: formatMessage(option.message),\n })),\n selectedValues,\n});\n"]}
|
|
@@ -3,3 +3,43 @@ export interface SkillWithCount {
|
|
|
3
3
|
value: string;
|
|
4
4
|
count: number;
|
|
5
5
|
}
|
|
6
|
+
/** Structurally compatible with react-intl's MessageDescriptor, without depending on the package directly. */
|
|
7
|
+
export interface QuizMessageDescriptor {
|
|
8
|
+
id: string;
|
|
9
|
+
defaultMessage: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
}
|
|
12
|
+
/** A selectable option for a quiz question, as defined in source (unresolved) form. */
|
|
13
|
+
export interface QuizAnswerOption {
|
|
14
|
+
value: string;
|
|
15
|
+
message: QuizMessageDescriptor;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* The definition of a quiz question: its identity, the question text, and every option offered.
|
|
19
|
+
* This is the single source of truth used both to render a step's UI and to record what was
|
|
20
|
+
* actually shown to the user when they answered it.
|
|
21
|
+
*/
|
|
22
|
+
export interface QuizQuestionSchema {
|
|
23
|
+
questionId: string;
|
|
24
|
+
/** Bump whenever the question or its options change meaningfully, so recorded answers can be grouped by what was actually asked. */
|
|
25
|
+
version: string;
|
|
26
|
+
question: QuizMessageDescriptor;
|
|
27
|
+
options: QuizAnswerOption[];
|
|
28
|
+
}
|
|
29
|
+
/** A resolved (formatted) option, as actually presented to the user. */
|
|
30
|
+
export interface QuizAnswerOptionRecord {
|
|
31
|
+
value: string;
|
|
32
|
+
label: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* A snapshot of a question, its options, and the user's selection(s), as it existed at answer
|
|
36
|
+
* time. Always an array so single-select (radio) and multi-select (checkbox) questions share one
|
|
37
|
+
* shape — a single-select answer is simply a one-element array.
|
|
38
|
+
*/
|
|
39
|
+
export interface QuizAnswerRecord {
|
|
40
|
+
questionId: string;
|
|
41
|
+
version: string;
|
|
42
|
+
question: string;
|
|
43
|
+
options: QuizAnswerOptionRecord[];
|
|
44
|
+
selectedValues: string[];
|
|
45
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/widgets/ProgressiveProfilingQuiz/data/types.ts"],"names":[],"mappings":"","sourcesContent":["/** A single Algolia facet value with its matching record count, e.g. from fetchSkills. */\nexport interface SkillWithCount {\n value: string,\n count: number,\n}\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/widgets/ProgressiveProfilingQuiz/data/types.ts"],"names":[],"mappings":"","sourcesContent":["/** A single Algolia facet value with its matching record count, e.g. from fetchSkills. */\nexport interface SkillWithCount {\n value: string,\n count: number,\n}\n\n/** Structurally compatible with react-intl's MessageDescriptor, without depending on the package directly. */\nexport interface QuizMessageDescriptor {\n id: string,\n defaultMessage: string,\n description?: string,\n}\n\n/** A selectable option for a quiz question, as defined in source (unresolved) form. */\nexport interface QuizAnswerOption {\n value: string,\n message: QuizMessageDescriptor,\n}\n\n/**\n * The definition of a quiz question: its identity, the question text, and every option offered.\n * This is the single source of truth used both to render a step's UI and to record what was\n * actually shown to the user when they answered it.\n */\nexport interface QuizQuestionSchema {\n questionId: string,\n /** Bump whenever the question or its options change meaningfully, so recorded answers can be grouped by what was actually asked. */\n version: string,\n question: QuizMessageDescriptor,\n options: QuizAnswerOption[],\n}\n\n/** A resolved (formatted) option, as actually presented to the user. */\nexport interface QuizAnswerOptionRecord {\n value: string,\n label: string,\n}\n\n/**\n * A snapshot of a question, its options, and the user's selection(s), as it existed at answer\n * time. Always an array so single-select (radio) and multi-select (checkbox) questions share one\n * shape — a single-select answer is simply a one-element array.\n */\nexport interface QuizAnswerRecord {\n questionId: string,\n version: string,\n question: string,\n options: QuizAnswerOptionRecord[],\n selectedValues: string[],\n}\n"]}
|
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect } from 'react';
|
|
2
3
|
import { ModalDialog } from '@openedx/paragon';
|
|
3
4
|
import { useIntl } from '@openedx/frontend-base';
|
|
5
|
+
import { useSearchParams } from 'react-router-dom';
|
|
4
6
|
import { useProgressiveProfilingQuiz } from '../ProgressiveProfilingQuizProvider';
|
|
5
7
|
import ProgressiveProfilingQuizStepper from './stepper';
|
|
6
8
|
import messages from './messages';
|
|
7
9
|
import './index.scss';
|
|
8
10
|
const ProgressiveProfilingQuizModal = () => {
|
|
9
|
-
const { isModalOpen, closeModal } = useProgressiveProfilingQuiz();
|
|
11
|
+
const { isModalOpen, openModal, closeModal } = useProgressiveProfilingQuiz();
|
|
10
12
|
const { formatMessage } = useIntl();
|
|
13
|
+
const [searchParams] = useSearchParams();
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
if (searchParams.get('progressive_profiling') === 'active') {
|
|
16
|
+
openModal();
|
|
17
|
+
}
|
|
18
|
+
}, [searchParams, openModal]);
|
|
11
19
|
return (_jsx(ModalDialog, { title: formatMessage(messages.modalTitle), isOpen: isModalOpen, onClose: closeModal, hasCloseButton: true, isFullscreenOnMobile: true, isOverflowVisible: false, className: "progressive-profiling-modal p-5 bg-light-400", children: _jsx(ModalDialog.Body, { children: _jsx(ProgressiveProfilingQuizStepper, {}) }) }));
|
|
12
20
|
};
|
|
13
21
|
export default ProgressiveProfilingQuizModal;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/widgets/ProgressiveProfilingQuiz/modal/index.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/widgets/ProgressiveProfilingQuiz/modal/index.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAC;AAClF,OAAO,+BAA+B,MAAM,WAAW,CAAC;AACxD,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,OAAO,cAAc,CAAC;AAEtB,MAAM,6BAA6B,GAAa,GAAG,EAAE;IACnD,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,2BAA2B,EAAE,CAAC;IAC7E,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IACpC,MAAM,CAAC,YAAY,CAAC,GAAG,eAAe,EAAE,CAAC;IAEzC,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,YAAY,CAAC,GAAG,CAAC,uBAAuB,CAAC,KAAK,QAAQ,EAAE,CAAC;YAC3D,SAAS,EAAE,CAAC;QACd,CAAC;IACH,CAAC,EAAE,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC,CAAC;IAE9B,OAAO,CACL,KAAC,WAAW,IACV,KAAK,EAAE,aAAa,CAAC,QAAQ,CAAC,UAAU,CAAC,EACzC,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,UAAU,EACnB,cAAc,QACd,oBAAoB,QACpB,iBAAiB,EAAE,KAAK,EACxB,SAAS,EAAC,8CAA8C,YAExD,KAAC,WAAW,CAAC,IAAI,cACf,KAAC,+BAA+B,KAAG,GAClB,GACP,CACf,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,6BAA6B,CAAC","sourcesContent":["import React, { useEffect } from 'react';\nimport { ModalDialog } from '@openedx/paragon';\nimport { useIntl } from '@openedx/frontend-base';\nimport { useSearchParams } from 'react-router-dom';\n\nimport { useProgressiveProfilingQuiz } from '../ProgressiveProfilingQuizProvider';\nimport ProgressiveProfilingQuizStepper from './stepper';\nimport messages from './messages';\n\nimport './index.scss';\n\nconst ProgressiveProfilingQuizModal: React.FC = () => {\n const { isModalOpen, openModal, closeModal } = useProgressiveProfilingQuiz();\n const { formatMessage } = useIntl();\n const [searchParams] = useSearchParams();\n\n useEffect(() => {\n if (searchParams.get('progressive_profiling') === 'active') {\n openModal();\n }\n }, [searchParams, openModal]);\n\n return (\n <ModalDialog\n title={formatMessage(messages.modalTitle)}\n isOpen={isModalOpen}\n onClose={closeModal}\n hasCloseButton\n isFullscreenOnMobile\n isOverflowVisible={false}\n className=\"progressive-profiling-modal p-5 bg-light-400\"\n >\n <ModalDialog.Body>\n <ProgressiveProfilingQuizStepper />\n </ModalDialog.Body>\n </ModalDialog>\n );\n};\n\nexport default ProgressiveProfilingQuizModal;\n"]}
|
|
@@ -18,7 +18,7 @@ const TOTAL_STEPS = Object.keys(PROGRESSIVE_PROFILING_QUIZ_STEPS).length;
|
|
|
18
18
|
const BaseStep = (_a) => {
|
|
19
19
|
var { children, optionalHeaderText } = _a, props = __rest(_a, ["children", "optionalHeaderText"]);
|
|
20
20
|
const { formatMessage } = useIntl();
|
|
21
|
-
return (_jsxs(Stepper.Step, Object.assign({}, props, { children: [_jsxs("h3", { className: "h6", children: [_jsxs("span", { children: [optionalHeaderText, "\u00A0"] }), formatMessage(messages.stepCount, { step: props.index + 1, total: TOTAL_STEPS })] }), _jsx("div", { className: "bg-
|
|
21
|
+
return (_jsxs(Stepper.Step, Object.assign({}, props, { children: [_jsxs("h3", { className: "h6 mb-3.5", children: [_jsxs("span", { children: [optionalHeaderText, "\u00A0"] }), formatMessage(messages.stepCount, { step: props.index + 1, total: TOTAL_STEPS })] }), _jsx("div", { className: "bg-white rounded p-4.5 mb-4", children: children })] })));
|
|
22
22
|
};
|
|
23
23
|
export default BaseStep;
|
|
24
24
|
//# sourceMappingURL=BaseStep.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseStep.js","sourceRoot":"","sources":["../../../../../../src/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/BaseStep.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAGjD,OAAO,EAAE,gCAAgC,EAAE,MAAM,sDAAsD,CAAC;AACxG,OAAO,QAAQ,MAAM,YAAY,CAAC;AAUlC,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC,MAAM,CAAC;AACzE,MAAM,QAAQ,GAA4B,CAAC,EAI1C,EAAE,EAAE;QAJsC,EACzC,QAAQ,EACR,kBAAkB,OAEnB,EADI,KAAK,cAHiC,kCAI1C,CADS;IAER,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IAEpC,OAAO,CACL,MAAC,OAAO,CAAC,IAAI,oBAAK,KAAK,eACrB,cAAI,SAAS,EAAC,
|
|
1
|
+
{"version":3,"file":"BaseStep.js","sourceRoot":"","sources":["../../../../../../src/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/BaseStep.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAGjD,OAAO,EAAE,gCAAgC,EAAE,MAAM,sDAAsD,CAAC;AACxG,OAAO,QAAQ,MAAM,YAAY,CAAC;AAUlC,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC,MAAM,CAAC;AACzE,MAAM,QAAQ,GAA4B,CAAC,EAI1C,EAAE,EAAE;QAJsC,EACzC,QAAQ,EACR,kBAAkB,OAEnB,EADI,KAAK,cAHiC,kCAI1C,CADS;IAER,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IAEpC,OAAO,CACL,MAAC,OAAO,CAAC,IAAI,oBAAK,KAAK,eACrB,cAAI,SAAS,EAAC,WAAW,aACvB,2BAAO,kBAAkB,cAAc,EACtC,aAAa,CAAC,QAAQ,CAAC,SAAS,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,KAAK,GAAG,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC,IAC9E,EACL,cAAK,SAAS,EAAC,6BAA6B,YACzC,QAAQ,GACL,KACO,CAChB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC","sourcesContent":["import { Stepper } from '@openedx/paragon';\nimport { useIntl } from '@openedx/frontend-base';\nimport React, { ReactNode } from 'react';\n\nimport { PROGRESSIVE_PROFILING_QUIZ_STEPS } from '@src/widgets/ProgressiveProfilingQuiz/data/constants';\nimport messages from './messages';\n\ninterface BaseStepProps {\n children: ReactNode,\n eventKey: string,\n title: string,\n index: number,\n optionalHeaderText?: string,\n}\n\nconst TOTAL_STEPS = Object.keys(PROGRESSIVE_PROFILING_QUIZ_STEPS).length;\nconst BaseStep: React.FC<BaseStepProps> = ({\n children,\n optionalHeaderText,\n ...props\n}) => {\n const { formatMessage } = useIntl();\n\n return (\n <Stepper.Step {...props}>\n <h3 className=\"h6 mb-3.5\">\n <span>{optionalHeaderText} </span>\n {formatMessage(messages.stepCount, { step: props.index + 1, total: TOTAL_STEPS })}\n </h3>\n <div className=\"bg-white rounded p-4.5 mb-4\">\n {children}\n </div>\n </Stepper.Step>\n );\n};\n\nexport default BaseStep;\n"]}
|
|
@@ -2,7 +2,7 @@ import { defineMessages } from '@openedx/frontend-base';
|
|
|
2
2
|
const messages = defineMessages({
|
|
3
3
|
stepCount: {
|
|
4
4
|
id: 'progressiveProfilingQuiz.stepper.baseStep.stepCount',
|
|
5
|
-
defaultMessage: 'Step {step} of {total}',
|
|
5
|
+
defaultMessage: 'Step {step} of {total}.',
|
|
6
6
|
description: 'Indicates the current step number out of the total number of steps in the progressive profiling quiz',
|
|
7
7
|
},
|
|
8
8
|
backButton: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../../../../src/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC9B,SAAS,EAAE;QACT,EAAE,EAAE,qDAAqD;QACzD,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../../../../src/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC9B,SAAS,EAAE;QACT,EAAE,EAAE,qDAAqD;QACzD,cAAc,EAAE,yBAAyB;QACzC,WAAW,EAAE,sGAAsG;KACpH;IACD,UAAU,EAAE;QACV,EAAE,EAAE,6CAA6C;QACjD,cAAc,EAAE,MAAM;QACtB,WAAW,EAAE,wFAAwF;KACtG;IACD,UAAU,EAAE;QACV,EAAE,EAAE,6CAA6C;QACjD,cAAc,EAAE,MAAM;QACtB,WAAW,EAAE,qFAAqF;KACnG;CACF,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { defineMessages } from '@openedx/frontend-base';\n\nconst messages = defineMessages({\n stepCount: {\n id: 'progressiveProfilingQuiz.stepper.baseStep.stepCount',\n defaultMessage: 'Step {step} of {total}.',\n description: 'Indicates the current step number out of the total number of steps in the progressive profiling quiz',\n },\n backButton: {\n id: 'progressiveProfilingQuiz.stepper.backButton',\n defaultMessage: 'Back',\n description: 'Label for the button to go back to the previous step of the progressive profiling quiz',\n },\n nextButton: {\n id: 'progressiveProfilingQuiz.stepper.nextButton',\n defaultMessage: 'Next',\n description: 'Label for the button to continue to the next step of the progressive profiling quiz',\n },\n});\n\nexport default messages;\n"]}
|
package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-goal/index.js
CHANGED
|
@@ -1,14 +1,29 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { Stepper, Button } from '@openedx/paragon';
|
|
2
|
+
import { Stepper, Button, Form, } from '@openedx/paragon';
|
|
3
3
|
import { useIntl } from '@openedx/frontend-base';
|
|
4
4
|
import BaseStep from '../BaseStep';
|
|
5
5
|
import { useProgressiveProfilingQuiz } from '../../../../../../widgets/ProgressiveProfilingQuiz/ProgressiveProfilingQuizProvider';
|
|
6
6
|
import { PROGRESSIVE_PROFILING_QUIZ_STEPS } from '../../../../../../widgets/ProgressiveProfilingQuiz/data/constants';
|
|
7
|
+
import { buildAnswerRecord } from '../../../../../../widgets/ProgressiveProfilingQuiz/data/schemaUtils';
|
|
7
8
|
import messages from './messages';
|
|
9
|
+
import schema from './schema';
|
|
10
|
+
import './index.scss';
|
|
8
11
|
const LearningGoalStep = () => {
|
|
9
|
-
|
|
12
|
+
var _a, _b;
|
|
13
|
+
const { goToNextStep, answers, recordAnswer } = useProgressiveProfilingQuiz();
|
|
10
14
|
const { formatMessage } = useIntl();
|
|
11
|
-
|
|
15
|
+
const selectedValue = (_b = (_a = answers[schema.questionId]) === null || _a === void 0 ? void 0 : _a.selectedValues[0]) !== null && _b !== void 0 ? _b : '';
|
|
16
|
+
const handleChange = (event) => {
|
|
17
|
+
recordAnswer(buildAnswerRecord(schema, [event.target.value], formatMessage));
|
|
18
|
+
};
|
|
19
|
+
const handleOptionClick = (event) => {
|
|
20
|
+
var _a;
|
|
21
|
+
if (event.target !== event.currentTarget) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
(_a = event.currentTarget.querySelector('input[type="radio"]')) === null || _a === void 0 ? void 0 : _a.click();
|
|
25
|
+
};
|
|
26
|
+
return (_jsxs(_Fragment, { children: [_jsx(BaseStep, { eventKey: PROGRESSIVE_PROFILING_QUIZ_STEPS.LEARNING_GOAL, title: formatMessage(messages.title), index: 0, optionalHeaderText: formatMessage(messages.headerText), children: _jsxs(Form.Group, { className: "mb-0", children: [_jsx(Form.Label, { className: "h4", children: formatMessage(messages.question) }), _jsx("p", { children: formatMessage(messages.hint) }), _jsx(Form.RadioSet, { name: schema.questionId, value: selectedValue, onChange: handleChange, className: "gap-4", children: schema.options.map(option => (_jsx("div", { className: "learning-goal-radio d-flex bg-light-100 px-3 py-3.5 mt-0", onClick: handleOptionClick, children: _jsx(Form.Radio, { value: option.value, children: formatMessage(option.message) }) }, option.value))) })] }) }), _jsxs(Stepper.ActionRow, { eventKey: PROGRESSIVE_PROFILING_QUIZ_STEPS.LEARNING_GOAL, children: [_jsx(Stepper.ActionRow.Spacer, {}), _jsx(Button, { variant: "outline-primary", onClick: goToNextStep, disabled: !selectedValue, children: formatMessage(messages.continueButton) })] })] }));
|
|
12
27
|
};
|
|
13
28
|
export default LearningGoalStep;
|
|
14
29
|
//# sourceMappingURL=index.js.map
|
package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-goal/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-goal/index.tsx"],"names":[],"mappings":";AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-goal/index.tsx"],"names":[],"mappings":";AACA,OAAO,EACL,OAAO,EAAE,MAAM,EAAE,IAAI,GACtB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,QAAQ,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,2BAA2B,EAAE,MAAM,wEAAwE,CAAC;AACrH,OAAO,EAAE,gCAAgC,EAAE,MAAM,sDAAsD,CAAC;AACxG,OAAO,EAAE,iBAAiB,EAAE,MAAM,wDAAwD,CAAC;AAC3F,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,MAAM,MAAM,UAAU,CAAC;AAE9B,OAAO,cAAc,CAAC;AAEtB,MAAM,gBAAgB,GAAa,GAAG,EAAE;;IACtC,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,YAAY,EAAE,GAAG,2BAA2B,EAAE,CAAC;IAC9E,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IAEpC,MAAM,aAAa,GAAG,MAAA,MAAA,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,0CAAE,cAAc,CAAC,CAAC,CAAC,mCAAI,EAAE,CAAC;IAE1E,MAAM,YAAY,GAAG,CAAC,KAA0C,EAAE,EAAE;QAClE,YAAY,CAAC,iBAAiB,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC;IAC/E,CAAC,CAAC;IAEF,MAAM,iBAAiB,GAAG,CAAC,KAAuC,EAAE,EAAE;;QACpE,IAAI,KAAK,CAAC,MAAM,KAAK,KAAK,CAAC,aAAa,EAAE,CAAC;YACzC,OAAO;QACT,CAAC;QACD,MAAA,KAAK,CAAC,aAAa,CAAC,aAAa,CAAmB,qBAAqB,CAAC,0CAAE,KAAK,EAAE,CAAC;IACtF,CAAC,CAAC;IAEF,OAAO,CACL,8BACE,KAAC,QAAQ,IACP,QAAQ,EAAE,gCAAgC,CAAC,aAAa,EACxD,KAAK,EAAE,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,EACpC,KAAK,EAAE,CAAC,EACR,kBAAkB,EAAE,aAAa,CAAC,QAAQ,CAAC,UAAU,CAAC,YAEtD,MAAC,IAAI,CAAC,KAAK,IAAC,SAAS,EAAC,MAAM,aAC1B,KAAC,IAAI,CAAC,KAAK,IAAC,SAAS,EAAC,IAAI,YACvB,aAAa,CAAC,QAAQ,CAAC,QAAQ,CAAC,GACtB,EACb,sBAAI,aAAa,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAK,EACrC,KAAC,IAAI,CAAC,QAAQ,IACZ,IAAI,EAAE,MAAM,CAAC,UAAU,EACvB,KAAK,EAAE,aAAa,EACpB,QAAQ,EAAE,YAAY,EACtB,SAAS,EAAC,OAAO,YAEhB,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAC5B,cAEE,SAAS,EAAC,0DAA0D,EACpE,OAAO,EAAE,iBAAiB,YAE1B,KAAC,IAAI,CAAC,KAAK,IAAC,KAAK,EAAE,MAAM,CAAC,KAAK,YAC5B,aAAa,CAAC,MAAM,CAAC,OAAO,CAAC,GACnB,IANR,MAAM,CAAC,KAAK,CAOb,CACP,CAAC,GACY,IACL,GACJ,EACX,MAAC,OAAO,CAAC,SAAS,IAAC,QAAQ,EAAE,gCAAgC,CAAC,aAAa,aACzE,KAAC,OAAO,CAAC,SAAS,CAAC,MAAM,KAAG,EAC5B,KAAC,MAAM,IAAC,OAAO,EAAC,iBAAiB,EAAC,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,CAAC,aAAa,YAC9E,aAAa,CAAC,QAAQ,CAAC,cAAc,CAAC,GAChC,IACS,IACnB,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC","sourcesContent":["import React from 'react';\nimport {\n Stepper, Button, Form,\n} from '@openedx/paragon';\nimport { useIntl } from '@openedx/frontend-base';\nimport BaseStep from '../BaseStep';\nimport { useProgressiveProfilingQuiz } from '@src/widgets/ProgressiveProfilingQuiz/ProgressiveProfilingQuizProvider';\nimport { PROGRESSIVE_PROFILING_QUIZ_STEPS } from '@src/widgets/ProgressiveProfilingQuiz/data/constants';\nimport { buildAnswerRecord } from '@src/widgets/ProgressiveProfilingQuiz/data/schemaUtils';\nimport messages from './messages';\nimport schema from './schema';\n\nimport './index.scss';\n\nconst LearningGoalStep: React.FC = () => {\n const { goToNextStep, answers, recordAnswer } = useProgressiveProfilingQuiz();\n const { formatMessage } = useIntl();\n\n const selectedValue = answers[schema.questionId]?.selectedValues[0] ?? '';\n\n const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n recordAnswer(buildAnswerRecord(schema, [event.target.value], formatMessage));\n };\n\n const handleOptionClick = (event: React.MouseEvent<HTMLDivElement>) => {\n if (event.target !== event.currentTarget) {\n return;\n }\n event.currentTarget.querySelector<HTMLInputElement>('input[type=\"radio\"]')?.click();\n };\n\n return (\n <>\n <BaseStep\n eventKey={PROGRESSIVE_PROFILING_QUIZ_STEPS.LEARNING_GOAL}\n title={formatMessage(messages.title)}\n index={0}\n optionalHeaderText={formatMessage(messages.headerText)}\n >\n <Form.Group className=\"mb-0\">\n <Form.Label className=\"h4\">\n {formatMessage(messages.question)}\n </Form.Label>\n <p>{formatMessage(messages.hint)}</p>\n <Form.RadioSet\n name={schema.questionId}\n value={selectedValue}\n onChange={handleChange}\n className=\"gap-4\"\n >\n {schema.options.map(option => (\n <div\n key={option.value}\n className=\"learning-goal-radio d-flex bg-light-100 px-3 py-3.5 mt-0\"\n onClick={handleOptionClick}\n >\n <Form.Radio value={option.value}>\n {formatMessage(option.message)}\n </Form.Radio>\n </div>\n ))}\n </Form.RadioSet>\n </Form.Group>\n </BaseStep>\n <Stepper.ActionRow eventKey={PROGRESSIVE_PROFILING_QUIZ_STEPS.LEARNING_GOAL}>\n <Stepper.ActionRow.Spacer />\n <Button variant=\"outline-primary\" onClick={goToNextStep} disabled={!selectedValue}>\n {formatMessage(messages.continueButton)}\n </Button>\n </Stepper.ActionRow>\n </>\n );\n};\n\nexport default LearningGoalStep;\n"]}
|
package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-goal/messages.d.ts
CHANGED
|
@@ -14,6 +14,36 @@ declare const messages: {
|
|
|
14
14
|
defaultMessage: string;
|
|
15
15
|
description: string;
|
|
16
16
|
};
|
|
17
|
+
hint: {
|
|
18
|
+
id: string;
|
|
19
|
+
defaultMessage: string;
|
|
20
|
+
description: string;
|
|
21
|
+
};
|
|
22
|
+
optionStartCareer: {
|
|
23
|
+
id: string;
|
|
24
|
+
defaultMessage: string;
|
|
25
|
+
description: string;
|
|
26
|
+
};
|
|
27
|
+
optionAdvanceCareer: {
|
|
28
|
+
id: string;
|
|
29
|
+
defaultMessage: string;
|
|
30
|
+
description: string;
|
|
31
|
+
};
|
|
32
|
+
optionChangeCareer: {
|
|
33
|
+
id: string;
|
|
34
|
+
defaultMessage: string;
|
|
35
|
+
description: string;
|
|
36
|
+
};
|
|
37
|
+
optionFunOrPersonalInterest: {
|
|
38
|
+
id: string;
|
|
39
|
+
defaultMessage: string;
|
|
40
|
+
description: string;
|
|
41
|
+
};
|
|
42
|
+
optionEarnDegreeOrCredit: {
|
|
43
|
+
id: string;
|
|
44
|
+
defaultMessage: string;
|
|
45
|
+
description: string;
|
|
46
|
+
};
|
|
17
47
|
continueButton: {
|
|
18
48
|
id: string;
|
|
19
49
|
defaultMessage: string;
|
package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-goal/messages.js
CHANGED
|
@@ -15,6 +15,36 @@ const messages = defineMessages({
|
|
|
15
15
|
defaultMessage: 'What’s your learning goal?',
|
|
16
16
|
description: 'Question asked in the learning goal step of the progressive profiling quiz',
|
|
17
17
|
},
|
|
18
|
+
hint: {
|
|
19
|
+
id: 'progressiveProfilingQuiz.stepper.learningGoal.hint',
|
|
20
|
+
defaultMessage: 'Select one',
|
|
21
|
+
description: 'Hint text shown above the learning goal question',
|
|
22
|
+
},
|
|
23
|
+
optionStartCareer: {
|
|
24
|
+
id: 'progressiveProfilingQuiz.stepper.learningGoal.optionStartCareer',
|
|
25
|
+
defaultMessage: 'Start my career',
|
|
26
|
+
description: 'Learning goal option: start new career',
|
|
27
|
+
},
|
|
28
|
+
optionAdvanceCareer: {
|
|
29
|
+
id: 'progressiveProfilingQuiz.stepper.learningGoal.optionAdvanceCareer',
|
|
30
|
+
defaultMessage: 'Advance my career',
|
|
31
|
+
description: 'Learning goal option: advancing in a current career',
|
|
32
|
+
},
|
|
33
|
+
optionChangeCareer: {
|
|
34
|
+
id: 'progressiveProfilingQuiz.stepper.learningGoal.optionChangeCareer',
|
|
35
|
+
defaultMessage: 'Change my career',
|
|
36
|
+
description: 'Learning goal option: changing careers',
|
|
37
|
+
},
|
|
38
|
+
optionFunOrPersonalInterest: {
|
|
39
|
+
id: 'progressiveProfilingQuiz.stepper.learningGoal.optionFunOrPersonalInterest',
|
|
40
|
+
defaultMessage: 'Learn for fun or personal interest',
|
|
41
|
+
description: 'Learning goal option: fun or personal interest',
|
|
42
|
+
},
|
|
43
|
+
optionEarnDegreeOrCredit: {
|
|
44
|
+
id: 'progressiveProfilingQuiz.stepper.learningGoal.optionEarnCertificate',
|
|
45
|
+
defaultMessage: 'Prepare for a degree or earn college credits',
|
|
46
|
+
description: 'Learning goal option: earning a degree or college credits',
|
|
47
|
+
},
|
|
18
48
|
continueButton: {
|
|
19
49
|
id: 'progressiveProfilingQuiz.stepper.learningGoal.continueButton',
|
|
20
50
|
defaultMessage: 'Continue',
|
package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-goal/messages.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../../../../../src/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-goal/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC9B,KAAK,EAAE;QACL,EAAE,EAAE,qDAAqD;QACzD,cAAc,EAAE,eAAe;QAC/B,WAAW,EAAE,oEAAoE;KAClF;IACD,UAAU,EAAE;QACV,EAAE,EAAE,0DAA0D;QAC9D,cAAc,EAAE,+DAA+D;QAC/E,WAAW,EAAE,oDAAoD;KAClE;IACD,QAAQ,EAAE;QACR,EAAE,EAAE,wDAAwD;QAC5D,cAAc,EAAE,4BAA4B;QAC5C,WAAW,EAAE,4EAA4E;KAC1F;IACD,cAAc,EAAE;QACd,EAAE,EAAE,8DAA8D;QAClE,cAAc,EAAE,UAAU;QAC1B,WAAW,EAAE,+EAA+E;KAC7F;CACF,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { defineMessages } from '@openedx/frontend-base';\n\nconst messages = defineMessages({\n title: {\n id: 'progressiveProfilingQuiz.stepper.learningGoal.title',\n defaultMessage: 'Learning Goal',\n description: 'Title for the learning goal step of the progressive profiling quiz',\n },\n headerText: {\n id: 'progressiveProfilingQuiz.stepper.learningGoal.headerText',\n defaultMessage: 'Tell us more about you so we can make course recommendations.',\n description: 'Header text shown above the learning goal question',\n },\n question: {\n id: 'progressiveProfilingQuiz.stepper.learningGoal.question',\n defaultMessage: 'What’s your learning goal?',\n description: 'Question asked in the learning goal step of the progressive profiling quiz',\n },\n continueButton: {\n id: 'progressiveProfilingQuiz.stepper.learningGoal.continueButton',\n defaultMessage: 'Continue',\n description: 'Label for the button to continue to the next step from the learning goal step',\n },\n});\n\nexport default messages;\n"]}
|
|
1
|
+
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../../../../../src/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-goal/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC9B,KAAK,EAAE;QACL,EAAE,EAAE,qDAAqD;QACzD,cAAc,EAAE,eAAe;QAC/B,WAAW,EAAE,oEAAoE;KAClF;IACD,UAAU,EAAE;QACV,EAAE,EAAE,0DAA0D;QAC9D,cAAc,EAAE,+DAA+D;QAC/E,WAAW,EAAE,oDAAoD;KAClE;IACD,QAAQ,EAAE;QACR,EAAE,EAAE,wDAAwD;QAC5D,cAAc,EAAE,4BAA4B;QAC5C,WAAW,EAAE,4EAA4E;KAC1F;IACD,IAAI,EAAE;QACJ,EAAE,EAAE,oDAAoD;QACxD,cAAc,EAAE,YAAY;QAC5B,WAAW,EAAE,kDAAkD;KAChE;IACD,iBAAiB,EAAE;QACjB,EAAE,EAAE,iEAAiE;QACrE,cAAc,EAAE,iBAAiB;QACjC,WAAW,EAAE,wCAAwC;KACtD;IACD,mBAAmB,EAAE;QACnB,EAAE,EAAE,mEAAmE;QACvE,cAAc,EAAE,mBAAmB;QACnC,WAAW,EAAE,qDAAqD;KACnE;IACD,kBAAkB,EAAE;QAClB,EAAE,EAAE,kEAAkE;QACtE,cAAc,EAAE,kBAAkB;QAClC,WAAW,EAAE,wCAAwC;KACtD;IACD,2BAA2B,EAAE;QAC3B,EAAE,EAAE,2EAA2E;QAC/E,cAAc,EAAE,oCAAoC;QACpD,WAAW,EAAE,gDAAgD;KAC9D;IACD,wBAAwB,EAAE;QACxB,EAAE,EAAE,qEAAqE;QACzE,cAAc,EAAE,8CAA8C;QAC9D,WAAW,EAAE,2DAA2D;KACzE;IACD,cAAc,EAAE;QACd,EAAE,EAAE,8DAA8D;QAClE,cAAc,EAAE,UAAU;QAC1B,WAAW,EAAE,+EAA+E;KAC7F;CACF,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { defineMessages } from '@openedx/frontend-base';\n\nconst messages = defineMessages({\n title: {\n id: 'progressiveProfilingQuiz.stepper.learningGoal.title',\n defaultMessage: 'Learning Goal',\n description: 'Title for the learning goal step of the progressive profiling quiz',\n },\n headerText: {\n id: 'progressiveProfilingQuiz.stepper.learningGoal.headerText',\n defaultMessage: 'Tell us more about you so we can make course recommendations.',\n description: 'Header text shown above the learning goal question',\n },\n question: {\n id: 'progressiveProfilingQuiz.stepper.learningGoal.question',\n defaultMessage: 'What’s your learning goal?',\n description: 'Question asked in the learning goal step of the progressive profiling quiz',\n },\n hint: {\n id: 'progressiveProfilingQuiz.stepper.learningGoal.hint',\n defaultMessage: 'Select one',\n description: 'Hint text shown above the learning goal question',\n },\n optionStartCareer: {\n id: 'progressiveProfilingQuiz.stepper.learningGoal.optionStartCareer',\n defaultMessage: 'Start my career',\n description: 'Learning goal option: start new career',\n },\n optionAdvanceCareer: {\n id: 'progressiveProfilingQuiz.stepper.learningGoal.optionAdvanceCareer',\n defaultMessage: 'Advance my career',\n description: 'Learning goal option: advancing in a current career',\n },\n optionChangeCareer: {\n id: 'progressiveProfilingQuiz.stepper.learningGoal.optionChangeCareer',\n defaultMessage: 'Change my career',\n description: 'Learning goal option: changing careers',\n },\n optionFunOrPersonalInterest: {\n id: 'progressiveProfilingQuiz.stepper.learningGoal.optionFunOrPersonalInterest',\n defaultMessage: 'Learn for fun or personal interest',\n description: 'Learning goal option: fun or personal interest',\n },\n optionEarnDegreeOrCredit: {\n id: 'progressiveProfilingQuiz.stepper.learningGoal.optionEarnCertificate',\n defaultMessage: 'Prepare for a degree or earn college credits',\n description: 'Learning goal option: earning a degree or college credits',\n },\n continueButton: {\n id: 'progressiveProfilingQuiz.stepper.learningGoal.continueButton',\n defaultMessage: 'Continue',\n description: 'Label for the button to continue to the next step from the learning goal step',\n },\n});\n\nexport default messages;\n"]}
|
package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-goal/schema.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { QuizQuestionSchema } from '../../../../../../widgets/ProgressiveProfilingQuiz/data/types';
|
|
2
|
+
/**
|
|
3
|
+
* IF YOU CHANGE THE SCHEMA, MAKE SURE TO UPDATE THE VERSION AS WELL
|
|
4
|
+
* For typos and small adjustments, use patch version.
|
|
5
|
+
* For any other changes, use minor versions unless it's been clearly indicated otherwise.
|
|
6
|
+
*/
|
|
7
|
+
declare const schema: QuizQuestionSchema;
|
|
8
|
+
export default schema;
|
package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-goal/schema.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { PROGRESSIVE_PROFILING_QUIZ_STEPS } from '../../../../../../widgets/ProgressiveProfilingQuiz/data/constants';
|
|
2
|
+
import messages from './messages';
|
|
3
|
+
/**
|
|
4
|
+
* IF YOU CHANGE THE SCHEMA, MAKE SURE TO UPDATE THE VERSION AS WELL
|
|
5
|
+
* For typos and small adjustments, use patch version.
|
|
6
|
+
* For any other changes, use minor versions unless it's been clearly indicated otherwise.
|
|
7
|
+
*/
|
|
8
|
+
const schema = {
|
|
9
|
+
questionId: PROGRESSIVE_PROFILING_QUIZ_STEPS.LEARNING_GOAL,
|
|
10
|
+
version: '1.0.0',
|
|
11
|
+
question: messages.question,
|
|
12
|
+
options: [
|
|
13
|
+
{ value: 'start-career', message: messages.optionStartCareer },
|
|
14
|
+
{ value: 'advance-career', message: messages.optionAdvanceCareer },
|
|
15
|
+
{ value: 'change-career', message: messages.optionChangeCareer },
|
|
16
|
+
{ value: 'fun-or-personal-interest', message: messages.optionFunOrPersonalInterest },
|
|
17
|
+
{ value: 'earn-degree-or-credit', message: messages.optionEarnDegreeOrCredit },
|
|
18
|
+
],
|
|
19
|
+
};
|
|
20
|
+
export default schema;
|
|
21
|
+
//# sourceMappingURL=schema.js.map
|
package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-goal/schema.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../../../../src/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-goal/schema.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gCAAgC,EAAE,MAAM,sDAAsD,CAAC;AACxG,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC;;;;EAIE;AACF,MAAM,MAAM,GAAuB;IACjC,UAAU,EAAE,gCAAgC,CAAC,aAAa;IAC1D,OAAO,EAAE,OAAO;IAChB,QAAQ,EAAE,QAAQ,CAAC,QAAQ;IAC3B,OAAO,EAAE;QACP,EAAE,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,QAAQ,CAAC,iBAAiB,EAAE;QAC9D,EAAE,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,QAAQ,CAAC,mBAAmB,EAAE;QAClE,EAAE,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,QAAQ,CAAC,kBAAkB,EAAE;QAChE,EAAE,KAAK,EAAE,0BAA0B,EAAE,OAAO,EAAE,QAAQ,CAAC,2BAA2B,EAAE;QACpF,EAAE,KAAK,EAAE,uBAAuB,EAAE,OAAO,EAAE,QAAQ,CAAC,wBAAwB,EAAE;KAC/E;CACF,CAAC;AAEF,eAAe,MAAM,CAAC","sourcesContent":["import { QuizQuestionSchema } from '@src/widgets/ProgressiveProfilingQuiz/data/types';\nimport { PROGRESSIVE_PROFILING_QUIZ_STEPS } from '@src/widgets/ProgressiveProfilingQuiz/data/constants';\nimport messages from './messages';\n\n/**\n * IF YOU CHANGE THE SCHEMA, MAKE SURE TO UPDATE THE VERSION AS WELL\n * For typos and small adjustments, use patch version.\n * For any other changes, use minor versions unless it's been clearly indicated otherwise.\n*/\nconst schema: QuizQuestionSchema = {\n questionId: PROGRESSIVE_PROFILING_QUIZ_STEPS.LEARNING_GOAL,\n version: '1.0.0',\n question: messages.question,\n options: [\n { value: 'start-career', message: messages.optionStartCareer },\n { value: 'advance-career', message: messages.optionAdvanceCareer },\n { value: 'change-career', message: messages.optionChangeCareer },\n { value: 'fun-or-personal-interest', message: messages.optionFunOrPersonalInterest },\n { value: 'earn-degree-or-credit', message: messages.optionEarnDegreeOrCredit },\n ],\n};\n\nexport default schema;\n"]}
|
package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-motivation/index.js
CHANGED
|
@@ -1,15 +1,34 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { Stepper, Button } from '@openedx/paragon';
|
|
2
|
+
import { Stepper, Button, Form } from '@openedx/paragon';
|
|
3
3
|
import { useIntl } from '@openedx/frontend-base';
|
|
4
4
|
import BaseStep from '../BaseStep';
|
|
5
5
|
import { useProgressiveProfilingQuiz } from '../../../../../../widgets/ProgressiveProfilingQuiz/ProgressiveProfilingQuizProvider';
|
|
6
6
|
import { PROGRESSIVE_PROFILING_QUIZ_STEPS } from '../../../../../../widgets/ProgressiveProfilingQuiz/data/constants';
|
|
7
|
+
import { buildAnswerRecord } from '../../../../../../widgets/ProgressiveProfilingQuiz/data/schemaUtils';
|
|
7
8
|
import stepMessages from '../messages';
|
|
8
9
|
import messages from './messages';
|
|
10
|
+
import schema from './schema';
|
|
11
|
+
import './index.scss';
|
|
9
12
|
const LearningMotivationStep = () => {
|
|
10
|
-
|
|
13
|
+
var _a, _b;
|
|
14
|
+
const { goToPreviousStep, goToNextStep, answers, recordAnswer, } = useProgressiveProfilingQuiz();
|
|
11
15
|
const { formatMessage } = useIntl();
|
|
12
|
-
|
|
16
|
+
const selectedValues = (_b = (_a = answers[schema.questionId]) === null || _a === void 0 ? void 0 : _a.selectedValues) !== null && _b !== void 0 ? _b : [];
|
|
17
|
+
const handleChange = (event) => {
|
|
18
|
+
const { checked, value } = event.target;
|
|
19
|
+
const nextValues = checked
|
|
20
|
+
? [...selectedValues, value]
|
|
21
|
+
: selectedValues.filter(selectedValue => selectedValue !== value);
|
|
22
|
+
recordAnswer(buildAnswerRecord(schema, nextValues, formatMessage));
|
|
23
|
+
};
|
|
24
|
+
const handleOptionClick = (event) => {
|
|
25
|
+
var _a;
|
|
26
|
+
if (event.target !== event.currentTarget) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
(_a = event.currentTarget.querySelector('input[type="checkbox"]')) === null || _a === void 0 ? void 0 : _a.click();
|
|
30
|
+
};
|
|
31
|
+
return (_jsxs(_Fragment, { children: [_jsx(BaseStep, { eventKey: PROGRESSIVE_PROFILING_QUIZ_STEPS.LEARNING_MOTIVATION, title: formatMessage(messages.title), index: 1, children: _jsxs(Form.Group, { className: "mb-0", children: [_jsx(Form.Label, { className: "h4", children: formatMessage(messages.question) }), _jsx("p", { children: formatMessage(messages.hint) }), _jsx(Form.CheckboxSet, { name: schema.questionId, value: selectedValues, onChange: handleChange, className: "gap-4", children: schema.options.map(option => (_jsx("div", { className: "learning-motivation-checkbox d-flex bg-light-100 px-3 py-3.5 mt-0", onClick: handleOptionClick, children: _jsx(Form.Checkbox, { value: option.value, children: formatMessage(option.message) }) }, option.value))) })] }) }), _jsxs(Stepper.ActionRow, { eventKey: PROGRESSIVE_PROFILING_QUIZ_STEPS.LEARNING_MOTIVATION, children: [_jsx(Button, { variant: "outline-primary", onClick: goToPreviousStep, children: formatMessage(stepMessages.backButton) }), _jsx(Button, { onClick: goToNextStep, disabled: selectedValues.length === 0, className: "ml-3", children: formatMessage(stepMessages.nextButton) })] })] }));
|
|
13
32
|
};
|
|
14
33
|
export default LearningMotivationStep;
|
|
15
34
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-motivation/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-motivation/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,QAAQ,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,2BAA2B,EAAE,MAAM,wEAAwE,CAAC;AACrH,OAAO,EAAE,gCAAgC,EAAE,MAAM,sDAAsD,CAAC;AACxG,OAAO,EAAE,iBAAiB,EAAE,MAAM,wDAAwD,CAAC;AAC3F,OAAO,YAAY,MAAM,aAAa,CAAC;AACvC,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,MAAM,MAAM,UAAU,CAAC;AAE9B,OAAO,cAAc,CAAC;AAEtB,MAAM,sBAAsB,GAAa,GAAG,EAAE;;IAC5C,MAAM,EACJ,gBAAgB,EAAE,YAAY,EAAE,OAAO,EAAE,YAAY,GACtD,GAAG,2BAA2B,EAAE,CAAC;IAClC,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IAEpC,MAAM,cAAc,GAAG,MAAA,MAAA,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,0CAAE,cAAc,mCAAI,EAAE,CAAC;IAExE,MAAM,YAAY,GAAG,CAAC,KAA0C,EAAE,EAAE;QAClE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC;QACxC,MAAM,UAAU,GAAG,OAAO;YACxB,CAAC,CAAC,CAAC,GAAG,cAAc,EAAE,KAAK,CAAC;YAC5B,CAAC,CAAC,cAAc,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,CAAC,aAAa,KAAK,KAAK,CAAC,CAAC;QACpE,YAAY,CAAC,iBAAiB,CAAC,MAAM,EAAE,UAAU,EAAE,aAAa,CAAC,CAAC,CAAC;IACrE,CAAC,CAAC;IAEF,MAAM,iBAAiB,GAAG,CAAC,KAAuC,EAAE,EAAE;;QACpE,IAAI,KAAK,CAAC,MAAM,KAAK,KAAK,CAAC,aAAa,EAAE,CAAC;YACzC,OAAO;QACT,CAAC;QACD,MAAA,KAAK,CAAC,aAAa,CAAC,aAAa,CAAmB,wBAAwB,CAAC,0CAAE,KAAK,EAAE,CAAC;IACzF,CAAC,CAAC;IAEF,OAAO,CACL,8BACE,KAAC,QAAQ,IACP,QAAQ,EAAE,gCAAgC,CAAC,mBAAmB,EAC9D,KAAK,EAAE,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,EACpC,KAAK,EAAE,CAAC,YAER,MAAC,IAAI,CAAC,KAAK,IAAC,SAAS,EAAC,MAAM,aAC1B,KAAC,IAAI,CAAC,KAAK,IAAC,SAAS,EAAC,IAAI,YACvB,aAAa,CAAC,QAAQ,CAAC,QAAQ,CAAC,GACtB,EACb,sBAAI,aAAa,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAK,EACrC,KAAC,IAAI,CAAC,WAAW,IACf,IAAI,EAAE,MAAM,CAAC,UAAU,EACvB,KAAK,EAAE,cAAc,EACrB,QAAQ,EAAE,YAAY,EACtB,SAAS,EAAC,OAAO,YAEhB,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAC5B,cAEE,SAAS,EAAC,mEAAmE,EAC7E,OAAO,EAAE,iBAAiB,YAE1B,KAAC,IAAI,CAAC,QAAQ,IAAC,KAAK,EAAE,MAAM,CAAC,KAAK,YAC/B,aAAa,CAAC,MAAM,CAAC,OAAO,CAAC,GAChB,IANX,MAAM,CAAC,KAAK,CAOb,CACP,CAAC,GACe,IACR,GACJ,EACX,MAAC,OAAO,CAAC,SAAS,IAAC,QAAQ,EAAE,gCAAgC,CAAC,mBAAmB,aAC/E,KAAC,MAAM,IAAC,OAAO,EAAC,iBAAiB,EAAC,OAAO,EAAE,gBAAgB,YACxD,aAAa,CAAC,YAAY,CAAC,UAAU,CAAC,GAChC,EACT,KAAC,MAAM,IAAC,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,cAAc,CAAC,MAAM,KAAK,CAAC,EAAE,SAAS,EAAC,MAAM,YACnF,aAAa,CAAC,YAAY,CAAC,UAAU,CAAC,GAChC,IACS,IACnB,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,sBAAsB,CAAC","sourcesContent":["import React from 'react';\nimport { Stepper, Button, Form } from '@openedx/paragon';\nimport { useIntl } from '@openedx/frontend-base';\nimport BaseStep from '../BaseStep';\nimport { useProgressiveProfilingQuiz } from '@src/widgets/ProgressiveProfilingQuiz/ProgressiveProfilingQuizProvider';\nimport { PROGRESSIVE_PROFILING_QUIZ_STEPS } from '@src/widgets/ProgressiveProfilingQuiz/data/constants';\nimport { buildAnswerRecord } from '@src/widgets/ProgressiveProfilingQuiz/data/schemaUtils';\nimport stepMessages from '../messages';\nimport messages from './messages';\nimport schema from './schema';\n\nimport './index.scss';\n\nconst LearningMotivationStep: React.FC = () => {\n const {\n goToPreviousStep, goToNextStep, answers, recordAnswer,\n } = useProgressiveProfilingQuiz();\n const { formatMessage } = useIntl();\n\n const selectedValues = answers[schema.questionId]?.selectedValues ?? [];\n\n const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n const { checked, value } = event.target;\n const nextValues = checked\n ? [...selectedValues, value]\n : selectedValues.filter(selectedValue => selectedValue !== value);\n recordAnswer(buildAnswerRecord(schema, nextValues, formatMessage));\n };\n\n const handleOptionClick = (event: React.MouseEvent<HTMLDivElement>) => {\n if (event.target !== event.currentTarget) {\n return;\n }\n event.currentTarget.querySelector<HTMLInputElement>('input[type=\"checkbox\"]')?.click();\n };\n\n return (\n <>\n <BaseStep\n eventKey={PROGRESSIVE_PROFILING_QUIZ_STEPS.LEARNING_MOTIVATION}\n title={formatMessage(messages.title)}\n index={1}\n >\n <Form.Group className=\"mb-0\">\n <Form.Label className=\"h4\">\n {formatMessage(messages.question)}\n </Form.Label>\n <p>{formatMessage(messages.hint)}</p>\n <Form.CheckboxSet\n name={schema.questionId}\n value={selectedValues}\n onChange={handleChange}\n className=\"gap-4\"\n >\n {schema.options.map(option => (\n <div\n key={option.value}\n className=\"learning-motivation-checkbox d-flex bg-light-100 px-3 py-3.5 mt-0\"\n onClick={handleOptionClick}\n >\n <Form.Checkbox value={option.value}>\n {formatMessage(option.message)}\n </Form.Checkbox>\n </div>\n ))}\n </Form.CheckboxSet>\n </Form.Group>\n </BaseStep>\n <Stepper.ActionRow eventKey={PROGRESSIVE_PROFILING_QUIZ_STEPS.LEARNING_MOTIVATION}>\n <Button variant=\"outline-primary\" onClick={goToPreviousStep}>\n {formatMessage(stepMessages.backButton)}\n </Button>\n <Button onClick={goToNextStep} disabled={selectedValues.length === 0} className=\"ml-3\">\n {formatMessage(stepMessages.nextButton)}\n </Button>\n </Stepper.ActionRow>\n </>\n );\n};\n\nexport default LearningMotivationStep;\n"]}
|
|
@@ -9,5 +9,35 @@ declare const messages: {
|
|
|
9
9
|
defaultMessage: string;
|
|
10
10
|
description: string;
|
|
11
11
|
};
|
|
12
|
+
hint: {
|
|
13
|
+
id: string;
|
|
14
|
+
defaultMessage: string;
|
|
15
|
+
description: string;
|
|
16
|
+
};
|
|
17
|
+
optionHardSkills: {
|
|
18
|
+
id: string;
|
|
19
|
+
defaultMessage: string;
|
|
20
|
+
description: string;
|
|
21
|
+
};
|
|
22
|
+
optionSoftSkills: {
|
|
23
|
+
id: string;
|
|
24
|
+
defaultMessage: string;
|
|
25
|
+
description: string;
|
|
26
|
+
};
|
|
27
|
+
optionEmergingTechnologies: {
|
|
28
|
+
id: string;
|
|
29
|
+
defaultMessage: string;
|
|
30
|
+
description: string;
|
|
31
|
+
};
|
|
32
|
+
optionPersonalEnrichment: {
|
|
33
|
+
id: string;
|
|
34
|
+
defaultMessage: string;
|
|
35
|
+
description: string;
|
|
36
|
+
};
|
|
37
|
+
optionFormalCredentials: {
|
|
38
|
+
id: string;
|
|
39
|
+
defaultMessage: string;
|
|
40
|
+
description: string;
|
|
41
|
+
};
|
|
12
42
|
};
|
|
13
43
|
export default messages;
|
|
@@ -10,6 +10,36 @@ const messages = defineMessages({
|
|
|
10
10
|
defaultMessage: 'What do you want to gain from your learning experience?',
|
|
11
11
|
description: 'Question asked in the learning motivation step of the progressive profiling quiz',
|
|
12
12
|
},
|
|
13
|
+
hint: {
|
|
14
|
+
id: 'progressiveProfilingQuiz.stepper.learningMotivation.hint',
|
|
15
|
+
defaultMessage: 'Select one or more',
|
|
16
|
+
description: 'Hint text shown above the learning motivation question',
|
|
17
|
+
},
|
|
18
|
+
optionHardSkills: {
|
|
19
|
+
id: 'progressiveProfilingQuiz.stepper.learningMotivation.optionHardSkills',
|
|
20
|
+
defaultMessage: 'Hard skills (i.e., coding, programming, statistics)',
|
|
21
|
+
description: 'Learning motivation option: hard skills',
|
|
22
|
+
},
|
|
23
|
+
optionSoftSkills: {
|
|
24
|
+
id: 'progressiveProfilingQuiz.stepper.learningMotivation.optionSoftSkills',
|
|
25
|
+
defaultMessage: 'Soft skills (i.e, leadership, management, and strategic thinking)',
|
|
26
|
+
description: 'Learning motivation option: soft skills',
|
|
27
|
+
},
|
|
28
|
+
optionEmergingTechnologies: {
|
|
29
|
+
id: 'progressiveProfilingQuiz.stepper.learningMotivation.optionEmergingTechnologies',
|
|
30
|
+
defaultMessage: 'Stay up to date on emerging technologies',
|
|
31
|
+
description: 'Learning motivation option: staying current on emerging technologies',
|
|
32
|
+
},
|
|
33
|
+
optionPersonalEnrichment: {
|
|
34
|
+
id: 'progressiveProfilingQuiz.stepper.learningMotivation.optionPersonalEnrichment',
|
|
35
|
+
defaultMessage: 'Personal enrichment and enjoyment',
|
|
36
|
+
description: 'Learning motivation option: personal enrichment and enjoyment',
|
|
37
|
+
},
|
|
38
|
+
optionFormalCredentials: {
|
|
39
|
+
id: 'progressiveProfilingQuiz.stepper.learningMotivation.optionFormalCredentials',
|
|
40
|
+
defaultMessage: 'Earn formal credentials for my resume',
|
|
41
|
+
description: 'Learning motivation option: earning formal credentials',
|
|
42
|
+
},
|
|
13
43
|
});
|
|
14
44
|
export default messages;
|
|
15
45
|
//# sourceMappingURL=messages.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../../../../../src/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-motivation/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC9B,KAAK,EAAE;QACL,EAAE,EAAE,2DAA2D;QAC/D,cAAc,EAAE,qBAAqB;QACrC,WAAW,EAAE,0EAA0E;KACxF;IACD,QAAQ,EAAE;QACR,EAAE,EAAE,8DAA8D;QAClE,cAAc,EAAE,yDAAyD;QACzE,WAAW,EAAE,kFAAkF;KAChG;CACF,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { defineMessages } from '@openedx/frontend-base';\n\nconst messages = defineMessages({\n title: {\n id: 'progressiveProfilingQuiz.stepper.learningMotivation.title',\n defaultMessage: 'Learning Motivation',\n description: 'Title for the learning motivation step of the progressive profiling quiz',\n },\n question: {\n id: 'progressiveProfilingQuiz.stepper.learningMotivation.question',\n defaultMessage: 'What do you want to gain from your learning experience?',\n description: 'Question asked in the learning motivation step of the progressive profiling quiz',\n },\n});\n\nexport default messages;\n"]}
|
|
1
|
+
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../../../../../src/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-motivation/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC9B,KAAK,EAAE;QACL,EAAE,EAAE,2DAA2D;QAC/D,cAAc,EAAE,qBAAqB;QACrC,WAAW,EAAE,0EAA0E;KACxF;IACD,QAAQ,EAAE;QACR,EAAE,EAAE,8DAA8D;QAClE,cAAc,EAAE,yDAAyD;QACzE,WAAW,EAAE,kFAAkF;KAChG;IACD,IAAI,EAAE;QACJ,EAAE,EAAE,0DAA0D;QAC9D,cAAc,EAAE,oBAAoB;QACpC,WAAW,EAAE,wDAAwD;KACtE;IACD,gBAAgB,EAAE;QAChB,EAAE,EAAE,sEAAsE;QAC1E,cAAc,EAAE,qDAAqD;QACrE,WAAW,EAAE,yCAAyC;KACvD;IACD,gBAAgB,EAAE;QAChB,EAAE,EAAE,sEAAsE;QAC1E,cAAc,EAAE,mEAAmE;QACnF,WAAW,EAAE,yCAAyC;KACvD;IACD,0BAA0B,EAAE;QAC1B,EAAE,EAAE,gFAAgF;QACpF,cAAc,EAAE,0CAA0C;QAC1D,WAAW,EAAE,sEAAsE;KACpF;IACD,wBAAwB,EAAE;QACxB,EAAE,EAAE,8EAA8E;QAClF,cAAc,EAAE,mCAAmC;QACnD,WAAW,EAAE,+DAA+D;KAC7E;IACD,uBAAuB,EAAE;QACvB,EAAE,EAAE,6EAA6E;QACjF,cAAc,EAAE,uCAAuC;QACvD,WAAW,EAAE,wDAAwD;KACtE;CACF,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { defineMessages } from '@openedx/frontend-base';\n\nconst messages = defineMessages({\n title: {\n id: 'progressiveProfilingQuiz.stepper.learningMotivation.title',\n defaultMessage: 'Learning Motivation',\n description: 'Title for the learning motivation step of the progressive profiling quiz',\n },\n question: {\n id: 'progressiveProfilingQuiz.stepper.learningMotivation.question',\n defaultMessage: 'What do you want to gain from your learning experience?',\n description: 'Question asked in the learning motivation step of the progressive profiling quiz',\n },\n hint: {\n id: 'progressiveProfilingQuiz.stepper.learningMotivation.hint',\n defaultMessage: 'Select one or more',\n description: 'Hint text shown above the learning motivation question',\n },\n optionHardSkills: {\n id: 'progressiveProfilingQuiz.stepper.learningMotivation.optionHardSkills',\n defaultMessage: 'Hard skills (i.e., coding, programming, statistics)',\n description: 'Learning motivation option: hard skills',\n },\n optionSoftSkills: {\n id: 'progressiveProfilingQuiz.stepper.learningMotivation.optionSoftSkills',\n defaultMessage: 'Soft skills (i.e, leadership, management, and strategic thinking)',\n description: 'Learning motivation option: soft skills',\n },\n optionEmergingTechnologies: {\n id: 'progressiveProfilingQuiz.stepper.learningMotivation.optionEmergingTechnologies',\n defaultMessage: 'Stay up to date on emerging technologies',\n description: 'Learning motivation option: staying current on emerging technologies',\n },\n optionPersonalEnrichment: {\n id: 'progressiveProfilingQuiz.stepper.learningMotivation.optionPersonalEnrichment',\n defaultMessage: 'Personal enrichment and enjoyment',\n description: 'Learning motivation option: personal enrichment and enjoyment',\n },\n optionFormalCredentials: {\n id: 'progressiveProfilingQuiz.stepper.learningMotivation.optionFormalCredentials',\n defaultMessage: 'Earn formal credentials for my resume',\n description: 'Learning motivation option: earning formal credentials',\n },\n});\n\nexport default messages;\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { QuizQuestionSchema } from '../../../../../../widgets/ProgressiveProfilingQuiz/data/types';
|
|
2
|
+
/**
|
|
3
|
+
* IF YOU CHANGE THE SCHEMA, MAKE SURE TO UPDATE THE VERSION AS WELL
|
|
4
|
+
* For typos and small adjustments, use patch version.
|
|
5
|
+
* For any other changes, use minor versions unless it's been clearly indicated otherwise.
|
|
6
|
+
*/
|
|
7
|
+
declare const schema: QuizQuestionSchema;
|
|
8
|
+
export default schema;
|
package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-motivation/schema.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { PROGRESSIVE_PROFILING_QUIZ_STEPS } from '../../../../../../widgets/ProgressiveProfilingQuiz/data/constants';
|
|
2
|
+
import messages from './messages';
|
|
3
|
+
/**
|
|
4
|
+
* IF YOU CHANGE THE SCHEMA, MAKE SURE TO UPDATE THE VERSION AS WELL
|
|
5
|
+
* For typos and small adjustments, use patch version.
|
|
6
|
+
* For any other changes, use minor versions unless it's been clearly indicated otherwise.
|
|
7
|
+
*/
|
|
8
|
+
const schema = {
|
|
9
|
+
questionId: PROGRESSIVE_PROFILING_QUIZ_STEPS.LEARNING_MOTIVATION,
|
|
10
|
+
version: '1.0.0',
|
|
11
|
+
question: messages.question,
|
|
12
|
+
options: [
|
|
13
|
+
{ value: 'hard-skills', message: messages.optionHardSkills },
|
|
14
|
+
{ value: 'soft-skills', message: messages.optionSoftSkills },
|
|
15
|
+
{ value: 'emerging-technologies', message: messages.optionEmergingTechnologies },
|
|
16
|
+
{ value: 'personal-enrichment', message: messages.optionPersonalEnrichment },
|
|
17
|
+
{ value: 'formal-credentials', message: messages.optionFormalCredentials },
|
|
18
|
+
],
|
|
19
|
+
};
|
|
20
|
+
export default schema;
|
|
21
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../../../../src/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-motivation/schema.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gCAAgC,EAAE,MAAM,sDAAsD,CAAC;AACxG,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC;;;;EAIE;AACF,MAAM,MAAM,GAAuB;IACjC,UAAU,EAAE,gCAAgC,CAAC,mBAAmB;IAChE,OAAO,EAAE,OAAO;IAChB,QAAQ,EAAE,QAAQ,CAAC,QAAQ;IAC3B,OAAO,EAAE;QACP,EAAE,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,QAAQ,CAAC,gBAAgB,EAAE;QAC5D,EAAE,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,QAAQ,CAAC,gBAAgB,EAAE;QAC5D,EAAE,KAAK,EAAE,uBAAuB,EAAE,OAAO,EAAE,QAAQ,CAAC,0BAA0B,EAAE;QAChF,EAAE,KAAK,EAAE,qBAAqB,EAAE,OAAO,EAAE,QAAQ,CAAC,wBAAwB,EAAE;QAC5E,EAAE,KAAK,EAAE,oBAAoB,EAAE,OAAO,EAAE,QAAQ,CAAC,uBAAuB,EAAE;KAC3E;CACF,CAAC;AAEF,eAAe,MAAM,CAAC","sourcesContent":["import { QuizQuestionSchema } from '@src/widgets/ProgressiveProfilingQuiz/data/types';\nimport { PROGRESSIVE_PROFILING_QUIZ_STEPS } from '@src/widgets/ProgressiveProfilingQuiz/data/constants';\nimport messages from './messages';\n\n/**\n * IF YOU CHANGE THE SCHEMA, MAKE SURE TO UPDATE THE VERSION AS WELL\n * For typos and small adjustments, use patch version.\n * For any other changes, use minor versions unless it's been clearly indicated otherwise.\n*/\nconst schema: QuizQuestionSchema = {\n questionId: PROGRESSIVE_PROFILING_QUIZ_STEPS.LEARNING_MOTIVATION,\n version: '1.0.0',\n question: messages.question,\n options: [\n { value: 'hard-skills', message: messages.optionHardSkills },\n { value: 'soft-skills', message: messages.optionSoftSkills },\n { value: 'emerging-technologies', message: messages.optionEmergingTechnologies },\n { value: 'personal-enrichment', message: messages.optionPersonalEnrichment },\n { value: 'formal-credentials', message: messages.optionFormalCredentials },\n ],\n};\n\nexport default schema;\n"]}
|