Skip to content

Commit

Permalink
resolved #126 (#2569)
Browse files Browse the repository at this point in the history
  • Loading branch information
lifeart authored Jan 27, 2024
1 parent 3537261 commit fd2c9dd
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions frontend/app/components/task-player/words-sequences/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import { TaskItem } from 'brn/utils/task-item';
import { tracked } from '@glimmer/tracking';
import { MODES } from 'brn/utils/task-modes';
import { task, Task as TaskGenerator } from 'ember-concurrency';
import AudioService from 'brn/services/audio';
import type AudioService from 'brn/services/audio';
import StatsService, { StatEvents } from 'brn/services/stats';
import WordsSequences from 'brn/models/task/words-sequences';
import AnswerOption from 'brn/utils/answer-option';
import type WordsSequences from 'brn/models/task/words-sequences';
import type AnswerOption from 'brn/utils/answer-option';

function getEmptyTemplate(
selectedItemsOrder: string[] = [],
Expand Down Expand Up @@ -62,8 +62,15 @@ export default class WordsSequencesComponent<
({ completedInCurrentCycle }) => completedInCurrentCycle === false,
);
}
willDestroy(): void {
super.willDestroy(...arguments);
document.body.dataset.correctAnswer = '';
}
get firstUncompletedTask() {
return this.uncompletedTasks.firstObject;
const item = this.uncompletedTasks.firstObject;
const words = item?.answer.mapBy('word');
document.body.dataset.correctAnswer = words?.join(',');
return item;
}
get audioFiles() {
if (!this.firstUncompletedTask) {
Expand Down

0 comments on commit fd2c9dd

Please sign in to comment.