Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/94 clean up code in task after audio testing #100

Merged
merged 13 commits into from
Nov 7, 2019

Conversation

ICTEnablers
Copy link
Collaborator

No need to merge this before the sprint demo

Copy link
Collaborator

@duff92 duff92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my comments :)

correctAudioElement.current.load();
wrongAudioElement.current.load();

audioElement.current) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Place this on one line :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

if (correctAudioElement.current) {
correctAudioElement.current.setAttribute('currentTime', '0');
correctAudioElement.current.play().then(() => {
if(correctKeyPressed) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space missing after if

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

}
}).catch(error => console.error('play current error', error));
}
else {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

else should be placed on same line

} else {

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

}, [currentPos, task.exercise, ttsOptions]);

useEffect(() => {
speak(task.exercise[currentPos].text, ttsOptions).then(url => playAudio(audioElement, url));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add catch for playAudio and speak

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

src/components/audio/audio.tsx Show resolved Hide resolved

const promise = audio.current.play();
if (promise !== undefined) {
const promise = audio.current.play().catch(error => console.error('playAudio error '+error));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add spaces in string console.error('playAudio error ' + error)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@duff92 duff92 merged commit bca177a into develop Nov 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants