@openedx/frontend-app-instructor-dashboard 1.0.0-alpha.38 → 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/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,EA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AC,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,SA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AE,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,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAOpD,MAAM,qBAAqB,GAAG,CAAC,EAAE,QAAQ,EAAE,WAAW,EAA8B,EAAE,EAAE;IACtF,MAAM,IAAI,GAAG,OAAO,EAAE,CAAC;IACvB,MAAM,EAAE,QAAQ,GAAG,EAAE,EAAE,GAAG,SAAS,EAAwB,CAAC;IAC5D,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YAAG,SAAS,EAAC,2BAA2B,YAEpC,QAAQ,KAAK,QAAQ;oBACnB,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,wBAAwB,CAAC;oBACvD,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,sBAAsB,CAAC,GAEvD,EACJ,eAAK,SAAS,EAAC,sCAAsC,aAClD,QAAQ,KAAK,QAAQ,IAAI,CACxB,cAAK,SAAS,EAAC,MAAM,YACnB,KAAC,mBAAmB,IAAC,GAAG,EAAE,eAAe,EAAE,aAAa,EAAE,mBAAmB,GAAI,GAC7E,CACP,EACD,cAAK,SAAS,EAAC,MAAM,YACnB,KAAC,mBAAmB,IAClB,GAAG,EAAE,eAAe,EACpB,UAAU,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,cAAc,CAAC,EACvD,WAAW,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,MAAM,CAAC,EAChD,QAAQ,EAAE,CAAC,eAAe,IAAI,QAAQ,KAAK,QAAQ,EACnD,eAAe,EAAE,eAAe,EAChC,aAAa,EAAE,mBAAmB,GAClC,GACE,IACF,EAEJ,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,CACpF,KAAC,UAAU,IAAa,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,KAAK,IAAI,CAAC,MAAM,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,EAAE,MAAM,2BAA2B,CAAC;AACrH,OAAO,QAAQ,MAAM,uBAAuB,CAAC;AAE7C,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACnF,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAOxD,MAAM,qBAAqB,GAAG,CAAC,EAAE,QAAQ,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AAC,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,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,gBAAgB;QAChC,WAAW,EAAE,oEAAoE;KAClF;IACD,WAAW,EAAE;QACX,EAAE,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AkB;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,gBAAgB;QAChC,WAAW,EAAE,oEAAoE;KAClF;IACD,WAAW,EAAE;QACX,EAAE,EAAE,8BAA8B;QAClC,cAAc,EAAE,cAAc;QAC9B,WAAW,EAAE,kEAAkE;KAChF;IACD,wBAAwB,EAAE;QACxB,EAAE,EAAE,2CAA2C;QAC/C,cAAc,EAAE,yGAAyG;QACzH,WAAW,EAAE,8CAA8C;KAC5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AE,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"]}
|
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"]}
|