Bug 86477

Summary: ktouch: false count on total letters
Product: [Applications] ktouch Reporter: Ben Burton <bab>
Component: generalAssignee: Haavard Froeiland <haavard>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Debian testing   
OS: Linux   
Latest Commit: Version Fixed In:

Description Ben Burton 2004-08-03 08:09:18 UTC
Version:            (using KDE KDE 3.2.3)
Installed from:    Debian testing/unstable Packages

Received through the Debian BTS (#263000):

When typing a false letter, the counter 'typed letters' is increased by two, 'correct letters' is left unchanged. This leads to false statistics.

Example: first letter should be A and I type b.

before: correct letters: 0    typed letters: 0
after:  correct letters: 0    typed letters: 2

(end of Debian bug report)

Looking through the ktouch sources, you can indeed see that addWrongChar() is being called twice -- once in KTouchTrainer::keyPressed() and then again in KTouchTrainer::updateWidgets(), which is called by keyPressed().

I presume a simple solution would be to remove the calls to addWrongChar() in updateWidgets(), as shown in the following patch (which applies to both HEAD and BRANCH).

Does this look correct to you (noting that we have a day before the 3.3 deep freeze)?

Ben.
--- ktouchtrainer.cpp   26 Jul 2003 18:52:50 -0000      1.4
+++ ktouchtrainer.cpp   3 Aug 2004 06:03:24 -0000
@@ -197,11 +197,6 @@ void KTouchTrainer::updateWidgets() {
             m_keyboardWidget->newKey(m_teacherText[len]);
     }
     else {
-        // ok, find the key the user missed:
-        if (m_teacherText.left(len-1)==m_studentText.left(len-1) && m_teacherText.length()>=len)
-            m_session.addWrongChar(m_teacherText[len-1]);
-        else
-            m_session.addWrongChar(8);
         m_keyboardWidget->newKey(QChar(8)); // wrong key, user must now press backspace
     };
     emit statusbarStatsChanged(m_session.m_correctChars, m_session.m_totalChars, m_session.m_words);
Comment 1 Anne-Marie Mahfouf 2004-09-20 16:25:13 UTC
CVS commit by annma: 

this fixes bug 86477, thanks to ben Burton for the patch
backport to KDE_3_3_BRANCH will follow

CCMAIL=86477-done@bugs.kde.org


  M +1 -6      ktouchtrainer.cpp   1.6


--- kdeedu/ktouch/src/ktouchtrainer.cpp  #1.5:1.6
@@ -2,5 +2,5 @@
  *   ktouchtrainer.cpp                                                     *
  *   -----------------                                                     *
- *   Copyright (C) 2000 by H