[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdeedu/parley/src
From:       Frederik Gladhorn <gladhorn () kde ! org>
Date:       2008-08-31 23:49:12
Message-ID: 1220226552.743885.18311.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 855519 by gladhorn:

Start a summary dialog to show after the practice. Great for review after learning \
and voc tests...


 M  +3 -0      CMakeLists.txt  
 M  +12 -0     practice/parleypracticemainwindow.cpp  
 M  +11 -0     practice/practiceentry.cpp  
 M  +2 -0      practice/practiceentrymanager.h  
 M  +1 -1      practice/statistics/statistics.cpp  
 A             practice/summary (directory)  
 A             practice/summary/practicesummary.cpp   [License: GPL (v2+)]
 A             practice/summary/practicesummary.h   [License: GPL (v2+)]
 A             practice/summary/practicesummary.ui  
 A             practice/summary/practicesummarywidget.ui  
 A             practice/summary/summarymodel.cpp   [License: GPL (v2+)]
 A             practice/summary/summarymodel.h   [License: GPL (v2+)]


--- trunk/KDE/kdeedu/parley/src/CMakeLists.txt #855518:855519
@@ -98,10 +98,13 @@
     practice/multiple/multipletextualprompt.cpp
     practice/multiple/multipletextualinput.cpp
     practice/messagebox.cpp
+    practice/summary/practicesummary.cpp
+    practice/summary/summarymodel.cpp
 )
 
 kde4_add_ui_files(practice_SRCS
     practice/kgametheme/kgamethemeselector.ui
+    practice/summary/practicesummary.ui
     practiceold/entryfilter.ui
 )
 
--- trunk/KDE/kdeedu/parley/src/practice/parleypracticemainwindow.cpp #855518:855519
@@ -35,6 +35,7 @@
 #include "activearea.h"
 #include "practiceentrymanager.h"
 #include "answervalidator.h"
+#include "practice/summary/practicesummary.h"
 
 
 ParleyPracticeMainWindow::ParleyPracticeMainWindow(KEduVocDocument* doc, QWidget \
*parent) @@ -247,6 +248,17 @@
 bool ParleyPracticeMainWindow::queryClose()
 {
     kDebug() << "queryClose";
+
+
+    hide();
+    // show statistics dialog
+    // be done with it
+    // should probably be moved out of here (?)
+    PracticeSummary* summary = new PracticeSummary(m_stats, m_manager, this);
+    summary->exec();
+
+    kDebug() << "Percent: " << m_stats->percentCorrect() << " Attempted: " << \
m_stats->attempted() << " Correct: " << m_stats->correct(); +
     emit signalPracticeFinished();
     return close();
 }
--- trunk/KDE/kdeedu/parley/src/practice/practiceentry.cpp #855518:855519
@@ -18,6 +18,17 @@
 PracticeEntry::PracticeEntry(KEduVocExpression* expr)
 : m_expression(expr)
 {
+    m_attempted = 0;
+    m_correct = 0;
+    m_taintedCorrect = 0;
+    m_taintedIncorrect = 0;
+    m_skipped = 0;
+
+    /// @todo initialize
+//     m_errorReasons[Statistics::NumberIncorrectReasons];
+//     m_taintReasons[Statistics::NumberTaintReasons];
+//     m_skipReasons[Statistics::NumberSkipReasons];
+
 }
 
 void PracticeEntry::answeredCorrectly(bool tainted)
--- trunk/KDE/kdeedu/parley/src/practice/practiceentrymanager.h #855518:855519
@@ -175,6 +175,8 @@
 
         /// The text of the solution.
         void signalNewSolution(const QString&);
+
+    friend class PracticeSummary;
 };
 
 
--- trunk/KDE/kdeedu/parley/src/practice/statistics/statistics.cpp #855518:855519
@@ -47,7 +47,7 @@
 {
     // this is true when the answer supplied was correct.
     if ((grade == 1.0) && (error == Correct))
-       slotCorrect();
+        slotCorrect();
     else
         slotIncorrect(error, userAnswer);
 }


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic