@digabi/exam-engine-core 23.2.3-titles-package.0 → 23.3.0-alpha.0

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.
Files changed (95) hide show
  1. package/dist/__tests__/playwright/Annotations.test.d.ts +2 -0
  2. package/dist/__tests__/playwright/Annotations.test.d.ts.map +1 -0
  3. package/dist/__tests__/playwright/Annotations.test.js +156 -0
  4. package/dist/__tests__/playwright/Annotations.test.js.map +1 -0
  5. package/dist/__tests__/playwright/attachments/Attachments.test.d.ts +2 -0
  6. package/dist/__tests__/playwright/attachments/Attachments.test.d.ts.map +1 -0
  7. package/dist/__tests__/playwright/attachments/Attachments.test.js +30 -0
  8. package/dist/__tests__/playwright/attachments/Attachments.test.js.map +1 -0
  9. package/dist/__tests__/playwright/exam/DNDAnswerContainer.test.js +3 -14
  10. package/dist/__tests__/playwright/exam/DNDAnswerContainer.test.js.map +1 -1
  11. package/dist/__tests__/playwright/exam/Exam.test.d.ts +2 -0
  12. package/dist/__tests__/playwright/exam/Exam.test.d.ts.map +1 -0
  13. package/dist/__tests__/playwright/exam/Exam.test.js +30 -0
  14. package/dist/__tests__/playwright/exam/Exam.test.js.map +1 -0
  15. package/dist/__tests__/playwright/grading-instructions/GradingInstructions.test.d.ts +2 -0
  16. package/dist/__tests__/playwright/grading-instructions/GradingInstructions.test.d.ts.map +1 -0
  17. package/dist/__tests__/playwright/grading-instructions/GradingInstructions.test.js +30 -0
  18. package/dist/__tests__/playwright/grading-instructions/GradingInstructions.test.js.map +1 -0
  19. package/dist/__tests__/playwright/stories/Annotations.story.d.ts +12 -0
  20. package/dist/__tests__/playwright/stories/Annotations.story.d.ts.map +1 -0
  21. package/dist/__tests__/playwright/stories/Annotations.story.js +22 -0
  22. package/dist/__tests__/playwright/stories/Annotations.story.js.map +1 -0
  23. package/dist/__tests__/playwright/stories/attachments/Attachments.story.d.ts +13 -0
  24. package/dist/__tests__/playwright/stories/attachments/Attachments.story.d.ts.map +1 -0
  25. package/dist/__tests__/playwright/stories/attachments/Attachments.story.js +17 -0
  26. package/dist/__tests__/playwright/stories/attachments/Attachments.story.js.map +1 -0
  27. package/dist/__tests__/playwright/stories/exam/Exam.story.d.ts +12 -0
  28. package/dist/__tests__/playwright/stories/exam/Exam.story.d.ts.map +1 -0
  29. package/dist/__tests__/playwright/stories/exam/Exam.story.js +56 -0
  30. package/dist/__tests__/playwright/stories/exam/Exam.story.js.map +1 -0
  31. package/dist/__tests__/playwright/stories/grading-intructions/GradingInstructions.story.d.ts +13 -0
  32. package/dist/__tests__/playwright/stories/grading-intructions/GradingInstructions.story.d.ts.map +1 -0
  33. package/dist/__tests__/playwright/stories/grading-intructions/GradingInstructions.story.js +16 -0
  34. package/dist/__tests__/playwright/stories/grading-intructions/GradingInstructions.story.js.map +1 -0
  35. package/dist/__tests__/playwright/utils/utils.d.ts +5 -0
  36. package/dist/__tests__/playwright/utils/utils.d.ts.map +1 -0
  37. package/dist/__tests__/playwright/utils/utils.js +36 -0
  38. package/dist/__tests__/playwright/utils/utils.js.map +1 -0
  39. package/dist/__tests__/tsconfig.tsbuildinfo +1 -1
  40. package/dist/components/exam/DNDAnswer.d.ts +17 -0
  41. package/dist/components/exam/DNDAnswer.d.ts.map +1 -0
  42. package/dist/components/exam/DNDAnswer.js +18 -0
  43. package/dist/components/exam/DNDAnswer.js.map +1 -0
  44. package/dist/components/exam/DNDAnswerOption.d.ts +4 -0
  45. package/dist/components/exam/DNDAnswerOption.d.ts.map +1 -0
  46. package/dist/components/exam/DNDAnswerOption.js +18 -0
  47. package/dist/components/exam/DNDAnswerOption.js.map +1 -0
  48. package/dist/components/exam/DragAndDrop.d.ts +3 -0
  49. package/dist/components/exam/DragAndDrop.d.ts.map +1 -0
  50. package/dist/components/exam/DragAndDrop.js +150 -0
  51. package/dist/components/exam/DragAndDrop.js.map +1 -0
  52. package/dist/components/exam/FinishExam.d.ts +5 -0
  53. package/dist/components/exam/FinishExam.d.ts.map +1 -0
  54. package/dist/components/exam/FinishExam.js +17 -0
  55. package/dist/components/exam/FinishExam.js.map +1 -0
  56. package/dist/components/results/AudioPlaceholder.d.ts +4 -0
  57. package/dist/components/results/AudioPlaceholder.d.ts.map +1 -0
  58. package/dist/components/results/AudioPlaceholder.js +25 -0
  59. package/dist/components/results/AudioPlaceholder.js.map +1 -0
  60. package/dist/components/results/DNDAnswer.d.ts +17 -0
  61. package/dist/components/results/DNDAnswer.d.ts.map +1 -0
  62. package/dist/components/results/DNDAnswer.js +16 -0
  63. package/dist/components/results/DNDAnswer.js.map +1 -0
  64. package/dist/components/results/isExamFinishPageHook.d.ts +2 -0
  65. package/dist/components/results/isExamFinishPageHook.d.ts.map +1 -0
  66. package/dist/components/results/isExamFinishPageHook.js +7 -0
  67. package/dist/components/results/isExamFinishPageHook.js.map +1 -0
  68. package/dist/components/shared/DNDAnswerCommon.d.ts +14 -0
  69. package/dist/components/shared/DNDAnswerCommon.d.ts.map +1 -0
  70. package/dist/components/shared/DNDAnswerCommon.js +25 -0
  71. package/dist/components/shared/DNDAnswerCommon.js.map +1 -0
  72. package/dist/components/shared/DNDAnswerOptionCommon.d.ts +6 -0
  73. package/dist/components/shared/DNDAnswerOptionCommon.d.ts.map +1 -0
  74. package/dist/components/shared/DNDAnswerOptionCommon.js +14 -0
  75. package/dist/components/shared/DNDAnswerOptionCommon.js.map +1 -0
  76. package/dist/components/shared/DNDTitleAndAnswerCommon.d.ts +13 -0
  77. package/dist/components/shared/DNDTitleAndAnswerCommon.d.ts.map +1 -0
  78. package/dist/components/shared/DNDTitleAndAnswerCommon.js +23 -0
  79. package/dist/components/shared/DNDTitleAndAnswerCommon.js.map +1 -0
  80. package/dist/main-bundle.js +3 -3
  81. package/package.json +4 -4
  82. package/dist/i18n/exam_titles_fi-FI.d.ts +0 -46
  83. package/dist/i18n/exam_titles_fi-FI.d.ts.map +0 -1
  84. package/dist/i18n/exam_titles_fi-FI.js +0 -46
  85. package/dist/i18n/exam_titles_fi-FI.js.map +0 -1
  86. package/dist/i18n/exam_titles_fi-FI.json +0 -45
  87. package/dist/i18n/exam_titles_sv-FI.d.ts +0 -46
  88. package/dist/i18n/exam_titles_sv-FI.d.ts.map +0 -1
  89. package/dist/i18n/exam_titles_sv-FI.js +0 -46
  90. package/dist/i18n/exam_titles_sv-FI.js.map +0 -1
  91. package/dist/i18n/exam_titles_sv-FI.json +0 -45
  92. package/dist/i18n/exams.d.ts +0 -11
  93. package/dist/i18n/exams.d.ts.map +0 -1
  94. package/dist/i18n/exams.js +0 -10
  95. package/dist/i18n/exams.js.map +0 -1
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.setupMasteredExam = setupMasteredExam;
7
+ exports.annotate = annotate;
8
+ const exam_engine_exams_1 = require("@digabi/exam-engine-exams");
9
+ const promises_1 = require("fs/promises");
10
+ const path_1 = __importDefault(require("path"));
11
+ const exam_engine_mastering_1 = require("@digabi/exam-engine-mastering");
12
+ async function setupMasteredExam(subject = 'SC') {
13
+ const examPath = (0, exam_engine_exams_1.resolveExam)(`${subject}/${subject}.xml`);
14
+ const resolveAttachment = (filename) => path_1.default.resolve(path_1.default.dirname(examPath), 'attachments', filename);
15
+ const examXml = await (0, promises_1.readFile)(examPath, 'utf-8');
16
+ const [masteredExam] = await (0, exam_engine_mastering_1.masterExam)(examXml, () => '', (0, exam_engine_mastering_1.getMediaMetadataFromLocalFile)(resolveAttachment), {
17
+ removeCorrectAnswers: true
18
+ });
19
+ return masteredExam;
20
+ }
21
+ async function annotate(locator, page) {
22
+ await locator.scrollIntoViewIfNeeded(); // Scroll the element into view
23
+ const box = await locator.boundingBox();
24
+ if (!box)
25
+ throw new Error('Bounding box not found');
26
+ const startX = box.x + 1;
27
+ const startY = box.y + 1;
28
+ const endX = box.x + 200; // Move further to the right to select text
29
+ const endY = startY;
30
+ // Simulate dragging the mouse to select text
31
+ await page.mouse.move(startX, startY);
32
+ await page.mouse.down();
33
+ await page.mouse.move(endX, endY);
34
+ await page.mouse.up();
35
+ }
36
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../__tests__/playwright/utils/utils.ts"],"names":[],"mappings":";;;;;AAMA,8CAQC;AAED,4BAcC;AA9BD,iEAAuD;AACvD,0CAAsC;AAEtC,gDAAuB;AACvB,yEAA0G;AAEnG,KAAK,UAAU,iBAAiB,CAAC,UAAkB,IAAI;IAC5D,MAAM,QAAQ,GAAG,IAAA,+BAAW,EAAC,GAAG,OAAO,IAAI,OAAO,MAAM,CAAC,CAAA;IACzD,MAAM,iBAAiB,GAAG,CAAC,QAAgB,EAAE,EAAE,CAAC,cAAI,CAAC,OAAO,CAAC,cAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,aAAa,EAAE,QAAQ,CAAC,CAAA;IAC7G,MAAM,OAAO,GAAG,MAAM,IAAA,mBAAQ,EAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;IACjD,MAAM,CAAC,YAAY,CAAC,GAAG,MAAM,IAAA,kCAAU,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,IAAA,qDAA6B,EAAC,iBAAiB,CAAC,EAAE;QAC3G,oBAAoB,EAAE,IAAI;KAC3B,CAAC,CAAA;IACF,OAAO,YAAY,CAAA;AACrB,CAAC;AAEM,KAAK,UAAU,QAAQ,CAAC,OAAgB,EAAE,IAAU;IACzD,MAAM,OAAO,CAAC,sBAAsB,EAAE,CAAA,CAAC,+BAA+B;IACtE,MAAM,GAAG,GAAG,MAAM,OAAO,CAAC,WAAW,EAAE,CAAA;IACvC,IAAI,CAAC,GAAG;QAAE,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAA;IACnD,MAAM,MAAM,GAAG,GAAG,CAAC,CAAC,GAAG,CAAC,CAAA;IACxB,MAAM,MAAM,GAAG,GAAG,CAAC,CAAC,GAAG,CAAC,CAAA;IACxB,MAAM,IAAI,GAAG,GAAG,CAAC,CAAC,GAAG,GAAG,CAAA,CAAC,2CAA2C;IACpE,MAAM,IAAI,GAAG,MAAM,CAAA;IAEnB,6CAA6C;IAC7C,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACrC,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAA;IACvB,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;IACjC,MAAM,IAAI,CAAC,KAAK,CAAC,EAAE,EAAE,CAAA;AACvB,CAAC"}