@gamelearn/arcade-components 0.22.0 → 0.22.1

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.
@@ -60,6 +60,7 @@ var WriterPuzzleComponent = function WriterPuzzleComponent(_ref) {
60
60
  skip = _ref.skip,
61
61
  type = _ref.type,
62
62
  documentTitle = _ref.documentTitle,
63
+ documentTitle_labelId = _ref.documentTitle_labelId,
63
64
  texts = _ref.texts,
64
65
  soundActions = _ref.soundActions;
65
66
 
@@ -163,20 +164,20 @@ var WriterPuzzleComponent = function WriterPuzzleComponent(_ref) {
163
164
  var currentDecision = decisionsList.filter(function (obj) {
164
165
  return obj.currenTextParagraph === indexOfText;
165
166
  });
166
- return currentDecision[0].fullText;
167
+ return currentDecision[0].fullText_labelId;
167
168
  };
168
169
 
169
170
  var createLecture = function createLecture() {
170
171
  return texts.map(function (element, indexOfText) {
171
172
  if (element.type === 'fixed') {
172
- if (element.fullText) {
173
- return element.fullText;
174
- }
173
+ var _element$fullText_lab;
174
+
175
+ return (_element$fullText_lab = element.fullText_labelId) !== null && _element$fullText_lab !== void 0 ? _element$fullText_lab : element.fullText;
175
176
  } else if (element.type === 'election') {
176
- var correctElection = getCorrectElection(element);
177
+ var correctElection = getCorrectElection(element); // 0,1,2 or undefined
177
178
 
178
- if (correctElection) {
179
- return element.electionTexts[correctElection].fullText;
179
+ if (correctElection >= 0) {
180
+ return element.electionTexts[correctElection].fullText_labelId;
180
181
  } // If there is no correct Election then it should pick the election of student
181
182
 
182
183
 
@@ -237,11 +238,12 @@ var WriterPuzzleComponent = function WriterPuzzleComponent(_ref) {
237
238
  var handleLectures = function handleLectures() {
238
239
  var text = createLecture();
239
240
  emitEvent({
240
- type: 'finishLecture',
241
+ type: 'finishMedia',
241
242
  payload: {
242
- name: documentTitle,
243
+ name: documentTitle_labelId,
243
244
  text: text,
244
- documentType: type
245
+ documentType: type,
246
+ type: 'text'
245
247
  }
246
248
  });
247
249
  };
@@ -291,18 +293,16 @@ var WriterPuzzleComponent = function WriterPuzzleComponent(_ref) {
291
293
  };
292
294
 
293
295
  var handleFinish = function handleFinish() {
294
- if (checkAllDecisionsRightWrong()) {
295
- // if all Decisions are right or wrong we just skip to end
296
- setReviewDone(true);
297
- setFeedbackScreenDone(true);
298
- endGame();
299
- }
300
-
301
296
  if (!checkIfFeedbackNeeded()) {
302
297
  // THis case is for when we do not have any Decision
303
298
  setReviewDone(true);
304
299
  setFeedbackScreen(true);
305
300
  endGame();
301
+ } else if (checkAllDecisionsRightWrong()) {
302
+ // if all Decisions are right or wrong we just skip to end
303
+ setReviewDone(true);
304
+ setFeedbackScreenDone(true);
305
+ endGame();
306
306
  }
307
307
 
308
308
  if (!reviewDone) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gamelearn/arcade-components",
3
3
  "license": "Gamelearn",
4
- "version": "0.22.0",
4
+ "version": "0.22.1",
5
5
  "main": "dist/index.js",
6
6
  "files": [
7
7
  "dist",