@nualang/nualang-ui-components 0.1.1286 → 0.1.1288

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.
@@ -501,6 +501,7 @@ function BotListItem({
501
501
  botIndex,
502
502
  moveBot,
503
503
  onDropBot,
504
+ parentClassroom,
504
505
  ...otherProps
505
506
  }) {
506
507
  const params = (0, _reactRouterDom.useParams)();
@@ -636,11 +637,6 @@ function BotListItem({
636
637
  marginBottom: "8px"
637
638
  },
638
639
  children: t("challenge_bot_desc")
639
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
640
- style: {
641
- fontSize: "12px"
642
- },
643
- children: t("freely_changed")
644
640
  })]
645
641
  })
646
642
  }))(({
@@ -761,7 +757,7 @@ function BotListItem({
761
757
  display: "flex",
762
758
  alignItems: "center",
763
759
  gap: "8px",
764
- children: [bot.botName || "", isCreator ? /*#__PURE__*/(0, _jsxRuntime.jsx)(ChallengeBotHtmlTooltip, {
760
+ children: [bot.botName || "", isCreator || parentClassroom?.isCreator ? /*#__PURE__*/(0, _jsxRuntime.jsx)(ChallengeBotHtmlTooltip, {
765
761
  placement: "right",
766
762
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Chip, {
767
763
  label: t("challenge_mode"),
@@ -796,7 +792,7 @@ function BotListItem({
796
792
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
797
793
  variant: "body1",
798
794
  children: bot.botName || ""
799
- }), isCreator ? /*#__PURE__*/(0, _jsxRuntime.jsx)(ChallengeBotHtmlTooltip, {
795
+ }), isCreator || parentClassroom?.isCreator ? /*#__PURE__*/(0, _jsxRuntime.jsx)(ChallengeBotHtmlTooltip, {
800
796
  placement: "right",
801
797
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Chip, {
802
798
  label: t("challenge_mode"),
@@ -1150,7 +1146,7 @@ function Exercises(props) {
1150
1146
  }
1151
1147
  }, [bots, botsStringified]);
1152
1148
  (0, _react.useEffect)(() => {
1153
- if (!isChallengeModeStudent && !isCreator) {
1149
+ if (!isChallengeModeStudent && !isCreator && !parentClassroom?.isCreator) {
1154
1150
  setBotsArray(bots.filter(bot => !bot.isChallengeBot || bot.isChallengeBot === false));
1155
1151
  }
1156
1152
  }, [bots, isChallengeModeStudent, isCreator]);
@@ -1821,6 +1817,7 @@ function Exercises(props) {
1821
1817
  botIndex: idx,
1822
1818
  moveBot: moveBot,
1823
1819
  onDropBot: onDropBot,
1820
+ parentClassroom: parentClassroom,
1824
1821
  ...props
1825
1822
  }, bot.botId)), isCreator ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.ListItemButton, {
1826
1823
  "data-cy": "add-bot-exercise",
@@ -293,7 +293,9 @@ const calcTopicCompletions = (topic, completions = [], isSectionHidden, assignme
293
293
  });
294
294
  const bots = topic.bots.map(bot => {
295
295
  const isUnassignedBot = assignmentExercises ? assignmentExercises && !assignmentExercises.some(e => e.botId === bot.botId) : false;
296
- if (isBotsHidden || bot.isBotHidden || isSectionHidden || topic.isTopicHidden || isUnassignedBot) {
296
+ if (isBotsHidden || bot.isBotHidden || bot.isChallengeBot ||
297
+ // Don't count challenge bots until we can identify if they're visible for the particular student
298
+ isSectionHidden || topic.isTopicHidden || isUnassignedBot) {
297
299
  return {
298
300
  ...bot,
299
301
  completedCount: 0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nualang/nualang-ui-components",
3
- "version": "0.1.1286",
3
+ "version": "0.1.1288",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "dist",