=============================== Concept for new, revised KTouch =============================== GENERAL PROGRAM CONCEPT ----------------------- What is the program supposed to do? ----------------------------------- The user can practice touch typing using the traditional typing/training lines, one line at a time of one level which is part of one lecture/training file. At the end of one lesson the speed and accuracy in this lesson is compared to the limits and so the automatic level change can be triggered, the user may during training increase/decrease the level himself. The user can pause the training (stops the speed counter). At the end of the lecture (no more levels) the user is prompted to do a test. The user can also start writing typing tests manually. Typing tests are done using a longer real-life text. The keyboard can be switched of during the test (this is the default). The user cannot pause the examination, only end. This is to allow the use of KTouch in school lessons and to prevent cheating. The test can be limited in time so that it stops after the given time. The test can also be limited in number of errors made. At the end of the test the test results are shown, including typing speed in chars per minute, absolute number of faults, relative number of faults, total chars and words typed etc. A mark is given (0-20 point scale) according to touch typing guidelines for secretaries. Thus the program can run in two modes: type training and examination mode. Description of the training mode -------------------------------- This is the traditional mode for KTouch. It shows three widgets, The status widget on top, the sliding trainer/typing line in the middle and the keyboard at the bottom. After hitting the start/pause button on the buttonbar (or in the menu) a sign appear "Start typing" which dissappears when the first key is pressed. If the user presses "Pause" during the training, the sign reappears, until the user presses a new key (without holding down ALT or CTRL -> this is to allow menu access with keys without starting the typing again). The statistics for the training modes are twofold. For each user the statistics per training session is taken. "Training session" means the start of a new lecture -or- start of the program (still needs to be specified). Also the training statistics for each level are taken. This is required so that the skill on the 'new' keys can be measured. The automatic level change feature only consideres these level based statistics, so each level has to be passed seperately. (Note: Lecture design must improve in future. A lecture should have more and shorter levels, with focus on character training and word training...) Training statistics (can be activated during the training session) show the total statistics and the statistics for the current level. Also the statistics for the previous training sessions can be seen, so that the progress can be shown. Description of the examination mode ----------------------------------- This mode shows the test statistics on top of the screen (different widget as for practice) and a longer multiline widget highlighting the text already typed. This widget scrolls down as the user types. If the text is completed successfully or a test limit is reached, the test is ended and the summary page appears. Training statistics ------------------- This concept needs to be revised. The statistics should give an idea about the progress, based on a certain lecture. So the user opens the statistics window always with respect to a certain lecture. (Since the lectures are different it wouldn't make sense evaluating the typing 'skill' on the "correct-char-per-minute" or "level reached" properties of different lectures). In the statistics the user should see first the overall 'skill' in the current training session (based on correct-chars-per-minute) and the skill in the current lecture (based on correct-chars-per-minute). The skill must be calculated from both, characters per second and number of typing errors. However, both values must be explicitely shown to allow evaluation on skill-tables used in schools. The user can also select a training history page, showing the progress in skill and typing speed of the previous training sessions. Examination summary page ------------------------ The examination result page contains the following data: Characters typed, wrong characters typed, start-time, end-time, total time (start- and end-time are to prevent cheating in class rooms, so the teacher sees when somebody restarts the examination). correct-characters-per-minute, total-characters-per-minute, words-per-minute correct/wrong ratio, skill (calculated from chars-per-min and correct/wrong ratio) and an examination mark (0..20) based on the skill. EDITORS ------- KTouch includes editors for the lectures, the examination texts, the keyboards and the colour schemes. All editors start with a dialog, asking the user to select a prefabricated lecture/exam/keyboard/colour scheme, create a new one or load it from somewhere. All editors provide 3 buttons: "Save", "Save as..." and "Quit". Pressing quit or closing the editor window causes a dialog box asking for saving the changes (if any have been made). In all dialogs the font can be changed, because a lot of multilingual problems with the current KTouch were reportet. The lecture editor ------------------ When the lecture editor is opened the user can choose which lecture to edit (or to create a new lecture). This lecture is then loaded and the user can edit it. The dialog works as in the old KTouch, so for each level a new character string can be given and a level description. The order of levels can be changed etc. New is that the lecture can get a title, thus making it more descriptive than just the filename. After the dialog is quitted, the current training lecture is reloaded to ensure that potential changes take place. The exam editor --------------- When the exam editor is openen, the user can choose which exam to edit (or to create a new exam text). A simple editor widget is opened and the user can edit the lines. During editing the editor widget calculates and shows number of characters, words and estimated time for the test for beginner/advances/prof levels (prof = secretary typing speed) The keyboard editor ------------------- Upon opening the keyboard editor, the user can choose between loading an existing layout and modifying it or create a new one. The keyboard editor shows a keyboard grid. The user can select one or more grid rectangles to create keys (thus longer keys are possible). Then the user types the description of the key: Main key character (top left), alternative key (above, e.g. numbers), second alternative key (like @ or ¤ signs). Then the user has to type all possible key combinations he wants to register, so for instance a Q on my keyboard has three possible combinations: q, Q and @ (which is ALTGR + Q) For each key all combinations are stored in a list box and can be later edited. The colour scheme editor ------------------------ The colour scheme editor shows a widget containing lots of colour buttons and descriptions for what colour this is being used. FIRST START / NORMAL START -------------------------- When KTouch is started first the program tries to determine the current keyboard layout set in KDE and tries to match a keyboard layout. That choice along with a request of the language for the lecture is shown and the user is prompted to either accept the choice or chose another layout/lecture. The traditional keyboard colour scheme of the original KTouch is used initially. Upon a normal startup the configuration is restored and the program begins in training mode, using the last lecture file the user was practicing. If this file is missing, a default mini-lecture is shown. So during a normal start the user is _always_ starting up in practice mode. SESSION MANAGEMENT - STARTUP WHEN SESSION IS RESTORED ----------------------------------------------------- KTouch restores the last program mode (exam or practice) and prompts for restarting the training/examination session at the level the user had when he closed the KDE session. KTouch won't support in-level breaks, so the session is always continued at the begin of a level. However, the points reached so far are stored (see training mode explaination for points) Session management can be switched off in the configuration dialog. If switched off, KTouch won't start if a KDE session is restored. FILE MANAGEMENT --------------- KTouch provides default training lectures, keyboard layouts and colour schemes which are installed in the install dir. However, a user might want to add his/her own files but may not have write access to the install directory. Thus the user can manually add files to the default file listing. For example in a school the teacher may want to put lecture or examination files on a central server and all users who want to train regularely with those files can add those files to the default lecture list (for quick access). Internally only the URLs of those files are stored and upon startup of KTouch only the URLs are added to the list. The adding of files to the default file lists is all done in the configuration dialog and stored along with the other configuration data. IMPLEMENTATION CONCEPT ====================== Data structure -------------- KTouchLevelData -> Data of a training level - level title/comment - new characters in this level - level text (lines in a std::vector) KTouchLecture -> Lecture data - lecture title - level data (std::vector) KTouchExamination -> Data of a test - title of the test - test level (beginner...pro) - examination text KTouchCharStats -> Data for a single key - the character (unicode) - how often correctly pressed - how often missed KTouchTrainingStatistics -> Stats for a certain training period (level or multiple levels) - time elapsed (so far) - key pressed - correct keys pressed (std::set) - characters stats KTouchTrainingSession -> Stats for a complete training session - current level stats - previous level stats (std::vector) - averaged stats KTouchKeyDef -> Holds geometry and access information of a key KTouchKeyboardLayout -> Holds all keys of a certain keyboard layout KTouchColourScheme -> A colour scheme for KTouch KTouchConfig -> Configuration object, contains all global config data - vector -> default + user added lecture files - vector -> default + user added keyboard files - vector -> Colour schemes ...TODO... Widgets ------- ...TODO... STARTUP ------- KTouch is started and before the main window is created, the configuration is read into the configuration object. If the configuration is not present or vital information (keyboard layout/last lecture) is missing, the flag "first_run" will be set in the configuration object. If KTouch is restored because of session management, the flag "no_session_management" will be checked first. If true, the program will be quit immediately (without having created the main window or shown anything). If KTouch is started the first time, the first default keyboard (english) and lecture file (english) is loaded during creation of the main window, but immediately afterwards the "setupNewUser" function is called, which handles the initial configuration of the program. During the creation of the main window the program is set up in practice mode, the layout for the default practice mode (statuswidget, slidelinewidget, keyboardwidget) is created and the pointers are stored. This is done in the function setupTrainingMode(). This function takes care of reading the current lecture, switching to the last level (if flag "keep_level" is enabled), clearing the status and preparing a new session. When finished the flag "wait_for_keypress" is set and the main window goes into "active session - accept key" mode. Session Management ------------------ Stuff to save during exit when KDE session management closes KTouch - practice or exam mode - lecture/examination file - level (if in practice mode, otherwise always 0) - if in practice mode the current statistics ...TODO...