fix: Verwende aktuelle Zeile statt gesamter Lektion für Statistiken
Co-authored-by: aider (deepseek/deepseek-reasoner) <aider@aider.chat>
This commit is contained in:
parent
900c82a553
commit
e34d79e565
1 changed files with 7 additions and 7 deletions
|
|
@ -12,8 +12,7 @@ document.addEventListener('DOMContentLoaded', function() {
|
|||
const totalElement = document.getElementById('total');
|
||||
const wpmElement = document.getElementById('wpm');
|
||||
|
||||
// Aktuelle Textdaten
|
||||
let currentText = window.initialText;
|
||||
// Aktuelle Textdaten (verwende nur lines, entferne currentText)
|
||||
let lines = window.lines;
|
||||
let currentLineIndex = window.currentLineIndex;
|
||||
let startTime = null;
|
||||
|
|
@ -66,7 +65,8 @@ document.addEventListener('DOMContentLoaded', function() {
|
|||
function updateTimer() {
|
||||
if (startTime) {
|
||||
const userValue = userInput.value;
|
||||
updateStatistics(userValue, currentText);
|
||||
const currentLine = lines[currentLineIndex];
|
||||
updateStatistics(userValue, currentLine);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -95,8 +95,8 @@ document.addEventListener('DOMContentLoaded', function() {
|
|||
if (data.error) {
|
||||
alert('Fehler: ' + data.error);
|
||||
} else {
|
||||
currentText = data.text;
|
||||
lines = currentText.split('\n');
|
||||
// Verwende nur lines, entferne currentText
|
||||
lines = data.text.split('\n');
|
||||
currentLineIndex = 0;
|
||||
updateLineDisplay();
|
||||
document.getElementById('lesson-title').textContent = data.title;
|
||||
|
|
@ -126,8 +126,8 @@ document.addEventListener('DOMContentLoaded', function() {
|
|||
})
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
currentText = data.text;
|
||||
lines = currentText.split('\n');
|
||||
// Verwende nur lines, entferne currentText
|
||||
lines = data.text.split('\n');
|
||||
currentLineIndex = 0;
|
||||
updateLineDisplay();
|
||||
// Aktualisiere den Lektionstitel
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue