@openedx/frontend-app-instructor-dashboard 1.0.0-alpha.37 → 1.0.0-alpha.39
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/grading/components/GradingActionRow.js +2 -10
- package/dist/grading/components/GradingActionRow.js.map +1 -1
- package/dist/grading/components/GradingConfigurationModal.js +1 -1
- package/dist/grading/components/GradingConfigurationModal.js.map +1 -1
- package/dist/grading/components/GradingLearnerContent.js +94 -13
- package/dist/grading/components/GradingLearnerContent.js.map +1 -1
- package/dist/grading/messages.d.ts +75 -0
- package/dist/grading/messages.js +75 -0
- package/dist/grading/messages.js.map +1 -1
- package/dist/specialExams/components/Allowances.js +63 -6
- package/dist/specialExams/components/Allowances.js.map +1 -1
- package/dist/specialExams/data/apiHook.d.ts +1 -1
- package/dist/specialExams/data/apiHook.js +2 -2
- package/dist/specialExams/data/apiHook.js.map +1 -1
- package/dist/specialExams/messages.d.ts +5 -0
- package/dist/specialExams/messages.js +5 -0
- package/dist/specialExams/messages.js.map +1 -1
- package/dist/types/index.d.ts +10 -0
- package/dist/types/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from 'react';
|
|
3
2
|
import { useParams } from 'react-router-dom';
|
|
4
3
|
import { useIntl } from '@openedx/frontend-base';
|
|
5
|
-
import { useToggle, ActionRow, Button, IconButton,
|
|
4
|
+
import { useToggle, ActionRow, Button, IconButton, Dropdown } from '@openedx/paragon';
|
|
6
5
|
import { TrendingUp, MoreVert, OpenInNew } from '@openedx/paragon/icons';
|
|
7
6
|
import { useCourseInfo } from '../../data/apiHook';
|
|
8
7
|
import GradingConfigurationModal from '../../grading/components/GradingConfigurationModal';
|
|
@@ -11,18 +10,11 @@ const GradingActionRow = () => {
|
|
|
11
10
|
const { courseId = '' } = useParams();
|
|
12
11
|
const intl = useIntl();
|
|
13
12
|
const { data = { gradebookUrl: '', studioGradingUrl: '' } } = useCourseInfo(courseId);
|
|
14
|
-
const [configurationMenuTarget, setConfigurationMenuTarget] = useState(null);
|
|
15
|
-
const [isOpenMenu, openMenu, closeMenu] = useToggle(false);
|
|
16
13
|
const [isOpenConfigModal, openConfigModal, closeConfigModal] = useToggle(false);
|
|
17
|
-
const handleConfigurationMenuClick = (event) => {
|
|
18
|
-
setConfigurationMenuTarget(event === null || event === void 0 ? void 0 : event.currentTarget);
|
|
19
|
-
openMenu();
|
|
20
|
-
};
|
|
21
14
|
const handleConfigModalOpen = () => {
|
|
22
15
|
openConfigModal();
|
|
23
|
-
closeMenu();
|
|
24
16
|
};
|
|
25
|
-
return (_jsxs(_Fragment, { children: [_jsxs(ActionRow, { children: [_jsx(Button, { as: "a", href: data.gradebookUrl, iconBefore: TrendingUp, variant: "outline-primary", children: intl.formatMessage(messages.viewGradebook) }), _jsx(
|
|
17
|
+
return (_jsxs(_Fragment, { children: [_jsxs(ActionRow, { children: [_jsx(Button, { as: "a", href: data.gradebookUrl, iconBefore: TrendingUp, variant: "outline-primary", children: intl.formatMessage(messages.viewGradebook) }), _jsxs(Dropdown, { children: [_jsx(Dropdown.Toggle, { as: IconButton, alt: intl.formatMessage(messages.configurationAlt), className: "lead", iconAs: MoreVert }), _jsxs(Dropdown.Menu, { children: [_jsx(Dropdown.Item, { onClick: handleConfigModalOpen, children: intl.formatMessage(messages.viewGradingConfiguration) }), _jsxs(Dropdown.Item, { as: "a", href: data.studioGradingUrl, target: "_blank", children: [intl.formatMessage(messages.viewCourseGradingSettings), _jsx(OpenInNew, { className: "ml-2" })] })] })] })] }), _jsx(GradingConfigurationModal, { isOpen: isOpenConfigModal, onClose: closeConfigModal })] }));
|
|
26
18
|
};
|
|
27
19
|
export default GradingActionRow;
|
|
28
20
|
//# sourceMappingURL=GradingActionRow.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GradingActionRow.js","sourceRoot":"","sources":["../../../src/grading/components/GradingActionRow.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"GradingActionRow.js","sourceRoot":"","sources":["../../../src/grading/components/GradingActionRow.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACtF,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,yBAAyB,MAAM,mDAAmD,CAAC;AAC1F,OAAO,QAAQ,MAAM,uBAAuB,CAAC;AAE7C,MAAM,gBAAgB,GAAG,GAAG,EAAE;IAC5B,MAAM,EAAE,QAAQ,GAAG,EAAE,EAAE,GAAG,SAAS,EAAwB,CAAC;IAC5D,MAAM,IAAI,GAAG,OAAO,EAAE,CAAC;IACvB,MAAM,EAAE,IAAI,GAAG,EAAE,YAAY,EAAE,EAAE,EAAE,gBAAgB,EAAE,EAAE,EAAE,EAAE,GAAG,aAAa,CAAC,QAAQ,CAAC,CAAC;IACtF,MAAM,CAAC,iBAAiB,EAAE,eAAe,EAAE,gBAAgB,CAAC,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC;IAEhF,MAAM,qBAAqB,GAAG,GAAG,EAAE;QACjC,eAAe,EAAE,CAAC;IACpB,CAAC,CAAC;IAEF,OAAO,CACL,8BACE,MAAC,SAAS,eACR,KAAC,MAAM,IAAC,EAAE,EAAC,GAAG,EAAC,IAAI,EAAE,IAAI,CAAC,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAAC,iBAAiB,YAAE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,aAAa,CAAC,GAAU,EAC/I,MAAC,QAAQ,eACP,KAAC,QAAQ,CAAC,MAAM,IACd,EAAE,EAAE,UAAU,EACd,GAAG,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,gBAAgB,CAAC,EAClD,SAAS,EAAC,MAAM,EAChB,MAAM,EAAE,QAAQ,GAChB,EACF,MAAC,QAAQ,CAAC,IAAI,eACZ,KAAC,QAAQ,CAAC,IAAI,IAAC,OAAO,EAAE,qBAAqB,YAC1C,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,wBAAwB,CAAC,GACxC,EAChB,MAAC,QAAQ,CAAC,IAAI,IAAC,EAAE,EAAC,GAAG,EAAC,IAAI,EAAE,IAAI,CAAC,gBAAgB,EAAE,MAAM,EAAC,QAAQ,aAC/D,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,yBAAyB,CAAC,EACvD,KAAC,SAAS,IAAC,SAAS,EAAC,MAAM,GAAG,IAChB,IACF,IACP,IACD,EACZ,KAAC,yBAAyB,IAAC,MAAM,EAAE,iBAAiB,EAAE,OAAO,EAAE,gBAAgB,GAAI,IAClF,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC","sourcesContent":["import { useParams } from 'react-router-dom';\nimport { useIntl } from '@openedx/frontend-base';\nimport { useToggle, ActionRow, Button, IconButton, Dropdown } from '@openedx/paragon';\nimport { TrendingUp, MoreVert, OpenInNew } from '@openedx/paragon/icons';\nimport { useCourseInfo } from '@src/data/apiHook';\nimport GradingConfigurationModal from '@src/grading/components/GradingConfigurationModal';\nimport messages from '@src/grading/messages';\n\nconst GradingActionRow = () => {\n const { courseId = '' } = useParams<{ courseId: string }>();\n const intl = useIntl();\n const { data = { gradebookUrl: '', studioGradingUrl: '' } } = useCourseInfo(courseId);\n const [isOpenConfigModal, openConfigModal, closeConfigModal] = useToggle(false);\n\n const handleConfigModalOpen = () => {\n openConfigModal();\n };\n\n return (\n <>\n <ActionRow>\n <Button as=\"a\" href={data.gradebookUrl} iconBefore={TrendingUp} variant=\"outline-primary\">{intl.formatMessage(messages.viewGradebook)}</Button>\n <Dropdown>\n <Dropdown.Toggle\n as={IconButton}\n alt={intl.formatMessage(messages.configurationAlt)}\n className=\"lead\"\n iconAs={MoreVert}\n />\n <Dropdown.Menu>\n <Dropdown.Item onClick={handleConfigModalOpen}>\n {intl.formatMessage(messages.viewGradingConfiguration)}\n </Dropdown.Item>\n <Dropdown.Item as=\"a\" href={data.studioGradingUrl} target=\"_blank\">\n {intl.formatMessage(messages.viewCourseGradingSettings)}\n <OpenInNew className=\"ml-2\" />\n </Dropdown.Item>\n </Dropdown.Menu>\n </Dropdown>\n </ActionRow>\n <GradingConfigurationModal isOpen={isOpenConfigModal} onClose={closeConfigModal} />\n </>\n );\n};\n\nexport default GradingActionRow;\n"]}
|
|
@@ -9,7 +9,7 @@ const GradingConfigurationModal = ({ isOpen, onClose }) => {
|
|
|
9
9
|
const intl = useIntl();
|
|
10
10
|
const { courseId = '' } = useParams();
|
|
11
11
|
const { data = null } = useGradingConfiguration(courseId);
|
|
12
|
-
return (_jsxs(ModalDialog, { size: "lg", title: intl.formatMessage(messages.gradingConfiguration), isOpen: isOpen, onClose: onClose, isOverflowVisible: false, children: [_jsx(ModalDialog.Header, { className: "p-3 pl-4 border-bottom", children: _jsx(ModalDialog.Title, { as: "h3", className: "m-0", children: intl.formatMessage(messages.gradingConfiguration) }) }), _jsx(ModalDialog.Body, { children: data ? _jsx(CodeEditor, { data: data }) : _jsx("p", { children: intl.formatMessage(messages.noGradingConfiguration) }) }), _jsx(ModalDialog.Footer, { className: "p-4 border-top", children: _jsx(Button, { onClick: onClose, children: intl.formatMessage(messages.close) }) })] }));
|
|
12
|
+
return (_jsxs(ModalDialog, { size: "lg", title: intl.formatMessage(messages.gradingConfiguration), isOpen: isOpen, onClose: onClose, isOverflowVisible: false, children: [_jsx(ModalDialog.Header, { className: "p-3 pl-4 border-bottom", children: _jsx(ModalDialog.Title, { as: "h3", className: "m-0 text-primary-500", children: intl.formatMessage(messages.gradingConfiguration) }) }), _jsx(ModalDialog.Body, { children: data ? _jsx(CodeEditor, { data: data }) : _jsx("p", { children: intl.formatMessage(messages.noGradingConfiguration) }) }), _jsx(ModalDialog.Footer, { className: "p-4 border-top", children: _jsx(Button, { onClick: onClose, children: intl.formatMessage(messages.close) }) })] }));
|
|
13
13
|
};
|
|
14
14
|
export default GradingConfigurationModal;
|
|
15
15
|
//# sourceMappingURL=GradingConfigurationModal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GradingConfigurationModal.js","sourceRoot":"","sources":["../../../src/grading/components/GradingConfigurationModal.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,QAAQ,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,UAAU,MAAM,4BAA4B,CAAC;AAOpD,MAAM,yBAAyB,GAAG,CAAC,EAAE,MAAM,EAAE,OAAO,EAAkC,EAAE,EAAE;IACxF,MAAM,IAAI,GAAG,OAAO,EAAE,CAAC;IACvB,MAAM,EAAE,QAAQ,GAAG,EAAE,EAAE,GAAG,SAAS,EAAwB,CAAC;IAC5D,MAAM,EAAE,IAAI,GAAG,IAAI,EAAE,GAAG,uBAAuB,CAAC,QAAQ,CAAC,CAAC;IAE1D,OAAO,CACL,MAAC,WAAW,IAAC,IAAI,EAAC,IAAI,EAAC,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,oBAAoB,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,KAAK,aACzI,KAAC,WAAW,CAAC,MAAM,IAAC,SAAS,EAAC,wBAAwB,YACpD,KAAC,WAAW,CAAC,KAAK,IAAC,EAAE,EAAC,IAAI,EAAC,SAAS,EAAC,
|
|
1
|
+
{"version":3,"file":"GradingConfigurationModal.js","sourceRoot":"","sources":["../../../src/grading/components/GradingConfigurationModal.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,QAAQ,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,UAAU,MAAM,4BAA4B,CAAC;AAOpD,MAAM,yBAAyB,GAAG,CAAC,EAAE,MAAM,EAAE,OAAO,EAAkC,EAAE,EAAE;IACxF,MAAM,IAAI,GAAG,OAAO,EAAE,CAAC;IACvB,MAAM,EAAE,QAAQ,GAAG,EAAE,EAAE,GAAG,SAAS,EAAwB,CAAC;IAC5D,MAAM,EAAE,IAAI,GAAG,IAAI,EAAE,GAAG,uBAAuB,CAAC,QAAQ,CAAC,CAAC;IAE1D,OAAO,CACL,MAAC,WAAW,IAAC,IAAI,EAAC,IAAI,EAAC,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,oBAAoB,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,KAAK,aACzI,KAAC,WAAW,CAAC,MAAM,IAAC,SAAS,EAAC,wBAAwB,YACpD,KAAC,WAAW,CAAC,KAAK,IAAC,EAAE,EAAC,IAAI,EAAC,SAAS,EAAC,sBAAsB,YACxD,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,oBAAoB,CAAC,GAChC,GACD,EACrB,KAAC,WAAW,CAAC,IAAI,cACd,IAAI,CAAC,CAAC,CAAC,KAAC,UAAU,IAAC,IAAI,EAAE,IAAI,GAAI,CAAC,CAAC,CAAC,sBAAI,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,sBAAsB,CAAC,GAAK,GAChF,EACnB,KAAC,WAAW,CAAC,MAAM,IAAC,SAAS,EAAC,gBAAgB,YAC5C,KAAC,MAAM,IAAC,OAAO,EAAE,OAAO,YAAG,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAU,GACpD,IACT,CACf,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,yBAAyB,CAAC","sourcesContent":["import { useParams } from 'react-router-dom';\nimport { Button, ModalDialog } from '@openedx/paragon';\nimport { useIntl } from '@openedx/frontend-base';\nimport messages from '@src/grading/messages';\nimport { useGradingConfiguration } from '@src/grading/data/apiHook';\nimport CodeEditor from '@src/components/CodeEditor';\n\ninterface GradingConfigurationModalProps {\n isOpen: boolean,\n onClose: () => void,\n}\n\nconst GradingConfigurationModal = ({ isOpen, onClose }: GradingConfigurationModalProps) => {\n const intl = useIntl();\n const { courseId = '' } = useParams<{ courseId: string }>();\n const { data = null } = useGradingConfiguration(courseId);\n\n return (\n <ModalDialog size=\"lg\" title={intl.formatMessage(messages.gradingConfiguration)} isOpen={isOpen} onClose={onClose} isOverflowVisible={false}>\n <ModalDialog.Header className=\"p-3 pl-4 border-bottom\">\n <ModalDialog.Title as=\"h3\" className=\"m-0 text-primary-500\">\n {intl.formatMessage(messages.gradingConfiguration)}\n </ModalDialog.Title>\n </ModalDialog.Header>\n <ModalDialog.Body>\n {data ? <CodeEditor data={data} /> : <p>{intl.formatMessage(messages.noGradingConfiguration)}</p>}\n </ModalDialog.Body>\n <ModalDialog.Footer className=\"p-4 border-top\">\n <Button onClick={onClose}>{intl.formatMessage(messages.close)}</Button>\n </ModalDialog.Footer>\n </ModalDialog>\n );\n};\n\nexport default GradingConfigurationModal;\n"]}
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useParams } from 'react-router-dom';
|
|
3
3
|
import { useEffect, useState, useRef } from 'react';
|
|
4
|
+
import { isAxiosError } from 'axios';
|
|
4
5
|
import { useIntl } from '@openedx/frontend-base';
|
|
5
|
-
import { Button, FormControl } from '@openedx/paragon';
|
|
6
|
+
import { Button, FormControl, ModalDialog, Stack } from '@openedx/paragon';
|
|
6
7
|
import ActionCard from '../../components/ActionCard';
|
|
7
8
|
import SpecifyLearnerField from '../../components/SpecifyLearnerField';
|
|
8
9
|
import SpecifyProblemField from '../../components/SpecifyProblemField';
|
|
9
10
|
import { useChangeScore, useDeleteHistory, useRescoreSubmission, useResetAttempts } from '../../grading/data/apiHook';
|
|
10
11
|
import messages from '../../grading/messages';
|
|
11
|
-
import { usePendingTasks } from '../../data/apiHook';
|
|
12
|
+
import { useLearner, usePendingTasks, useProblemDetails } from '../../data/apiHook';
|
|
13
|
+
import { useAlert } from '../../providers/AlertProvider';
|
|
12
14
|
const GradingLearnerContent = ({ toolType, onShowTasks }) => {
|
|
15
|
+
var _a, _b, _c, _d;
|
|
13
16
|
const intl = useIntl();
|
|
14
17
|
const { courseId = '' } = useParams();
|
|
15
18
|
const [usernameOrEmail, setUsernameOrEmail] = useState('');
|
|
@@ -17,22 +20,62 @@ const GradingLearnerContent = ({ toolType, onShowTasks }) => {
|
|
|
17
20
|
const [score, setScore] = useState('');
|
|
18
21
|
const learnerFieldRef = useRef(null);
|
|
19
22
|
const problemFieldRef = useRef(null);
|
|
23
|
+
const [showCurrentStatus, setShowCurrentStatus] = useState(false);
|
|
24
|
+
const [confirmationModalData, setConfirmationModalData] = useState({ message: '', confirmButtonLabel: '', action: undefined });
|
|
25
|
+
const { data: problemData = { currentScore: { score: 0, total: null }, attempts: { current: null, total: 0 } }, isError: isProblemDataError } = useProblemDetails(courseId, blockId, usernameOrEmail);
|
|
26
|
+
const { data: learnerData = { username: '', progressUrl: '' } } = useLearner(courseId, usernameOrEmail);
|
|
27
|
+
const { showModal, showToast } = useAlert();
|
|
20
28
|
const { mutate: resetAttempts } = useResetAttempts(courseId);
|
|
21
29
|
const { mutate: deleteHistory } = useDeleteHistory(courseId);
|
|
22
30
|
const { mutate: changeScore } = useChangeScore(courseId);
|
|
23
31
|
const { mutate: rescoreSubmission } = useRescoreSubmission(courseId);
|
|
24
32
|
const { refetch: refetchTasks } = usePendingTasks(courseId);
|
|
33
|
+
const resetConfirmationModalData = () => setConfirmationModalData({ message: '', confirmButtonLabel: '', action: undefined });
|
|
34
|
+
const manageOnError = (error) => {
|
|
35
|
+
var _a, _b;
|
|
36
|
+
resetConfirmationModalData();
|
|
37
|
+
const errorMessage = isAxiosError(error) && ((_b = (_a = error.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.error) ? error.response.data.error : intl.formatMessage(messages.unexpectedError);
|
|
38
|
+
showModal({
|
|
39
|
+
message: errorMessage,
|
|
40
|
+
variant: 'danger',
|
|
41
|
+
confirmText: intl.formatMessage(messages.close),
|
|
42
|
+
});
|
|
43
|
+
};
|
|
25
44
|
const handleResetAttempts = () => {
|
|
26
|
-
resetAttempts({ learner: usernameOrEmail, problem: blockId }
|
|
45
|
+
resetAttempts({ learner: usernameOrEmail, problem: blockId }, {
|
|
46
|
+
onSuccess: () => {
|
|
47
|
+
resetConfirmationModalData();
|
|
48
|
+
showToast(intl.formatMessage(messages.resetAttemptsSuccess, { student: usernameOrEmail || intl.formatMessage(messages.allLearners), blockId }));
|
|
49
|
+
},
|
|
50
|
+
onError: manageOnError
|
|
51
|
+
});
|
|
27
52
|
};
|
|
28
53
|
const handleRescoreSubmission = (onlyIfHigher = false) => {
|
|
29
|
-
rescoreSubmission({ learner: usernameOrEmail, problem: blockId, onlyIfHigher }
|
|
54
|
+
rescoreSubmission({ learner: usernameOrEmail, problem: blockId, onlyIfHigher }, {
|
|
55
|
+
onSuccess: () => {
|
|
56
|
+
resetConfirmationModalData();
|
|
57
|
+
showToast(intl.formatMessage(messages.rescoreSubmissionSuccess, { student: usernameOrEmail || intl.formatMessage(messages.allLearners), blockId }));
|
|
58
|
+
},
|
|
59
|
+
onError: manageOnError
|
|
60
|
+
});
|
|
30
61
|
};
|
|
31
62
|
const handleDeleteHistory = () => {
|
|
32
|
-
deleteHistory({ learner: usernameOrEmail, problem: blockId }
|
|
63
|
+
deleteHistory({ learner: usernameOrEmail, problem: blockId }, {
|
|
64
|
+
onSuccess: () => {
|
|
65
|
+
resetConfirmationModalData();
|
|
66
|
+
showToast(intl.formatMessage(messages.deleteHistorySuccess, { student: usernameOrEmail || intl.formatMessage(messages.allLearners), blockId }));
|
|
67
|
+
},
|
|
68
|
+
onError: manageOnError
|
|
69
|
+
});
|
|
33
70
|
};
|
|
34
71
|
const handleOverrideScore = () => {
|
|
35
|
-
changeScore({ learner: usernameOrEmail, problem: blockId, newScore: Number(score) }
|
|
72
|
+
changeScore({ learner: usernameOrEmail, problem: blockId, newScore: Number(score) }, {
|
|
73
|
+
onSuccess: () => {
|
|
74
|
+
resetConfirmationModalData();
|
|
75
|
+
showToast(intl.formatMessage(messages.overrideScoreSuccess, { student: usernameOrEmail || intl.formatMessage(messages.allLearners), blockId }));
|
|
76
|
+
},
|
|
77
|
+
onError: manageOnError
|
|
78
|
+
});
|
|
36
79
|
};
|
|
37
80
|
const handleScoreChange = (e) => {
|
|
38
81
|
const value = e.target.value;
|
|
@@ -41,6 +84,37 @@ const GradingLearnerContent = ({ toolType, onShowTasks }) => {
|
|
|
41
84
|
setScore(value);
|
|
42
85
|
}
|
|
43
86
|
};
|
|
87
|
+
const confirmationInfo = {
|
|
88
|
+
resetAttempts: {
|
|
89
|
+
message: messages.resetAttemptsConfirmation,
|
|
90
|
+
confirmButtonLabel: messages.resetAttempts,
|
|
91
|
+
action: handleResetAttempts,
|
|
92
|
+
},
|
|
93
|
+
deleteState: {
|
|
94
|
+
message: messages.deleteStateConfirmation,
|
|
95
|
+
confirmButtonLabel: messages.deleteStateButtonLabel,
|
|
96
|
+
action: handleDeleteHistory,
|
|
97
|
+
},
|
|
98
|
+
overrideScore: {
|
|
99
|
+
message: messages.overrideScoreConfirmation,
|
|
100
|
+
confirmButtonLabel: messages.rescore,
|
|
101
|
+
action: handleOverrideScore,
|
|
102
|
+
},
|
|
103
|
+
rescore: {
|
|
104
|
+
message: messages.rescoreConfirmation,
|
|
105
|
+
confirmButtonLabel: messages.rescore,
|
|
106
|
+
action: () => handleRescoreSubmission(),
|
|
107
|
+
},
|
|
108
|
+
rescoreIfImproves: {
|
|
109
|
+
message: messages.rescoreConfirmation,
|
|
110
|
+
confirmButtonLabel: messages.rescore,
|
|
111
|
+
action: () => handleRescoreSubmission(true),
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
const openConfirmationModal = (type) => {
|
|
115
|
+
const { message, confirmButtonLabel, action } = confirmationInfo[type];
|
|
116
|
+
setConfirmationModalData({ message: intl.formatMessage(message, { student: usernameOrEmail || intl.formatMessage(messages.allLearners), blockId }), confirmButtonLabel: intl.formatMessage(confirmButtonLabel), action });
|
|
117
|
+
};
|
|
44
118
|
const handleTaskStatusClick = () => {
|
|
45
119
|
refetchTasks();
|
|
46
120
|
onShowTasks();
|
|
@@ -50,6 +124,7 @@ const GradingLearnerContent = ({ toolType, onShowTasks }) => {
|
|
|
50
124
|
setUsernameOrEmail('');
|
|
51
125
|
setBlockId('');
|
|
52
126
|
setScore('');
|
|
127
|
+
setShowCurrentStatus(false);
|
|
53
128
|
(_a = learnerFieldRef.current) === null || _a === void 0 ? void 0 : _a.reset();
|
|
54
129
|
(_b = problemFieldRef.current) === null || _b === void 0 ? void 0 : _b.reset();
|
|
55
130
|
}, [toolType]);
|
|
@@ -57,23 +132,23 @@ const GradingLearnerContent = ({ toolType, onShowTasks }) => {
|
|
|
57
132
|
{
|
|
58
133
|
title: intl.formatMessage(messages.resetAttempts),
|
|
59
134
|
description: intl.formatMessage(messages.resetAttemptsDescription),
|
|
60
|
-
customAction: (_jsx(Button, { disabled: !usernameOrEmail || !blockId, onClick:
|
|
135
|
+
customAction: (_jsx(Button, { disabled: !usernameOrEmail || !blockId, onClick: () => openConfirmationModal('resetAttempts'), children: intl.formatMessage(messages.resetAttemptsButtonLabel) }))
|
|
61
136
|
},
|
|
62
137
|
{
|
|
63
138
|
title: intl.formatMessage(messages.rescoreSubmission),
|
|
64
139
|
description: intl.formatMessage(messages.rescoreSubmissionDescription),
|
|
65
|
-
customAction: (_jsxs("div", { className: "d-flex flex-column gap-3", children: [_jsx(Button, { disabled: !usernameOrEmail || !blockId, onClick: () =>
|
|
140
|
+
customAction: (_jsxs("div", { className: "d-flex flex-column gap-3", children: [_jsx(Button, { disabled: !usernameOrEmail || !blockId, onClick: () => openConfirmationModal('rescore'), children: intl.formatMessage(messages.rescoreSubmissionButtonLabel) }), _jsx(Button, { disabled: !usernameOrEmail || !blockId, onClick: () => openConfirmationModal('rescoreIfImproves'), children: intl.formatMessage(messages.rescoreIfImprovesScoreButtonLabel) })] })),
|
|
66
141
|
},
|
|
67
142
|
{
|
|
68
143
|
title: intl.formatMessage(messages.overrideScore),
|
|
69
144
|
description: intl.formatMessage(messages.overrideScoreDescription),
|
|
70
145
|
buttonLabel: intl.formatMessage(messages.overrideScoreButtonLabel),
|
|
71
|
-
customAction: (_jsxs("div", { className: "d-flex align-items-center gap-2", children: [_jsx(FormControl, { name: intl.formatMessage(messages.overrideScorePlaceholder), type: "number", placeholder: intl.formatMessage(messages.overrideScorePlaceholder), value: score, onChange: handleScoreChange }), _jsx(Button, { disabled: !usernameOrEmail || !blockId || !score, onClick:
|
|
146
|
+
customAction: (_jsxs("div", { className: "d-flex align-items-center gap-2", children: [_jsx(FormControl, { name: intl.formatMessage(messages.overrideScorePlaceholder), type: "number", placeholder: intl.formatMessage(messages.overrideScorePlaceholder), value: score, onChange: handleScoreChange }), _jsx(Button, { disabled: !usernameOrEmail || !blockId || !score, onClick: () => openConfirmationModal('overrideScore'), children: intl.formatMessage(messages.overrideScoreButtonLabel) })] }))
|
|
72
147
|
},
|
|
73
148
|
{
|
|
74
149
|
title: intl.formatMessage(messages.deleteHistory),
|
|
75
150
|
description: intl.formatMessage(messages.deleteHistoryDescription),
|
|
76
|
-
customAction: (_jsx("div", { className: "d-flex flex-column gap-3", children: _jsx(Button, { disabled: !usernameOrEmail || !blockId, onClick:
|
|
151
|
+
customAction: (_jsx("div", { className: "d-flex flex-column gap-3", children: _jsx(Button, { disabled: !usernameOrEmail || !blockId, onClick: () => openConfirmationModal('deleteState'), children: intl.formatMessage(messages.deleteHistoryButtonLabel) }) })),
|
|
77
152
|
},
|
|
78
153
|
{
|
|
79
154
|
title: intl.formatMessage(messages.taskStatus),
|
|
@@ -86,12 +161,12 @@ const GradingLearnerContent = ({ toolType, onShowTasks }) => {
|
|
|
86
161
|
title: intl.formatMessage(messages.resetAttempts),
|
|
87
162
|
description: intl.formatMessage(messages.resetAllLearnersAttemptsDescription),
|
|
88
163
|
buttonLabel: intl.formatMessage(messages.resetAttemptsButtonLabel),
|
|
89
|
-
customAction: (_jsx(Button, { disabled: !blockId, onClick:
|
|
164
|
+
customAction: (_jsx(Button, { disabled: !blockId, onClick: () => openConfirmationModal('resetAttempts'), children: intl.formatMessage(messages.resetAttemptsButtonLabel) }))
|
|
90
165
|
},
|
|
91
166
|
{
|
|
92
167
|
title: intl.formatMessage(messages.rescoreSubmission),
|
|
93
168
|
description: intl.formatMessage(messages.rescoreSubmissionAllLearnersDescription),
|
|
94
|
-
customAction: (_jsxs("div", { className: "d-flex flex-column gap-3", children: [_jsx(Button, { disabled: !blockId, onClick: () =>
|
|
169
|
+
customAction: (_jsxs("div", { className: "d-flex flex-column gap-3", children: [_jsx(Button, { disabled: !blockId, onClick: () => openConfirmationModal('rescore'), children: intl.formatMessage(messages.rescoreAllSubmissionButtonLabel) }), _jsx(Button, { disabled: !blockId, onClick: () => openConfirmationModal('rescoreIfImproves'), children: intl.formatMessage(messages.rescoreIfImprovesScoreButtonLabel) })] })),
|
|
95
170
|
},
|
|
96
171
|
{
|
|
97
172
|
title: intl.formatMessage(messages.taskStatus),
|
|
@@ -102,6 +177,9 @@ const GradingLearnerContent = ({ toolType, onShowTasks }) => {
|
|
|
102
177
|
const rows = toolType === 'single' ? singleLearnerActionRows : allLearnersActionRows;
|
|
103
178
|
const handleProblemChange = (location) => {
|
|
104
179
|
setBlockId(location);
|
|
180
|
+
if (usernameOrEmail && location) {
|
|
181
|
+
setShowCurrentStatus(true);
|
|
182
|
+
}
|
|
105
183
|
};
|
|
106
184
|
const handleLearnerChange = (usernameOrEmail) => {
|
|
107
185
|
var _a;
|
|
@@ -109,10 +187,13 @@ const GradingLearnerContent = ({ toolType, onShowTasks }) => {
|
|
|
109
187
|
// Reset problem field when learner changes due to progress and attempts change for every learner
|
|
110
188
|
setBlockId('');
|
|
111
189
|
(_a = problemFieldRef.current) === null || _a === void 0 ? void 0 : _a.reset();
|
|
190
|
+
if (showCurrentStatus) {
|
|
191
|
+
setShowCurrentStatus(false);
|
|
192
|
+
}
|
|
112
193
|
};
|
|
113
194
|
return (_jsxs(_Fragment, { children: [_jsx("p", { className: "x-small text-primary mt-3", children: toolType === 'single'
|
|
114
195
|
? intl.formatMessage(messages.descriptionSingleLearner)
|
|
115
|
-
: intl.formatMessage(messages.descriptionAllLearners) }), _jsxs("div", { className: "d-flex justify-content-between gap-4", children: [toolType === 'single' && (_jsx("div", { className: "w-50", children: _jsx(SpecifyLearnerField, { ref: learnerFieldRef, onClickSelect: handleLearnerChange }) })), _jsx("div", { className: "w-50", children: _jsx(SpecifyProblemField, { ref: problemFieldRef, fieldLabel: intl.formatMessage(messages.specifyProblem), buttonLabel: intl.formatMessage(messages.select), disabled: !usernameOrEmail && toolType === 'single', usernameOrEmail: usernameOrEmail, onClickSelect: handleProblemChange }) })] }), rows.map(({ title, description, buttonLabel, customAction, onButtonClick }, index) => (_jsx(ActionCard, { buttonLabel: buttonLabel, description: description, title: title, hasBorderBottom: index !== rows.length - 1, customAction: customAction, onButtonClick: onButtonClick }, title)))] }));
|
|
196
|
+
: intl.formatMessage(messages.descriptionAllLearners) }), _jsxs("div", { className: "d-flex justify-content-between gap-4", children: [toolType === 'single' && (_jsx("div", { className: "w-50", children: _jsx(SpecifyLearnerField, { ref: learnerFieldRef, onClickSelect: handleLearnerChange }) })), _jsx("div", { className: "w-50", children: _jsx(SpecifyProblemField, { ref: problemFieldRef, fieldLabel: intl.formatMessage(messages.specifyProblem), buttonLabel: intl.formatMessage(messages.select), disabled: !usernameOrEmail && toolType === 'single', usernameOrEmail: usernameOrEmail, onClickSelect: handleProblemChange }) })] }), showCurrentStatus && learnerData.username && !isProblemDataError && (_jsxs(_Fragment, { children: [_jsx("p", { className: "text-primary-500 x-small mb-0 mt-3", children: intl.formatMessage(messages.currentScore) }), _jsxs(Stack, { direction: "horizontal", gap: 2, className: "align-items-center justify-content-between mr-3.5", children: [_jsxs(Stack, { direction: "horizontal", gap: 5, className: "align-items-end", children: [_jsx("p", { className: "text-primary-500 mb-0", children: learnerData.username }), _jsxs(Stack, { className: "align-items-center", children: [_jsx("p", { className: "x-small mb-0 text-gray-500", children: intl.formatMessage(messages.score) }), _jsxs("p", { className: "lead m-0 text-primary-700", children: [((_a = problemData.currentScore) === null || _a === void 0 ? void 0 : _a.score) || 0, " ", ((_b = problemData.currentScore) === null || _b === void 0 ? void 0 : _b.total) && `/ ${problemData.currentScore.total}`] })] }), _jsxs(Stack, { className: "align-items-center", children: [_jsx("p", { className: "x-small mb-0 text-gray-500", children: intl.formatMessage(messages.attempts) }), _jsxs("p", { className: "lead m-0 text-primary-700", children: [((_c = problemData.attempts) === null || _c === void 0 ? void 0 : _c.current) || 0, " ", ((_d = problemData.attempts) === null || _d === void 0 ? void 0 : _d.total) && `/ ${problemData.attempts.total}`] })] })] }), _jsx(Button, { as: "a", href: learnerData.progressUrl, className: "bg-white", variant: "outline-primary", children: intl.formatMessage(messages.viewProgress) })] })] })), rows.map(({ title, description, buttonLabel, customAction, onButtonClick }, index) => (_jsx(ActionCard, { buttonLabel: buttonLabel, description: description, title: title, hasBorderBottom: index !== rows.length - 1, customAction: customAction, onButtonClick: onButtonClick }, title))), confirmationModalData.message !== '' && (_jsxs(ModalDialog, { title: confirmationModalData.confirmButtonLabel, isOpen: confirmationModalData.message !== '', onClose: () => setConfirmationModalData({ message: '', confirmButtonLabel: '', action: undefined }), isOverflowVisible: false, hasCloseButton: false, children: [_jsx(ModalDialog.Body, { className: "pt-4", children: _jsx("p", { className: "text-break", children: confirmationModalData.message }) }), _jsxs(ModalDialog.Footer, { children: [_jsx(Button, { variant: "tertiary", onClick: () => setConfirmationModalData({ message: '', confirmButtonLabel: '', action: undefined }), children: intl.formatMessage(messages.close) }), _jsx(Button, { className: "ml-2", onClick: confirmationModalData.action, children: confirmationModalData.confirmButtonLabel })] })] }))] }));
|
|
116
197
|
};
|
|
117
198
|
export default GradingLearnerContent;
|
|
118
199
|
//# sourceMappingURL=GradingLearnerContent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GradingLearnerContent.js","sourceRoot":"","sources":["../../../src/grading/components/GradingLearnerContent.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,UAA+B,MAAM,4BAA4B,CAAC;AACzE,OAAO,mBAAmB,MAAM,qCAAqC,CAAC;AACtE,OAAO,mBAAmB,MAAM,qCAAqC,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AACrH,OAAO,QAAQ,MAAM,uBAAuB,CAAC;AAE7C,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GAAG,CAAC,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,IAA7K,KAAK,CAA4K,CACnM,CAAC,IAEH,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,qBAAqB,CAAC","sourcesContent":["import { useParams } from 'react-router-dom';\nimport { useEffect, useState, useRef } from 'react';\nimport { useIntl } from '@openedx/frontend-base';\nimport { Button, FormControl } from '@openedx/paragon';\nimport ActionCard, { ActionCardProps } from '@src/components/ActionCard';\nimport SpecifyLearnerField from '@src/components/SpecifyLearnerField';\nimport SpecifyProblemField from '@src/components/SpecifyProblemField';\nimport { useChangeScore, useDeleteHistory, useRescoreSubmission, useResetAttempts } from '@src/grading/data/apiHook';\nimport messages from '@src/grading/messages';\nimport { GradingToolsType } from '@src/grading/types';\nimport { usePendingTasks } from '@src/data/apiHook';\n\ninterface GradingLearnerContentProps {\n toolType: GradingToolsType,\n onShowTasks: () => void,\n}\n\nconst GradingLearnerContent = ({ toolType, onShowTasks }: GradingLearnerContentProps) => {\n const intl = useIntl();\n const { courseId = '' } = useParams<{ courseId: string }>();\n const [usernameOrEmail, setUsernameOrEmail] = useState('');\n const [blockId, setBlockId] = useState('');\n const [score, setScore] = useState('');\n const learnerFieldRef = useRef<{ reset: () => void }>(null);\n const problemFieldRef = useRef<{ reset: () => void }>(null);\n\n const { mutate: resetAttempts } = useResetAttempts(courseId);\n const { mutate: deleteHistory } = useDeleteHistory(courseId);\n const { mutate: changeScore } = useChangeScore(courseId);\n const { mutate: rescoreSubmission } = useRescoreSubmission(courseId);\n const { refetch: refetchTasks } = usePendingTasks(courseId);\n\n const handleResetAttempts = (): void => {\n resetAttempts({ learner: usernameOrEmail, problem: blockId });\n };\n\n const handleRescoreSubmission = (onlyIfHigher = false): void => {\n rescoreSubmission({ learner: usernameOrEmail, problem: blockId, onlyIfHigher });\n };\n\n const handleDeleteHistory = (): void => {\n deleteHistory({ learner: usernameOrEmail, problem: blockId });\n };\n\n const handleOverrideScore = (): void => {\n changeScore({ learner: usernameOrEmail, problem: blockId, newScore: Number(score) });\n };\n\n const handleScoreChange = (e: React.ChangeEvent<HTMLInputElement>): void => {\n const value = e.target.value;\n const numericRegex = /^-?\\d*\\.?\\d*$/;\n\n if (numericRegex.test(value) || value === '') {\n setScore(value);\n }\n };\n\n const handleTaskStatusClick = (): void => {\n refetchTasks();\n onShowTasks();\n };\n\n useEffect(() => {\n setUsernameOrEmail('');\n setBlockId('');\n setScore('');\n learnerFieldRef.current?.reset();\n problemFieldRef.current?.reset();\n }, [toolType]);\n\n const singleLearnerActionRows: ActionCardProps[] = [\n {\n title: intl.formatMessage(messages.resetAttempts),\n description: intl.formatMessage(messages.resetAttemptsDescription),\n customAction: (\n <Button disabled={!usernameOrEmail || !blockId} onClick={handleResetAttempts}>\n {intl.formatMessage(messages.resetAttemptsButtonLabel)}\n </Button>\n )\n },\n {\n title: intl.formatMessage(messages.rescoreSubmission),\n description: intl.formatMessage(messages.rescoreSubmissionDescription),\n customAction: (\n <div className=\"d-flex flex-column gap-3\">\n <Button disabled={!usernameOrEmail || !blockId} onClick={() => handleRescoreSubmission()}>{intl.formatMessage(messages.rescoreSubmissionButtonLabel)}</Button>\n <Button disabled={!usernameOrEmail || !blockId} onClick={() => handleRescoreSubmission(true)}>{intl.formatMessage(messages.rescoreIfImprovesScoreButtonLabel)}</Button>\n </div>\n ),\n },\n {\n title: intl.formatMessage(messages.overrideScore),\n description: intl.formatMessage(messages.overrideScoreDescription),\n buttonLabel: intl.formatMessage(messages.overrideScoreButtonLabel),\n customAction: (\n <div className=\"d-flex align-items-center gap-2\">\n <FormControl\n name={intl.formatMessage(messages.overrideScorePlaceholder)}\n type=\"number\"\n placeholder={intl.formatMessage(messages.overrideScorePlaceholder)}\n value={score}\n onChange={handleScoreChange}\n />\n <Button disabled={!usernameOrEmail || !blockId || !score} onClick={handleOverrideScore}>{intl.formatMessage(messages.overrideScoreButtonLabel)}</Button>\n </div>\n )\n },\n {\n title: intl.formatMessage(messages.deleteHistory),\n description: intl.formatMessage(messages.deleteHistoryDescription),\n customAction: (\n <div className=\"d-flex flex-column gap-3\">\n <Button disabled={!usernameOrEmail || !blockId} onClick={handleDeleteHistory}>{intl.formatMessage(messages.deleteHistoryButtonLabel)}</Button>\n </div>\n ),\n },\n {\n title: intl.formatMessage(messages.taskStatus),\n description: intl.formatMessage(messages.taskStatusDescription),\n customAction: (\n <Button disabled={!usernameOrEmail || !blockId} onClick={handleTaskStatusClick}>\n {intl.formatMessage(messages.taskStatusButtonLabel)}\n </Button>\n )\n }\n ];\n\n const allLearnersActionRows = [\n {\n title: intl.formatMessage(messages.resetAttempts),\n description: intl.formatMessage(messages.resetAllLearnersAttemptsDescription),\n buttonLabel: intl.formatMessage(messages.resetAttemptsButtonLabel),\n customAction: (\n <Button disabled={!blockId} onClick={handleResetAttempts}>\n {intl.formatMessage(messages.resetAttemptsButtonLabel)}\n </Button>\n )\n },\n {\n title: intl.formatMessage(messages.rescoreSubmission),\n description: intl.formatMessage(messages.rescoreSubmissionAllLearnersDescription),\n customAction: (\n <div className=\"d-flex flex-column gap-3\">\n <Button disabled={!blockId} onClick={() => handleRescoreSubmission()}>{intl.formatMessage(messages.rescoreAllSubmissionButtonLabel)}</Button>\n <Button disabled={!blockId} onClick={() => handleRescoreSubmission(true)}>{intl.formatMessage(messages.rescoreIfImprovesScoreButtonLabel)}</Button>\n </div>\n ),\n },\n {\n title: intl.formatMessage(messages.taskStatus),\n description: intl.formatMessage(messages.taskStatusDescription),\n customAction: (\n <Button onClick={handleTaskStatusClick}>\n {intl.formatMessage(messages.taskStatusButtonLabel)}\n </Button>\n )\n }\n ];\n\n const rows = toolType === 'single' ? singleLearnerActionRows : allLearnersActionRows;\n\n const handleProblemChange = (location: string): void => {\n setBlockId(location);\n };\n\n const handleLearnerChange = (usernameOrEmail: string): void => {\n setUsernameOrEmail(usernameOrEmail);\n // Reset problem field when learner changes due to progress and attempts change for every learner\n setBlockId('');\n problemFieldRef.current?.reset();\n };\n\n return (\n <>\n <p className=\"x-small text-primary mt-3\">\n {\n toolType === 'single'\n ? intl.formatMessage(messages.descriptionSingleLearner)\n : intl.formatMessage(messages.descriptionAllLearners)\n }\n </p>\n <div className=\"d-flex justify-content-between gap-4\">\n {toolType === 'single' && (\n <div className=\"w-50\">\n <SpecifyLearnerField ref={learnerFieldRef} onClickSelect={handleLearnerChange} />\n </div>\n )}\n <div className=\"w-50\">\n <SpecifyProblemField\n ref={problemFieldRef}\n fieldLabel={intl.formatMessage(messages.specifyProblem)}\n buttonLabel={intl.formatMessage(messages.select)}\n disabled={!usernameOrEmail && toolType === 'single'}\n usernameOrEmail={usernameOrEmail}\n onClickSelect={handleProblemChange}\n />\n </div>\n </div>\n {\n rows.map(({ title, description, buttonLabel, customAction, onButtonClick }, index) => (\n <ActionCard key={title} buttonLabel={buttonLabel} description={description} title={title} hasBorderBottom={index !== rows.length - 1} customAction={customAction} onButtonClick={onButtonClick} />\n ))\n }\n </>\n );\n};\n\nexport default GradingLearnerContent;\n"]}
|
|
1
|
+
{"version":3,"file":"GradingLearnerContent.js","sourceRoot":"","sources":["../../../src/grading/components/GradingLearnerContent.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC3E,OAAO,UAA+B,MAAM,4BAA4B,CAAC;AACzE,OAAO,mBAAmB,MAAM,qCAAqC,CAAC;AACtE,OAAO,mBAAmB,MAAM,qCAAqC,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,gBAAgB,EA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AAO,GAAK,GAC5C,EACnB,MAAC,WAAW,CAAC,MAAM,eACjB,KAAC,MAAM,IAAC,OAAO,EAAC,UAAU,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,wBAAwB,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,kBAAkB,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,YAAG,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAU,EAC7K,KAAC,MAAM,IAAC,SAAS,EAAC,MAAM,EAAC,OAAO,EAAE,qBAAqB,CAAC,MAAM,YAAG,qBAAqB,CAAC,kBAAkB,GAAU,IAChG,IACT,CACf,IAEF,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,qBAAqB,CAAC","sourcesContent":["import { useParams } from 'react-router-dom';\nimport { useEffect, useState, useRef } from 'react';\nimport { isAxiosError } from 'axios';\nimport { useIntl } from '@openedx/frontend-base';\nimport { Button, FormControl, ModalDialog, Stack } from '@openedx/paragon';\nimport ActionCard, { ActionCardProps } from '@src/components/ActionCard';\nimport SpecifyLearnerField from '@src/components/SpecifyLearnerField';\nimport SpecifyProblemField from '@src/components/SpecifyProblemField';\nimport { useChangeScore, useDeleteHistory, useRescoreSubmission, useResetAttempts } from '@src/grading/data/apiHook';\nimport messages from '@src/grading/messages';\nimport { GradingToolsType } from '@src/grading/types';\nimport { useLearner, usePendingTasks, useProblemDetails } from '@src/data/apiHook';\nimport { useAlert } from '@src/providers/AlertProvider';\n\ninterface GradingLearnerContentProps {\n toolType: GradingToolsType,\n onShowTasks: () => void,\n}\n\nconst GradingLearnerContent = ({ toolType, onShowTasks }: GradingLearnerContentProps) => {\n const intl = useIntl();\n const { courseId = '' } = useParams<{ courseId: string }>();\n const [usernameOrEmail, setUsernameOrEmail] = useState('');\n const [blockId, setBlockId] = useState('');\n const [score, setScore] = useState('');\n const learnerFieldRef = useRef<{ reset: () => void }>(null);\n const problemFieldRef = useRef<{ reset: () => void }>(null);\n const [showCurrentStatus, setShowCurrentStatus] = useState(false);\n const [confirmationModalData, setConfirmationModalData] = useState<{ message: string, confirmButtonLabel: string, action?: () => void }>({ message: '', confirmButtonLabel: '', action: undefined });\n const { data: problemData = { currentScore: { score: 0, total: null }, attempts: { current: null, total: 0 } }, isError: isProblemDataError } = useProblemDetails(courseId, blockId, usernameOrEmail);\n const { data: learnerData = { username: '', progressUrl: '' } } = useLearner(courseId, usernameOrEmail);\n const { showModal, showToast } = useAlert();\n\n const { mutate: resetAttempts } = useResetAttempts(courseId);\n const { mutate: deleteHistory } = useDeleteHistory(courseId);\n const { mutate: changeScore } = useChangeScore(courseId);\n const { mutate: rescoreSubmission } = useRescoreSubmission(courseId);\n const { refetch: refetchTasks } = usePendingTasks(courseId);\n\n const resetConfirmationModalData = () => setConfirmationModalData({ message: '', confirmButtonLabel: '', action: undefined });\n\n const manageOnError = (error: Error) => {\n resetConfirmationModalData();\n const errorMessage = isAxiosError(error) && error.response?.data?.error ? error.response.data.error : intl.formatMessage(messages.unexpectedError);\n showModal({\n message: errorMessage,\n variant: 'danger',\n confirmText: intl.formatMessage(messages.close),\n });\n };\n\n const handleResetAttempts = (): void => {\n resetAttempts({ learner: usernameOrEmail, problem: blockId }, {\n onSuccess: () => {\n resetConfirmationModalData();\n showToast(intl.formatMessage(messages.resetAttemptsSuccess, { student: usernameOrEmail || intl.formatMessage(messages.allLearners), blockId }));\n },\n onError: manageOnError\n });\n };\n\n const handleRescoreSubmission = (onlyIfHigher = false): void => {\n rescoreSubmission({ learner: usernameOrEmail, problem: blockId, onlyIfHigher }, {\n onSuccess: () => {\n resetConfirmationModalData();\n showToast(intl.formatMessage(messages.rescoreSubmissionSuccess, { student: usernameOrEmail || intl.formatMessage(messages.allLearners), blockId }));\n },\n onError: manageOnError\n });\n };\n\n const handleDeleteHistory = (): void => {\n deleteHistory({ learner: usernameOrEmail, problem: blockId }, {\n onSuccess: () => {\n resetConfirmationModalData();\n showToast(intl.formatMessage(messages.deleteHistorySuccess, { student: usernameOrEmail || intl.formatMessage(messages.allLearners), blockId }));\n },\n onError: manageOnError\n });\n };\n\n const handleOverrideScore = (): void => {\n changeScore({ learner: usernameOrEmail, problem: blockId, newScore: Number(score) }, {\n onSuccess: () => {\n resetConfirmationModalData();\n showToast(intl.formatMessage(messages.overrideScoreSuccess, { student: usernameOrEmail || intl.formatMessage(messages.allLearners), blockId }));\n },\n onError: manageOnError\n });\n };\n\n const handleScoreChange = (e: React.ChangeEvent<HTMLInputElement>): void => {\n const value = e.target.value;\n const numericRegex = /^-?\\d*\\.?\\d*$/;\n\n if (numericRegex.test(value) || value === '') {\n setScore(value);\n }\n };\n\n const confirmationInfo = {\n resetAttempts: {\n message: messages.resetAttemptsConfirmation,\n confirmButtonLabel: messages.resetAttempts,\n action: handleResetAttempts,\n },\n deleteState: {\n message: messages.deleteStateConfirmation,\n confirmButtonLabel: messages.deleteStateButtonLabel,\n action: handleDeleteHistory,\n },\n overrideScore: {\n message: messages.overrideScoreConfirmation,\n confirmButtonLabel: messages.rescore,\n action: handleOverrideScore,\n },\n rescore: {\n message: messages.rescoreConfirmation,\n confirmButtonLabel: messages.rescore,\n action: () => handleRescoreSubmission(),\n },\n rescoreIfImproves: {\n message: messages.rescoreConfirmation,\n confirmButtonLabel: messages.rescore,\n action: () => handleRescoreSubmission(true),\n }\n };\n\n const openConfirmationModal = (type: keyof typeof confirmationInfo): void => {\n const { message, confirmButtonLabel, action } = confirmationInfo[type];\n setConfirmationModalData({ message: intl.formatMessage(message, { student: usernameOrEmail || intl.formatMessage(messages.allLearners), blockId }), confirmButtonLabel: intl.formatMessage(confirmButtonLabel), action });\n };\n\n const handleTaskStatusClick = (): void => {\n refetchTasks();\n onShowTasks();\n };\n\n useEffect(() => {\n setUsernameOrEmail('');\n setBlockId('');\n setScore('');\n setShowCurrentStatus(false);\n learnerFieldRef.current?.reset();\n problemFieldRef.current?.reset();\n }, [toolType]);\n\n const singleLearnerActionRows: ActionCardProps[] = [\n {\n title: intl.formatMessage(messages.resetAttempts),\n description: intl.formatMessage(messages.resetAttemptsDescription),\n customAction: (\n <Button disabled={!usernameOrEmail || !blockId} onClick={() => openConfirmationModal('resetAttempts')}>\n {intl.formatMessage(messages.resetAttemptsButtonLabel)}\n </Button>\n )\n },\n {\n title: intl.formatMessage(messages.rescoreSubmission),\n description: intl.formatMessage(messages.rescoreSubmissionDescription),\n customAction: (\n <div className=\"d-flex flex-column gap-3\">\n <Button disabled={!usernameOrEmail || !blockId} onClick={() => openConfirmationModal('rescore')}>\n {intl.formatMessage(messages.rescoreSubmissionButtonLabel)}\n </Button>\n <Button disabled={!usernameOrEmail || !blockId} onClick={() => openConfirmationModal('rescoreIfImproves')}>\n {intl.formatMessage(messages.rescoreIfImprovesScoreButtonLabel)}\n </Button>\n </div>\n ),\n },\n {\n title: intl.formatMessage(messages.overrideScore),\n description: intl.formatMessage(messages.overrideScoreDescription),\n buttonLabel: intl.formatMessage(messages.overrideScoreButtonLabel),\n customAction: (\n <div className=\"d-flex align-items-center gap-2\">\n <FormControl\n name={intl.formatMessage(messages.overrideScorePlaceholder)}\n type=\"number\"\n placeholder={intl.formatMessage(messages.overrideScorePlaceholder)}\n value={score}\n onChange={handleScoreChange}\n />\n <Button disabled={!usernameOrEmail || !blockId || !score} onClick={() => openConfirmationModal('overrideScore')}>{intl.formatMessage(messages.overrideScoreButtonLabel)}</Button>\n </div>\n )\n },\n {\n title: intl.formatMessage(messages.deleteHistory),\n description: intl.formatMessage(messages.deleteHistoryDescription),\n customAction: (\n <div className=\"d-flex flex-column gap-3\">\n <Button disabled={!usernameOrEmail || !blockId} onClick={() => openConfirmationModal('deleteState')}>{intl.formatMessage(messages.deleteHistoryButtonLabel)}</Button>\n </div>\n ),\n },\n {\n title: intl.formatMessage(messages.taskStatus),\n description: intl.formatMessage(messages.taskStatusDescription),\n customAction: (\n <Button disabled={!usernameOrEmail || !blockId} onClick={handleTaskStatusClick}>\n {intl.formatMessage(messages.taskStatusButtonLabel)}\n </Button>\n )\n }\n ];\n\n const allLearnersActionRows = [\n {\n title: intl.formatMessage(messages.resetAttempts),\n description: intl.formatMessage(messages.resetAllLearnersAttemptsDescription),\n buttonLabel: intl.formatMessage(messages.resetAttemptsButtonLabel),\n customAction: (\n <Button disabled={!blockId} onClick={() => openConfirmationModal('resetAttempts')}>\n {intl.formatMessage(messages.resetAttemptsButtonLabel)}\n </Button>\n )\n },\n {\n title: intl.formatMessage(messages.rescoreSubmission),\n description: intl.formatMessage(messages.rescoreSubmissionAllLearnersDescription),\n customAction: (\n <div className=\"d-flex flex-column gap-3\">\n <Button disabled={!blockId} onClick={() => openConfirmationModal('rescore')}>{intl.formatMessage(messages.rescoreAllSubmissionButtonLabel)}</Button>\n <Button disabled={!blockId} onClick={() => openConfirmationModal('rescoreIfImproves')}>{intl.formatMessage(messages.rescoreIfImprovesScoreButtonLabel)}</Button>\n </div>\n ),\n },\n {\n title: intl.formatMessage(messages.taskStatus),\n description: intl.formatMessage(messages.taskStatusDescription),\n customAction: (\n <Button onClick={handleTaskStatusClick}>\n {intl.formatMessage(messages.taskStatusButtonLabel)}\n </Button>\n )\n }\n ];\n\n const rows = toolType === 'single' ? singleLearnerActionRows : allLearnersActionRows;\n\n const handleProblemChange = (location: string): void => {\n setBlockId(location);\n if (usernameOrEmail && location) {\n setShowCurrentStatus(true);\n }\n };\n\n const handleLearnerChange = (usernameOrEmail: string): void => {\n setUsernameOrEmail(usernameOrEmail);\n // Reset problem field when learner changes due to progress and attempts change for every learner\n setBlockId('');\n problemFieldRef.current?.reset();\n if (showCurrentStatus) {\n setShowCurrentStatus(false);\n }\n };\n\n return (\n <>\n <p className=\"x-small text-primary mt-3\">\n {\n toolType === 'single'\n ? intl.formatMessage(messages.descriptionSingleLearner)\n : intl.formatMessage(messages.descriptionAllLearners)\n }\n </p>\n <div className=\"d-flex justify-content-between gap-4\">\n {toolType === 'single' && (\n <div className=\"w-50\">\n <SpecifyLearnerField ref={learnerFieldRef} onClickSelect={handleLearnerChange} />\n </div>\n )}\n <div className=\"w-50\">\n <SpecifyProblemField\n ref={problemFieldRef}\n fieldLabel={intl.formatMessage(messages.specifyProblem)}\n buttonLabel={intl.formatMessage(messages.select)}\n disabled={!usernameOrEmail && toolType === 'single'}\n usernameOrEmail={usernameOrEmail}\n onClickSelect={handleProblemChange}\n />\n </div>\n </div>\n {\n showCurrentStatus && learnerData.username && !isProblemDataError && (\n <>\n <p className=\"text-primary-500 x-small mb-0 mt-3\">{intl.formatMessage(messages.currentScore)}</p>\n <Stack direction=\"horizontal\" gap={2} className=\"align-items-center justify-content-between mr-3.5\">\n <Stack direction=\"horizontal\" gap={5} className=\"align-items-end\">\n <p className=\"text-primary-500 mb-0\">{learnerData.username}</p>\n <Stack className=\"align-items-center\">\n <p className=\"x-small mb-0 text-gray-500\">{intl.formatMessage(messages.score)}</p>\n <p className=\"lead m-0 text-primary-700\">{problemData.currentScore?.score || 0} {problemData.currentScore?.total && `/ ${problemData.currentScore.total}`}</p>\n </Stack>\n <Stack className=\"align-items-center\">\n <p className=\"x-small mb-0 text-gray-500\">{intl.formatMessage(messages.attempts)}</p>\n <p className=\"lead m-0 text-primary-700\">{problemData.attempts?.current || 0} {problemData.attempts?.total && `/ ${problemData.attempts.total}`}</p>\n </Stack>\n </Stack>\n <Button as=\"a\" href={learnerData.progressUrl} className=\"bg-white\" variant=\"outline-primary\">{intl.formatMessage(messages.viewProgress)}</Button>\n </Stack>\n </>\n )\n }\n {\n rows.map(({ title, description, buttonLabel, customAction, onButtonClick }, index) => (\n <ActionCard key={title} buttonLabel={buttonLabel} description={description} title={title} hasBorderBottom={index !== rows.length - 1} customAction={customAction} onButtonClick={onButtonClick} />\n ))\n }\n {\n confirmationModalData.message !== '' && (\n <ModalDialog\n title={confirmationModalData.confirmButtonLabel}\n isOpen={confirmationModalData.message !== ''}\n onClose={() => setConfirmationModalData({ message: '', confirmButtonLabel: '', action: undefined })}\n isOverflowVisible={false}\n hasCloseButton={false}\n >\n <ModalDialog.Body className=\"pt-4\">\n <p className=\"text-break\">{confirmationModalData.message}</p>\n </ModalDialog.Body>\n <ModalDialog.Footer>\n <Button variant=\"tertiary\" onClick={() => setConfirmationModalData({ message: '', confirmButtonLabel: '', action: undefined })}>{intl.formatMessage(messages.close)}</Button>\n <Button className=\"ml-2\" onClick={confirmationModalData.action}>{confirmationModalData.confirmButtonLabel}</Button>\n </ModalDialog.Footer>\n </ModalDialog>\n )\n }\n </>\n );\n};\n\nexport default GradingLearnerContent;\n"]}
|
|
@@ -169,5 +169,80 @@ declare const messages: {
|
|
|
169
169
|
defaultMessage: string;
|
|
170
170
|
description: string;
|
|
171
171
|
};
|
|
172
|
+
currentScore: {
|
|
173
|
+
id: string;
|
|
174
|
+
defaultMessage: string;
|
|
175
|
+
description: string;
|
|
176
|
+
};
|
|
177
|
+
viewProgress: {
|
|
178
|
+
id: string;
|
|
179
|
+
defaultMessage: string;
|
|
180
|
+
description: string;
|
|
181
|
+
};
|
|
182
|
+
score: {
|
|
183
|
+
id: string;
|
|
184
|
+
defaultMessage: string;
|
|
185
|
+
description: string;
|
|
186
|
+
};
|
|
187
|
+
attempts: {
|
|
188
|
+
id: string;
|
|
189
|
+
defaultMessage: string;
|
|
190
|
+
description: string;
|
|
191
|
+
};
|
|
192
|
+
rescore: {
|
|
193
|
+
id: string;
|
|
194
|
+
defaultMessage: string;
|
|
195
|
+
description: string;
|
|
196
|
+
};
|
|
197
|
+
resetAttemptsConfirmation: {
|
|
198
|
+
id: string;
|
|
199
|
+
defaultMessage: string;
|
|
200
|
+
description: string;
|
|
201
|
+
};
|
|
202
|
+
overrideScoreConfirmation: {
|
|
203
|
+
id: string;
|
|
204
|
+
defaultMessage: string;
|
|
205
|
+
description: string;
|
|
206
|
+
};
|
|
207
|
+
deleteStateConfirmation: {
|
|
208
|
+
id: string;
|
|
209
|
+
defaultMessage: string;
|
|
210
|
+
description: string;
|
|
211
|
+
};
|
|
212
|
+
rescoreConfirmation: {
|
|
213
|
+
id: string;
|
|
214
|
+
defaultMessage: string;
|
|
215
|
+
description: string;
|
|
216
|
+
};
|
|
217
|
+
deleteStateButtonLabel: {
|
|
218
|
+
id: string;
|
|
219
|
+
defaultMessage: string;
|
|
220
|
+
description: string;
|
|
221
|
+
};
|
|
222
|
+
resetAttemptsSuccess: {
|
|
223
|
+
id: string;
|
|
224
|
+
defaultMessage: string;
|
|
225
|
+
description: string;
|
|
226
|
+
};
|
|
227
|
+
overrideScoreSuccess: {
|
|
228
|
+
id: string;
|
|
229
|
+
defaultMessage: string;
|
|
230
|
+
description: string;
|
|
231
|
+
};
|
|
232
|
+
rescoreSubmissionSuccess: {
|
|
233
|
+
id: string;
|
|
234
|
+
defaultMessage: string;
|
|
235
|
+
description: string;
|
|
236
|
+
};
|
|
237
|
+
deleteHistorySuccess: {
|
|
238
|
+
id: string;
|
|
239
|
+
defaultMessage: string;
|
|
240
|
+
description: string;
|
|
241
|
+
};
|
|
242
|
+
unexpectedError: {
|
|
243
|
+
id: string;
|
|
244
|
+
defaultMessage: string;
|
|
245
|
+
description: string;
|
|
246
|
+
};
|
|
172
247
|
};
|
|
173
248
|
export default messages;
|
package/dist/grading/messages.js
CHANGED
|
@@ -169,6 +169,81 @@ const messages = defineMessages({
|
|
|
169
169
|
id: 'instruct.grading.rescoreAllSubmissionButtonLabel',
|
|
170
170
|
defaultMessage: 'Rescore All Learners\' Submissions',
|
|
171
171
|
description: 'Button label for the rescore submission action card in the all learners view'
|
|
172
|
+
},
|
|
173
|
+
currentScore: {
|
|
174
|
+
id: 'instruct.grading.currentScore',
|
|
175
|
+
defaultMessage: 'Current Score',
|
|
176
|
+
description: 'Label for the current score displayed in the single learner view'
|
|
177
|
+
},
|
|
178
|
+
viewProgress: {
|
|
179
|
+
id: 'instruct.grading.viewProgress',
|
|
180
|
+
defaultMessage: 'View Progress Page',
|
|
181
|
+
description: 'Label for the view progress button displayed next to the current score in the single learner view'
|
|
182
|
+
},
|
|
183
|
+
score: {
|
|
184
|
+
id: 'instruct.grading.score',
|
|
185
|
+
defaultMessage: 'Score',
|
|
186
|
+
description: 'Label for the score displayed in the current status section of the single learner view'
|
|
187
|
+
},
|
|
188
|
+
attempts: {
|
|
189
|
+
id: 'instruct.grading.attempts',
|
|
190
|
+
defaultMessage: 'Attempts',
|
|
191
|
+
description: 'Label for the attempts displayed in the current status section of the single learner view'
|
|
192
|
+
},
|
|
193
|
+
rescore: {
|
|
194
|
+
id: 'instruct.grading.rescore',
|
|
195
|
+
defaultMessage: 'Rescore',
|
|
196
|
+
description: 'Label for the rescore confirmation action'
|
|
197
|
+
},
|
|
198
|
+
resetAttemptsConfirmation: {
|
|
199
|
+
id: 'instruct.grading.resetAttemptsConfirmation',
|
|
200
|
+
defaultMessage: 'Reset attempts for {student} on problem "{blockId}"?',
|
|
201
|
+
description: 'Confirmation message for resetting attempts'
|
|
202
|
+
},
|
|
203
|
+
overrideScoreConfirmation: {
|
|
204
|
+
id: 'instruct.grading.overrideScoreConfirmation',
|
|
205
|
+
defaultMessage: 'Override score for {student} for problem "{blockId}"?',
|
|
206
|
+
description: 'Confirmation message for overriding score'
|
|
207
|
+
},
|
|
208
|
+
deleteStateConfirmation: {
|
|
209
|
+
id: 'instruct.grading.deleteStateConfirmation',
|
|
210
|
+
defaultMessage: 'Delete state for student "{student}" on problem "{blockId}"?',
|
|
211
|
+
description: 'Confirmation message for deleting state'
|
|
212
|
+
},
|
|
213
|
+
rescoreConfirmation: {
|
|
214
|
+
id: 'instruct.grading.rescoreConfirmation',
|
|
215
|
+
defaultMessage: 'Rescore problem for {student} for "{blockId}"?',
|
|
216
|
+
description: 'Confirmation message for rescoring a submission'
|
|
217
|
+
},
|
|
218
|
+
deleteStateButtonLabel: {
|
|
219
|
+
id: 'instruct.grading.deleteStateButtonLabel',
|
|
220
|
+
defaultMessage: 'Delete State',
|
|
221
|
+
description: 'Button label for the delete state confirmation action'
|
|
222
|
+
},
|
|
223
|
+
resetAttemptsSuccess: {
|
|
224
|
+
id: 'instruct.grading.resetAttemptsSuccess',
|
|
225
|
+
defaultMessage: 'Successfully reset problem attempts for {student} on problem "{blockId}".',
|
|
226
|
+
description: 'Success message for resetting attempts'
|
|
227
|
+
},
|
|
228
|
+
overrideScoreSuccess: {
|
|
229
|
+
id: 'instruct.grading.overrideScoreSuccess',
|
|
230
|
+
defaultMessage: 'Started task to override the score for {student} on problem "{blockId}". \n \n Click the \'Show Task Status\' button to see the status of the task.',
|
|
231
|
+
description: 'Success message for overriding score'
|
|
232
|
+
},
|
|
233
|
+
rescoreSubmissionSuccess: {
|
|
234
|
+
id: 'instruct.grading.rescoreSubmissionSuccess',
|
|
235
|
+
defaultMessage: 'Successfully started task to rescore problem "{blockId}" for {student}. \n \n Click the \'Show Task Status\' button to see the status of the task.',
|
|
236
|
+
description: 'Success message for rescoring submission'
|
|
237
|
+
},
|
|
238
|
+
deleteHistorySuccess: {
|
|
239
|
+
id: 'instruct.grading.deleteHistorySuccess',
|
|
240
|
+
defaultMessage: 'State for student "{student}" successfully deleted.',
|
|
241
|
+
description: 'Success message for deleting history'
|
|
242
|
+
},
|
|
243
|
+
unexpectedError: {
|
|
244
|
+
id: 'instruct.grading.unexpectedError',
|
|
245
|
+
defaultMessage: 'An unexpected error occurred. Please try again.',
|
|
246
|
+
description: 'Message to display when an unexpected error occurs'
|
|
172
247
|
}
|
|
173
248
|
});
|
|
174
249
|
export default messages;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../src/grading/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC9B,SAAS,EAAE;QACT,EAAE,EAAE,4BAA4B;QAChC,cAAc,EAAE,eAAe;QAC/B,WAAW,EAAE,4BAA4B;KAC1C;IACD,gBAAgB,EAAE;QAChB,EAAE,EAAE,mCAAmC;QACvC,cAAc,EAAE,oCAAoC;QACpD,WAAW,EAAE,4CAA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BAA6B;QACjC,cAAc,EAAE,aAAa;QAC7B,WAAW,EAAE,uCAAuC;KACrD;IACD,qBAAqB,EAAE;QACrB,EAAE,EAAE,wCAAwC;QAC5C,cAAc,EAAE,oEAAoE;QACpF,WAAW,EAAE,6CAA6C;KAC3D;IACD,qBAAqB,EAAE;QACrB,EAAE,EAAE,wCAAwC;QAC5C,cAAc,EAAE,kBAAkB;QAClC,WAAW,EAAE,8CAA8C;KAC5D;IACD,cAAc,EAAE;QACd,EAAE,EAAE,iCAAiC;QACrC,cAAc,EAAE,kBAAkB;QAClC,WAAW,EAAE,2CAA2C;KACzD;IACD,MAAM,EAAE;QACN,EAAE,EAAE,yBAAyB;QAC7B,cAAc,EAAE,QAAQ;QACxB,WAAW,EAAE,0DAA0D;KACxE;IACD,wBAAwB,EAAE;QACxB,EAAE,EAAE,2CAA2C;QAC/C,cAAc,EAAE,OAAO;QACvB,WAAW,EAAE,qDAAqD;KACnE;IACD,mCAAmC,EAAE;QACnC,EAAE,EAAE,sDAAsD;QAC1D,cAAc,EAAE,mDAAmD;QACnE,WAAW,EAAE,yEAAyE;KACvF;IACD,uCAAuC,EAAE;QACvC,EAAE,EAAE,0DAA0D;QAC9D,cAAc,EAAE,8DAA8D;QAC9E,WAAW,EAAE,6EAA6E;KAC3F;IACD,+BAA+B,EAAE;QAC/B,EAAE,EAAE,kDAAkD;QACtD,cAAc,EAAE,oCAAoC;QACpD,WAAW,EAAE,8EAA8E;KAC5F;CACF,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { defineMessages } from '@openedx/frontend-base';\n\nconst messages = defineMessages({\n pageTitle: {\n id: 'instruct.grading.pageTitle',\n defaultMessage: 'Grading Tools',\n description: 'Title for the grading page'\n },\n configurationAlt: {\n id: 'instruct.grading.configurationAlt',\n defaultMessage: 'Grading Configuration and Settings',\n description: 'Alt text for the configuration icon button'\n },\n viewGradebook: {\n id: 'instruct.grading.viewGradebook',\n defaultMessage: 'View Gradebook',\n description: 'Text for the button to view the gradebook'\n },\n singleLearner: {\n id: 'instruct.grading.singleLearner',\n defaultMessage: 'Single Learner',\n description: 'Single Learner button label to display corresponding grading tools'\n },\n allLearners: {\n id: 'instruct.grading.allLearners',\n defaultMessage: 'All Learners',\n description: 'All learners button label to display corresponding grading tools'\n },\n descriptionSingleLearner: {\n id: 'instruct.grading.descriptionSingleLearner',\n defaultMessage: 'These grading tools allow for grade review and adjustment for a specific learner on a specific problem.',\n description: 'Description for single learner grading tools'\n },\n descriptionAllLearners: {\n id: 'instruct.grading.descriptionAllLearners',\n defaultMessage: 'These grading tools allow for grade review and adjustment all enrolled learners on a specific problem.',\n description: 'Description for all learners grading tools'\n },\n gradingConfiguration: {\n id: 'instruct.grading.gradingConfiguration',\n defaultMessage: 'Grading Configuration',\n description: 'Title for the grading configuration modal'\n },\n close: {\n id: 'instruct.grading.modals.close',\n defaultMessage: 'Close',\n description: 'Text for the close button in the grading configuration modal'\n },\n viewGradingConfiguration: {\n id: 'instruct.grading.viewGradingConfiguration',\n defaultMessage: 'View Grading Configuration',\n description: 'View grading configuration menu item label'\n },\n viewCourseGradingSettings: {\n id: 'instruct.grading.viewCourseGradingSettings',\n defaultMessage: 'View Course Grading Settings',\n description: 'View course grading settings menu item label'\n },\n noGradingConfiguration: {\n id: 'instruct.grading.noGradingConfiguration',\n defaultMessage: 'No grading configuration found for this course.',\n description: 'Message to display when there is no grading configuration for the course'\n },\n resetAttempts: {\n id: 'instruct.grading.resetAttempts',\n defaultMessage: 'Reset Attempts',\n description: 'Title for the reset attempts action card'\n },\n resetAttemptsDescription: {\n id: 'instruct.grading.resetAttemptsDescription',\n defaultMessage: 'Allow a learner who has used up all attempts to work on the problem again.',\n description: 'Description for the reset attempts action card'\n },\n resetAttemptsButtonLabel: {\n id: 'instruct.grading.resetAttemptsButtonLabel',\n defaultMessage: 'Reset Attempts to Zero',\n description: 'Button label for the reset attempts action card'\n },\n rescoreSubmission: {\n id: 'instruct.grading.rescoreSubmission',\n defaultMessage: 'Rescore Submission',\n description: 'Title for the rescore submission action card'\n },\n rescoreSubmissionDescription: {\n id: 'instruct.grading.rescoreSubmissionDescription',\n defaultMessage: 'For the specified problem, two tools exist for rescoring learner responses.',\n description: 'Description for the rescore submission action card'\n },\n rescoreSubmissionButtonLabel: {\n id: 'instruct.grading.rescoreSubmissionButtonLabel',\n defaultMessage: 'Rescore Learner\\'s Submission',\n description: 'Button label for the rescore submission action card'\n },\n rescoreIfImprovesScoreButtonLabel: {\n id: 'instruct.grading.rescoreIfImprovesScoreButtonLabel',\n defaultMessage: 'Rescore Only if Score Improves',\n description: 'Button label for the rescore if improves score action in the rescore submission'\n },\n overrideScore: {\n id: 'instruct.grading.overrideScore',\n defaultMessage: 'Override Score',\n description: 'Title for the override score action card'\n },\n overrideScoreDescription: {\n id: 'instruct.grading.overrideScoreDescription',\n defaultMessage: 'For the specified problem, override the learner\\'s score. Input the new score, out of the total points available for this problem.',\n description: 'Description for the override score action card'\n },\n overrideScoreButtonLabel: {\n id: 'instruct.grading.overrideScoreButtonLabel',\n defaultMessage: 'Override Learner\\'s Score',\n description: 'Button label for the override score action card'\n },\n deleteHistory: {\n id: 'instruct.grading.deleteHistory',\n defaultMessage: 'Delete History',\n description: 'Title for the delete history action card'\n },\n deleteHistoryDescription: {\n id: 'instruct.grading.deleteHistoryDescription',\n defaultMessage: 'For the specified problem, permanently and completely delete the learner\\'s answers and scores from the database.',\n description: 'Description for the delete history action card'\n },\n deleteHistoryButtonLabel: {\n id: 'instruct.grading.deleteHistoryButtonLabel',\n defaultMessage: 'Delete Learner\\'s State',\n description: 'Button label for the delete history action card'\n },\n taskStatus: {\n id: 'instruct.grading.taskStatus',\n defaultMessage: 'Task Status',\n description: 'Title for the task status action card'\n },\n taskStatusDescription: {\n id: 'instruct.grading.taskStatusDescription',\n defaultMessage: 'Show the status for the tasks that you submitted for this problem.',\n description: 'Description for the task status action card'\n },\n taskStatusButtonLabel: {\n id: 'instruct.grading.taskStatusButtonLabel',\n defaultMessage: 'Show Task Status',\n description: 'Button label for the task status action card'\n },\n specifyProblem: {\n id: 'instruct.grading.specifyProblem',\n defaultMessage: 'Specify Problem:',\n description: 'Label for the specify problem input field'\n },\n select: {\n id: 'instruct.grading.select',\n defaultMessage: 'Select',\n description: 'Label for the select button in the specify problem field'\n },\n overrideScorePlaceholder: {\n id: 'instruct.grading.overrideScorePlaceholder',\n defaultMessage: 'Score',\n description: 'Placeholder text for the override score input field'\n },\n resetAllLearnersAttemptsDescription: {\n id: 'instruct.grading.resetAllLearnersAttemptsDescription',\n defaultMessage: 'Allows all learners to work on the problem again.',\n description: 'Description for the reset attempts action card in the all learners view'\n },\n rescoreSubmissionAllLearnersDescription: {\n id: 'instruct.grading.rescoreSubmissionAllLearnersDescription',\n defaultMessage: 'For the specified problem, rescore all learners\\' responses.',\n description: 'Description for the rescore submission action card in the all learners view'\n },\n rescoreAllSubmissionButtonLabel: {\n id: 'instruct.grading.rescoreAllSubmissionButtonLabel',\n defaultMessage: 'Rescore All Learners\\' Submissions',\n description: 'Button label for the rescore submission action card in the all learners view'\n }\n});\n\nexport default messages;\n"]}
|
|
1
|
+
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../src/grading/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC9B,SAAS,EAAE;QACT,EAAE,EAAE,4BAA4B;QAChC,cAAc,EAAE,eAAe;QAC/B,WAAW,EAAE,4BAA4B;KAC1C;IACD,gBAAgB,EAAE;QAChB,EAAE,EAAE,mCAAmC;QACvC,cAAc,EAAE,oCAAoC;QACpD,WAAW,EAAE,4CAA4C;KAC1D;IACD,aAAa,EAAE;QACb,EAAE,EAAE,gCAAgC;QACpC,cAAc,EAAE,gBAAgB;QAChC,WAAW,EAAE,2CAA2C;KACzD;IACD,aAAa,EAAE;QACb,EAAE,EAAE,gCAAgC;QACpC,cAAc,EAAE,gBAA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D;IACD,yBAAyB,EAAE;QACzB,EAAE,EAAE,4CAA4C;QAChD,cAAc,EAAE,sDAAsD;QACtE,WAAW,EAAE,6CAA6C;KAC3D;IACD,yBAAyB,EAAE;QACzB,EAAE,EAAE,4CAA4C;QAChD,cAAc,EAAE,uDAAuD;QACvE,WAAW,EAAE,2CAA2C;KACzD;IACD,uBAAuB,EAAE;QACvB,EAAE,EAAE,0CAA0C;QAC9C,cAAc,EAAE,8DAA8D;QAC9E,WAAW,EAAE,yCAAyC;KACvD;IACD,mBAAmB,EAAE;QACnB,EAAE,EAAE,sCAAsC;QAC1C,cAAc,EAAE,gDAAgD;QAChE,WAAW,EAAE,iDAAiD;KAC/D;IACD,sBAAsB,EAAE;QACtB,EAAE,EAAE,yCAAyC;QAC7C,cAAc,EAAE,cAAc;QAC9B,WAAW,EAAE,uDAAuD;KACrE;IACD,oBAAoB,EAAE;QACpB,EAAE,EAAE,uCAAuC;QAC3C,cAAc,EAAE,2EAA2E;QAC3F,WAAW,EAAE,wCAAwC;KACtD;IACD,oBAAoB,EAAE;QACpB,EAAE,EAAE,uCAAuC;QAC3C,cAAc,EAAE,qJAAqJ;QACrK,WAAW,EAAE,sCAAsC;KACpD;IACD,wBAAwB,EAAE;QACxB,EAAE,EAAE,2CAA2C;QAC/C,cAAc,EAAE,oJAAoJ;QACpK,WAAW,EAAE,0CAA0C;KACxD;IACD,oBAAoB,EAAE;QACpB,EAAE,EAAE,uCAAuC;QAC3C,cAAc,EAAE,qDAAqD;QACrE,WAAW,EAAE,sCAAsC;KACpD;IACD,eAAe,EAAE;QACf,EAAE,EAAE,kCAAkC;QACtC,cAAc,EAAE,iDAAiD;QACjE,WAAW,EAAE,oDAAoD;KAClE;CACF,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { defineMessages } from '@openedx/frontend-base';\n\nconst messages = defineMessages({\n pageTitle: {\n id: 'instruct.grading.pageTitle',\n defaultMessage: 'Grading Tools',\n description: 'Title for the grading page'\n },\n configurationAlt: {\n id: 'instruct.grading.configurationAlt',\n defaultMessage: 'Grading Configuration and Settings',\n description: 'Alt text for the configuration icon button'\n },\n viewGradebook: {\n id: 'instruct.grading.viewGradebook',\n defaultMessage: 'View Gradebook',\n description: 'Text for the button to view the gradebook'\n },\n singleLearner: {\n id: 'instruct.grading.singleLearner',\n defaultMessage: 'Single Learner',\n description: 'Single Learner button label to display corresponding grading tools'\n },\n allLearners: {\n id: 'instruct.grading.allLearners',\n defaultMessage: 'All Learners',\n description: 'All learners button label to display corresponding grading tools'\n },\n descriptionSingleLearner: {\n id: 'instruct.grading.descriptionSingleLearner',\n defaultMessage: 'These grading tools allow for grade review and adjustment for a specific learner on a specific problem.',\n description: 'Description for single learner grading tools'\n },\n descriptionAllLearners: {\n id: 'instruct.grading.descriptionAllLearners',\n defaultMessage: 'These grading tools allow for grade review and adjustment all enrolled learners on a specific problem.',\n description: 'Description for all learners grading tools'\n },\n gradingConfiguration: {\n id: 'instruct.grading.gradingConfiguration',\n defaultMessage: 'Grading Configuration',\n description: 'Title for the grading configuration modal'\n },\n close: {\n id: 'instruct.grading.modals.close',\n defaultMessage: 'Close',\n description: 'Text for the close button in the grading configuration modal'\n },\n viewGradingConfiguration: {\n id: 'instruct.grading.viewGradingConfiguration',\n defaultMessage: 'View Grading Configuration',\n description: 'View grading configuration menu item label'\n },\n viewCourseGradingSettings: {\n id: 'instruct.grading.viewCourseGradingSettings',\n defaultMessage: 'View Course Grading Settings',\n description: 'View course grading settings menu item label'\n },\n noGradingConfiguration: {\n id: 'instruct.grading.noGradingConfiguration',\n defaultMessage: 'No grading configuration found for this course.',\n description: 'Message to display when there is no grading configuration for the course'\n },\n resetAttempts: {\n id: 'instruct.grading.resetAttempts',\n defaultMessage: 'Reset Attempts',\n description: 'Title for the reset attempts action card'\n },\n resetAttemptsDescription: {\n id: 'instruct.grading.resetAttemptsDescription',\n defaultMessage: 'Allow a learner who has used up all attempts to work on the problem again.',\n description: 'Description for the reset attempts action card'\n },\n resetAttemptsButtonLabel: {\n id: 'instruct.grading.resetAttemptsButtonLabel',\n defaultMessage: 'Reset Attempts to Zero',\n description: 'Button label for the reset attempts action card'\n },\n rescoreSubmission: {\n id: 'instruct.grading.rescoreSubmission',\n defaultMessage: 'Rescore Submission',\n description: 'Title for the rescore submission action card'\n },\n rescoreSubmissionDescription: {\n id: 'instruct.grading.rescoreSubmissionDescription',\n defaultMessage: 'For the specified problem, two tools exist for rescoring learner responses.',\n description: 'Description for the rescore submission action card'\n },\n rescoreSubmissionButtonLabel: {\n id: 'instruct.grading.rescoreSubmissionButtonLabel',\n defaultMessage: 'Rescore Learner\\'s Submission',\n description: 'Button label for the rescore submission action card'\n },\n rescoreIfImprovesScoreButtonLabel: {\n id: 'instruct.grading.rescoreIfImprovesScoreButtonLabel',\n defaultMessage: 'Rescore Only if Score Improves',\n description: 'Button label for the rescore if improves score action in the rescore submission'\n },\n overrideScore: {\n id: 'instruct.grading.overrideScore',\n defaultMessage: 'Override Score',\n description: 'Title for the override score action card'\n },\n overrideScoreDescription: {\n id: 'instruct.grading.overrideScoreDescription',\n defaultMessage: 'For the specified problem, override the learner\\'s score. Input the new score, out of the total points available for this problem.',\n description: 'Description for the override score action card'\n },\n overrideScoreButtonLabel: {\n id: 'instruct.grading.overrideScoreButtonLabel',\n defaultMessage: 'Override Learner\\'s Score',\n description: 'Button label for the override score action card'\n },\n deleteHistory: {\n id: 'instruct.grading.deleteHistory',\n defaultMessage: 'Delete History',\n description: 'Title for the delete history action card'\n },\n deleteHistoryDescription: {\n id: 'instruct.grading.deleteHistoryDescription',\n defaultMessage: 'For the specified problem, permanently and completely delete the learner\\'s answers and scores from the database.',\n description: 'Description for the delete history action card'\n },\n deleteHistoryButtonLabel: {\n id: 'instruct.grading.deleteHistoryButtonLabel',\n defaultMessage: 'Delete Learner\\'s State',\n description: 'Button label for the delete history action card'\n },\n taskStatus: {\n id: 'instruct.grading.taskStatus',\n defaultMessage: 'Task Status',\n description: 'Title for the task status action card'\n },\n taskStatusDescription: {\n id: 'instruct.grading.taskStatusDescription',\n defaultMessage: 'Show the status for the tasks that you submitted for this problem.',\n description: 'Description for the task status action card'\n },\n taskStatusButtonLabel: {\n id: 'instruct.grading.taskStatusButtonLabel',\n defaultMessage: 'Show Task Status',\n description: 'Button label for the task status action card'\n },\n specifyProblem: {\n id: 'instruct.grading.specifyProblem',\n defaultMessage: 'Specify Problem:',\n description: 'Label for the specify problem input field'\n },\n select: {\n id: 'instruct.grading.select',\n defaultMessage: 'Select',\n description: 'Label for the select button in the specify problem field'\n },\n overrideScorePlaceholder: {\n id: 'instruct.grading.overrideScorePlaceholder',\n defaultMessage: 'Score',\n description: 'Placeholder text for the override score input field'\n },\n resetAllLearnersAttemptsDescription: {\n id: 'instruct.grading.resetAllLearnersAttemptsDescription',\n defaultMessage: 'Allows all learners to work on the problem again.',\n description: 'Description for the reset attempts action card in the all learners view'\n },\n rescoreSubmissionAllLearnersDescription: {\n id: 'instruct.grading.rescoreSubmissionAllLearnersDescription',\n defaultMessage: 'For the specified problem, rescore all learners\\' responses.',\n description: 'Description for the rescore submission action card in the all learners view'\n },\n rescoreAllSubmissionButtonLabel: {\n id: 'instruct.grading.rescoreAllSubmissionButtonLabel',\n defaultMessage: 'Rescore All Learners\\' Submissions',\n description: 'Button label for the rescore submission action card in the all learners view'\n },\n currentScore: {\n id: 'instruct.grading.currentScore',\n defaultMessage: 'Current Score',\n description: 'Label for the current score displayed in the single learner view'\n },\n viewProgress: {\n id: 'instruct.grading.viewProgress',\n defaultMessage: 'View Progress Page',\n description: 'Label for the view progress button displayed next to the current score in the single learner view'\n },\n score: {\n id: 'instruct.grading.score',\n defaultMessage: 'Score',\n description: 'Label for the score displayed in the current status section of the single learner view'\n },\n attempts: {\n id: 'instruct.grading.attempts',\n defaultMessage: 'Attempts',\n description: 'Label for the attempts displayed in the current status section of the single learner view'\n },\n rescore: {\n id: 'instruct.grading.rescore',\n defaultMessage: 'Rescore',\n description: 'Label for the rescore confirmation action'\n },\n resetAttemptsConfirmation: {\n id: 'instruct.grading.resetAttemptsConfirmation',\n defaultMessage: 'Reset attempts for {student} on problem \"{blockId}\"?',\n description: 'Confirmation message for resetting attempts'\n },\n overrideScoreConfirmation: {\n id: 'instruct.grading.overrideScoreConfirmation',\n defaultMessage: 'Override score for {student} for problem \"{blockId}\"?',\n description: 'Confirmation message for overriding score'\n },\n deleteStateConfirmation: {\n id: 'instruct.grading.deleteStateConfirmation',\n defaultMessage: 'Delete state for student \"{student}\" on problem \"{blockId}\"?',\n description: 'Confirmation message for deleting state'\n },\n rescoreConfirmation: {\n id: 'instruct.grading.rescoreConfirmation',\n defaultMessage: 'Rescore problem for {student} for \"{blockId}\"?',\n description: 'Confirmation message for rescoring a submission'\n },\n deleteStateButtonLabel: {\n id: 'instruct.grading.deleteStateButtonLabel',\n defaultMessage: 'Delete State',\n description: 'Button label for the delete state confirmation action'\n },\n resetAttemptsSuccess: {\n id: 'instruct.grading.resetAttemptsSuccess',\n defaultMessage: 'Successfully reset problem attempts for {student} on problem \"{blockId}\".',\n description: 'Success message for resetting attempts'\n },\n overrideScoreSuccess: {\n id: 'instruct.grading.overrideScoreSuccess',\n defaultMessage: 'Started task to override the score for {student} on problem \"{blockId}\". \\n \\n Click the \\'Show Task Status\\' button to see the status of the task.',\n description: 'Success message for overriding score'\n },\n rescoreSubmissionSuccess: {\n id: 'instruct.grading.rescoreSubmissionSuccess',\n defaultMessage: 'Successfully started task to rescore problem \"{blockId}\" for {student}. \\n \\n Click the \\'Show Task Status\\' button to see the status of the task.',\n description: 'Success message for rescoring submission'\n },\n deleteHistorySuccess: {\n id: 'instruct.grading.deleteHistorySuccess',\n defaultMessage: 'State for student \"{student}\" successfully deleted.',\n description: 'Success message for deleting history'\n },\n unexpectedError: {\n id: 'instruct.grading.unexpectedError',\n defaultMessage: 'An unexpected error occurred. Please try again.',\n description: 'Message to display when an unexpected error occurs'\n }\n});\n\nexport default messages;\n"]}
|
|
@@ -1,29 +1,86 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
1
10
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from 'react';
|
|
11
|
+
import { useState, useEffect } from 'react';
|
|
12
|
+
import { useParams } from 'react-router-dom';
|
|
13
|
+
import { useIntl } from '@openedx/frontend-base';
|
|
3
14
|
import { useToggle } from '@openedx/paragon';
|
|
4
15
|
import AddAllowanceModal from '../../specialExams/components/AddAllowanceModal';
|
|
5
16
|
import AllowancesList from '../../specialExams/components/AllowancesList';
|
|
6
17
|
import EditAllowanceModal from '../../specialExams/components/EditAllowanceModal';
|
|
7
18
|
import DeleteAllowanceModal from '../../specialExams/components/DeleteAllowanceModal';
|
|
19
|
+
import { useAttempts } from '../../specialExams/data/apiHook';
|
|
20
|
+
import messages from '../../specialExams/messages';
|
|
21
|
+
import { useAlert } from '../../providers/AlertProvider';
|
|
8
22
|
const Allowances = () => {
|
|
23
|
+
var _a;
|
|
24
|
+
const intl = useIntl();
|
|
25
|
+
const { courseId = '' } = useParams();
|
|
26
|
+
const { showModal } = useAlert();
|
|
9
27
|
const [isAddModalOpen, openAddModal, closeAddModal] = useToggle(false);
|
|
10
28
|
const [isEditModalOpen, openEditModal, closeEditModal] = useToggle(false);
|
|
11
29
|
const [isDeleteModalOpen, openDeleteModal, closeDeleteModal] = useToggle(false);
|
|
12
30
|
const [selectedAllowance, setSelectedAllowance] = useState(null);
|
|
31
|
+
const [pendingAction, setPendingAction] = useState(null);
|
|
32
|
+
const { refetch } = useAttempts(courseId, {
|
|
33
|
+
page: 0,
|
|
34
|
+
pageSize: 100,
|
|
35
|
+
emailOrUsername: (_a = selectedAllowance === null || selectedAllowance === void 0 ? void 0 : selectedAllowance.user.username) !== null && _a !== void 0 ? _a : '',
|
|
36
|
+
ordering: '',
|
|
37
|
+
}, false); // disabled by default — only runs on refetch
|
|
38
|
+
// Handle the attempt check after selectedAllowance and pendingAction are set
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
if (!selectedAllowance || !pendingAction) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
const checkAttempt = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
44
|
+
const { data } = yield refetch();
|
|
45
|
+
const hasAttempt = data === null || data === void 0 ? void 0 : data.results.some((attempt) => attempt.examId === selectedAllowance.proctoredExam.id);
|
|
46
|
+
if (hasAttempt) {
|
|
47
|
+
showModal({
|
|
48
|
+
message: intl.formatMessage(messages.cannotModifyAllowance, {
|
|
49
|
+
action: pendingAction,
|
|
50
|
+
username: selectedAllowance.user.username,
|
|
51
|
+
}),
|
|
52
|
+
variant: 'warning',
|
|
53
|
+
});
|
|
54
|
+
setSelectedAllowance(null);
|
|
55
|
+
setPendingAction(null);
|
|
56
|
+
}
|
|
57
|
+
else if (pendingAction === 'edit') {
|
|
58
|
+
openEditModal();
|
|
59
|
+
setPendingAction(null);
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
openDeleteModal();
|
|
63
|
+
setPendingAction(null);
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
checkAttempt();
|
|
67
|
+
}, [selectedAllowance, pendingAction, refetch, showModal, intl, openEditModal, openDeleteModal]);
|
|
13
68
|
const handleEditAllowance = (allowance) => {
|
|
14
69
|
setSelectedAllowance(allowance);
|
|
15
|
-
|
|
70
|
+
setPendingAction('edit');
|
|
71
|
+
};
|
|
72
|
+
const handleDeleteAllowance = (allowance) => {
|
|
73
|
+
setSelectedAllowance(allowance);
|
|
74
|
+
setPendingAction('delete');
|
|
16
75
|
};
|
|
17
76
|
const handleCloseEditModal = () => {
|
|
18
77
|
setSelectedAllowance(null);
|
|
78
|
+
setPendingAction(null);
|
|
19
79
|
closeEditModal();
|
|
20
80
|
};
|
|
21
|
-
const handleDeleteAllowance = (allowance) => {
|
|
22
|
-
setSelectedAllowance(allowance);
|
|
23
|
-
openDeleteModal();
|
|
24
|
-
};
|
|
25
81
|
const handleCloseDeleteModal = () => {
|
|
26
82
|
setSelectedAllowance(null);
|
|
83
|
+
setPendingAction(null);
|
|
27
84
|
closeDeleteModal();
|
|
28
85
|
};
|
|
29
86
|
return (_jsxs(_Fragment, { children: [_jsx(AllowancesList, { onClickAdd: openAddModal, onEdit: handleEditAllowance, onDelete: handleDeleteAllowance }), _jsx(AddAllowanceModal, { isOpen: isAddModalOpen, onClose: closeAddModal }), selectedAllowance && _jsx(EditAllowanceModal, { isOpen: isEditModalOpen, onClose: handleCloseEditModal, allowance: selectedAllowance }), selectedAllowance && _jsx(DeleteAllowanceModal, { isOpen: isDeleteModalOpen, onClose: handleCloseDeleteModal, allowance: selectedAllowance })] }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Allowances.js","sourceRoot":"","sources":["../../../src/specialExams/components/Allowances.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Allowances.js","sourceRoot":"","sources":["../../../src/specialExams/components/Allowances.tsx"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,i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AAC,MAAM,CAAC,CAAC;IAC3B,CAAC,CAAC;IAEF,MAAM,qBAAqB,GAAG,CAAC,SAAoB,EAAE,EAAE;QACrD,oBAAoB,CAAC,SAAS,CAAC,CAAC;QAChC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC7B,CAAC,CAAC;IAEF,MAAM,oBAAoB,GAAG,GAAG,EAAE;QAChC,oBAAoB,CAAC,IAAI,CAAC,CAAC;QAC3B,gBAAgB,CAAC,IAAI,CAAC,CAAC;QACvB,cAAc,EAAE,CAAC;IACnB,CAAC,CAAC;IAEF,MAAM,sBAAsB,GAAG,GAAG,EAAE;QAClC,oBAAoB,CAAC,IAAI,CAAC,CAAC;QAC3B,gBAAgB,CAAC,IAAI,CAAC,CAAC;QACvB,gBAAgB,EAAE,CAAC;IACrB,CAAC,CAAC;IAEF,OAAO,CACL,8BACE,KAAC,cAAc,IAAC,UAAU,EAAE,YAAY,EAAE,MAAM,EAAE,mBAAmB,EAAE,QAAQ,EAAE,qBAAqB,GAAI,EAC1G,KAAC,iBAAiB,IAAC,MAAM,EAAE,cAAc,EAAE,OAAO,EAAE,aAAa,GAAI,EACpE,iBAAiB,IAAI,KAAC,kBAAkB,IAAC,MAAM,EAAE,eAAe,EAAE,OAAO,EAAE,oBAAoB,EAAE,SAAS,EAAE,iBAAiB,GAAI,EACjI,iBAAiB,IAAI,KAAC,oBAAoB,IAAC,MAAM,EAAE,iBAAiB,EAAE,OAAO,EAAE,sBAAsB,EAAE,SAAS,EAAE,iBAAiB,GAAI,IACvI,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import { useState, useEffect } from 'react';\nimport { useParams } from 'react-router-dom';\nimport { useIntl } from '@openedx/frontend-base';\nimport { useToggle } from '@openedx/paragon';\nimport AddAllowanceModal from '@src/specialExams/components/AddAllowanceModal';\nimport AllowancesList from '@src/specialExams/components/AllowancesList';\nimport EditAllowanceModal from '@src/specialExams/components/EditAllowanceModal';\nimport DeleteAllowanceModal from '@src/specialExams/components/DeleteAllowanceModal';\nimport { useAttempts } from '@src/specialExams/data/apiHook';\nimport messages from '@src/specialExams/messages';\nimport { Allowance } from '@src/specialExams/types';\nimport { useAlert } from '@src/providers/AlertProvider';\n\nconst Allowances = () => {\n const intl = useIntl();\n const { courseId = '' } = useParams<{ courseId: string }>();\n const { showModal } = useAlert();\n const [isAddModalOpen, openAddModal, closeAddModal] = useToggle(false);\n const [isEditModalOpen, openEditModal, closeEditModal] = useToggle(false);\n const [isDeleteModalOpen, openDeleteModal, closeDeleteModal] = useToggle(false);\n const [selectedAllowance, setSelectedAllowance] = useState<Allowance | null>(null);\n const [pendingAction, setPendingAction] = useState<'edit' | 'delete' | null>(null);\n\n const { refetch } = useAttempts(courseId, {\n page: 0,\n pageSize: 100,\n emailOrUsername: selectedAllowance?.user.username ?? '',\n ordering: '',\n }, false); // disabled by default — only runs on refetch\n\n // Handle the attempt check after selectedAllowance and pendingAction are set\n useEffect(() => {\n if (!selectedAllowance || !pendingAction) {\n return;\n }\n\n const checkAttempt = async () => {\n const { data } = await refetch();\n const hasAttempt = data?.results.some(\n (attempt) => attempt.examId === selectedAllowance.proctoredExam.id\n );\n\n if (hasAttempt) {\n showModal({\n message: intl.formatMessage(messages.cannotModifyAllowance, {\n action: pendingAction,\n username: selectedAllowance.user.username,\n }),\n variant: 'warning',\n });\n setSelectedAllowance(null);\n setPendingAction(null);\n } else if (pendingAction === 'edit') {\n openEditModal();\n setPendingAction(null);\n } else {\n openDeleteModal();\n setPendingAction(null);\n }\n };\n\n checkAttempt();\n }, [selectedAllowance, pendingAction, refetch, showModal, intl, openEditModal, openDeleteModal]);\n\n const handleEditAllowance = (allowance: Allowance) => {\n setSelectedAllowance(allowance);\n setPendingAction('edit');\n };\n\n const handleDeleteAllowance = (allowance: Allowance) => {\n setSelectedAllowance(allowance);\n setPendingAction('delete');\n };\n\n const handleCloseEditModal = () => {\n setSelectedAllowance(null);\n setPendingAction(null);\n closeEditModal();\n };\n\n const handleCloseDeleteModal = () => {\n setSelectedAllowance(null);\n setPendingAction(null);\n closeDeleteModal();\n };\n\n return (\n <>\n <AllowancesList onClickAdd={openAddModal} onEdit={handleEditAllowance} onDelete={handleDeleteAllowance} />\n <AddAllowanceModal isOpen={isAddModalOpen} onClose={closeAddModal} />\n {selectedAllowance && <EditAllowanceModal isOpen={isEditModalOpen} onClose={handleCloseEditModal} allowance={selectedAllowance} />}\n {selectedAllowance && <DeleteAllowanceModal isOpen={isDeleteModalOpen} onClose={handleCloseDeleteModal} allowance={selectedAllowance} />}\n </>\n );\n};\n\nexport default Allowances;\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AddAllowanceParams, AttemptsParams, DeleteAllowanceParams } from '../types';
|
|
2
|
-
export declare const useAttempts: (courseId: string, params: AttemptsParams) => import("@tanstack/react-query").UseQueryResult<import("../../types").DataList<import("../types").Attempt>, Error>;
|
|
2
|
+
export declare const useAttempts: (courseId: string, params: AttemptsParams, enabled?: boolean) => import("@tanstack/react-query").UseQueryResult<import("../../types").DataList<import("../types").Attempt>, Error>;
|
|
3
3
|
export declare const useAllowances: (courseId: string, params: AttemptsParams) => import("@tanstack/react-query").UseQueryResult<import("../../types").DataList<import("../types").Allowance>, Error>;
|
|
4
4
|
export declare const useAddAllowance: (courseId: string) => import("@tanstack/react-query").UseMutationResult<import("../types").Allowance[], Error, AddAllowanceParams, unknown>;
|
|
5
5
|
export declare const useDeleteAllowance: (courseId: string) => import("@tanstack/react-query").UseMutationResult<void, Error, DeleteAllowanceParams, unknown>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
|
|
2
2
|
import { addAllowance, deleteAllowance, getAllowances, getAttempts, getSpecialExams } from './api';
|
|
3
3
|
import { specialExamsQueryKeys } from './queryKeys';
|
|
4
|
-
export const useAttempts = (courseId, params) => (useQuery({
|
|
4
|
+
export const useAttempts = (courseId, params, enabled = true) => (useQuery({
|
|
5
5
|
queryKey: specialExamsQueryKeys.attempts(courseId, params),
|
|
6
6
|
queryFn: () => getAttempts(courseId, params),
|
|
7
|
-
enabled: !!courseId,
|
|
7
|
+
enabled: !!courseId && enabled,
|
|
8
8
|
}));
|
|
9
9
|
export const useAllowances = (courseId, params) => (useQuery({
|
|
10
10
|
queryKey: specialExamsQueryKeys.allowances(courseId, params),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apiHook.js","sourceRoot":"","sources":["../../../src/specialExams/data/apiHook.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC9E,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AACnG,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAGpD,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,QAAgB,EAAE,MAAsB,EAAE,EAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"apiHook.js","sourceRoot":"","sources":["../../../src/specialExams/data/apiHook.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC9E,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AACnG,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAGpD,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,QAAgB,EAAE,MAAsB,EAAE,OAAO,GAAG,IAAI,EAAE,EAAE,CAAC,CACvF,QAAQ,CAAC;IACP,QAAQ,EAAE,qBAAqB,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1D,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,QAAQ,EAAE,MAA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AAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,QAAgB,EAAE,QAAgB,EAAE,EAAE,CAAC,CACrE,QAAQ,CAAC;IACP,QAAQ,EAAE,qBAAqB,CAAC,YAAY,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAChE,OAAO,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAClD,OAAO,EAAE,CAAC,CAAC,QAAQ,IAAI,CAAC,CAAC,QAAQ;CAClC,CAAC,CACH,CAAC","sourcesContent":["import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';\nimport { addAllowance, deleteAllowance, getAllowances, getAttempts, getSpecialExams } from './api';\nimport { specialExamsQueryKeys } from './queryKeys';\nimport { AddAllowanceParams, AttemptsParams, DeleteAllowanceParams } from '../types';\n\nexport const useAttempts = (courseId: string, params: AttemptsParams, enabled = true) => (\n useQuery({\n queryKey: specialExamsQueryKeys.attempts(courseId, params),\n queryFn: () => getAttempts(courseId, params),\n enabled: !!courseId && enabled,\n })\n);\n\nexport const useAllowances = (courseId: string, params: AttemptsParams) => (\n useQuery({\n queryKey: specialExamsQueryKeys.allowances(courseId, params),\n queryFn: () => getAllowances(courseId, params),\n enabled: !!courseId,\n })\n);\n\nexport const useAddAllowance = (courseId: string) => {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (newAllowance: AddAllowanceParams) =>\n addAllowance(courseId, newAllowance),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: specialExamsQueryKeys.allowances(courseId), exact: false });\n },\n });\n};\n\nexport const useDeleteAllowance = (courseId: string) => {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (params: DeleteAllowanceParams) => deleteAllowance(courseId, params),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: specialExamsQueryKeys.allowances(courseId), exact: false });\n },\n });\n};\n\nexport const useSpecialExams = (courseId: string, examType: string) => (\n useQuery({\n queryKey: specialExamsQueryKeys.specialExams(courseId, examType),\n queryFn: () => getSpecialExams(courseId, examType),\n enabled: !!courseId && !!examType,\n })\n);\n"]}
|
|
@@ -219,6 +219,11 @@ const messages = defineMessages({
|
|
|
219
219
|
id: 'instruct.specialExams.editAllowanceError',
|
|
220
220
|
defaultMessage: 'An error occurred while editing the allowance. Please try again.',
|
|
221
221
|
description: 'Error message displayed when there is an issue editing an allowance'
|
|
222
|
+
},
|
|
223
|
+
cannotModifyAllowance: {
|
|
224
|
+
id: 'instruct.specialExams.cannotModifyAllowance',
|
|
225
|
+
defaultMessage: 'Cannot {action} allowance: {username} has already attempted the exam',
|
|
226
|
+
description: 'Warning message shown when trying to edit or delete an allowance for a student who has already attempted the exam'
|
|
222
227
|
}
|
|
223
228
|
});
|
|
224
229
|
export default messages;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../src/specialExams/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC9B,iBAAiB,EAAE;QACjB,EAAE,EAAE,6BAA6B;QACjC,cAAc,EAAE,eAAe;QAC/B,WAAW,EAAE,kCAAkC;KAChD;IACD,YAAY,EAAE;QACZ,EAAE,EAAE,oCAAoC;QACxC,cAAc,EAAE,eAAe;QAC/B,WAAW,EAAE,iCAAiC;KAC/C;IACD,UAAU,EAAE;QACV,EAAE,EAAE,kCAAkC;QACtC,cAAc,EAAE,YAAY;QAC5B,WAAW,EAAE,8BAA8B;KAC5C;IACD,QAAQ,EAAE;QACR,EAAE,EAAE,gCAAgC;QACpC,cAAc,EAAE,UAAU;QAC1B,WAAW,EAAE,kDAAkD;KAChE;IACD,QAAQ,EAAE;QACR,EAAE,EAAE,gCAAgC;QACpC,cAAc,EAAE,WAAW;QAC3B,WAAW,EAAE,mDAAmD;KACjE;IACD,SAAS,EAAE;QACT,EAAE,EAAE,iCAAiC;QACrC,cAAc,EAA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QACrC,WAAW,EAAE,wDAAwD;KACtE;IACD,iBAAiB,EAAE;QACjB,EAAE,EAAE,yCAAyC;QAC7C,cAAc,EAAE,iEAAiE;QACjF,WAAW,EAAE,uEAAuE;KACrF;IACD,kBAAkB,EAAE;QAClB,EAAE,EAAE,0CAA0C;QAC9C,cAAc,EAAE,kEAAkE;QAClF,WAAW,EAAE,qEAAqE;KACnF;CACF,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { defineMessages } from '@openedx/frontend-base';\n\nconst messages = defineMessages({\n specialExamsTitle: {\n id: 'instruct.specialExams.title',\n defaultMessage: 'Special Exams',\n description: 'Title for the special exams page'\n },\n examAttempts: {\n id: 'instruct.specialExams.examAttempts',\n defaultMessage: 'Exam Attempts',\n description: 'Label for the exam attempts tab'\n },\n allowances: {\n id: 'instruct.specialExams.allowances',\n defaultMessage: 'Allowances',\n description: 'Label for the allowances tab'\n },\n username: {\n id: 'instruct.specialExams.username',\n defaultMessage: 'Username',\n description: 'Column header for username in exam attempts list',\n },\n examName: {\n id: 'instruct.specialExams.examName',\n defaultMessage: 'Exam Name',\n description: 'Column header for exam name in exam attempts list',\n },\n timeLimit: {\n id: 'instruct.specialExams.timeLimit',\n defaultMessage: 'Time Limit',\n description: 'Column header for time limit in exam attempts list',\n },\n type: {\n id: 'instruct.specialExams.type',\n defaultMessage: 'Type',\n description: 'Column header for type in exam attempts list',\n },\n startedAt: {\n id: 'instruct.specialExams.startedAt',\n defaultMessage: 'Started At',\n description: 'Column header for started at in exam attempts list',\n },\n completedAt: {\n id: 'instruct.specialExams.completedAt',\n defaultMessage: 'Completed At',\n description: 'Column header for completed at in exam attempts list',\n },\n status: {\n id: 'instruct.specialExams.status',\n defaultMessage: 'Status',\n description: 'Column header for status in exam attempts list',\n },\n noAttempts: {\n id: 'instruct.specialExams.noAttempts',\n defaultMessage: 'No exam attempts found',\n description: 'Message displayed when there are no exam attempts to show',\n },\n noAllowances: {\n id: 'instruct.specialExams.noAllowances',\n defaultMessage: 'No allowances found',\n description: 'Message displayed when there are no allowances to show',\n },\n editAllowance: {\n id: 'instruct.specialExams.editAllowance',\n defaultMessage: 'Edit Allowance',\n description: 'ARIA label for actions button and modal title when editing an allowance',\n },\n email: {\n id: 'instruct.specialExams.email',\n defaultMessage: 'Email',\n description: 'Column header for email in allowances list',\n },\n allowanceType: {\n id: 'instruct.specialExams.allowanceType',\n defaultMessage: 'Allowance Type',\n description: 'Column header for allowance type in allowances list',\n },\n allowanceValue: {\n id: 'instruct.specialExams.allowanceValue',\n defaultMessage: 'Allowance Value',\n description: 'Column header for allowance value in allowances list',\n },\n addAllowance: {\n id: 'instruct.specialExams.addAllowance',\n defaultMessage: 'Add Allowance',\n description: 'Label for the button to add a new allowance',\n },\n cancel: {\n id: 'instruct.specialExams.cancel',\n defaultMessage: 'Cancel',\n description: 'Label for cancel button in add/edit allowance modal',\n },\n createAllowance: {\n id: 'instruct.specialExams.createAllowance',\n defaultMessage: 'Create Allowance',\n description: 'Label for the create button in add allowance modal',\n },\n specifyLearners: {\n id: 'instruct.specialExams.specifyLearners',\n defaultMessage: 'Specify Learners',\n description: 'Label for the field to specify learners in add allowance modal',\n },\n specifyLearnersPlaceholder: {\n id: 'instruct.specialExams.specifyLearnersPlaceholder',\n defaultMessage: 'Learner email addresses and/or usernames separated by commas',\n description: 'Placeholder for the field to specify learners in add allowance modal',\n },\n selectExamType: {\n id: 'instruct.specialExams.selectExamType',\n defaultMessage: 'Select Exam Type',\n description: 'Label for the field to select exam type in add allowance modal',\n },\n selectExams: {\n id: 'instruct.specialExams.selectExams',\n defaultMessage: 'Select Exam(s)',\n description: 'Label for the field to select exams in add allowance modal',\n },\n selectAllowanceType: {\n id: 'instruct.specialExams.selectAllowanceType',\n defaultMessage: 'Select Allowance Type',\n description: 'Label for the field to select allowance type in add allowance modal',\n },\n addTime: {\n id: 'instruct.specialExams.addTime',\n defaultMessage: 'Add Time',\n description: 'Label for the field to enter time value in add allowance modal',\n },\n addTimePlaceholder: {\n id: 'instruct.specialExams.addTimePlaceholder',\n defaultMessage: 'Time (minutes)',\n description: 'Placeholder for the field to enter time value in add allowance modal',\n },\n actions: {\n id: 'instruct.specialExams.actions',\n defaultMessage: 'Actions',\n description: 'ARIA label for actions button in allowances list',\n },\n proctored: {\n id: 'instruct.specialExams.proctored',\n defaultMessage: 'Proctored',\n description: 'Label for whether the special exam is proctored in the list of special exams',\n },\n timed: {\n id: 'instruct.specialExams.timed',\n defaultMessage: 'Timed',\n description: 'Label for whether the special exam is timed in the list of special exams',\n },\n timeMultiplier: {\n id: 'instruct.specialExams.timeMultiplier',\n defaultMessage: 'Time Multiplier',\n description: 'Label for the time multiplier value in the list of special exams',\n },\n additionalTime: {\n id: 'instruct.specialExams.additionalTime',\n defaultMessage: 'Additional Time',\n description: 'Label for the additional time value in the list of special exams',\n },\n reviewPolicy: {\n id: 'instruct.specialExams.reviewPolicy',\n defaultMessage: 'Review Policy Exception',\n description: 'Label for the review policy exception in the list of special exams',\n },\n exceptionPlaceholder: {\n id: 'instruct.specialExams.exceptionPlaceholder',\n defaultMessage: 'Exception',\n description: 'Placeholder for the review policy exception description in add allowance modal',\n },\n timeMultiplierPlaceholder: {\n id: 'instruct.specialExams.timeMultiplierPlaceholder',\n defaultMessage: 'Multiplier (number > 1)',\n description: 'Placeholder for the time multiplier value in add allowance modal',\n },\n edit: {\n id: 'instruct.specialExams.edit',\n defaultMessage: 'Edit',\n description: 'Label for edit action in allowance list',\n },\n delete: {\n id: 'instruct.specialExams.delete',\n defaultMessage: 'Delete',\n description: 'Label for delete action in allowance list',\n },\n deleteAllowance: {\n id: 'instruct.specialExams.deleteAllowance',\n defaultMessage: 'Delete Allowance',\n description: 'Title for delete allowance confirmation modal'\n },\n deleteConfirmation: {\n id: 'instruct.specialExams.deleteConfirmation',\n defaultMessage: 'Delete allowance for {user} for {examName}?',\n description: 'Delete confirmation message'\n },\n deleteError: {\n id: 'instruct.specialExams.deleteError',\n defaultMessage: 'An error occurred while deleting the allowance. Please try again.',\n description: 'Error message displayed when there is an issue deleting an allowance'\n },\n addAdditionalTimeGranted: {\n id: 'instruct.specialExams.addAdditionalTimeGranted',\n defaultMessage: 'Add Time',\n description: 'Label for additional time granted field in add allowance modal',\n },\n addReviewPolicyException: {\n id: 'instruct.specialExams.addReviewPolicyException',\n defaultMessage: 'Add Policy Exception',\n description: 'Label for review policy exception field in add allowance modal',\n },\n addTimeMultiplier: {\n id: 'instruct.specialExams.addTimeMultiplier',\n defaultMessage: 'Add Time Multiplier',\n description: 'Label for time multiplier field in add allowance modal',\n },\n addAllowanceError: {\n id: 'instruct.specialExams.addAllowanceError',\n defaultMessage: 'An error occurred while adding the allowance. Please try again.',\n description: 'Error message displayed when there is an issue adding a new allowance'\n },\n editAllowanceError: {\n id: 'instruct.specialExams.editAllowanceError',\n defaultMessage: 'An error occurred while editing the allowance. Please try again.',\n description: 'Error message displayed when there is an issue editing an allowance'\n }\n});\n\nexport default messages;\n"]}
|
|
1
|
+
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../src/specialExams/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC9B,iBAAiB,EAAE;QACjB,EAAE,EAAE,6BAA6B;QACjC,cAAc,EAAE,eAAe;QAC/B,WAAW,EAAE,kCAAkC;KAChD;IACD,YAAY,EAAE;QACZ,EAAE,EAAE,oCAAoC;QACxC,cAAc,EAAE,eAAe;QAC/B,WAAW,EAAE,iCAAiC;KAC/C;IACD,UAAU,EAAE;QACV,EAAE,EAAE,kCAAkC;QACtC,cAAc,EAAE,YAAY;QAC5B,WAAW,EAAE,8BAA8B;KAC5C;IACD,QAAQ,EAAE;QACR,EAAE,EAAE,gCAAgC;QACpC,cAAc,EAAE,UAAU;QAC1B,WAAW,EAAE,kDAAkD;KAChE;IACD,QAAQ,EAAE;QACR,EAAE,EAAE,gCAAgC;QACpC,cA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QACtC,WAAW,EAAE,gEAAgE;KAC9E;IACD,iBAAiB,EAAE;QACjB,EAAE,EAAE,yCAAyC;QAC7C,cAAc,EAAE,qBAAqB;QACrC,WAAW,EAAE,wDAAwD;KACtE;IACD,iBAAiB,EAAE;QACjB,EAAE,EAAE,yCAAyC;QAC7C,cAAc,EAAE,iEAAiE;QACjF,WAAW,EAAE,uEAAuE;KACrF;IACD,kBAAkB,EAAE;QAClB,EAAE,EAAE,0CAA0C;QAC9C,cAAc,EAAE,kEAAkE;QAClF,WAAW,EAAE,qEAAqE;KACnF;IACD,qBAAqB,EAAE;QACrB,EAAE,EAAE,6CAA6C;QACjD,cAAc,EAAE,sEAAsE;QACtF,WAAW,EAAE,mHAAmH;KACjI;CACF,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { defineMessages } from '@openedx/frontend-base';\n\nconst messages = defineMessages({\n specialExamsTitle: {\n id: 'instruct.specialExams.title',\n defaultMessage: 'Special Exams',\n description: 'Title for the special exams page'\n },\n examAttempts: {\n id: 'instruct.specialExams.examAttempts',\n defaultMessage: 'Exam Attempts',\n description: 'Label for the exam attempts tab'\n },\n allowances: {\n id: 'instruct.specialExams.allowances',\n defaultMessage: 'Allowances',\n description: 'Label for the allowances tab'\n },\n username: {\n id: 'instruct.specialExams.username',\n defaultMessage: 'Username',\n description: 'Column header for username in exam attempts list',\n },\n examName: {\n id: 'instruct.specialExams.examName',\n defaultMessage: 'Exam Name',\n description: 'Column header for exam name in exam attempts list',\n },\n timeLimit: {\n id: 'instruct.specialExams.timeLimit',\n defaultMessage: 'Time Limit',\n description: 'Column header for time limit in exam attempts list',\n },\n type: {\n id: 'instruct.specialExams.type',\n defaultMessage: 'Type',\n description: 'Column header for type in exam attempts list',\n },\n startedAt: {\n id: 'instruct.specialExams.startedAt',\n defaultMessage: 'Started At',\n description: 'Column header for started at in exam attempts list',\n },\n completedAt: {\n id: 'instruct.specialExams.completedAt',\n defaultMessage: 'Completed At',\n description: 'Column header for completed at in exam attempts list',\n },\n status: {\n id: 'instruct.specialExams.status',\n defaultMessage: 'Status',\n description: 'Column header for status in exam attempts list',\n },\n noAttempts: {\n id: 'instruct.specialExams.noAttempts',\n defaultMessage: 'No exam attempts found',\n description: 'Message displayed when there are no exam attempts to show',\n },\n noAllowances: {\n id: 'instruct.specialExams.noAllowances',\n defaultMessage: 'No allowances found',\n description: 'Message displayed when there are no allowances to show',\n },\n editAllowance: {\n id: 'instruct.specialExams.editAllowance',\n defaultMessage: 'Edit Allowance',\n description: 'ARIA label for actions button and modal title when editing an allowance',\n },\n email: {\n id: 'instruct.specialExams.email',\n defaultMessage: 'Email',\n description: 'Column header for email in allowances list',\n },\n allowanceType: {\n id: 'instruct.specialExams.allowanceType',\n defaultMessage: 'Allowance Type',\n description: 'Column header for allowance type in allowances list',\n },\n allowanceValue: {\n id: 'instruct.specialExams.allowanceValue',\n defaultMessage: 'Allowance Value',\n description: 'Column header for allowance value in allowances list',\n },\n addAllowance: {\n id: 'instruct.specialExams.addAllowance',\n defaultMessage: 'Add Allowance',\n description: 'Label for the button to add a new allowance',\n },\n cancel: {\n id: 'instruct.specialExams.cancel',\n defaultMessage: 'Cancel',\n description: 'Label for cancel button in add/edit allowance modal',\n },\n createAllowance: {\n id: 'instruct.specialExams.createAllowance',\n defaultMessage: 'Create Allowance',\n description: 'Label for the create button in add allowance modal',\n },\n specifyLearners: {\n id: 'instruct.specialExams.specifyLearners',\n defaultMessage: 'Specify Learners',\n description: 'Label for the field to specify learners in add allowance modal',\n },\n specifyLearnersPlaceholder: {\n id: 'instruct.specialExams.specifyLearnersPlaceholder',\n defaultMessage: 'Learner email addresses and/or usernames separated by commas',\n description: 'Placeholder for the field to specify learners in add allowance modal',\n },\n selectExamType: {\n id: 'instruct.specialExams.selectExamType',\n defaultMessage: 'Select Exam Type',\n description: 'Label for the field to select exam type in add allowance modal',\n },\n selectExams: {\n id: 'instruct.specialExams.selectExams',\n defaultMessage: 'Select Exam(s)',\n description: 'Label for the field to select exams in add allowance modal',\n },\n selectAllowanceType: {\n id: 'instruct.specialExams.selectAllowanceType',\n defaultMessage: 'Select Allowance Type',\n description: 'Label for the field to select allowance type in add allowance modal',\n },\n addTime: {\n id: 'instruct.specialExams.addTime',\n defaultMessage: 'Add Time',\n description: 'Label for the field to enter time value in add allowance modal',\n },\n addTimePlaceholder: {\n id: 'instruct.specialExams.addTimePlaceholder',\n defaultMessage: 'Time (minutes)',\n description: 'Placeholder for the field to enter time value in add allowance modal',\n },\n actions: {\n id: 'instruct.specialExams.actions',\n defaultMessage: 'Actions',\n description: 'ARIA label for actions button in allowances list',\n },\n proctored: {\n id: 'instruct.specialExams.proctored',\n defaultMessage: 'Proctored',\n description: 'Label for whether the special exam is proctored in the list of special exams',\n },\n timed: {\n id: 'instruct.specialExams.timed',\n defaultMessage: 'Timed',\n description: 'Label for whether the special exam is timed in the list of special exams',\n },\n timeMultiplier: {\n id: 'instruct.specialExams.timeMultiplier',\n defaultMessage: 'Time Multiplier',\n description: 'Label for the time multiplier value in the list of special exams',\n },\n additionalTime: {\n id: 'instruct.specialExams.additionalTime',\n defaultMessage: 'Additional Time',\n description: 'Label for the additional time value in the list of special exams',\n },\n reviewPolicy: {\n id: 'instruct.specialExams.reviewPolicy',\n defaultMessage: 'Review Policy Exception',\n description: 'Label for the review policy exception in the list of special exams',\n },\n exceptionPlaceholder: {\n id: 'instruct.specialExams.exceptionPlaceholder',\n defaultMessage: 'Exception',\n description: 'Placeholder for the review policy exception description in add allowance modal',\n },\n timeMultiplierPlaceholder: {\n id: 'instruct.specialExams.timeMultiplierPlaceholder',\n defaultMessage: 'Multiplier (number > 1)',\n description: 'Placeholder for the time multiplier value in add allowance modal',\n },\n edit: {\n id: 'instruct.specialExams.edit',\n defaultMessage: 'Edit',\n description: 'Label for edit action in allowance list',\n },\n delete: {\n id: 'instruct.specialExams.delete',\n defaultMessage: 'Delete',\n description: 'Label for delete action in allowance list',\n },\n deleteAllowance: {\n id: 'instruct.specialExams.deleteAllowance',\n defaultMessage: 'Delete Allowance',\n description: 'Title for delete allowance confirmation modal'\n },\n deleteConfirmation: {\n id: 'instruct.specialExams.deleteConfirmation',\n defaultMessage: 'Delete allowance for {user} for {examName}?',\n description: 'Delete confirmation message'\n },\n deleteError: {\n id: 'instruct.specialExams.deleteError',\n defaultMessage: 'An error occurred while deleting the allowance. Please try again.',\n description: 'Error message displayed when there is an issue deleting an allowance'\n },\n addAdditionalTimeGranted: {\n id: 'instruct.specialExams.addAdditionalTimeGranted',\n defaultMessage: 'Add Time',\n description: 'Label for additional time granted field in add allowance modal',\n },\n addReviewPolicyException: {\n id: 'instruct.specialExams.addReviewPolicyException',\n defaultMessage: 'Add Policy Exception',\n description: 'Label for review policy exception field in add allowance modal',\n },\n addTimeMultiplier: {\n id: 'instruct.specialExams.addTimeMultiplier',\n defaultMessage: 'Add Time Multiplier',\n description: 'Label for time multiplier field in add allowance modal',\n },\n addAllowanceError: {\n id: 'instruct.specialExams.addAllowanceError',\n defaultMessage: 'An error occurred while adding the allowance. Please try again.',\n description: 'Error message displayed when there is an issue adding a new allowance'\n },\n editAllowanceError: {\n id: 'instruct.specialExams.editAllowanceError',\n defaultMessage: 'An error occurred while editing the allowance. Please try again.',\n description: 'Error message displayed when there is an issue editing an allowance'\n },\n cannotModifyAllowance: {\n id: 'instruct.specialExams.cannotModifyAllowance',\n defaultMessage: 'Cannot {action} allowance: {username} has already attempted the exam',\n description: 'Warning message shown when trying to edit or delete an allowance for a student who has already attempted the exam'\n }\n});\n\nexport default messages;\n"]}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -51,3 +51,13 @@ export interface SelectedLearner extends Learner {
|
|
|
51
51
|
progressUrl: string;
|
|
52
52
|
isEnrolled: boolean;
|
|
53
53
|
}
|
|
54
|
+
export interface ProblemDetails {
|
|
55
|
+
currentScore: {
|
|
56
|
+
score: number;
|
|
57
|
+
total: number | null;
|
|
58
|
+
};
|
|
59
|
+
attempts: {
|
|
60
|
+
current: number | null;
|
|
61
|
+
total: number;
|
|
62
|
+
};
|
|
63
|
+
}
|
package/dist/types/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAiBC,CAAC;AAMD,CAAC;AAyBD,CAAC","sourcesContent":["export interface TableCellValue<T> {\n row: {\n original: T,\n },\n}\n\nexport interface PaginationParams {\n page: number,\n pageSize: number,\n}\n\nexport interface APIError {\n response: {\n data: {\n error: string,\n },\n },\n};\n\nexport interface DataList<T> {\n count: number,\n numPages: number,\n results: T[],\n};\n\nexport interface PendingTask {\n taskType: string,\n taskInput: Record<string, any>,\n taskId: string,\n requester: string,\n taskState: string,\n created: string,\n taskOutput: Record<string, any> | null,\n durationSec: number,\n status: string,\n taskMessage: string,\n}\n\nexport interface DataTableFetchDataProps {\n filters: { id: string, value: string }[],\n pageIndex: number,\n sortBy: { id: string, desc: boolean }[],\n}\n\nexport interface Learner {\n username: string,\n fullName: string,\n email: string,\n};\n\nexport interface SelectedLearner extends Learner {\n progressUrl: string,\n isEnrolled: boolean,\n}\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAiBC,CAAC;AAMD,CAAC;AAyBD,CAAC","sourcesContent":["export interface TableCellValue<T> {\n row: {\n original: T,\n },\n}\n\nexport interface PaginationParams {\n page: number,\n pageSize: number,\n}\n\nexport interface APIError {\n response: {\n data: {\n error: string,\n },\n },\n};\n\nexport interface DataList<T> {\n count: number,\n numPages: number,\n results: T[],\n};\n\nexport interface PendingTask {\n taskType: string,\n taskInput: Record<string, any>,\n taskId: string,\n requester: string,\n taskState: string,\n created: string,\n taskOutput: Record<string, any> | null,\n durationSec: number,\n status: string,\n taskMessage: string,\n}\n\nexport interface DataTableFetchDataProps {\n filters: { id: string, value: string }[],\n pageIndex: number,\n sortBy: { id: string, desc: boolean }[],\n}\n\nexport interface Learner {\n username: string,\n fullName: string,\n email: string,\n};\n\nexport interface SelectedLearner extends Learner {\n progressUrl: string,\n isEnrolled: boolean,\n}\n\nexport interface ProblemDetails {\n currentScore: {\n score: number,\n total: number | null,\n },\n attempts: {\n current: number | null,\n total: number,\n },\n}\n"]}
|