diff --git a/client/ws-client.js b/client/ws-client.js index ffb4e04..dcc39c5 100644 --- a/client/ws-client.js +++ b/client/ws-client.js @@ -38,7 +38,7 @@ const NEXT_QUESTION = 'Nächste Frage'; const QUESTION_ONE_ANSWERS = { 'teller': 1, 'hund': 1, 'lampe': 1, 'brief': 1, 'apfel': 1, 'apfelwiese': 2, 'apfelbaum': 2, 'und': 1, 'hose': 1, 'tisch': 1, 'wiese': 1, 'glas': 1, 'baum': 1 }; const QUESTION_ONE_QUESTIONS = ['teller', 'hund', 'lampe', 'brief', 'apfel', 'hose', 'tisch', 'wiese', 'glas', 'baum']; const QUESTION_TWO_ANSWERS = {}; -var QUESTION_TWO_QUESTIONS = ['']; +var QUESTION_TWO_QUESTIONS; const QUESTION_THREE_QUESTIONS_PT1 = ['7, 2', '4, 7, 9', '5, 4, 9, 6', '2, 7, 5, 3, 6', '8, 1, 3, 5, 4, 2']; const QUESTION_THREE_QUESTIONS_PT2 = ['8, 6', '3, 1, 5', '1, 9, 7, 4', '1, 3, 5, 4, 8', '4, 1, 2, 7, 9, 5']; const QUESTION_THREE_ANSWERS_PT1 = ['27', '974', '6945', '63572', '245318']; @@ -170,11 +170,10 @@ function checkIntent (result) { break; case WELCOME_INTENT: state = 'detect'; - // speak(result.fulfillmentText) - speak('go'); + speak(result.fulfillmentText); break; case WELCOME_FOLLOWUP_YES: - startQuestion(2); + startQuestion(1); break; case WELCOME_FOLLOWUP_NO: skipRecording = true; @@ -263,7 +262,7 @@ function readQuestionTwo () { function () { recognition.stop(); handleAnswer(answerQuery); - }, 6000); + }, 60000); recognizeSpeech(); }; } @@ -366,8 +365,7 @@ function handleAnswerToThirdQuestion (query) { // #region global functions function startDemenzScreening () { - // ws.send('starte demenz test'); - startQuestion(3); + ws.send('starte demenz test'); testBtn.disabled = true; testBtn.textContent = 'Test in progress'; infoPara.textContent = 'wait...';