diff --git a/api.php b/api.php index 088e9c58..3bcfd11f 100644 --- a/api.php +++ b/api.php @@ -228,6 +228,7 @@ function get_word_test_ajax($testsql, $word_mode, $lgid, $wordregex, $testtype): if (empty($word_record)) { $output = array( "word_id" => 0, + "word_lg_id" => 0, "word_text" => '', "group" => '' ); @@ -257,6 +258,7 @@ function get_word_test_ajax($testsql, $word_mode, $lgid, $wordregex, $testtype): return array( "word_id" => $word_record['WoID'], + "word_lg_id" => $word_record['WoLgID'], "solution" => $solution, "word_text" => $save, "group" => $html_sentence diff --git a/do_test_test.php b/do_test_test.php index b907075c..a60bb9aa 100644 --- a/do_test_test.php +++ b/do_test_test.php @@ -910,12 +910,22 @@ function prepare_test_frames() * @param {number} word_id Word ID * @param {string} solution Test answer * @param {string} group + * @param {string} word_text word text + * @param {string} word_lg_id Word language id */ - function insert_new_word(word_id, solution, group) { + function insert_new_word(word_id,word_text,word_lg_id,solution, group) { + LWT_DATA.test.solution = solution; LWT_DATA.word.id = word_id; - + /** + * Read the word aloud + */ + function read_word() { + speechDispatcher( + word_text, word_lg_id + ); + } $('#term-test').html(group); $(document).on('keydown', keydown_event_do_test_test); @@ -953,7 +963,7 @@ function (tomorrow_test) { ); } else { insert_new_word( - current_test.word_id, current_test.solution, current_test.group + current_test.word_id,current_test.word_text,current_test.word_lg_id current_test.solution, current_test.group ); } }