Benutzer-Werkzeuge

Webseiten-Werkzeuge


tools:akkordtrainer2

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen der Seite angezeigt.

Link zu der Vergleichsansicht

Beide Seiten, vorherige ÜberarbeitungVorherige Überarbeitung
Nächste Überarbeitung
Vorherige Überarbeitung
tools:akkordtrainer2 [07/11/2025 17:49] Eric Webertools:akkordtrainer2 [19/01/2026 15:13] (aktuell) Eric Weber
Zeile 1: Zeile 1:
 <html> <html>
-<html lang="de"> 
 <head> <head>
     <meta charset="UTF-8">     <meta charset="UTF-8">
Zeile 557: Zeile 556:
             document.getElementById('nextBtn').style.display = 'none';             document.getElementById('nextBtn').style.display = 'none';
                          
-            playChord(currentChordNotes, quizSettings.playMode === 'successive');+            playChord(currentChordNotes, quizSettings.playMode === 'simultaneous');
         }         }
  
         function generateWrongAnswers(correctType, correctInversion) {         function generateWrongAnswers(correctType, correctInversion) {
             const wrong = [];             const wrong = [];
-            const allTypes Object.keys(chordDefinitions)+            const selectedTypes quizSettings.chordTypes
-            const isTriad = chordDefinitions[correctType].intervals.length === 3;+            const correctAnswer = chordDefinitions[correctType].name + ' - ' + getInversionName(correctType, correctInversion);
                          
-            while (wrong.length < 4) { +            // Erstelle alle möglichen Kombinationen 
-                const randomType allTypes[Math.floor(Math.random() * allTypes.length)]; +            const allPossibleAnswers = []; 
-                const randomIsTriad = chordDefinitions[randomType].intervals.length === 3; +            selectedTypes.forEach(type => { 
-                const randomMaxInv randomIsTriad ? 2 : 3+                const isTriad = chordDefinitions[type].intervals.length === 3; 
-                const randomInv = Math.floor(Math.random((randomMaxInv + 1));+                let maxInv 0
 +                if (isTriad && quizSettings.triadInversion === 'all'
 +                    maxInv = 2; 
 +                } else if (!isTriad && quizSettings.seventhInversion === 'all'
 +                    maxInv = 3; 
 +                }
                                  
-                const answer chordDefinitions[randomType].name ' - ' getInversionName(randomType, randomInv); +                for (let inv 0; inv <= maxInv; inv++) { 
-                const correctAnswer = chordDefinitions[correctType].name + ' - ' + getInversionName(correctTypecorrectInversion); +                    const answer = chordDefinitions[type].name + ' - ' + getInversionName(typeinv); 
-                 +                    if (answer !== correctAnswer) { 
-                if (answer !== correctAnswer && !wrong.includes(answer)) { +                        allPossibleAnswers.push(answer); 
-                    wrong.push(answer);+                    }
                 }                 }
-            }+            });
                          
-            return wrong;+            // Mische und wähle bis zu 4 falsche Antworten 
 +            const shuffled = allPossibleAnswers.sort(() => Math.random() - 0.5); 
 +            return shuffled.slice(0, Math.min(4, shuffled.length));
         }         }
  
tools/akkordtrainer2.1762534170.txt.gz · Zuletzt geändert: von Eric Weber