added part one of last question
This commit is contained in:
parent
b56f6dfa22
commit
05bb11382d
@ -18,6 +18,8 @@ const QUESTION_ONE = 'Ich werde Ihnen jetzt langsam eine Liste mit Worten vorles
|
|||||||
const QUESTION_ONE_PT2 = 'Vielen Dank. Nun nenne ich Ihnen die gleichen 10 Worte ein zweites mal. Auch danach sollen Sie wieder möglichst viele Worte wiederholen';
|
const QUESTION_ONE_PT2 = 'Vielen Dank. Nun nenne ich Ihnen die gleichen 10 Worte ein zweites mal. Auch danach sollen Sie wieder möglichst viele Worte wiederholen';
|
||||||
const QUESTION_TWO = 'Nennen Sie mir bitte so viel Dinge wie möglich, die man im Supermarkt kaufen kann. Sie haben dafür eine Minute Zeit. Und Los';
|
const QUESTION_TWO = 'Nennen Sie mir bitte so viel Dinge wie möglich, die man im Supermarkt kaufen kann. Sie haben dafür eine Minute Zeit. Und Los';
|
||||||
const QUESTION_THREE = 'Ich werde Ihnen jetzt eine Zahlenreihe nennen, die Sie mir dann bitte in umgekehrter Reihenfolge wiederholen sollen. Wenn ich beispielsweise, vier - fünf sage, dann sagen Sie bitte, fünf - vier.';
|
const QUESTION_THREE = 'Ich werde Ihnen jetzt eine Zahlenreihe nennen, die Sie mir dann bitte in umgekehrter Reihenfolge wiederholen sollen. Wenn ich beispielsweise, vier - fünf sage, dann sagen Sie bitte, fünf - vier.';
|
||||||
|
const QUESTION_FOUR = 'Wir kommen nun zur vierten Frage. Bitte zählen Sie von 76 an rückwärts. Nennen Sie die Zahlen abwechselnd als ganze Zahlen und als einzelne Ziffern. Zum Beispiel:';
|
||||||
|
const QUESTION_FOUR_PT2 = ['34', '3, 3', '32', '3, 1'];
|
||||||
// #endregion
|
// #endregion
|
||||||
|
|
||||||
// #region intents
|
// #region intents
|
||||||
@ -118,7 +120,7 @@ window.speechSynthesis.onvoiceschanged = function () {
|
|||||||
listSpeechsynth.voice = element;
|
listSpeechsynth.voice = element;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
speechsynth.rate = 0.88;
|
||||||
listSpeechsynth.rate = 0.7;
|
listSpeechsynth.rate = 0.7;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -233,6 +235,7 @@ function handleQuestion () {
|
|||||||
readQuestionThree();
|
readQuestionThree();
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
|
readQuestionFour();
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
break;
|
break;
|
||||||
@ -259,6 +262,7 @@ function readQuestionTwo () {
|
|||||||
let utterance = new SpeechSynthesisUtterance();
|
let utterance = new SpeechSynthesisUtterance();
|
||||||
utterance.voice = voices[2];
|
utterance.voice = voices[2];
|
||||||
utterance.text = QUESTION_TWO;
|
utterance.text = QUESTION_TWO;
|
||||||
|
utterance.rate = 0.8;
|
||||||
window.speechSynthesis.speak(utterance);
|
window.speechSynthesis.speak(utterance);
|
||||||
utterance.onend = function (event) {
|
utterance.onend = function (event) {
|
||||||
window.setTimeout(
|
window.setTimeout(
|
||||||
@ -281,13 +285,24 @@ function readQuestionThree () {
|
|||||||
let utterance = new SpeechSynthesisUtterance();
|
let utterance = new SpeechSynthesisUtterance();
|
||||||
utterance.voice = voices[2];
|
utterance.voice = voices[2];
|
||||||
utterance.text = QUESTION_THREE;
|
utterance.text = QUESTION_THREE;
|
||||||
|
utterance.rate = 0.88;
|
||||||
window.speechSynthesis.speak(utterance);
|
window.speechSynthesis.speak(utterance);
|
||||||
utterance.onend = function (event) {
|
utterance.onend = function (event) {
|
||||||
speak(QUESTION_THREE_QUESTIONS_PT1[questionThreeCount]);
|
speak(QUESTION_THREE_QUESTIONS_PT1[questionThreeCount]);
|
||||||
};
|
};
|
||||||
utterance.onerror = function (event) {
|
}
|
||||||
console.log('An error has occurred with the speech synthesis: ' + event.error);
|
|
||||||
};
|
function readQuestionFour () {
|
||||||
|
// skipRecording = true;
|
||||||
|
// speak(QUESTION_FOUR);
|
||||||
|
for (let i = 0; i < QUESTION_FOUR_PT2.length; i++) {
|
||||||
|
let utterance = new SpeechSynthesisUtterance();
|
||||||
|
utterance.voice = voices[2];
|
||||||
|
utterance.rate = 0.75;
|
||||||
|
utterance.text = QUESTION_FOUR_PT2[i];
|
||||||
|
window.speechSynthesis.speak(utterance);
|
||||||
|
}
|
||||||
|
// speak('Sie haben hierfür 1 Minute Zeit.');
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleAnswer (query) {
|
function handleAnswer (query) {
|
||||||
@ -336,7 +351,7 @@ function handleAnswerToSecondQuestion (answer) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function handleAnswerToThirdQuestion (query) {
|
function handleAnswerToThirdQuestion (query) {
|
||||||
speechsynth.rate = 0.87;
|
speechsynth.rate = 0.88;
|
||||||
query = query.replace(' ', '');
|
query = query.replace(' ', '');
|
||||||
|
|
||||||
let answerArray;
|
let answerArray;
|
||||||
@ -359,7 +374,7 @@ function handleAnswerToThirdQuestion (query) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (strike === 2 || questionThreeCount === 5) {
|
if (strike === 2 || questionThreeCount === 5) {
|
||||||
speechsynth.rate = 1;
|
speechsynth.rate = 0.88;
|
||||||
console.log('question 3 points: ' + questionPoints[question]);
|
console.log('question 3 points: ' + questionPoints[question]);
|
||||||
skipRecording = true;
|
skipRecording = true;
|
||||||
speak('weiter geht es mit der Nächsten Frage');
|
speak('weiter geht es mit der Nächsten Frage');
|
||||||
@ -411,7 +426,7 @@ recognition.onresult = function (event) {
|
|||||||
// testBtn.disabled = false
|
// testBtn.disabled = false
|
||||||
// testBtn.textContent = 'record...'
|
// testBtn.textContent = 'record...'
|
||||||
};
|
};
|
||||||
1;
|
|
||||||
recognition.onspeechend = function () {
|
recognition.onspeechend = function () {
|
||||||
// recognition.stop();
|
// recognition.stop();
|
||||||
// testBtn.disabled = false;
|
// testBtn.disabled = false;
|
||||||
@ -516,7 +531,7 @@ function processSpeech (speechResult) {
|
|||||||
|
|
||||||
function startDemenzScreening () {
|
function startDemenzScreening () {
|
||||||
// ws.send('starte demenz test');
|
// ws.send('starte demenz test');
|
||||||
startQuestion(2);
|
startQuestion(4);
|
||||||
testBtn.disabled = true;
|
testBtn.disabled = true;
|
||||||
testBtn.textContent = 'Test in progress';
|
testBtn.textContent = 'Test in progress';
|
||||||
infoPara.textContent = 'wait...';
|
infoPara.textContent = 'wait...';
|
||||||
@ -524,14 +539,7 @@ function startDemenzScreening () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function testSpeechOut () {
|
function testSpeechOut () {
|
||||||
answerQuery = 'apfel wiese tisch apfel lampe pferd';
|
readQuestionFour();
|
||||||
question = 1;
|
|
||||||
for (let i = 0; i < 2; i++) {
|
|
||||||
var tokens = answerQuery.split(new RegExp(separators.join('|'), 'g'));
|
|
||||||
questionPoints[question] += calculatePoints(tokens, QUESTION_ONE_ANSWERS);
|
|
||||||
}
|
|
||||||
|
|
||||||
console.log(questionPoints[question]);
|
|
||||||
|
|
||||||
// speechsynth.text = 'test 123';
|
// speechsynth.text = 'test 123';
|
||||||
// speechsynth.volume = 1;
|
// speechsynth.volume = 1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user