@nualang/nualang-ui-components 0.1.1242 → 0.1.1244
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/README.md +64 -64
- package/dist/Assignments/AssignmentBotSelection/AssignmentBotSelection.js +178 -0
- package/dist/Assignments/AssignmentBotSelection/package.json +7 -0
- package/dist/Assignments/AssignmentCard/AssignmentCard.js +27 -14
- package/dist/Assignments/AssignmentCard/package.json +6 -6
- package/dist/Assignments/AssignmentCardsList/AssignmentCardsList.js +4 -3
- package/dist/Assignments/AssignmentCardsList/package.json +6 -6
- package/dist/Assignments/AssignmentCourseSelection/AssignmentCourseSelection.js +115 -78
- package/dist/Assignments/AssignmentCourseSelection/package.json +6 -6
- package/dist/Assignments/AssignmentExerciseSelection/AssignmentExerciseSelection.js +102 -27
- package/dist/Assignments/AssignmentExerciseSelection/package.json +6 -6
- package/dist/Assignments/AssignmentExerciseSelector/AssignmentExerciseSelector.js +2 -0
- package/dist/Assignments/AssignmentExerciseSelector/package.json +6 -6
- package/dist/Assignments/AssignmentRoleplaySelection/AssignmentRoleplaySelection.js +12 -15
- package/dist/Assignments/AssignmentRoleplaySelection/package.json +6 -6
- package/dist/Assignments/AssignmentSelectExercise/AssignmentSelectExercise.js +25 -6
- package/dist/Assignments/CreateAssignmentDialog/CreateAssignmentDialog.js +110 -39
- package/dist/Assignments/CreateAssignmentDialog/package.json +6 -6
- package/dist/Assignments/SelectAssignmentTypeDialog/package.json +6 -6
- package/dist/Cards/SubscriptionPlan/SubscriptionPlan.js +1 -2
- package/dist/Cards/SubscriptionPlan/nuala.svg +28 -28
- package/dist/Cards/SubscriptionPlan/plus.svg +4 -4
- package/dist/Charts/Bar/TotalGrades/package.json +6 -6
- package/dist/Dialogs/AvatarDialog/AvatarDialog.js +13 -11
- package/dist/Dialogs/GenerateBot/package.json +6 -6
- package/dist/Dialogs/UploadPhrases/UploadPhrases.js +6 -6
- package/dist/Dialogs/UploadRoleplayScript/UploadRoleplayScript.js +11 -11
- package/dist/Editors/Bot/Bot.js +1 -2
- package/dist/Editors/Bot/Editor/BotFlow/BotFlow.js +4 -5
- package/dist/Editors/Phrases/Phrases.js +2 -2
- package/dist/Editors/Roleplay/Roleplay.js +1 -2
- package/dist/Exercises/Bot/Bot.js +25 -11
- package/dist/Exercises/Listener/Listener.js +1 -2
- package/dist/Exercises/Pronouncer/Pronouncer.js +1 -2
- package/dist/Exercises/Roleplay/OriginalRoleplay.js +1 -2
- package/dist/Exercises/Roleplay/Roleplay.js +1 -2
- package/dist/Exercises/Translator/Translator.js +1 -2
- package/dist/Forms/CreateBot/Steps/BotInformation/BotInformation.js +1 -2
- package/dist/Forms/CreateBot/Steps/BotSettings/BotSettings.js +1 -2
- package/dist/Forms/CreateClassroom/Steps/ClassroomInformation/ClassroomInformation.js +1 -2
- package/dist/Forms/CreateClassroom/Steps/ClassroomSettings/ClassroomSettings.js +1 -2
- package/dist/Forms/CreateClassroom/Steps/Customization/Customization.js +1 -2
- package/dist/Forms/CreateCourse/Steps/CourseInformation/CourseInformation.js +1 -2
- package/dist/Forms/CreateCourse/Steps/CourseSettings/CourseSettings.js +1 -2
- package/dist/Forms/CreateCourse/Steps/Customization/Customization.js +1 -2
- package/dist/Forms/CreateGroup/Steps/GroupInformation/GroupInformation.js +1 -2
- package/dist/Forms/CreateGroup/Steps/GroupSettings/GroupSettings.js +1 -2
- package/dist/Forms/CreateRoleplay/Steps/RoleplayInformation/RoleplayInformation.js +1 -2
- package/dist/Forms/CreateRoleplay/Steps/RoleplaySettings/RoleplaySettings.js +1 -2
- package/dist/Forms/CreateRoleplayHook/Steps/RoleplayInformation/RoleplayInformation.js +1 -2
- package/dist/Forms/CreateRoleplayHook/Steps/RoleplaySettings/RoleplaySettings.js +1 -2
- package/dist/Forms/CreateTopic/Steps/Customization/Customization.js +1 -2
- package/dist/Forms/CreateTopic/Steps/TopicInformation/TopicInformation.js +1 -2
- package/dist/Forms/CreateTopic/Steps/TopicSettings/TopicSettings.js +1 -2
- package/dist/Forms/DiscussImageSelector/package.json +6 -6
- package/dist/Forms/DiscussMultiStepFormDialog/package.json +6 -6
- package/dist/Forms/FeedbackForm/FeedbackForm.js +1 -2
- package/dist/Forms/MultiStepForm/MultiStepForm.js +2 -2
- package/dist/Forms/MultiStepFormHook/MultiStepFormHook.js +1 -2
- package/dist/Forms/Settings/Tabs/General/General.js +1 -2
- package/dist/Lists/Categories/package.json +6 -6
- package/dist/Live/Game/Game.js +1 -2
- package/dist/Live/LiveListener/LiveListener.js +1 -2
- package/dist/Misc/AxiosRestExample/AxiosRestExample.js +3 -3
- package/dist/Misc/AxiosRestExample/AxiosRestPostExample.js +6 -6
- package/dist/Misc/ColorLinearProgress/package.json +6 -6
- package/dist/Misc/Notes/Notes.js +1 -2
- package/dist/Misc/NualaCreating/styles.css +68 -68
- package/dist/Navigation/ResponsiveTabs/ResponsiveTabs.js +4 -4
- package/dist/Screens/Classrooms/ViewClassroom/ViewClassroom.js +50 -24
- package/dist/Screens/Courses/ViewCourse/ViewTopic/ViewTopic.js +0 -3
- package/dist/Screens/Dashboard/Dashboard.js +1 -2
- package/dist/Screens/GenerateAudio/GenerateAudio.js +1 -2
- package/dist/Screens/Search/package.json +6 -6
- package/dist/Tables/MeetingPrompstList/MeetingPromptsList.js +148 -71
- package/dist/Tables/Progress/Progress.js +13 -8
- package/dist/Tables/Progress/ProgressList.js +3 -3
- package/dist/Tables/Progress/ProgressTable.js +37 -19
- package/dist/hooks/useRecognition.js +6 -6
- package/dist/hooks/useSpreadsheetState.js +7 -7
- package/dist/img/0-nuala-001.svg +34 -34
- package/dist/img/1-teacher-001.svg +38 -38
- package/dist/img/AudioNuala.svg +165 -165
- package/dist/img/Bronze Medal.svg +545 -545
- package/dist/img/Bronze.svg +349 -349
- package/dist/img/BronzeBadge.svg +493 -493
- package/dist/img/BronzeBadgeWithoutRibbon.svg +317 -317
- package/dist/img/Frame 51.svg +98 -98
- package/dist/img/Frame 52.svg +131 -131
- package/dist/img/Frame 53.svg +139 -139
- package/dist/img/Gold Badge.svg +362 -362
- package/dist/img/Gold Medal.svg +481 -481
- package/dist/img/GoldBadge.svg +470 -470
- package/dist/img/GoldBadgeWithoutRibbon.svg +324 -324
- package/dist/img/NewText.svg +5 -5
- package/dist/img/NualaCreateImage.svg +129 -129
- package/dist/img/NualangLiveAnswerQuickly.svg +103 -103
- package/dist/img/NualangLiveAnwerQuicklyListening.svg +3607 -3607
- package/dist/img/NualangLiveListen.svg +42 -42
- package/dist/img/NualangLiveListenToPhrase.svg +4285 -4285
- package/dist/img/NualangLivePickAnswer.svg +134 -134
- package/dist/img/NualangLiveResult.svg +1235 -1235
- package/dist/img/NualangLiveRoleplayAnswer.svg +334 -334
- package/dist/img/NualangLiveRoleplayConvo.svg +282 -282
- package/dist/img/NualangLiveSeePlace.svg +134 -134
- package/dist/img/NualangLiveTranslate.svg +54 -54
- package/dist/img/NualangLiveTranslateQuickly.svg +197 -197
- package/dist/img/NualangLiveViewConversations.svg +135 -135
- package/dist/img/Polly.svg +17 -17
- package/dist/img/Silver Badge.svg +523 -523
- package/dist/img/Silver Medal.svg +549 -549
- package/dist/img/SilverBadge.svg +655 -655
- package/dist/img/SilverBadgeWithoutRibbon.svg +491 -491
- package/dist/img/avatars/0-nuala-001.svg +34 -34
- package/dist/img/avatars/0-nuala-002.svg +25 -25
- package/dist/img/avatars/0-nuala-003.svg +27 -27
- package/dist/img/avatars/0-nuala-004.svg +41 -41
- package/dist/img/avatars/0-nuala-005.svg +33 -33
- package/dist/img/avatars/0-nuala-006.svg +32 -32
- package/dist/img/avatars/0-nuala-007.svg +37 -37
- package/dist/img/avatars/0-nuala-008.svg +21 -21
- package/dist/img/avatars/0-nuala-009.svg +21 -21
- package/dist/img/avatars/0-nuala-010.svg +39 -39
- package/dist/img/avatars/0-nuala-011.svg +33 -33
- package/dist/img/avatars/0-nuala-012.svg +43 -43
- package/dist/img/avatars/0-nuala-013.svg +36 -36
- package/dist/img/avatars/0-nuala-014.svg +30 -30
- package/dist/img/avatars/0-nuala-015.svg +28 -28
- package/dist/img/avatars/0-nuala-016.svg +24 -24
- package/dist/img/avatars/0-nuala-017.svg +31 -31
- package/dist/img/avatars/0-nuala-018.svg +29 -29
- package/dist/img/avatars/0-nuala-019.svg +57 -57
- package/dist/img/avatars/0-nuala-020.svg +30 -30
- package/dist/img/avatars/0-nuala-021.svg +28 -28
- package/dist/img/avatars/1-teacher-001.svg +38 -38
- package/dist/img/avatars/1-teacher-002.svg +52 -52
- package/dist/img/avatars/1-teacher-003.svg +86 -86
- package/dist/img/avatars/nuala_10_celebrating.svg +44 -44
- package/dist/img/avatars/nuala_10_speaking.svg +45 -45
- package/dist/img/avatars/nuala_11_celebrating.svg +38 -38
- package/dist/img/avatars/nuala_11_speaking.svg +41 -41
- package/dist/img/avatars/nuala_12_celebrating.svg +48 -48
- package/dist/img/avatars/nuala_12_speaking.svg +49 -49
- package/dist/img/avatars/nuala_13_celebrating.svg +41 -41
- package/dist/img/avatars/nuala_13_speaking.svg +44 -44
- package/dist/img/avatars/nuala_14_celebrating.svg +35 -35
- package/dist/img/avatars/nuala_14_speaking.svg +36 -36
- package/dist/img/avatars/nuala_15_celebrating.svg +33 -33
- package/dist/img/avatars/nuala_15_speaking.svg +36 -36
- package/dist/img/avatars/nuala_16_celebrating.svg +29 -29
- package/dist/img/avatars/nuala_16_speaking.svg +32 -32
- package/dist/img/avatars/nuala_17_celebrating.svg +36 -36
- package/dist/img/avatars/nuala_17_speaking.svg +39 -39
- package/dist/img/avatars/nuala_18_celebrating.svg +34 -34
- package/dist/img/avatars/nuala_18_speaking.svg +37 -37
- package/dist/img/avatars/nuala_19_celebrating.svg +62 -62
- package/dist/img/avatars/nuala_19_speaking.svg +65 -65
- package/dist/img/avatars/nuala_1_celebrating.svg +30 -30
- package/dist/img/avatars/nuala_1_speaking.svg +37 -37
- package/dist/img/avatars/nuala_20_celebrating.svg +35 -35
- package/dist/img/avatars/nuala_20_speaking.svg +38 -38
- package/dist/img/avatars/nuala_21_celebrating.svg +33 -33
- package/dist/img/avatars/nuala_21_speaking.svg +36 -36
- package/dist/img/avatars/nuala_2_celebrating.svg +21 -21
- package/dist/img/avatars/nuala_2_speaking.svg +29 -29
- package/dist/img/avatars/nuala_3_celebrating.svg +20 -20
- package/dist/img/avatars/nuala_3_speaking.svg +28 -28
- package/dist/img/avatars/nuala_4_celebrating.svg +33 -33
- package/dist/img/avatars/nuala_4_speaking.svg +41 -41
- package/dist/img/avatars/nuala_5_celebrating.svg +30 -30
- package/dist/img/avatars/nuala_5_speaking.svg +36 -36
- package/dist/img/avatars/nuala_6_celebrating.svg +37 -37
- package/dist/img/avatars/nuala_6_speaking.svg +36 -36
- package/dist/img/avatars/nuala_7_celebrating.svg +42 -42
- package/dist/img/avatars/nuala_7_speaking.svg +43 -43
- package/dist/img/avatars/nuala_8_celebrating.svg +26 -26
- package/dist/img/avatars/nuala_8_speaking.svg +29 -29
- package/dist/img/avatars/nuala_9_celebrating.svg +26 -26
- package/dist/img/avatars/nuala_9_speaking.svg +27 -27
- package/dist/img/aws.svg +5 -5
- package/dist/img/azure.svg +9 -9
- package/dist/img/bot-error.svg +28 -28
- package/dist/img/bot_nuala.svg +45 -45
- package/dist/img/classroom.svg +178 -178
- package/dist/img/course.svg +113 -113
- package/dist/img/dashboard.svg +103 -103
- package/dist/img/nuala_1_celebrating.svg +33 -33
- package/dist/img/nuala_2_celebrating.svg +20 -20
- package/dist/img/nuala_3_celebrating.svg +21 -21
- package/dist/img/nuala_4_celebrating.svg +30 -30
- package/dist/img/nuala_5_celebrating.svg +30 -30
- package/dist/img/nuala_celebrating.svg +39 -39
- package/dist/img/nuala_sign_in.svg +62 -62
- package/dist/img/nuala_speaking.svg +41 -41
- package/dist/img/nuala_speaking_2.svg +41 -41
- package/dist/img/nuala_speaking_3.svg +41 -41
- package/dist/img/nuala_speaking_4.svg +41 -41
- package/dist/img/nualang-logo-primary.svg +17 -17
- package/dist/img/nualangSquareIcon.svg +18 -18
- package/dist/img/nualas.svg +185 -185
- package/dist/img/sentiment_dissatisfied_24px.svg +3 -3
- package/dist/img/sentiment_satisfied_24px.svg +3 -3
- package/dist/img/sentiment_very_satisfied_24px.svg +3 -3
- package/dist/img/stars1.svg +44 -44
- package/dist/img/stars2.svg +30 -30
- package/dist/img/structuring.svg +76 -76
- package/dist/img/teacher-create-2.svg +81 -81
- package/dist/img/teacher-create.svg +49 -49
- package/dist/img/teacher-world.svg +271 -271
- package/dist/img/teacher.svg +89 -89
- package/dist/img/world.svg +41 -41
- package/dist/utils/canvasUtils.js +5 -5
- package/dist/utils/index.js +31 -19
- package/package.json +185 -185
package/README.md
CHANGED
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
# Nualang ui-components
|
|
2
|
-
This is the ui-components repository for the Nualang product. The components
|
|
3
|
-
are developed, reviewed and tested with storybook and a library is then published
|
|
4
|
-
to `npm` and consumed from there by nualang web apps.
|
|
5
|
-
|
|
6
|
-
## Getting Started
|
|
7
|
-
Clone this repository and then execute `npm install`. `npm start` will start
|
|
8
|
-
[stoybook](https://storybook.js.org) and allow you to brrowse the available components.
|
|
9
|
-
|
|
10
|
-
## Develop
|
|
11
|
-
```
|
|
12
|
-
npm start
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## Create Local Package
|
|
16
|
-
Compile and pack (This will create a '.tgz' file):
|
|
17
|
-
```
|
|
18
|
-
npm run localpack
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
Install package (Inside webapp):
|
|
22
|
-
```
|
|
23
|
-
npm i ../ui-components/fathomtech-nualang-ui-components-0.1.XXX.tgz
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
If webapp is caching previous versions (Add a character to the end of the .tgz, e.g 'a') and install again:
|
|
27
|
-
```
|
|
28
|
-
yarn add ../ui-components/fathomtech-nualang-ui-components-0.1.XXXa.tgz
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
## Publish to npm
|
|
32
|
-
Make sure that the version number has been updayed in package.json.
|
|
33
|
-
Ensure that you have committed the latest version to git.
|
|
34
|
-
Execute:-
|
|
35
|
-
```bash
|
|
36
|
-
npm run postversion
|
|
37
|
-
```
|
|
38
|
-
npm will complain if you try to re-publish a previously used version number.
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
## Additional Scripts
|
|
42
|
-
In the project directory, you can run:
|
|
43
|
-
|
|
44
|
-
### `npm run storybook`
|
|
45
|
-
Runs the app in the development mode.<br />
|
|
46
|
-
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
|
|
47
|
-
|
|
48
|
-
The page will reload if you make edits.<br />
|
|
49
|
-
You should also see any lint errors in the console.
|
|
50
|
-
|
|
51
|
-
### `npm run test`
|
|
52
|
-
Launches the test runner in interactive watch mode.<br />
|
|
53
|
-
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
|
|
54
|
-
|
|
55
|
-
### `npm run lint`
|
|
56
|
-
Check for any lint errors or warnings.
|
|
57
|
-
|
|
58
|
-
### `npm run compile`
|
|
59
|
-
Run the babel compiler to compile es6 to js.
|
|
60
|
-
|
|
61
|
-
### `npm run postversion`
|
|
62
|
-
Publish a new version of the pacakage to npm. npm will complain
|
|
63
|
-
|
|
64
|
-
### `npm run chromatic`
|
|
1
|
+
# Nualang ui-components
|
|
2
|
+
This is the ui-components repository for the Nualang product. The components
|
|
3
|
+
are developed, reviewed and tested with storybook and a library is then published
|
|
4
|
+
to `npm` and consumed from there by nualang web apps.
|
|
5
|
+
|
|
6
|
+
## Getting Started
|
|
7
|
+
Clone this repository and then execute `npm install`. `npm start` will start
|
|
8
|
+
[stoybook](https://storybook.js.org) and allow you to brrowse the available components.
|
|
9
|
+
|
|
10
|
+
## Develop
|
|
11
|
+
```
|
|
12
|
+
npm start
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Create Local Package
|
|
16
|
+
Compile and pack (This will create a '.tgz' file):
|
|
17
|
+
```
|
|
18
|
+
npm run localpack
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Install package (Inside webapp):
|
|
22
|
+
```
|
|
23
|
+
npm i ../ui-components/fathomtech-nualang-ui-components-0.1.XXX.tgz
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
If webapp is caching previous versions (Add a character to the end of the .tgz, e.g 'a') and install again:
|
|
27
|
+
```
|
|
28
|
+
yarn add ../ui-components/fathomtech-nualang-ui-components-0.1.XXXa.tgz
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Publish to npm
|
|
32
|
+
Make sure that the version number has been updayed in package.json.
|
|
33
|
+
Ensure that you have committed the latest version to git.
|
|
34
|
+
Execute:-
|
|
35
|
+
```bash
|
|
36
|
+
npm run postversion
|
|
37
|
+
```
|
|
38
|
+
npm will complain if you try to re-publish a previously used version number.
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
## Additional Scripts
|
|
42
|
+
In the project directory, you can run:
|
|
43
|
+
|
|
44
|
+
### `npm run storybook`
|
|
45
|
+
Runs the app in the development mode.<br />
|
|
46
|
+
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
|
|
47
|
+
|
|
48
|
+
The page will reload if you make edits.<br />
|
|
49
|
+
You should also see any lint errors in the console.
|
|
50
|
+
|
|
51
|
+
### `npm run test`
|
|
52
|
+
Launches the test runner in interactive watch mode.<br />
|
|
53
|
+
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
|
|
54
|
+
|
|
55
|
+
### `npm run lint`
|
|
56
|
+
Check for any lint errors or warnings.
|
|
57
|
+
|
|
58
|
+
### `npm run compile`
|
|
59
|
+
Run the babel compiler to compile es6 to js.
|
|
60
|
+
|
|
61
|
+
### `npm run postversion`
|
|
62
|
+
Publish a new version of the pacakage to npm. npm will complain
|
|
63
|
+
|
|
64
|
+
### `npm run chromatic`
|
|
65
65
|
Publish a new version of the pacakage to https://www.chromatic.com/
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.InProgressBadge = InProgressBadge;
|
|
7
|
+
exports.ProgressBadge = ProgressBadge;
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
var _react = require("react");
|
|
10
|
+
var _material = require("@mui/material");
|
|
11
|
+
var _iconsMaterial = require("@mui/icons-material");
|
|
12
|
+
var _reactRouterDom = require("react-router-dom");
|
|
13
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
+
const sxGreenColor = theme => ({
|
|
15
|
+
color: theme.palette.success ? theme.palette.success.dark : ""
|
|
16
|
+
});
|
|
17
|
+
const sxInfoColor = theme => ({
|
|
18
|
+
color: theme.palette.info ? theme.palette.info.main : ""
|
|
19
|
+
});
|
|
20
|
+
function ProgressBadge({
|
|
21
|
+
completions
|
|
22
|
+
}) {
|
|
23
|
+
return completions > 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Badge, {
|
|
24
|
+
sx: sxGreenColor,
|
|
25
|
+
badgeContent: completions,
|
|
26
|
+
color: "default",
|
|
27
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_iconsMaterial.Done, {})
|
|
28
|
+
}) : null;
|
|
29
|
+
}
|
|
30
|
+
function InProgressBadge({
|
|
31
|
+
progressCount
|
|
32
|
+
}) {
|
|
33
|
+
return progressCount > 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Badge, {
|
|
34
|
+
sx: sxInfoColor,
|
|
35
|
+
color: "default",
|
|
36
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_iconsMaterial.Timelapse, {})
|
|
37
|
+
}) : null;
|
|
38
|
+
}
|
|
39
|
+
function Bot({
|
|
40
|
+
bot,
|
|
41
|
+
courseSectionTopicId,
|
|
42
|
+
isBotSelected,
|
|
43
|
+
t,
|
|
44
|
+
isExerciseSelected,
|
|
45
|
+
handleSelectExercise = null,
|
|
46
|
+
selectedExercises,
|
|
47
|
+
useCase,
|
|
48
|
+
assignment,
|
|
49
|
+
lastClickedExerciseId,
|
|
50
|
+
memberCourseCompletions,
|
|
51
|
+
topicProgress,
|
|
52
|
+
isCreator
|
|
53
|
+
}) {
|
|
54
|
+
const navigate = (0, _reactRouterDom.useNavigate)();
|
|
55
|
+
const params = (0, _reactRouterDom.useParams)();
|
|
56
|
+
const {
|
|
57
|
+
classroomId
|
|
58
|
+
} = params;
|
|
59
|
+
const [courseId, sectionId, topicId] = courseSectionTopicId ? courseSectionTopicId.split("|") : "";
|
|
60
|
+
const [lasClickedCourseId, lasClickedSectionId, lasClickedTopicId, lastClickedAssignmentId, lastClickedBotId] = lastClickedExerciseId?.split("|") || [];
|
|
61
|
+
const addSearchParams = () => {
|
|
62
|
+
if (!classroomId || !courseId || !sectionId || !topicId || !bot?.botId) {
|
|
63
|
+
console.error("Missing required parameters for navigation");
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
const lastClickedExercise = {
|
|
67
|
+
courseSectionTopicId: `${courseSectionTopicId}|${assignment.assignmentId}|${bot.botId}`
|
|
68
|
+
};
|
|
69
|
+
localStorage.setItem("lastClickedExercise", JSON.stringify(lastClickedExercise));
|
|
70
|
+
navigate(`/classrooms/${classroomId}/${courseId}/${sectionId}/${topicId}/bots/${bot?.botId}?assignmentId=${assignment.assignmentId}`);
|
|
71
|
+
};
|
|
72
|
+
const [open, setOpen] = (0, _react.useState)(lastClickedBotId === bot.botId && lastClickedAssignmentId === assignment.assignmentId);
|
|
73
|
+
const [isSelected, setIsSelected] = (0, _react.useState)(false);
|
|
74
|
+
(0, _react.useEffect)(() => {
|
|
75
|
+
// Check if this exercise is selected
|
|
76
|
+
const exerciseSelected = selectedExercises?.some(exercise => exercise.botId === bot.botId);
|
|
77
|
+
setIsSelected(exerciseSelected);
|
|
78
|
+
}, [selectedExercises, bot.botId]);
|
|
79
|
+
const handleClick = () => {
|
|
80
|
+
setIsSelected(!isSelected);
|
|
81
|
+
const exercise = {
|
|
82
|
+
botId: bot.botId,
|
|
83
|
+
courseSectionTopicId
|
|
84
|
+
};
|
|
85
|
+
handleSelectExercise([exercise]);
|
|
86
|
+
};
|
|
87
|
+
const getBotCompletion = () => {
|
|
88
|
+
if (!Array.isArray(memberCourseCompletions) || memberCourseCompletions.length === 0) {
|
|
89
|
+
return 0;
|
|
90
|
+
}
|
|
91
|
+
const botCompletion = memberCourseCompletions.filter(completion => completion.botId === bot.botId);
|
|
92
|
+
return botCompletion.length;
|
|
93
|
+
};
|
|
94
|
+
const getBotProgress = () => {
|
|
95
|
+
const progress = topicProgress?.filter(progress => progress.botId === bot.botId && progress.existingMessages && progress.existingMessages !== null);
|
|
96
|
+
return progress?.length || 0;
|
|
97
|
+
};
|
|
98
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
99
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
100
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.ListItemButton, {
|
|
101
|
+
onClick: () => {
|
|
102
|
+
if (useCase === "assignment-start") {
|
|
103
|
+
addSearchParams();
|
|
104
|
+
} else if (handleSelectExercise) {
|
|
105
|
+
handleClick();
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
sx: {
|
|
109
|
+
display: "flex",
|
|
110
|
+
alignItems: "center",
|
|
111
|
+
justifyContent: "space-between",
|
|
112
|
+
flexDirection: {
|
|
113
|
+
xs: "column",
|
|
114
|
+
sm: "row"
|
|
115
|
+
},
|
|
116
|
+
marginLeft: "60px"
|
|
117
|
+
},
|
|
118
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
119
|
+
display: "flex",
|
|
120
|
+
alignItems: "center",
|
|
121
|
+
width: {
|
|
122
|
+
xs: "100%",
|
|
123
|
+
sm: "85%"
|
|
124
|
+
},
|
|
125
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Avatar, {
|
|
126
|
+
src: bot.picture
|
|
127
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.ListItemText, {
|
|
128
|
+
primary: bot.botName,
|
|
129
|
+
secondary: bot.description,
|
|
130
|
+
sx: {
|
|
131
|
+
marginLeft: 2
|
|
132
|
+
}
|
|
133
|
+
})]
|
|
134
|
+
}), useCase === "assignment-select" && /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Checkbox, {
|
|
135
|
+
checked: isSelected,
|
|
136
|
+
onClick: e => {
|
|
137
|
+
e.stopPropagation();
|
|
138
|
+
handleClick();
|
|
139
|
+
}
|
|
140
|
+
}), useCase === "assignment-start" && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.ListItemIcon, {
|
|
141
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(InProgressBadge, {
|
|
142
|
+
progressCount: getBotProgress()
|
|
143
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(ProgressBadge, {
|
|
144
|
+
completions: getBotCompletion()
|
|
145
|
+
})]
|
|
146
|
+
})]
|
|
147
|
+
})
|
|
148
|
+
})
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
function AssignmentBotSelection({
|
|
152
|
+
bots = [],
|
|
153
|
+
courseSectionTopicId,
|
|
154
|
+
t,
|
|
155
|
+
isExerciseSelected,
|
|
156
|
+
handleSelectExercise,
|
|
157
|
+
selectedExercises,
|
|
158
|
+
useCase,
|
|
159
|
+
assignment,
|
|
160
|
+
lastClickedExerciseId,
|
|
161
|
+
memberCourseCompletions,
|
|
162
|
+
topicProgress
|
|
163
|
+
}) {
|
|
164
|
+
return bots.map((bot, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(Bot, {
|
|
165
|
+
bot: bot,
|
|
166
|
+
courseSectionTopicId: courseSectionTopicId,
|
|
167
|
+
t: t,
|
|
168
|
+
isExerciseSelected: isExerciseSelected,
|
|
169
|
+
handleSelectExercise: handleSelectExercise,
|
|
170
|
+
selectedExercises: selectedExercises,
|
|
171
|
+
useCase: useCase,
|
|
172
|
+
assignment: assignment,
|
|
173
|
+
lastClickedExerciseId: lastClickedExerciseId,
|
|
174
|
+
memberCourseCompletions: memberCourseCompletions,
|
|
175
|
+
topicProgress: topicProgress
|
|
176
|
+
}, index));
|
|
177
|
+
}
|
|
178
|
+
var _default = exports.default = AssignmentBotSelection;
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = AssignmentCard;
|
|
7
|
-
var _react =
|
|
7
|
+
var _react = require("react");
|
|
8
8
|
var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
|
|
9
9
|
var _material = require("@mui/material");
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
@@ -14,8 +14,6 @@ var _useConfirm = _interopRequireDefault(require("../../hooks/useConfirm"));
|
|
|
14
14
|
var _iconsMaterial = require("@mui/icons-material");
|
|
15
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
16
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
18
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
19
17
|
function AssignmentCard({
|
|
20
18
|
t = text => text,
|
|
21
19
|
index = 0,
|
|
@@ -33,8 +31,10 @@ function AssignmentCard({
|
|
|
33
31
|
memberId,
|
|
34
32
|
fetchMemberCourseCompletions,
|
|
35
33
|
lastClickedExerciseId,
|
|
36
|
-
handleViewProgress
|
|
34
|
+
handleViewProgress,
|
|
35
|
+
lastAssignmentFetch
|
|
37
36
|
}) {
|
|
37
|
+
console.log(assignment);
|
|
38
38
|
const [confirm] = (0, _useConfirm.default)(t);
|
|
39
39
|
const {
|
|
40
40
|
useQuery
|
|
@@ -45,7 +45,7 @@ function AssignmentCard({
|
|
|
45
45
|
await deleteAssignment(classroomId, assignmentId);
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
|
-
const calculateDaysUntilDue = (dueDate, scheduledDate) => {
|
|
48
|
+
const calculateDaysUntilDue = (dueDate, scheduledDate, t) => {
|
|
49
49
|
const now = new Date();
|
|
50
50
|
const due = new Date(dueDate);
|
|
51
51
|
const scheduled = new Date(scheduledDate);
|
|
@@ -112,6 +112,8 @@ function AssignmentCard({
|
|
|
112
112
|
staleTime: 500000
|
|
113
113
|
});
|
|
114
114
|
const memberCourseCompletions = (0, _react.useMemo)(() => memberCourseCompletionsQuery.isSuccess && memberCourseCompletionsQuery.data ? memberCourseCompletionsQuery.data : {}, [memberCourseCompletionsQuery.data, memberCourseCompletionsQuery.isSuccess]);
|
|
115
|
+
const lastFetch = lastAssignmentFetch?.current[assignment?.classroomId] || 0;
|
|
116
|
+
const isNew = assignment?.updatedAt > lastFetch && !isCreator;
|
|
115
117
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Card, {
|
|
116
118
|
sx: {
|
|
117
119
|
display: "flex",
|
|
@@ -124,25 +126,36 @@ function AssignmentCard({
|
|
|
124
126
|
},
|
|
125
127
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Grid, {
|
|
126
128
|
container: true,
|
|
127
|
-
sx: {
|
|
128
|
-
width: '100%'
|
|
129
|
-
},
|
|
130
129
|
spacing: 2,
|
|
131
130
|
alignItems: "center",
|
|
132
131
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Grid, {
|
|
133
132
|
size: "grow",
|
|
134
133
|
flexDirection: "column",
|
|
135
134
|
display: "flex",
|
|
136
|
-
children: /*#__PURE__*/(0, _jsxRuntime.
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
children:
|
|
135
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
136
|
+
display: "flex",
|
|
137
|
+
alignItems: "center",
|
|
138
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
139
|
+
variant: "body1",
|
|
140
|
+
component: "div",
|
|
141
|
+
children: assignment.title
|
|
142
|
+
}), isNew && /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
|
|
143
|
+
ml: 2,
|
|
144
|
+
px: 1,
|
|
145
|
+
py: 0.25,
|
|
146
|
+
bgcolor: "#8300A1",
|
|
147
|
+
color: "white",
|
|
148
|
+
fontSize: "0.75rem",
|
|
149
|
+
borderRadius: 1,
|
|
150
|
+
fontWeight: "bold",
|
|
151
|
+
children: t('NEW')
|
|
152
|
+
})]
|
|
140
153
|
})
|
|
141
154
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Grid, {
|
|
142
155
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
143
156
|
variant: "button",
|
|
144
157
|
color: "text.secondary",
|
|
145
|
-
children: calculateDaysUntilDue(assignment.dueDate, assignment.scheduleDate)
|
|
158
|
+
children: calculateDaysUntilDue(assignment.dueDate, assignment.scheduleDate, t)
|
|
146
159
|
})
|
|
147
160
|
}), isCreator && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Grid, {
|
|
148
161
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Tooltip, {
|
|
@@ -174,7 +187,7 @@ function AssignmentCard({
|
|
|
174
187
|
spacing: 2,
|
|
175
188
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Grid, {
|
|
176
189
|
size: {
|
|
177
|
-
md:
|
|
190
|
+
md: 10,
|
|
178
191
|
xs: 12
|
|
179
192
|
},
|
|
180
193
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "AssignmentCard",
|
|
3
|
-
"version": "0.0.0",
|
|
4
|
-
"private": true,
|
|
5
|
-
"main": "./AssignmentCard.js"
|
|
6
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "AssignmentCard",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"main": "./AssignmentCard.js"
|
|
6
|
+
}
|
|
7
7
|
|
|
@@ -13,8 +13,7 @@ var _teacherCreate = _interopRequireDefault(require("../../img/teacher-create-2.
|
|
|
13
13
|
var _Add = _interopRequireDefault(require("@mui/icons-material/Add"));
|
|
14
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
15
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
|
-
function
|
|
17
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
16
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
18
17
|
const AssignmentCardsList = ({
|
|
19
18
|
t = text => text,
|
|
20
19
|
assignments = [],
|
|
@@ -31,7 +30,8 @@ const AssignmentCardsList = ({
|
|
|
31
30
|
progressHelpers,
|
|
32
31
|
fetchMemberCourseCompletions,
|
|
33
32
|
memberId,
|
|
34
|
-
handleViewProgress
|
|
33
|
+
handleViewProgress,
|
|
34
|
+
lastAssignmentFetch
|
|
35
35
|
}) => {
|
|
36
36
|
const [lastClickedExerciseId, setLastClickedExerciseId] = (0, _react.useState)(null);
|
|
37
37
|
(0, _react.useEffect)(() => {
|
|
@@ -133,6 +133,7 @@ const AssignmentCardsList = ({
|
|
|
133
133
|
return new Date(assignment.scheduleDate) <= new Date();
|
|
134
134
|
}).map((assignment, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_AssignmentCard.default, {
|
|
135
135
|
index: index,
|
|
136
|
+
lastAssignmentFetch: lastAssignmentFetch,
|
|
136
137
|
assignment: assignment,
|
|
137
138
|
t: t,
|
|
138
139
|
isCreator: isCreator,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "AssignmentCardsList",
|
|
3
|
-
"version": "0.0.0",
|
|
4
|
-
"private": true,
|
|
5
|
-
"main": "./AssignmentCardsList.js"
|
|
6
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "AssignmentCardsList",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"main": "./AssignmentCardsList.js"
|
|
6
|
+
}
|
|
7
7
|
|