spanish-quizzer

An app to quiz you on Spanish vocabulary and verb conjugations
git clone https://git.ashermorgan.net/spanish-quizzer/
Log | Files | Refs | README

commit 1d164df0b27b63159f16c07cf34294312a341f5b
parent e77814288204dda355d8c8231f8a67e40c6b21b3
Author: AsherMorgan <59518073+AsherMorgan@users.noreply.github.com>
Date:   Sat, 13 Jun 2020 18:26:31 -0700

Remove conditions for prompt and feedback audio.

Diffstat:
MScripts/Quizzer.js | 45+++++----------------------------------------
MStyles/Quizzer.css | 2+-
Mindex.html | 4++--
3 files changed, 8 insertions(+), 43 deletions(-)

diff --git a/Scripts/Quizzer.js b/Scripts/Quizzer.js @@ -31,37 +31,26 @@ function Start() { return; } - // Configure voice input + + // Validate browser for voice input if (document.getElementById("settingsInputType").value != "Text") { - // Validate browser if (!window.chrome || (!window.chrome.webstore && !window.chrome.runtime)) { // Browser is not Googole Chrome or Microsoft (Chromium) Edge alert("Your browser does not support voice input."); return; } - - // Add audio attribute - document.getElementById("quizzerFeedback").classList.add("audio"); - } - else { - document.getElementById("quizzerFeedback").classList.remove("audio"); } // Save terms to local storage localStorage.setItem("terms", JSON.stringify(Terms)); - // Configure prompt audio + + // Give iOS devices ringer warning for prompt audio if (document.getElementById("settingsPromptType").value != "Text") { - document.getElementById("quizzerPrompt").classList.add("audio"); - - // Give iOS devices ringer warning if (!!navigator.platform && /iPad|iPhone|iPod/.test(navigator.platform)) { alert("Please make sure your ringer is on in order to hear audio prompts."); } } - else { - document.getElementById("quizzerPrompt").classList.remove("audio"); - } // Show and hide elements document.getElementById("settings").hidden = true; @@ -110,18 +99,12 @@ function Resume() { return; } - // Configure prompt audio + // Give iOS devices ringer warning for prompt audio if (document.getElementById("settingsPromptType").value != "Text") { - document.getElementById("quizzerPrompt").classList.add("audio"); - - // Give iOS devices ringer warning if (!!navigator.platform && /iPad|iPhone|iPod/.test(navigator.platform)) { alert("Please make sure your ringer is on in order to hear audio prompts."); } } - else { - document.getElementById("quizzerPrompt").classList.remove("audio"); - } // Show and hide elements document.getElementById("settings").hidden = true; @@ -403,24 +386,6 @@ function Read(text, label) -// Read the prompt if audio is enabled -function quizzerPromptClicked() { - if (document.getElementById("settingsPromptType").value != "Text") { - Read(Terms[Term][1], Terms[Term][0]); - } -} - - - -// Read the answer if audio is enabled -function quizzerFeedbackClicked() { - if (document.getElementById("settingsInputType").value != "Text") { - Read(Terms[Term][3], Terms[Term][2]); - } -} - - - // Processes a user's submitted responce function Submit() { // Parse responce diff --git a/Styles/Quizzer.css b/Styles/Quizzer.css @@ -1,5 +1,5 @@ /******** Quizzer styles ********/ -#quizzerPrompt.audio, #quizzerFeedback.audio { +#quizzerPrompt, #quizzerFeedback { cursor: pointer; } diff --git a/index.html b/index.html @@ -120,7 +120,7 @@ <div> <label for="quizzerPrompt" id="quizzerPromptType" class="label"></label> - <span id="quizzerPrompt" onclick="quizzerPromptClicked()"></span> + <span id="quizzerPrompt" onclick="Read(Terms[Term][1], Terms[Term][0]);"></span> </div> <div> @@ -133,7 +133,7 @@ <button id="quizzerSkip" class="quizzerButton" onclick="Reset()">Skip</button> </div> - <div id="quizzerFeedback" onclick="quizzerFeedbackClicked()" class="bad"></div> + <div id="quizzerFeedback" onclick="Read(Terms[Term][3], Terms[Term][2]);" class="bad"></div> <div id="quizzerCongrats" class="good"></div> </div>