mario-education 2.4.518-feedback → 2.4.520-feedback

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.
@@ -31,6 +31,7 @@ export interface IChat {
31
31
  text?: string;
32
32
  time: string;
33
33
  isUser: boolean;
34
+ isSystem?: boolean;
34
35
  options?: string[];
35
36
  }
36
37
  export interface IPrompt {
package/dist/index.js CHANGED
@@ -6163,19 +6163,14 @@ var useCSVImport = function useCSVImport() {
6163
6163
 
6164
6164
  var formData = new FormData();
6165
6165
  formData.append("file", file, file.name);
6166
- console.log("run");
6167
- console.log("📌 Type run:", type.toString());
6168
6166
 
6169
6167
  var _temp8 = function () {
6170
6168
  if (type == CSVType.AllUser) {
6171
- console.log("📌 Type 1:", type.toString());
6172
6169
  return Promise.resolve(file.text()).then(function (fileTextRaw) {
6173
- console.log("📌 fileTextRaw:", fileTextRaw);
6174
6170
  var fileText = fileTextRaw.trim();
6175
6171
  var rows = fileText.split("\n").map(function (row) {
6176
6172
  return row.trim();
6177
6173
  });
6178
- console.log("📌 rows:", rows);
6179
6174
  var headerIndex = rows.findIndex(function (row) {
6180
6175
  return row.split(",").includes("FirstName");
6181
6176
  });
@@ -6185,14 +6180,12 @@ var useCSVImport = function useCSVImport() {
6185
6180
  }
6186
6181
 
6187
6182
  fileText = rows.slice(headerIndex).join("\n");
6188
- console.log("📌 fileText:", fileText);
6189
6183
  var parsedData = Papa.parse(fileText, {
6190
6184
  header: true,
6191
6185
  skipEmptyLines: true
6192
6186
  });
6193
6187
  var header = parsedData.meta.fields;
6194
6188
  var dataRows = parsedData.data;
6195
- console.log("📌 dataRows:", dataRows);
6196
6189
  var chunkSize = 20;
6197
6190
  var chunks = [];
6198
6191
 
@@ -6219,8 +6212,6 @@ var useCSVImport = function useCSVImport() {
6219
6212
  } else {
6220
6213
  var _temp14 = function () {
6221
6214
  if (isCheckDomainIBS) {
6222
- console.log("📌 Type if:", type.toString());
6223
-
6224
6215
  var _temp15 = function () {
6225
6216
  if (type == CSVType.ClassReflection) {
6226
6217
  return Promise.resolve(importClassReflectionCSV(formData)).then(function () {});
@@ -6229,7 +6220,6 @@ var useCSVImport = function useCSVImport() {
6229
6220
 
6230
6221
  if (_temp15 && _temp15.then) return _temp15.then(function () {});
6231
6222
  } else {
6232
- console.log("📌 Type else:", type.toString());
6233
6223
  return Promise.resolve(importCSV(formData, type.toString())).then(function () {});
6234
6224
  }
6235
6225
  }();
@@ -36662,14 +36652,15 @@ var ModelSkillStudent = function ModelSkillStudent(_ref) {
36662
36652
 
36663
36653
  var titleModelSession = name !== t("average_student_stress") ? t("students_who_are_not_feeling_safe") : t("students_who_are_highly_stressed");
36664
36654
  var tagName = name !== t("average_student_stress") ? t("unsafe") : t("high_stressed");
36655
+ var isReadyToLearn = name === t(overallReadinessToLearn);
36665
36656
  return React__default.createElement(core$1.Grid, {
36666
36657
  className: styles$3["model-skill-student"] + " " + styles$3[!studentCount ? "green-background" : "red-background"]
36667
36658
  }, React__default.createElement(ModelStudentSession, {
36668
36659
  open: openModel,
36669
36660
  onClose: handleToggleModel,
36670
- title: name !== t(overallReadinessToLearn) ? titleModelSession : t("students_who_are_not_ready_to_learn"),
36671
- tagName: tagName,
36672
- isHiddenAvg: name == t(overallReadinessToLearn),
36661
+ title: !isReadyToLearn ? titleModelSession : t("students_who_are_not_ready_to_learn"),
36662
+ tagName: !isReadyToLearn ? tagName : t("not_ready_to_learn"),
36663
+ isHiddenAvg: isReadyToLearn,
36673
36664
  responseStudent: responseStudent,
36674
36665
  isStressMode: !(name !== t("average_student_stress"))
36675
36666
  }), !studentCount ? React__default.createElement(CheckCircleIcon, {
@@ -78698,6 +78689,7 @@ var useAIChat = function useAIChat() {
78698
78689
  text: r.message.replace(/\$\{\{/g, ""),
78699
78690
  time: "",
78700
78691
  isUser: ((_r$role = r.role) === null || _r$role === void 0 ? void 0 : _r$role.toString()) == "User",
78692
+ isSystem: false,
78701
78693
  options: (_r$message = r.message) === null || _r$message === void 0 ? void 0 : (_r$message$match = _r$message.match(regex)) === null || _r$message$match === void 0 ? void 0 : (_r$message$match$ = _r$message$match[1]) === null || _r$message$match$ === void 0 ? void 0 : (_r$message$match$$spl = _r$message$match$.split(" || ")) === null || _r$message$match$$spl === void 0 ? void 0 : (_r$message$match$$spl2 = _r$message$match$$spl[1]) === null || _r$message$match$$spl2 === void 0 ? void 0 : _r$message$match$$spl2.split("/")
78702
78694
  };
78703
78695
  })) || []);
@@ -78721,11 +78713,13 @@ var useAIChat = function useAIChat() {
78721
78713
  var responses = chats.concat([{
78722
78714
  isUser: true,
78723
78715
  message: option,
78724
- time: ""
78716
+ time: "",
78717
+ isSystem: false
78725
78718
  }, {
78726
78719
  time: "",
78727
78720
  isUser: false,
78728
- message: ""
78721
+ message: "",
78722
+ isSystem: false
78729
78723
  }]);
78730
78724
  setChats(responses);
78731
78725
  var startDate;
@@ -78936,21 +78930,31 @@ var useAIChat = function useAIChat() {
78936
78930
  isUser: false,
78937
78931
  message: messageText,
78938
78932
  time: "",
78939
- text: ""
78933
+ text: "",
78934
+ isSystem: false
78940
78935
  }], match ? [{
78941
78936
  isUser: false,
78942
78937
  message: match[1],
78943
78938
  time: "",
78944
78939
  text: "",
78945
- options: (_match$1$split$ = match[1].split(" || ")[1]) === null || _match$1$split$ === void 0 ? void 0 : _match$1$split$.split("/")
78940
+ options: (_match$1$split$ = match[1].split(" || ")[1]) === null || _match$1$split$ === void 0 ? void 0 : _match$1$split$.split("/"),
78941
+ isSystem: false
78946
78942
  }] : []).filter(function (r) {
78947
78943
  return r.message;
78948
78944
  });
78949
78945
  aiChats = updatedChats;
78950
78946
  return updatedChats;
78951
78947
  });
78948
+ var formattedSystemMessages = systemMessages.map(function (msg) {
78949
+ return {
78950
+ message: msg.text,
78951
+ time: "",
78952
+ isUser: false,
78953
+ isSystem: true
78954
+ };
78955
+ });
78952
78956
  saveHistoryPrompt(_extends({}, prompt, {
78953
- messages: aiChats,
78957
+ messages: aiChats.concat(formattedSystemMessages),
78954
78958
  output: "",
78955
78959
  promptId: prompt.id,
78956
78960
  grade: "",