Skip to content

Commit

Permalink
Utterance checkbox not saved
Browse files Browse the repository at this point in the history
  • Loading branch information
ProgramComputer authored Jan 5, 2024
1 parent 12a90a3 commit 3fed85c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions do_test_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,15 @@ function do_test_prepare_ajax_test_area($selector, $selection, $count, $testtype

?>
<script type="text/javascript">
window.onload = (event) => {
var utterancecheckbox = document.getElementById('utterance-allowed')

var utterancechecked = JSON.parse(localStorage.getItem('utterance-allowed'));
utterancecheckbox.checked = utterancechecked;
utterancecheckbox.addEventListener('change', function () {
localStorage.setItem('utterance-allowed', utterancecheckbox.checked);
});
};
/**
* Get a new word test.
*/
Expand Down

0 comments on commit 3fed85c

Please sign in to comment.