eat-js-sdk 2.0.58 → 2.0.59

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.
@@ -5296,8 +5296,9 @@ const generatePreviewScoringMetadata = (data) => {
5296
5296
  return null;
5297
5297
  };
5298
5298
  const loadSessionData = async (sessionId, mode) => {
5299
- const skipUserValidationStr = get(skipUserValidation) ? "?skip_user_validation=true" : "";
5300
- const { data: session } = await useGet(`sessions/${sessionId}${skipUserValidationStr}`);
5299
+ get(skipUserValidation) ? "?skip_user_validation=true" : "";
5300
+ const includeHtmlTags = "?include=[html_tags]";
5301
+ const { data: session } = await useGet(`sessions/${sessionId}/item${includeHtmlTags}`);
5301
5302
  if (!session) {
5302
5303
  throw new Error(`No session data found for session ID: ${sessionId}`);
5303
5304
  }
@@ -5306,13 +5307,12 @@ const loadSessionData = async (sessionId, mode) => {
5306
5307
  metadata,
5307
5308
  is_finished: isFinished,
5308
5309
  is_locked: isLocked,
5309
- total_correct_answers: totalCorrectAnswers
5310
+ total_correct_answers: totalCorrectAnswers,
5311
+ item
5310
5312
  } = session;
5311
5313
  if (!itemId) {
5312
5314
  throw new Error("No item ID found in session");
5313
5315
  }
5314
- const includeAnswer = `?include=[html_tags${isFinished && isLocked ? ",correct_answer" : ""}]`;
5315
- const { data: item } = await useGet(`items/${itemId}${includeAnswer}`);
5316
5316
  return {
5317
5317
  ...item,
5318
5318
  sessionId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eat-js-sdk",
3
- "version": "2.0.58",
3
+ "version": "2.0.59",
4
4
  "change version": "2.0.2",
5
5
  "description": "Authoring tool frontend SDK",
6
6
  "contributors": [