Skip to content

Commit

Permalink
add speech dispatcher
Browse files Browse the repository at this point in the history
  • Loading branch information
ProgramComputer committed Jan 5, 2024
1 parent 3fed85c commit 6e57167
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
2 changes: 2 additions & 0 deletions api.php
Original file line number Diff line number Diff line change
Expand Up @@ -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" => ''
);
Expand Down Expand Up @@ -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
Expand Down
16 changes: 13 additions & 3 deletions do_test_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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
);
}
}
Expand Down

0 comments on commit 6e57167

Please sign in to comment.