Permalink
Browse files

v1.2.0

  • Loading branch information...
1 parent 2c60f0b commit 8b6a70e55c31de3760a4f0b67d14b09366b092fd @michal-tomlein committed Feb 8, 2009
Showing with 16,410 additions and 10,971 deletions.
  1. +8 −8 build.nut
  2. +0 −516 database_editor/database.cpp
  3. +0 −271 database_editor/flags.cpp
  4. BIN database_editor/images/textbold.png
  5. BIN database_editor/images/textcenter.png
  6. BIN database_editor/images/textitalic.png
  7. BIN database_editor/images/textjustify.png
  8. BIN database_editor/images/textleft.png
  9. BIN database_editor/images/textright.png
  10. BIN database_editor/images/textunder.png
  11. +1 −1 iTest.pro
  12. +11 −1 {test_writer → iTestClient}/about_widget.cpp
  13. 0 {test_writer → iTestClient}/about_widget.h
  14. +0 −6 {test_writer → iTestClient}/about_widget_v2.ui
  15. +6 −6 {test_writer → iTestClient}/client.cpp
  16. +360 −0 iTestClient/database.cpp
  17. +10 −0 iTestClient/env_vars.cpp
  18. +1 −0 {database_editor → iTestClient}/i18n.qrc
  19. +517 −0 iTestClient/i18n/Portuguese.ts
  20. +522 −477 {test_writer → iTestClient}/i18n/Russian.ts
  21. +522 −477 {test_writer → iTestClient}/i18n/Slovak.ts
  22. +523 −478 {test_writer → iTestClient}/i18n/Turkish.ts
  23. +27 −8 test_writer/iTestWri.pro → iTestClient/iTestClient.pro
  24. 0 {test_writer → iTestClient}/images/back.png
  25. 0 {test_writer → iTestClient}/images/button_cancel.png
  26. 0 {test_writer → iTestClient}/images/button_ok.png
  27. 0 {test_writer → iTestClient}/images/connect.png
  28. 0 {test_writer → iTestClient}/images/contents.png
  29. 0 {test_writer → iTestClient}/images/fileclose.png
  30. 0 {test_writer → iTestClient}/images/fileopen.png
  31. 0 {test_writer → iTestClient}/images/filesave.png
  32. 0 {test_writer → iTestClient}/images/filesaveas.png
  33. 0 {test_writer → iTestClient}/images/flag.png
  34. 0 {test_writer → iTestClient}/images/folder_red.png
  35. 0 {test_writer → iTestClient}/images/forward.png
  36. 0 {test_writer → iTestClient}/images/itcl.ico
  37. 0 {test_writer → iTestClient}/images/itcl.png
  38. 0 {test_writer → iTestClient}/images/itest.png
  39. BIN iTestClient/images/itestwri.icns
  40. 0 {test_writer → iTestClient}/images/itestwri.ico
  41. 0 {test_writer → iTestClient}/images/itestwri.png
  42. 0 {test_writer → iTestClient}/images/itestwri128.ico
  43. 0 {test_writer → iTestClient}/images/itestwri48.png
  44. 0 {test_writer → iTestClient}/images/player_play.png
  45. 0 {test_writer → iTestClient}/images/qt4.png
  46. 0 {test_writer → iTestClient}/images/quit.png
  47. 0 {test_writer → iTestClient}/images/reload.png
  48. 0 {test_writer → iTestClient}/itestwri.rc
  49. +66 −13 {test_writer → iTestClient}/main.cpp
  50. +8 −17 {test_writer → iTestClient}/main_window.h
  51. +25 −4 {test_writer → iTestClient}/main_window.ui
  52. +108 −0 iTestClient/pass_mark.cpp
  53. +33 −0 iTestClient/pass_mark.h
  54. +1 −1 {test_writer → iTestClient}/question_answer.cpp
  55. +30 −3 {test_writer → iTestClient}/question_item.cpp
  56. +19 −1 {test_writer → iTestClient}/question_item.h
  57. 0 {test_writer → iTestClient}/resources.qrc
  58. +63 −53 {database_editor → iTestServer}/about_widget.cpp
  59. 0 {database_editor → iTestServer}/about_widget.h
  60. +0 −6 {database_editor → iTestServer}/about_widget_v2.ui
  61. +36 −3 {database_editor → iTestServer}/archived_session.cpp
  62. +1 −0 {database_editor → iTestServer}/archived_session.h
  63. +28 −19 {database_editor → iTestServer}/client.cpp
  64. +5 −1 {database_editor → iTestServer}/client.h
  65. +558 −0 iTestServer/database.cpp
  66. +8 −5 {database_editor → iTestServer}/env_vars.cpp
  67. +244 −0 iTestServer/flags.cpp
  68. +1 −0 {test_writer → iTestServer}/i18n.qrc
  69. +2,709 −0 iTestServer/i18n/Portuguese.ts
  70. +2,744 −2,547 {database_editor → iTestServer}/i18n/Russian.ts
  71. +2,754 −2,549 {database_editor → iTestServer}/i18n/Slovak.ts
  72. +2,741 −2,544 {database_editor → iTestServer}/i18n/Turkish.ts
  73. +27 −8 database_editor/itest.pro → iTestServer/iTestServer.pro
  74. 0 {database_editor → iTestServer}/images/archive.png
  75. 0 {database_editor → iTestServer}/images/back.png
  76. 0 {database_editor → iTestServer}/images/bottom.png
  77. 0 {database_editor → iTestServer}/images/button_cancel.png
  78. 0 {database_editor → iTestServer}/images/button_ok.png
  79. 0 {database_editor → iTestServer}/images/client.png
  80. 0 {database_editor → iTestServer}/images/clients.png
  81. 0 {database_editor → iTestServer}/images/contents.png
  82. 0 {database_editor → iTestServer}/images/copy_from_archive.png
  83. 0 {database_editor → iTestServer}/images/copy_to_archive.png
  84. 0 {database_editor → iTestServer}/images/difficult.png
  85. 0 {database_editor → iTestServer}/images/down.png
  86. 0 {database_editor → iTestServer}/images/easy.png
  87. 0 {database_editor → iTestServer}/images/edit.png
  88. 0 {database_editor → iTestServer}/images/editcopy.png
  89. 0 {database_editor → iTestServer}/images/editdelete.png
  90. 0 {database_editor → iTestServer}/images/editpaste.png
  91. 0 {database_editor → iTestServer}/images/exporttest.png
  92. 0 {database_editor → iTestServer}/images/fileclose.png
  93. 0 {database_editor → iTestServer}/images/filenew.png
  94. 0 {database_editor → iTestServer}/images/fileopen.png
  95. 0 {database_editor → iTestServer}/images/fileprint.png
  96. 0 {database_editor → iTestServer}/images/filequickprint.png
  97. 0 {database_editor → iTestServer}/images/filesave.png
  98. 0 {database_editor → iTestServer}/images/filesaveas.png
  99. 0 {database_editor → iTestServer}/images/filter.png
  100. 0 {database_editor → iTestServer}/images/flag.png
  101. 0 {database_editor → iTestServer}/images/folder_red.png
  102. 0 {database_editor → iTestServer}/images/forward.png
  103. 0 {database_editor → iTestServer}/images/itdb48.ico
  104. 0 {database_editor → iTestServer}/images/itdb48.png
  105. BIN iTestServer/images/itest.icns
  106. 0 {database_editor → iTestServer}/images/itest.ico
  107. 0 {database_editor → iTestServer}/images/itest.png
  108. 0 {database_editor → iTestServer}/images/itest128.ico
  109. 0 {database_editor → iTestServer}/images/itest32.png
  110. 0 {database_editor → iTestServer}/images/itest48.png
  111. 0 {database_editor → iTestServer}/images/itestserver.png
  112. 0 {database_editor → iTestServer}/images/itestserver32.png
  113. 0 {database_editor → iTestServer}/images/itestwri.png
  114. BIN iTestServer/images/itestwri32.png
  115. 0 {database_editor → iTestServer}/images/itos.ico
  116. 0 {database_editor → iTestServer}/images/itos.png
  117. 0 {database_editor → iTestServer}/images/locale.png
  118. 0 {database_editor → iTestServer}/images/log.png
  119. 0 {database_editor → iTestServer}/images/medium.png
  120. 0 {database_editor → iTestServer}/images/player_play.png
  121. 0 {database_editor → iTestServer}/images/player_stop.png
  122. 0 {database_editor → iTestServer}/images/print_folder.png
  123. 0 {database_editor → iTestServer}/images/qt4.png
  124. 0 {database_editor → iTestServer}/images/quit.png
  125. 0 {database_editor → iTestServer}/images/reload.png
  126. 0 {database_editor → iTestServer}/images/restore.png
  127. 0 {database_editor → iTestServer}/images/save_all.png
  128. 0 {database_editor → iTestServer}/images/savebackup.png
  129. 0 {database_editor → iTestServer}/images/savedsessions32.png
  130. 0 {database_editor → iTestServer}/images/sort_ascending.png
  131. 0 {database_editor → iTestServer}/images/sort_descending.png
  132. 0 {database_editor → iTestServer}/images/statistics.png
  133. 0 {database_editor → iTestServer}/images/top.png
  134. 0 {database_editor → iTestServer}/images/up.png
  135. 0 {database_editor → iTestServer}/itest.rc
  136. +30 −3 {database_editor → iTestServer}/main.cpp
  137. +136 −83 {database_editor → iTestServer}/main_window.cpp
  138. +24 −8 {database_editor → iTestServer}/main_window.h
  139. +644 −305 {database_editor → iTestServer}/main_window_v2.ui
  140. +125 −0 iTestServer/pass_mark.cpp
  141. +31 −0 iTestServer/pass_mark.h
  142. +29 −7 {database_editor → iTestServer}/print_engine.cpp
  143. +54 −13 {database_editor → iTestServer}/question_item.cpp
  144. +8 −1 {database_editor → iTestServer}/question_item.h
  145. +172 −157 {database_editor → iTestServer}/questions.cpp
  146. +4 −10 {database_editor → iTestServer}/resources.qrc
  147. +278 −103 {database_editor → iTestServer}/server.cpp
  148. +6 −4 {database_editor → iTestServer}/session.cpp
  149. +3 −3 {database_editor → iTestServer}/session.h
  150. +107 −5 {database_editor → iTestServer}/session_viewer.cpp
  151. +38 −0 {database_editor → iTestServer}/student.cpp
  152. +4 −1 {database_editor → iTestServer}/student.h
  153. 0 {database_editor → iTestServer}/text_formatting.cpp
  154. BIN itcl.icns
  155. BIN itcl.png
  156. BIN itdb.icns
  157. BIN itdb.png
  158. BIN itest.png
  159. BIN itestwri.png
  160. BIN itos.icns
  161. BIN itos.png
  162. +0 −235 test_writer/database.cpp
  163. +0 −10 test_writer/env_vars.cpp
View
16 build.nut
@@ -3,26 +3,26 @@
local qmakeOpts = [ "-config", "release" ]
local makeTool = "make";
-printl("Entering directory: database_editor");
-chdir("database_editor");
+printl("Entering directory: iTestServer");
+chdir("iTestServer");
printl("Running QMAKE");
run("qmake", qmakeOpts);
printl("Running LRELEASE (translations)");
-run("lrelease", [ "iTest.pro" ]);
+run("lrelease", [ "iTestServer.pro" ]);
-printl("Leaving directory: database_editor");
-printl("Entering directory: test_writer");
-chdir("../test_writer");
+printl("Leaving directory: iTestServer");
+printl("Entering directory: iTestClient");
+chdir("../iTestClient");
printl("Running QMAKE");
run("qmake", qmakeOpts);
printl("Running LRELEASE (translations)");
-run("lrelease", [ "iTestWri.pro" ]);
+run("lrelease", [ "iTestClient.pro" ]);
-printl("Leaving directory: test_writer");
+printl("Leaving directory: iTestClient");
chdir("..");
printl("Running QMAKE");
View
516 database_editor/database.cpp
@@ -1,516 +0,0 @@
-#include "main_window.h"
-
-bool MainWindow::saveChangesBeforeProceeding(QString parentFunction, bool close)
-{
- if (current_db_open && this->isWindowModified()) {
- switch (QMessageBox::information(this, parentFunction, tr("Save changes before proceeding?"), tr("&Save"), tr("&Discard"), tr("Cancel"), 0, 2)) {
- case 0: // Save
- current_db_open = false;
- save(); if (close) {closeDB();}; return false;
- break;
- case 1: // Discard
- current_db_open = false;
- if (close) {closeDB();}; return false;
- break;
- case 2: // Cancel
- return true;
- break;
- }
- } else if (current_db_open && (!this->isWindowModified())) {
- if (close) {closeDB();}; return false;
- }
- return false;
-}
-
-void MainWindow::newDB()
-{
- this->setEnabled(false);
- // Save changes before proceeding?
- bool cancelled = saveChangesBeforeProceeding(tr("New database"), true);
- if (cancelled) { this->setEnabled(true); return; }
- // Creating database -------------------------------------------------------
- bool ok;
- QString db_name = QInputDialog::getText(this, tr("New database"), tr("Database name:"), QLineEdit::Normal, tr("Untitled database"), &ok);
- QString saveDBName;
- if (!ok) { this->setEnabled(true); return; }
- if (!db_name.isEmpty()) {
- saveDBName = QFileDialog::getSaveFileName(this, tr("Create database file"), tr("%1.itdb").arg(db_name), tr("iTest databases (*.itdb)"));
- } else {
- saveDBName = QFileDialog::getSaveFileName(this, tr("Create database file"), tr("untitled.itdb"), tr("iTest databases (*.itdb)"));
- }
- if (saveDBName.isNull() || saveDBName.isEmpty()) { this->setEnabled(true); return; }
- QFile file(saveDBName);
- if (!file.open(QFile::WriteOnly | QFile::Text))
- {
- QMessageBox::critical(this, tr("Create database file"), tr("Cannot write file %1:\n%2.").arg(saveDBName).arg(file.errorString()));
- this->setWindowTitle(tr("iTest - Database Editor"));
- this->setEnabled(true); return;
- }
- setProgress(10); // PROGRESS >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
- QTextStream sfile(&file);
- sfile.setCodec("UTF-8");
- sfile << "[ITEST_VERSION]\n" << f_ver << endl;
- sfile << "[ITEST_DB_VERSION]\n" << f_db_ver << endl;
- sfile << "[DB_NAME]\n" << db_name << endl;
- sfile << "[DB_DATE]\n" << endl;
- sfile << "[DB_DATE_ULSD]\ntrue" << endl;
- sfile << "[DB_COMMENTS]\n" << endl;
- sfile << "[DB_QNUM]\n0" << endl;
- sfile << "[DB_SNUM]\n0" << endl;
- sfile << "[DB_FLAGS]" << endl;
- sfile << "--------------------\n";
- for (int i = 0; i < 20; ++i) {sfile << "[DB_F" << i << "]\n" << endl;}
- sfile << "[DB_FLAGS_END]";
- setProgress(50); // PROGRESS >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
- // APPLY
- enableAll(); clearAll();
- DBIDatabaseNameLineEdit->setText( db_name );
- current_db_file = saveDBName;
- current_db_name = db_name;
- current_db_open = true;
- addRecent(saveDBName);
- this->setWindowTitle(tr("%1[*] - iTest - Database Editor").arg(current_db_name));
- this->setWindowModified(false);
- statusBar()->showMessage(tr("Ready"), 10000);
- setProgress(100); setProgress(-1); // PROGRESS >>>>>>>>>>>>>>>>>>>>>>>>>>>>>
- actionEdit_questions->setChecked(true);
- actionUse_last_save_date->setChecked(true);
- DBIUseLastSaveDateCheckBox->setChecked(true);
- DBIDateEdit->setDateTime(QDateTime::currentDateTime());
- DBIDateEdit->setEnabled(false);
- setPage(actionEdit_questions);
- this->setEnabled(true);
- // -------------------------------------------------------------------------
-}
-
-void MainWindow::save() { saveDB(current_db_file); }
-
-void MainWindow::saveAs()
-{
- QString db_name = DBIDatabaseNameLineEdit->text();
- QString saveDBName = QFileDialog::getSaveFileName(this, tr("Save database"), QString("%1.itdb").arg(db_name), tr("iTest databases (*.itdb)"));
- if (!saveDBName.isNull() || !saveDBName.isEmpty()) { addRecent(saveDBName); saveDB(saveDBName); }
-}
-
-void MainWindow::saveCopy()
-{
- if (this->isWindowModified()) {
- switch (QMessageBox::information(this, tr("Save a copy"), tr("It is necessary to save any changes you have made to the database before proceeding."), tr("&Save"), tr("Cancel"), 0, 1)) {
- case 0: // Save
- save(); break;
- case 1: // Cancel
- return; break;
- }
- }
- QString db_name = DBIDatabaseNameLineEdit->text();
- QString saveDBName = QFileDialog::getSaveFileName(this, tr("Save a copy"), QString("%1.itdb").arg(db_name), tr("iTest databases (*.itdb)"));
- if (!saveDBName.isNull() || !saveDBName.isEmpty())
- { addRecent(saveDBName); saveDB(saveDBName, true, false); }
-}
-
-void MainWindow::saveBackup()
-{
- if (this->isWindowModified()) {
- switch (QMessageBox::information(this, tr("Save a backup"), tr("It is necessary to save any changes you have made to the database before proceeding."), tr("&Save"), tr("Cancel"), 0, 1)) {
- case 0: // Save
- save(); break;
- case 1: // Cancel
- return; break;
- }
- }
- QString db_name = DBIDatabaseNameLineEdit->text();
- QString saveDBName = QFileDialog::getSaveFileName(this, tr("Save a backup"), QString("%1.itdb").arg(db_name), tr("iTest databases (*.itdb)"));
- if (!saveDBName.isNull() || !saveDBName.isEmpty())
- { addRecent(saveDBName); saveDB(saveDBName, true, true); }
-}
-
-void MainWindow::saveDB(QString db_file_name, bool savecopy, bool allsessions)
-{
- this->setEnabled(false); qApp->processEvents();
- // Prepare
- if (LQListWidget->currentIndex().isValid()) {
- applyQuestionChanges();
- }
- // Gather info
- QString db_name = DBIDatabaseNameLineEdit->text();
- if (db_name != current_db_name) {
- QSettings archive(QSettings::IniFormat, QSettings::UserScope, "Michal Tomlein", "iTest");
- QStringList dbs, sns; QString buffer;
- switch (QMessageBox::information(this, tr("iTest - Database Editor"), tr("Are you sure you want to change the database name?\nIf you do so, any archived sessions associated to this database\non other computers will not load, unless you change it back.\nThis computer's archive will be updated."), tr("&Change"), tr("Do &not change"), 0, 1)) {
- case 0: // Change
- dbs = archive.value("databases").toStringList();
- if (!dbs.contains(current_db_name)) { break; }
- dbs.removeAll(current_db_name);
- dbs << db_name;
- archive.setValue("databases", dbs);
- sns = archive.value(QString("%1/sessions").arg(current_db_name)).toStringList();
- archive.setValue(QString("%1/sessions").arg(db_name), sns);
- for (int i = 0; i < sns.count(); ++i) {
- buffer = archive.value(QString("%1/%2").arg(current_db_name).arg(sns.at(i))).toString();
- archive.setValue(QString("%1/%2").arg(db_name).arg(sns.at(i)), buffer);
- }
- archive.remove(current_db_name);
- break;
- case 1: // Do not change
- db_name = current_db_name;
- DBIDatabaseNameLineEdit->setText(current_db_name);
- break;
- }
- }
- QString use_last_save_date; QString db_date;
- if (actionUse_last_save_date->isChecked()) {
- db_date = QDateTime::currentDateTime().toString("yyyy.MM.dd-hh:mm");
- use_last_save_date = "true";
- } else {
- db_date = DBIDateEdit->dateTime().toString("yyyy.MM.dd-hh:mm");
- use_last_save_date = "false";
- }
- QString db_comments = removeLineBreaks(ECTextEdit->toHtml());
- QMap<QDateTime, Session *> sessions = current_db_sessions;
- if (allsessions) {
- QMapIterator<QDateTime, ArchivedSession *> a(current_db_archivedsessions);
- while (a.hasNext()) { a.next();
- if (!sessions.contains(a.key())) {
- sessions.insert(a.key(), a.value());
- }
- }
- }
- uint db_snum = (uint)sessions.size();
- // Save database -----------------------------------------------------------
- QFile file(db_file_name);
- if (!file.open(QFile::WriteOnly | QFile::Text))
- {
- QMessageBox::critical(this, tr("Save database"), tr("Cannot write file %1:\n%2.").arg(db_file_name).arg(file.errorString()));
- this->setEnabled(true); return;
- }
- setProgress(5); // PROGRESS >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
- QTextStream sfile(&file); QString q_file_name;
- sfile.setCodec("UTF-8");
- sfile << "[ITEST_VERSION]\n" << f_ver << endl;
- sfile << "[ITEST_DB_VERSION]\n" << f_db_ver << endl;
- sfile << "[DB_NAME]\n" << db_name << endl;
- sfile << "[DB_DATE]\n" << db_date << endl;
- sfile << "[DB_DATE_ULSD]\n" << use_last_save_date << endl;
- sfile << "[DB_COMMENTS]\n" << db_comments << endl;
- sfile << "[DB_QNUM]\n" << current_db_questions.size() << endl;
- sfile << "[DB_SNUM]\n" << db_snum << endl;
- sfile << "[DB_FLAGS]" << endl;
- for (int i = 0; i < 20; ++i)
- {if (current_db_fe[i]) {sfile << "+";} else {sfile << "-";}} sfile << endl;
- for (int i = 0; i < 20; ++i)
- {sfile << "[DB_F" << i << "]" << endl; sfile << current_db_f[i] << endl;}
- sfile << "[DB_FLAGS_END]" << endl;
- setProgress(10); // PROGRESS >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
- uint count = (uint)current_db_questions.size() + (uint)sessions.size();
- uint n = current_db_questions.size();
- for (int i = 0; i < LQListWidget->count(); ++i) {
- sfile << current_db_questions.value(LQListWidget->item(i))->allProperties() << endl;
- setProgress((90/(i+1)*count)+10); // PROGRESS >>>>>>>>>>>>>>>>>>>>>>>>>>
- }
- QMapIterator<QDateTime, Session *> i(sessions);
- while (i.hasNext()) { i.next(); n++;
- sfile << i.value()->sessionData() << endl;
- for (int s = 0; s < i.value()->numStudents(); ++s) {
- sfile << i.value()->student(s)->studentData() << endl;
- }
- setProgress((90/n*count)+10); // PROGRESS >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
- }
- // -------------------------------------------------------------------------
- while (!current_db_queued_sessions.isEmpty()) {
- ArchivedSession * session = current_db_queued_sessions.dequeue();
- if (session->status() == ArchivedSession::Remove) {
- session->removeFromArchive();
- session->destruct();
- delete session;
- } else if (session->status() == ArchivedSession::Archive) {
- session->archive();
- session->setStatus(ArchivedSession::Default);
- }
- }
- // -------------------------------------------------------------------------
- if (!savecopy) {
- current_db_name = db_name;
- current_db_date = db_date;
- current_db_comments = db_comments;
- current_db_file = db_file_name;
- if (actionUse_last_save_date->isChecked()) {
- DBIDateEdit->setDateTime(QDateTime::fromString(current_db_date, "yyyy.MM.dd-hh:mm"));
- }
- }
- this->setWindowTitle(tr("%1[*] - iTest - Database Editor").arg(current_db_name));
- this->setWindowModified(false);
- statusBar()->showMessage(tr("Database saved"), 10000);
- setProgress(100); setProgress(-1); // PROGRESS >>>>>>>>>>>>>>>>>>>>>>>>>>>>>
- // -------------------------------------------------------------------------
- this->setEnabled(true);
-}
-
-void MainWindow::open()
-{
- // Save changes before proceeding?
- bool cancelled = saveChangesBeforeProceeding(tr("Open database"), true);
- if (!cancelled) {
- // Opening database --------------------------------------------------------
- QString openDBName = QFileDialog::getOpenFileName(this, tr("Open database file"), "", tr("iTest databases (*.itdb);;All files (*.*)"));
- if (!openDBName.isNull()) { addRecent(openDBName); openDB(openDBName); }
- }
-}
-
-void MainWindow::openRecent()
-{
- if (recentDBsListWidget->currentIndex().isValid()) {
- addRecent(recentDBsListWidget->currentItem()->text());
- openDB(recentDBsListWidget->currentItem()->text());
- }
-}
-
-void MainWindow::openRecent(QListWidgetItem * item)
-{
- QString buffer = item->text();
- addRecent(buffer);
- openDB(buffer);
-}
-
-void MainWindow::openDB(QString openDBName, bool useCP1250)
-{
- if (openDBName.isNull()) { return; }
- this->setEnabled(false); qApp->processEvents();
- QFile file(openDBName);
- if (!file.open(QFile::ReadOnly | QFile::Text))
- {
- QMessageBox::critical(this, tr("Open database"), tr("Cannot read file %1:\n%2.").arg(openDBName).arg(file.errorString()));
- this->setEnabled(true); return;
- }
- setProgress(3); // PROGRESS >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
- QTextStream rfile(&file);
- if (useCP1250) { rfile.setCodec("CP 1250"); }
- else { rfile.setCodec("UTF-8"); }
-
- QString db_buffer; float version; float db_version; QString db_name;
- QString db_date; QString db_comments; int db_qnum; bool db_fxxe[20];
- QString db_f[20]; QString q_file_name; QString db_ulsd; int s_lenum;
- QuestionItem * item; QStringList answers; int db_snum; int s_snum;
- QStringList bufferlist; QuestionItem::Answer ans;
- QuestionItem::Answer c_ans;
- // -------------------------------------------------------------------------
- db_buffer = rfile.readLine();
- if (db_buffer != "[ITEST_VERSION]")
- { errorInvalidDBFile(tr("Open database"), openDBName); return; }
- db_buffer = rfile.readLine();
- version = db_buffer.toFloat();
- db_buffer = rfile.readLine();
- if (db_buffer != "[ITEST_DB_VERSION]")
- { errorInvalidDBFile(tr("Open database"), openDBName); return; }
- db_buffer = rfile.readLine();
- db_version = db_buffer.toFloat();
- if ((version > f_ver) && (db_version == f_db_ver))
- { QMessageBox::information(this, tr("iTest version notice"), tr("There is a newer version of iTest available.\nNonetheless, this version is able to open the database file you selected,\nbut you are most probably missing a whole bunch of cool new features.")); }
- if ((version > f_ver) && (db_version > f_db_ver))
- { QMessageBox::critical(this, tr("iTest version notice"), tr("You need a newer version of iTest to open this database file.")); this->setEnabled(true); return; }
- if (!useCP1250) {
- if (db_version == 1.0) { openDB(openDBName, true); return; }
- }
-
- if (rfile.readLine() != "[DB_NAME]")
- { errorInvalidDBFile(tr("Open database"), openDBName); return; }
- // Database name
- db_name = rfile.readLine();
- if (rfile.readLine() != "[DB_DATE]")
- { errorInvalidDBFile(tr("Open database"), openDBName); return; }
- // Database date
- db_date = rfile.readLine();
- if (rfile.readLine() != "[DB_DATE_ULSD]")
- { errorInvalidDBFile(tr("Open database"), openDBName); return; }
- // Use last save date
- db_ulsd = rfile.readLine();
- if (rfile.readLine() != "[DB_COMMENTS]")
- { errorInvalidDBFile(tr("Open database"), openDBName); return; }
- // Database comments
- db_comments = rfile.readLine();
- if (rfile.readLine() != "[DB_QNUM]")
- { errorInvalidDBFile(tr("Open database"), openDBName); return; }
- // Question number
- db_qnum = rfile.readLine().toInt();
- if (rfile.readLine() != "[DB_SNUM]")
- { errorInvalidDBFile(tr("Open database"), openDBName); return; }
- // Number of saved sessions
- db_snum = rfile.readLine().toInt();
- if (rfile.readLine() != "[DB_FLAGS]")
- { errorInvalidDBFile(tr("Open database"), openDBName); return; }
- setProgress(6); // PROGRESS >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
- // fxxe
- db_buffer = rfile.readLine();
- for (int i = 0; i < 20; ++i) {
- if (db_buffer.at(i) == '+') {db_fxxe[i] = true;} else if (db_buffer.at(i) == '-')
- {db_fxxe[i] = false;} else { errorInvalidDBFile(tr("Open database"), openDBName); return; }
- }
- // flags
- for (int i = 0; i < 20; ++i) {
- if (rfile.readLine() != QString("[DB_F%1]").arg(i)) { errorInvalidDBFile(tr("Open database"), openDBName); return; }
- db_f[i] = rfile.readLine();
- }
- // End of flags
- if (rfile.readLine() != "[DB_FLAGS_END]") { errorInvalidDBFile(tr("Open database"), openDBName); return; }
- setProgress(10); // PROGRESS >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
- int count = db_qnum + db_snum;
- // Questions
- for (int i = 0; i < db_qnum; ++i) {
- answers.clear();
- // Question name
- if (rfile.readLine() != "[Q_NAME]") { errorInvalidDBFile(tr("Open database"), openDBName); return; }
- item = new QuestionItem (rfile.readLine());
- // Flag
- if (rfile.readLine() != "[Q_FLAG]") { errorInvalidDBFile(tr("Open database"), openDBName); return; }
- item->setFlag(rfile.readLine().toInt());
- // Difficulty
- if (rfile.readLine() != "[Q_DIFFICULTY]") { errorInvalidDBFile(tr("Open database"), openDBName); return; }
- item->setDifficulty(rfile.readLine().toInt());
- // Question text
- if (rfile.readLine() != "[Q_TEXT]") { errorInvalidDBFile(tr("Open database"), openDBName); return; }
- item->setText(rfile.readLine());
- // Answer A
- if (rfile.readLine() != "[Q_ANSA]") { errorInvalidDBFile(tr("Open database"), openDBName); return; }
- answers << rfile.readLine();
- if (rfile.readLine() != "[Q_ANSA_C]") { errorInvalidDBFile(tr("Open database"), openDBName); return; }
- answers << rfile.readLine();
- // Answer B
- if (rfile.readLine() != "[Q_ANSB]") { errorInvalidDBFile(tr("Open database"), openDBName); return; }
- answers << rfile.readLine();
- if (rfile.readLine() != "[Q_ANSB_C]") { errorInvalidDBFile(tr("Open database"), openDBName); return; }
- answers << rfile.readLine();
- // Answer C
- if (rfile.readLine() != "[Q_ANSC]") { errorInvalidDBFile(tr("Open database"), openDBName); return; }
- answers << rfile.readLine();
- if (rfile.readLine() != "[Q_ANSC_C]") { errorInvalidDBFile(tr("Open database"), openDBName); return; }
- answers << rfile.readLine();
- // Answer D
- if (rfile.readLine() != "[Q_ANSD]") { errorInvalidDBFile(tr("Open database"), openDBName); return; }
- answers << rfile.readLine();
- if (rfile.readLine() != "[Q_ANSD_C]") { errorInvalidDBFile(tr("Open database"), openDBName); return; }
- answers << rfile.readLine();
- // Statistics
- if (rfile.readLine() != "[Q_ICNT]") { errorInvalidDBFile(tr("Open database"), openDBName); return; }
- item->setIncorrectAnsCount(rfile.readLine().toUInt());
- if (rfile.readLine() != "[Q_CCNT]") { errorInvalidDBFile(tr("Open database"), openDBName); return; }
- item->setCorrectAnsCount(rfile.readLine().toUInt());
- // End
- if (rfile.readLine() != "[Q_END]") { errorInvalidDBFile(tr("Open database"), openDBName); return; }
- // Add map entry
- item->setAnswers(answers);
- QListWidgetItem * q_item = new QListWidgetItem (item->name());
- LQListWidget->addItem(q_item);
- current_db_questions.insert(q_item, item);
- switch (item->difficulty()) {
- case 0: q_item->setIcon(QIcon(QString::fromUtf8(":/images/images/easy.png"))); break;
- case 1: q_item->setIcon(QIcon(QString::fromUtf8(":/images/images/medium.png"))); break;
- case 2: q_item->setIcon(QIcon(QString::fromUtf8(":/images/images/difficult.png"))); break;
- default: q_item->setIcon(QIcon(QString::fromUtf8(":/images/images/easy.png"))); break;
- }
- setQuestionItemColour(q_item, item->flag());
- setProgress((85/(i+1)*count)+10); // PROGRESS >>>>>>>>>>>>>>>>>>>>>>>>
- }
- // Saved sessions
- for (int i = 0; i < db_snum; ++i) {
- if (rfile.atEnd()) { break; }
- if (rfile.readLine() != "[SESSION]") { continue; }
- Session * session = new Session;
- session->setName(rfile.readLine());
- session->setDateTimeFromString(rfile.readLine());
- session->setPassMark(rfile.readLine().toInt());
- s_snum = rfile.readLine().toInt();
- s_lenum = rfile.readLine().toInt();
- for (int le = 0; le < s_lenum; ++le) {
- bufferlist.clear();
- bufferlist = rfile.readLine().split(';');
- if (bufferlist.count() == 6) {
- session->addLogEntry(bufferlist.at(0).toInt(),
- bufferlist.at(1).toInt(),
- bufferlist.at(2).toInt(),
- bufferlist.at(3).toInt(),
- bufferlist.at(4).toInt(),
- bufferlist.at(5).toInt(),
- rfile.readLine());
- } else {
- session->addLogEntry(255, 255, 255, 0, 0, 0, rfile.readLine());
- }
- }
- for (int s = 0; s < s_snum; ++s) {
- if (rfile.atEnd()) { break; }
- if (rfile.readLine() != "[STUDENT]") { continue; }
- Student * student = new Student (rfile.readLine());
- if (rfile.readLine() == "true") { student->setReady(true); }
- else { student->setReady(false); }
- student->setNumber(rfile.readLine().toInt());
- student->setScore(rfile.readLine().toInt());
- int numresults = rfile.readLine().toInt();
- QMap<QString, QuestionAnswer> * results = new QMap<QString, QuestionAnswer>;
- for (int a = 0; a < numresults; ++a) {
- db_buffer = rfile.readLine();
- ans = (QuestionItem::Answer)rfile.readLine().toInt();
- c_ans = (QuestionItem::Answer)rfile.readLine().toInt();
- QuestionAnswer qans (c_ans, ans);
- results->insert(db_buffer, qans);
- }
- student->setResults(results);
- session->addStudent(student);
- }
- current_db_sessions.insert(session->dateTime(), session);
- QListWidgetItem * item = new QListWidgetItem (QString("%1 - %2").arg(session->dateTimeToString()).arg(session->name()));
- VSSLSListWidget->insertItem(0, item);
- item->setData(Qt::UserRole, session->dateTime());
- setProgress((85/(db_qnum+i+1)*count)+10); // PROGRESS >>>>>>>>>>>>>>>>
- }
- // Set texts - DBI section
- DBIDatabaseNameLineEdit->setText( db_name );
- DBIDateEdit->setDateTime( QDateTime::fromString(db_date, "yyyy.MM.dd-hh:mm") );
- if (db_ulsd == "true") {
- DBIUseLastSaveDateCheckBox->setChecked(true);
- actionUse_last_save_date->setChecked(true);
- DBIDateEdit->setEnabled(false);
- } else if (db_ulsd == "false") {
- DBIUseLastSaveDateCheckBox->setChecked(false);
- actionUse_last_save_date->setChecked(false);
- DBIDateEdit->setEnabled(true);
- }
- ECTextEdit->setHtml( db_comments );
- // Set flags
- for (int i = 0; i < 20; ++i) {current_db_fe[i] = db_fxxe[i];}
- for (int i = 0; i < 20; ++i) {current_db_f[i] = db_f[i];}
- setProgress(97); // PROGRESS >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
- // Apply flags
- setFlags(); loadFlags();
- setProgress(98); // PROGRESS >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
- // Enable All
- enableAll();
- setProgress(99); // PROGRESS >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
- // Save values
- current_db_file = openDBName;
- current_db_name = db_name;
- current_db_date = db_date;
- current_db_comments = db_comments;
- current_db_open = true;
- this->setWindowTitle(tr("%1[*] - iTest - Database Editor").arg(current_db_name));
- this->setWindowModified(false);
- statusBar()->showMessage(tr("Database open"), 10000);
- setProgress(100); setProgress(-1); // PROGRESS >>>>>>>>>>>>>>>>>>>>>>>>>>>>>
- actionEdit_questions->setChecked(true);
- mainStackedWidget->setCurrentIndex(1); updateGeometry();
- // -------------------------------------------------------------------------
- this->setEnabled(true);
- // Load archived sessions
- openArchive();
-}
-
-void MainWindow::closeDB()
-{
- // Save changes before proceeding?
- if (saveChangesBeforeProceeding(tr("Close database"), false)) { return; }
- // Closing database --------------------------------------------------------
- clearAll(); disableAll(); current_db_open = false;
- this->setWindowTitle(tr("iTest - Database Editor"));
- this->setWindowModified(false);
- setProgress(100); setProgress(-1); // PROGRESS >>>>>>>>>>>>>>>>>>>>>>>>>>>>>
- mainStackedWidget->setCurrentIndex(0); updateGeometry();
- statusBar()->showMessage(tr("Database closed"), 10000);
- // -------------------------------------------------------------------------
-}
View
271 database_editor/flags.cpp
@@ -1,271 +0,0 @@
-#include "main_window.h"
-
-void MainWindow::setupFlagsPage()
-{
- EFFlagLineEdit[0] = Flag01LineEdit; EFFlagCheckBox[0] = Flag01CheckBox;
- EFFlagLineEdit[1] = Flag02LineEdit; EFFlagCheckBox[1] = Flag02CheckBox;
- EFFlagLineEdit[2] = Flag03LineEdit; EFFlagCheckBox[2] = Flag03CheckBox;
- EFFlagLineEdit[3] = Flag04LineEdit; EFFlagCheckBox[3] = Flag04CheckBox;
- EFFlagLineEdit[4] = Flag05LineEdit; EFFlagCheckBox[4] = Flag05CheckBox;
- EFFlagLineEdit[5] = Flag06LineEdit; EFFlagCheckBox[5] = Flag06CheckBox;
- EFFlagLineEdit[6] = Flag07LineEdit; EFFlagCheckBox[6] = Flag07CheckBox;
- EFFlagLineEdit[7] = Flag08LineEdit; EFFlagCheckBox[7] = Flag08CheckBox;
- EFFlagLineEdit[8] = Flag09LineEdit; EFFlagCheckBox[8] = Flag09CheckBox;
- EFFlagLineEdit[9] = Flag10LineEdit; EFFlagCheckBox[9] = Flag10CheckBox;
- EFFlagLineEdit[10] = Flag11LineEdit; EFFlagCheckBox[10] = Flag11CheckBox;
- EFFlagLineEdit[11] = Flag12LineEdit; EFFlagCheckBox[11] = Flag12CheckBox;
- EFFlagLineEdit[12] = Flag13LineEdit; EFFlagCheckBox[12] = Flag13CheckBox;
- EFFlagLineEdit[13] = Flag14LineEdit; EFFlagCheckBox[13] = Flag14CheckBox;
- EFFlagLineEdit[14] = Flag15LineEdit; EFFlagCheckBox[14] = Flag15CheckBox;
- EFFlagLineEdit[15] = Flag16LineEdit; EFFlagCheckBox[15] = Flag16CheckBox;
- EFFlagLineEdit[16] = Flag17LineEdit; EFFlagCheckBox[16] = Flag17CheckBox;
- EFFlagLineEdit[17] = Flag18LineEdit; EFFlagCheckBox[17] = Flag18CheckBox;
- EFFlagLineEdit[18] = Flag19LineEdit; EFFlagCheckBox[18] = Flag19CheckBox;
- EFFlagLineEdit[19] = Flag20LineEdit; EFFlagCheckBox[19] = Flag20CheckBox;
- EFFlagQnumLabel[0] = FlagQnumLabel_0; EFFlagQnumLabel[1] = FlagQnumLabel_1;
- EFFlagQnumLabel[2] = FlagQnumLabel_2; EFFlagQnumLabel[3] = FlagQnumLabel_3;
- EFFlagQnumLabel[4] = FlagQnumLabel_4; EFFlagQnumLabel[5] = FlagQnumLabel_5;
- EFFlagQnumLabel[6] = FlagQnumLabel_6; EFFlagQnumLabel[7] = FlagQnumLabel_7;
- EFFlagQnumLabel[8] = FlagQnumLabel_8; EFFlagQnumLabel[9] = FlagQnumLabel_9;
- EFFlagQnumLabel[10] = FlagQnumLabel_10; EFFlagQnumLabel[11] = FlagQnumLabel_11;
- EFFlagQnumLabel[12] = FlagQnumLabel_12; EFFlagQnumLabel[13] = FlagQnumLabel_13;
- EFFlagQnumLabel[14] = FlagQnumLabel_14; EFFlagQnumLabel[15] = FlagQnumLabel_15;
- EFFlagQnumLabel[16] = FlagQnumLabel_16; EFFlagQnumLabel[17] = FlagQnumLabel_17;
- EFFlagQnumLabel[18] = FlagQnumLabel_18; EFFlagQnumLabel[19] = FlagQnumLabel_19;
- QLabel * fl[20];
- fl[0] = FlagLabel_1; fl[1] = FlagLabel_2; fl[2] = FlagLabel_3;
- fl[3] = FlagLabel_4; fl[4] = FlagLabel_5; fl[5] = FlagLabel_6;
- fl[6] = FlagLabel_7; fl[7] = FlagLabel_8; fl[8] = FlagLabel_9;
- fl[9] = FlagLabel_10; fl[10] = FlagLabel_11; fl[11] = FlagLabel_12;
- fl[12] = FlagLabel_13; fl[13] = FlagLabel_14; fl[14] = FlagLabel_15;
- fl[15] = FlagLabel_16; fl[16] = FlagLabel_17; fl[17] = FlagLabel_18;
- fl[18] = FlagLabel_19; fl[19] = FlagLabel_20;
-
- for (int i = 0; i < 20; ++i) {
- EFFlagLineEdit[i]->setStatusTip(tr("Type a name for flag %1").arg(i + 1));
- EFFlagCheckBox[i]->setStatusTip(tr("Check or uncheck this checkbox to enable or disable flag %1").arg(i + 1));
- fl[i]->setText(tr("Flag %1:").arg(i + 1));
- QObject::connect(EFFlagCheckBox[i], SIGNAL(toggled(bool)), EFFlagLineEdit[i], SLOT(setEnabled(bool)));
- }
- QObject::connect(EFButtonBox, SIGNAL(clicked(QAbstractButton *)), this, SLOT(updateFlags(QAbstractButton *)));
-}
-
-void MainWindow::setFlags()
-{
- int q_flag_i = SQFlagComboBox->itemData(SQFlagComboBox->currentIndex()).toInt();
- SQFlagComboBox->clear(); LQFlagComboBox->clear();
- current_db_flagentries.clear();
- for (int i = 0; i < 20; ++i) {
- if (current_db_fe[i]) {
- SQFlagComboBox->addItem(QString("%1 - %2").arg(i+1).arg(current_db_f[i]), i);
- LQFlagComboBox->addItem(QString("%1 - %2").arg(i+1).arg(current_db_f[i]), i);
- current_db_flagentries.insert(i, SQFlagComboBox->count()-1);
- }
- }
- SQFlagComboBox->setCurrentIndex(current_db_flagentries.value(q_flag_i));
- checkForUnflaggedQuestions();
-}
-
-void MainWindow::loadFlags()
-{
- for (int i = 0; i < 20; ++i)
- {
- if (current_db_fe[i]) {EFFlagCheckBox[i]->setChecked( true );}
- else {EFFlagCheckBox[i]->setChecked( false );}
- EFFlagLineEdit[i]->setText( current_db_f[i] );
- }
-}
-
-void MainWindow::applyFlags()
-{
- for (int i = 0; i < 20; ++i)
- {
- current_db_f[i] = EFFlagLineEdit[i]->text();
- current_db_fe[i] = EFFlagCheckBox[i]->isChecked();
- }
- setFlags(); updateFlagQnums();
- statusBar()->showMessage(tr("Flags saved"), 10000);
- setDatabaseModified();
-}
-
-void MainWindow::discardFlags()
-{
- loadFlags(); statusBar()->showMessage(tr("Flags discarded"), 10000);
-}
-
-void MainWindow::updateFlags(QAbstractButton * btn)
-{
- if (btn == EFButtonBox->button(EFButtonBox->Apply)) {applyFlags();}
- else if (btn == EFButtonBox->button(EFButtonBox->Discard)) {discardFlags();}
-}
-
-void MainWindow::updateFlagQnums()
-{
- int flag_qnum [20];
- for (int i = 0; i < 20; ++i) { flag_qnum[i] = 0; }
- QMapIterator<QListWidgetItem *, QuestionItem *> i(current_db_questions);
- while (i.hasNext()) {
- i.next();
- if (i.value()->flag() >= 0 && i.value()->flag() < 20) {
- flag_qnum[i.value()->flag()]++;
- }
- }
- QString label_text = tr("Number of questions with this flag: ");
- QString buffer;
- for (int i = 0; i < 20; ++i) {
- buffer = label_text;
- buffer.append(QString("%1").arg(flag_qnum[i]));
- EFFlagQnumLabel[i]->setText(buffer);
- if (flag_qnum[i] > 0) {
- if (EFFlagCheckBox[i]->isChecked()) {
- EFFlagCheckBox[i]->setEnabled(false);
- }
- }
- else {EFFlagCheckBox[i]->setEnabled(true);}
- }
-}
-
-void MainWindow::checkForUnflaggedQuestions()
-{
- int numflags = 0; QuestionItem * item;
- for (int i = 0; i < 20; ++i) { if (current_db_fe[i]) { numflags++; } }
- if (numflags > 0) {
- for (int i = 0; i < LQListWidget->count(); ++i) {
- item = current_db_questions.value(LQListWidget->item(i));
- if (item->flag() == -1) {
- item->setFlag(SQFlagComboBox->itemData(0).toInt());
- setQuestionItemColour(LQListWidget->item(i), item->flag());
- setDatabaseModified();
- if (LQListWidget->currentRow() == i) {
- SQFlagComboBox->setCurrentIndex(current_db_flagentries.value(item->flag()));
- LQFlagComboBox->setCurrentIndex(current_db_flagentries.value(item->flag()));
- }
- }
- }
- }
-}
-
-void MainWindow::setFlagLineEditPalettes()
-{
- QPalette palette;
-
- palette.setColor(QPalette::Active, QPalette::Base, QColor::QColor(255, 255, 255));
- palette.setColor(QPalette::Active, QPalette::Text, QColor::QColor(0, 0, 0));
- palette.setColor(QPalette::Inactive, QPalette::Base, QColor::QColor(255, 255, 255));
- palette.setColor(QPalette::Inactive, QPalette::Text, QColor::QColor(0, 0, 0));
- Flag01LineEdit->setPalette(palette);
-
- palette.setColor(QPalette::Active, QPalette::Base, QColor::QColor(197, 255, 120));
- palette.setColor(QPalette::Active, QPalette::Text, QColor::QColor(0, 0, 0));
- palette.setColor(QPalette::Inactive, QPalette::Base, QColor::QColor(197, 255, 120));
- palette.setColor(QPalette::Inactive, QPalette::Text, QColor::QColor(0, 0, 0));
- Flag02LineEdit->setPalette(palette);
-
- palette.setColor(QPalette::Active, QPalette::Base, QColor::QColor(92, 163, 0));
- palette.setColor(QPalette::Active, QPalette::Text, QColor::QColor(0, 0, 0));
- palette.setColor(QPalette::Inactive, QPalette::Base, QColor::QColor(92, 163, 0));
- palette.setColor(QPalette::Inactive, QPalette::Text, QColor::QColor(0, 0, 0));
- Flag03LineEdit->setPalette(palette);
-
- palette.setColor(QPalette::Active, QPalette::Base, QColor::QColor(69, 110, 14));
- palette.setColor(QPalette::Active, QPalette::Text, QColor::QColor(255, 255, 255));
- palette.setColor(QPalette::Inactive, QPalette::Base, QColor::QColor(69, 110, 14));
- palette.setColor(QPalette::Inactive, QPalette::Text, QColor::QColor(255, 255, 255));
- Flag04LineEdit->setPalette(palette);
-
- palette.setColor(QPalette::Active, QPalette::Base, QColor::QColor(17, 120, 122));
- palette.setColor(QPalette::Active, QPalette::Text, QColor::QColor(255, 255, 255));
- palette.setColor(QPalette::Inactive, QPalette::Base, QColor::QColor(17, 120, 122));
- palette.setColor(QPalette::Inactive, QPalette::Text, QColor::QColor(255, 255, 255));
- Flag05LineEdit->setPalette(palette);
-
- palette.setColor(QPalette::Active, QPalette::Base, QColor::QColor(0, 163, 136));
- palette.setColor(QPalette::Active, QPalette::Text, QColor::QColor(0, 0, 0));
- palette.setColor(QPalette::Inactive, QPalette::Base, QColor::QColor(0, 163, 136));
- palette.setColor(QPalette::Inactive, QPalette::Text, QColor::QColor(0, 0, 0));
- Flag06LineEdit->setPalette(palette);
-
- palette.setColor(QPalette::Active, QPalette::Base, QColor::QColor(0, 147, 163));
- palette.setColor(QPalette::Active, QPalette::Text, QColor::QColor(0, 0, 0));
- palette.setColor(QPalette::Inactive, QPalette::Base, QColor::QColor(0, 147, 163));
- palette.setColor(QPalette::Inactive, QPalette::Text, QColor::QColor(0, 0, 0));
- Flag07LineEdit->setPalette(palette);
-
- palette.setColor(QPalette::Active, QPalette::Base, QColor::QColor(0, 125, 163));
- palette.setColor(QPalette::Active, QPalette::Text, QColor::QColor(255, 255, 255));
- palette.setColor(QPalette::Inactive, QPalette::Base, QColor::QColor(0, 125, 163));
- palette.setColor(QPalette::Inactive, QPalette::Text, QColor::QColor(255, 255, 255));
- Flag08LineEdit->setPalette(palette);
-
- palette.setColor(QPalette::Active, QPalette::Base, QColor::QColor(0, 84, 163));
- palette.setColor(QPalette::Active, QPalette::Text, QColor::QColor(255, 255, 255));
- palette.setColor(QPalette::Inactive, QPalette::Base, QColor::QColor(0, 84, 163));
- palette.setColor(QPalette::Inactive, QPalette::Text, QColor::QColor(255, 255, 255));
- Flag09LineEdit->setPalette(palette);
-
- palette.setColor(QPalette::Active, QPalette::Base, QColor::QColor(40, 76, 110));
- palette.setColor(QPalette::Active, QPalette::Text, QColor::QColor(255, 255, 255));
- palette.setColor(QPalette::Inactive, QPalette::Base, QColor::QColor(40, 76, 110));
- palette.setColor(QPalette::Inactive, QPalette::Text, QColor::QColor(255, 255, 255));
- Flag10LineEdit->setPalette(palette);
-
- palette.setColor(QPalette::Active, QPalette::Base, QColor::QColor(0, 11, 163));
- palette.setColor(QPalette::Active, QPalette::Text, QColor::QColor(255, 255, 255));
- palette.setColor(QPalette::Inactive, QPalette::Base, QColor::QColor(0, 11, 163));
- palette.setColor(QPalette::Inactive, QPalette::Text, QColor::QColor(255, 255, 255));
- Flag11LineEdit->setPalette(palette);
-
- palette.setColor(QPalette::Active, QPalette::Base, QColor::QColor(139, 0, 163));
- palette.setColor(QPalette::Active, QPalette::Text, QColor::QColor(255, 255, 255));
- palette.setColor(QPalette::Inactive, QPalette::Base, QColor::QColor(139, 0, 163));
- palette.setColor(QPalette::Inactive, QPalette::Text, QColor::QColor(255, 255, 255));
- Flag12LineEdit->setPalette(palette);
-
- palette.setColor(QPalette::Active, QPalette::Base, QColor::QColor(163, 0, 79));
- palette.setColor(QPalette::Active, QPalette::Text, QColor::QColor(255, 255, 255));
- palette.setColor(QPalette::Inactive, QPalette::Base, QColor::QColor(163, 0, 79));
- palette.setColor(QPalette::Inactive, QPalette::Text, QColor::QColor(255, 255, 255));
- Flag13LineEdit->setPalette(palette);
-
- palette.setColor(QPalette::Active, QPalette::Base, QColor::QColor(163, 0, 0));
- palette.setColor(QPalette::Active, QPalette::Text, QColor::QColor(0, 0, 0));
- palette.setColor(QPalette::Inactive, QPalette::Base, QColor::QColor(163, 0, 0));
- palette.setColor(QPalette::Inactive, QPalette::Text, QColor::QColor(0, 0, 0));
- Flag14LineEdit->setPalette(palette);
-
- palette.setColor(QPalette::Active, QPalette::Base, QColor::QColor(255, 0, 0));
- palette.setColor(QPalette::Active, QPalette::Text, QColor::QColor(0, 0, 0));
- palette.setColor(QPalette::Inactive, QPalette::Base, QColor::QColor(255, 0, 0));
- palette.setColor(QPalette::Inactive, QPalette::Text, QColor::QColor(0, 0, 0));
- Flag15LineEdit->setPalette(palette);
-
- palette.setColor(QPalette::Active, QPalette::Base, QColor::QColor(204, 109, 0));
- palette.setColor(QPalette::Active, QPalette::Text, QColor::QColor(0, 0, 0));
- palette.setColor(QPalette::Inactive, QPalette::Base, QColor::QColor(204, 109, 0));
- palette.setColor(QPalette::Inactive, QPalette::Text, QColor::QColor(0, 0, 0));
- Flag16LineEdit->setPalette(palette);
-
- palette.setColor(QPalette::Active, QPalette::Base, QColor::QColor(204, 163, 0));
- palette.setColor(QPalette::Active, QPalette::Text, QColor::QColor(0, 0, 0));
- palette.setColor(QPalette::Inactive, QPalette::Base, QColor::QColor(204, 163, 0));
- palette.setColor(QPalette::Inactive, QPalette::Text, QColor::QColor(0, 0, 0));
- Flag17LineEdit->setPalette(palette);
-
- palette.setColor(QPalette::Active, QPalette::Base, QColor::QColor(201, 204, 0));
- palette.setColor(QPalette::Active, QPalette::Text, QColor::QColor(0, 0, 0));
- palette.setColor(QPalette::Inactive, QPalette::Base, QColor::QColor(201, 204, 0));
- palette.setColor(QPalette::Inactive, QPalette::Text, QColor::QColor(0, 0, 0));
- Flag18LineEdit->setPalette(palette);
-
- palette.setColor(QPalette::Active, QPalette::Base, QColor::QColor(255, 251, 0));
- palette.setColor(QPalette::Active, QPalette::Text, QColor::QColor(0, 0, 0));
- palette.setColor(QPalette::Inactive, QPalette::Base, QColor::QColor(255, 251, 0));
- palette.setColor(QPalette::Inactive, QPalette::Text, QColor::QColor(0, 0, 0));
- Flag19LineEdit->setPalette(palette);
-
- palette.setColor(QPalette::Active, QPalette::Base, QColor::QColor(221, 255, 0));
- palette.setColor(QPalette::Active, QPalette::Text, QColor::QColor(0, 0, 0));
- palette.setColor(QPalette::Inactive, QPalette::Base, QColor::QColor(221, 255, 0));
- palette.setColor(QPalette::Inactive, QPalette::Text, QColor::QColor(0, 0, 0));
- Flag20LineEdit->setPalette(palette);
-}
View
BIN database_editor/images/textbold.png
Deleted file not rendered
View
BIN database_editor/images/textcenter.png
Deleted file not rendered
View
BIN database_editor/images/textitalic.png
Deleted file not rendered
View
BIN database_editor/images/textjustify.png
Deleted file not rendered
View
BIN database_editor/images/textleft.png
Deleted file not rendered
View
BIN database_editor/images/textright.png
Deleted file not rendered
View
BIN database_editor/images/textunder.png
Deleted file not rendered
View
2 iTest.pro
@@ -1,2 +1,2 @@
TEMPLATE = subdirs
-SUBDIRS += database_editor test_writer
+SUBDIRS += iTestServer iTestClient
View
12 test_writer/about_widget.cpp → iTestClient/about_widget.cpp
@@ -10,7 +10,7 @@ AboutWidget::AboutWidget(QString ver, QString qtver, QString year)
about.append(tr("Version"));
about.append(QString(" %1</span></p><p></p>").arg(ver));
about.append("<p style=\"font-family: sans-serif; font-size:8pt;\">");
- about.append(tr("iTest is a Qt application consisting of a Database Editor and a Test Writer designed for easy computerised examination."));
+ about.append(tr("iTest is a Qt application consisting of a Server and a Client designed for easy computerised examination."));
about.append("</p><p></p>");
about.append("<p style=\"font-family: sans-serif; font-size:8pt;\">");
about.append(tr("This programme is distributed under the terms of the GPL v2."));
@@ -19,6 +19,11 @@ AboutWidget::AboutWidget(QString ver, QString qtver, QString year)
about.append("<p></p><p style=\"font-family: sans-serif; font-size:8pt;\">");
about.append(tr("The programme is provided AS IS with ABSOLUTELY NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE."));
about.append("</p>");
+#ifdef Q_WS_MAC
+ about.remove("font-family: sans-serif;");
+ about.replace("font-size:12pt;", "font-size:14pt;");
+ about.replace("font-size:8pt;", "font-size:10pt;");
+#endif
aboutTextBrowser->setHtml(about);
QString aboutQt = "<p style=\"font-family: sans-serif; font-style:italic;\"><span style=\"font-size:12pt;\">";
aboutQt.append(tr("About Qt"));
@@ -31,6 +36,11 @@ AboutWidget::AboutWidget(QString ver, QString qtver, QString year)
aboutQt.append("</p><p></p><p style=\"font-family: sans-serif; font-size:8pt;\">");
aboutQt.append(tr("Qt is a Trolltech product. See <span style=\"font-style:italic;\">http://www.trolltech.com/qt/</span> for more information."));
aboutQt.append("</p>");
+#ifdef Q_WS_MAC
+ aboutQt.remove("font-family: sans-serif;");
+ aboutQt.replace("font-size:12pt;", "font-size:14pt;");
+ aboutQt.replace("font-size:8pt;", "font-size:10pt;");
+#endif
aboutQtTextBrowser->setHtml(aboutQt);
}
View
0 test_writer/about_widget.h → iTestClient/about_widget.h
File renamed without changes.
View
6 test_writer/about_widget_v2.ui → iTestClient/about_widget_v2.ui
@@ -260,12 +260,6 @@
<property name="icon" >
<iconset resource="resources.qrc" >:/images/images/fileclose.png</iconset>
</property>
- <property name="iconSize" >
- <size>
- <width>22</width>
- <height>22</height>
- </size>
- </property>
</widget>
</item>
</layout>
View
12 test_writer/client.cpp → iTestClient/client.cpp
@@ -8,9 +8,9 @@ void MainWindow::connectSocket()
test_loaded = false;
num_entries = 0;
current_entry = 0;
+ current_connection_local = (serverNameLineEdit->text() == "Localhost" || serverNameLineEdit->text() == "localhost");
tcpSocket->abort();
- tcpSocket->connectToHost(serverNameLineEdit->text(),
- serverPortLineEdit->text().toInt());
+ tcpSocket->connectToHost(serverNameLineEdit->text(), serverPortLineEdit->text().toInt());
if (progress_dialog != NULL) delete progress_dialog;
progress_dialog = new QProgressDialog (this);
progress_dialog->setLabelText(tr("Retrieving test data..."));
@@ -208,7 +208,7 @@ void MainWindow::saveResults()
}
}
loadResults(current_test_results, resultsTableWidget);
- scoreLabel->setText(tr("%1 out of %2").arg(current_test_score).arg(LQListWidget->count()));
+ scoreLabel->setText(tr("%1 out of %2 (%3)").arg(current_test_score).arg(LQListWidget->count()).arg(current_test_passmark.check(current_test_results, &current_test_questions) ? tr("PASSED") : tr("FAILED")));
}
void MainWindow::loadResults(QMap<QString, QuestionAnswer> * results, QTableWidget * tw)
@@ -260,19 +260,19 @@ void MainWindow::displayError(QAbstractSocket::SocketError socketError)
case QAbstractSocket::RemoteHostClosedError:
break;
case QAbstractSocket::HostNotFoundError:
- QMessageBox::information(this, tr("iTest - Test Writer"),
+ QMessageBox::information(this, tr("iTestClient"),
tr("The host was not found. Please check the "
"host name and port settings."));
break;
case QAbstractSocket::ConnectionRefusedError:
- QMessageBox::information(this, tr("iTest - Test Writer"),
+ QMessageBox::information(this, tr("iTestClient"),
tr("The connection was refused by the peer. "
"Make sure the iTest server is running, "
"and check that the host name and port "
"settings are correct."));
break;
default:
- QMessageBox::information(this, tr("iTest - Test Writer"),
+ QMessageBox::information(this, tr("iTestClient"),
tr("The following error occurred: %1.")
.arg(tcpSocket->errorString()));
}
View
360 iTestClient/database.cpp
@@ -0,0 +1,360 @@
+#include "main_window.h"
+
+void MainWindow::browse_i()
+{
+ DBPathLineEdit->setText(QFileDialog::getOpenFileName(this, tr("Open database file"), "", tr("iTest off-line test sessions (*.itos);;All files (*.*)")));
+}
+
+void MainWindow::browse_o()
+{
+ savePathLineEdit->setText(QFileDialog::getSaveFileName(this, tr("Output file path"), tr("answers.itcl"), tr("iTest off-line client log (*.itcl)")));
+}
+
+void MainWindow::loadTest(QString input)
+{
+ QProgressDialog progress (this);
+ progress.setLabelText(tr("Loading test data..."));
+ progress.setMinimum(0);
+ progress.setMinimumDuration(0);
+ progress.setWindowModality(Qt::WindowModal);
+
+ QTextStream in(&input);
+
+ QString db_buffer; float version; float db_version; QString db_name;
+ QString db_date; QString db_comments; int db_qnum; bool db_fxxe[20];
+ QString db_f[20]; QString q_file_name; QString db_ulsd; QString test_date;
+ QuestionItem * item; QStringList answers; int test_qnum; QString test_time;
+ QString db_use_groups = "false";
+ // ------------------------------------------------------------------------
+ if (in.readLine() != "[ITEST_VERSION]")
+ { errorInvalidData(); return; }
+ version = in.readLine().toFloat();
+ if (in.readLine() != "[ITEST_DB_VERSION]")
+ { errorInvalidData(); return; }
+ db_version = in.readLine().toFloat();
+ if ((version > f_ver) && (db_version == f_itos_ver))
+ { QMessageBox::information(this, tr("iTest version notice"), tr("There is a newer version of iTest available.\nNonetheless, this version is able to open the database file you selected,\nbut you are most probably missing a whole bunch of cool new features.")); }
+ if ((version > f_ver) && (db_version > f_itos_ver))
+ { QMessageBox::critical(this, tr("iTest version notice"), tr("You need a newer version of iTest to open this database file.")); return; }
+ if (db_version == 1.0) { errorInvalidData(); return; }
+
+ if (in.readLine() != "[DB_NAME]") { errorInvalidData(); return; }
+ // Database name
+ db_name = in.readLine();
+ if (in.readLine() != "[DB_DATE]") { errorInvalidData(); return; }
+ // Database date
+ db_date = in.readLine();
+ if (in.readLine() != "[DB_DATE_ULSD]") { errorInvalidData(); return; }
+ // Use last save date
+ db_ulsd = in.readLine();
+ if (db_version >= 1.2) {
+ if (in.readLine() != "[TEST_GRPS]") { errorInvalidData(); return; }
+ // Use groups
+ db_use_groups = in.readLine();
+ }
+ if (in.readLine() != "[TEST_DATE]") { errorInvalidData(); return; }
+ // Test date
+ test_date = in.readLine();
+ if (in.readLine() != "[TEST_TIME]") { errorInvalidData(); return; }
+ // Test time
+ test_time = in.readLine();
+ if (in.readLine() != "[TEST_QNUM]") { errorInvalidData(); return; }
+ // Test qnum
+ test_qnum = in.readLine().toInt();
+ if (in.readLine() != "[DB_COMMENTS]") { errorInvalidData(); return; }
+ // Database comments
+ db_comments = in.readLine();
+ if (in.readLine() != "[DB_QNUM]") { errorInvalidData(); return; }
+ // Question number
+ db_qnum = in.readLine().toInt();
+ progress.setMaximum(db_qnum);
+ if (in.readLine() != "[DB_FLAGS]") { errorInvalidData(); return; }
+ // fxxe
+ db_buffer = in.readLine();
+ for (int i = 0; i < 20; ++i) {
+ if (db_buffer.at(i) == '+') {db_fxxe[i] = true;} else if (db_buffer.at(i) == '-')
+ {db_fxxe[i] = false;} else { errorInvalidData(); return; }
+ }
+ // flags
+ for (int i = 0; i < 20; ++i) {
+ if (in.readLine() != QString("[DB_F%1]").arg(i)) { errorInvalidData(); return; }
+ db_f[i] = in.readLine();
+ }
+ // End of flags
+ if (in.readLine() != "[DB_FLAGS_END]") { errorInvalidData(); return; }
+ // Pass mark
+ if (db_version >= 1.2) {
+ if (in.readLine() != "[PASSMARK]") { errorInvalidData(); return; }
+ current_test_passmark.setPassMark(in.readLine().toInt());
+ int pm_count = in.readLine().toInt(); int pm_c;
+ for (int i = 0; i < pm_count; ++i) {
+ pm_c = in.readLine().toInt();
+ current_test_passmark.addCondition(pm_c, in.readLine().toInt());
+ }
+ }
+ // Questions
+ for (int i = 0; i < db_qnum; ++i) {
+ answers.clear();
+ // Question name
+ if (in.readLine() != "[Q_NAME]") { errorInvalidData(); return; }
+ item = new QuestionItem (in.readLine());
+ // Flag
+ if (in.readLine() != "[Q_FLAG]") { errorInvalidData(); return; }
+ item->setFlag(in.readLine().toInt());
+ if (db_version >= 1.2) {
+ // Group
+ if (in.readLine() != "[Q_GRP]") { errorInvalidData(); return; }
+ item->setGroup(in.readLine());
+ }
+ // Difficulty
+ if (db_version >= 1.2) { if (in.readLine() != "[Q_DIF]") { errorInvalidData(); return; } }
+ else { if (in.readLine() != "[Q_DIFFICULTY]") { errorInvalidData(); return; } }
+ item->setDifficulty(in.readLine().toInt());
+ // Question text
+ if (in.readLine() != "[Q_TEXT]") { errorInvalidData(); return; }
+ item->setText(in.readLine());
+ // Answer A
+ if (in.readLine() != "[Q_ANSA]") { errorInvalidData(); return; }
+ answers << in.readLine();
+ //if (in.readLine() != "[Q_ANSA_C]") { errorInvalidData(); return; }
+ //answers << in.readLine();
+ answers << "false";
+ // Answer B
+ if (in.readLine() != "[Q_ANSB]") { errorInvalidData(); return; }
+ answers << in.readLine();
+ //if (in.readLine() != "[Q_ANSB_C]") { errorInvalidData(); return; }
+ //answers << in.readLine();
+ answers << "false";
+ // Answer C
+ if (in.readLine() != "[Q_ANSC]") { errorInvalidData(); return; }
+ answers << in.readLine();
+ //if (in.readLine() != "[Q_ANSC_C]") { errorInvalidData(); return; }
+ //answers << in.readLine();
+ answers << "false";
+ // Answer D
+ if (in.readLine() != "[Q_ANSD]") { errorInvalidData(); return; }
+ answers << in.readLine();
+ //if (in.readLine() != "[Q_ANSD_C]") { errorInvalidData(); return; }
+ //answers << in.readLine();
+ answers << "false";
+ // End
+ if (in.readLine() != "[Q_END]") { errorInvalidData(); return; }
+ // Add map entry
+ item->setAnswers(answers);
+ current_db_questions << item;
+
+ progress.setValue(i); // PROGRESS >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+ qApp->processEvents();
+ }
+ // Set flags
+ for (int i = 0; i < 20; ++i) {current_db_fe[i] = db_fxxe[i];}
+ for (int i = 0; i < 20; ++i) {current_db_f[i] = db_f[i];}
+ // Save values
+ current_db_name = db_name;
+ current_db_date = db_date;
+ current_test_date = test_date;
+ current_db_comments = db_comments;
+ current_test_qnum = test_qnum;
+ current_test_time_remaining = 0;
+ current_test_time_remaining += (QTime::fromString(test_time, "hh:mm").hour() * 60);
+ current_test_time_remaining += QTime::fromString(test_time, "hh:mm").minute();
+ current_test_use_groups = (db_use_groups == "true");
+ // Display info
+ ITW_test_name->setText(current_db_name);
+ ITW_test_date->setText(current_db_date);
+ ITW_test_timestamp->setText(current_test_date);
+ ITW_test_time->setText(test_time);
+ ITW_test_qnum->setText(QString("%1 of total %2").arg(current_test_qnum).arg(db_qnum));
+ QString pm_str = tr("Total");
+ pm_str.append(QString(": %1;").arg(current_test_passmark.passMark()));
+ for (int i = 0; i < current_test_passmark.count(); ++i) {
+ if (current_test_passmark.condition(i) < 0 && current_test_passmark.condition(i) >= 20) { continue; }
+ pm_str.append(QString(" %1: %2;").arg(current_db_f[current_test_passmark.condition(i)]).arg(current_test_passmark.value(i)));
+ }
+ ITW_test_passmark->setText(pm_str);
+ ITW_test_comments->setHtml(current_db_comments);
+ infoTableWidget->setColumnWidth(0, infoTableWidget->geometry().width() - infoTableWidget->verticalHeader()->width() - 25);
+ infoTableWidget->setRowHeight(8, 200);
+ infoTableWidget->setEnabled(true);
+
+ progress.setValue(db_qnum);
+ qApp->processEvents();
+
+ tbtnGetReady->setEnabled(true);
+ // ------------------------------------------------------------------------
+ randomlySelectQuestions();
+}
+
+void MainWindow::loadFile()
+{
+ QString file_name = DBPathLineEdit->text();
+ if (file_name.isEmpty()) { return; }
+ loadFile(file_name);
+}
+
+void MainWindow::loadFile(QString file_name)
+{
+ QProgressDialog progress(this);
+ progress.setLabelText(tr("Reading database file..."));
+ progress.setMinimum(0);
+ progress.setMaximum(2);
+ progress.setMinimumDuration(0);
+ progress.setWindowModality(Qt::WindowModal);
+
+ if (file_name.isEmpty()) { return; }
+
+ progress.setValue(0); // PROGRESS >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+ qApp->processEvents();
+
+ QFile file(file_name);
+ if (!file.open(QFile::ReadOnly | QFile::Text))
+ {
+ QMessageBox::critical(this, tr("Open database"), tr("Cannot read file %1:\n%2.").arg(file_name).arg(file.errorString()));
+ return;
+ }
+ QTextStream rfile(&file);
+ rfile.setCodec("UTF-8");
+
+ progress.setValue(1); // PROGRESS >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+ qApp->processEvents();
+
+ client_number = QTime::currentTime().second();
+ loadTest(rfile.readAll());
+
+ progress.setValue(2); // PROGRESS >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+ qApp->processEvents();
+
+ disableInputTypeSelection();
+ // -------------------------------------------------------------------------
+}
+
+void MainWindow::randomlySelectQuestions()
+{
+ QProgressDialog progress(this);
+ progress.setLabelText(tr("Generating test..."));
+ progress.setMinimum(0);
+ progress.setMinimumDuration(0);
+ progress.setWindowModality(Qt::WindowModal);
+
+ QStringList flags; QList<QString> groups;
+ if (current_test_passmark.count() <= 0) {
+ progress.setMaximum(current_test_qnum);
+ int rand; QList<int> randlist;
+ for (int i = 0; i < current_test_qnum; ++i) {
+ random_0:
+ do {
+ rand = (qrand() + client_number) % current_db_questions.size();
+ } while (randlist.contains(rand));
+ if (current_test_use_groups) {
+ if (!current_db_questions.at(rand)->group().isEmpty()) {
+ if (groups.contains(current_db_questions.at(rand)->group())) { goto random_0; }
+ else { groups << current_db_questions.at(rand)->group(); }
+ }
+ }
+ randlist << rand;
+ QListWidgetItem * q_item = new QListWidgetItem;
+ if (hideQuestionNamesCheckBox->isChecked()) {
+ q_item->setText(QString("%1").arg(LQListWidget->count() + 1));
+ } else {
+ q_item->setText(current_db_questions.at(rand)->name());
+ }
+ q_item->setData(Qt::UserRole, current_db_questions.at(rand)->name());
+ LQListWidget->addItem(q_item);
+ current_test_questions.insert(q_item, current_db_questions.at(rand));
+ if ((current_db_questions.at(rand)->flag() >= 0) && (current_db_questions.at(rand)->flag() < 20)) {
+ if (!flags.contains(current_db_f[current_db_questions.at(rand)->flag()]))
+ { flags << current_db_f[current_db_questions.at(rand)->flag()]; } }
+ progress.setValue(i + 1); // PROGRESS >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+ qApp->processEvents();
+ }
+ ITW_test_fnum->setText(QString("%1").arg(flags.count()));
+ ITW_test_flags->setText(flags.join(", "));
+ } else {
+ progress.setMaximum(current_db_questions.size() + current_test_passmark.count());
+ QList<QuestionItem *> qflist[current_test_passmark.count()];
+ QList<QuestionItem *> unusedqlist; int x;
+ for (int i = 0; i < current_db_questions.size(); ++i) {
+ if (current_test_passmark.conditionIndex(current_db_questions.at(i)->flag()) != -1) {
+ qflist[current_test_passmark.conditionIndex(current_db_questions.at(i)->flag())] << current_db_questions.at(i);
+ } else {
+ unusedqlist << current_db_questions.at(i);
+ }
+ progress.setValue(i + 1); // PROGRESS >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+ qApp->processEvents();
+ }
+ for (int c = 0; c < current_test_passmark.count(); ++c) {
+ int rand; QList<int> randlist;
+ x = current_test_passmark.conditionIndex(current_test_passmark.condition(c));
+ for (int i = 0; i < current_test_passmark.value(c); ++i) {
+ random_1:
+ do {
+ rand = (qrand() + client_number) % qflist[x].size();
+ } while (randlist.contains(rand));
+ if (current_test_use_groups) {
+ if (!qflist[x].at(rand)->group().isEmpty()) {
+ if (groups.contains(qflist[x].at(rand)->group())) { goto random_1; }
+ else { groups << qflist[x].at(rand)->group(); }
+ }
+ }
+ randlist << rand;
+ QListWidgetItem * q_item = new QListWidgetItem;
+ if (hideQuestionNamesCheckBox->isChecked()) {
+ q_item->setText(QString("%1").arg(LQListWidget->count() + 1));
+ } else {
+ q_item->setText(qflist[x].at(rand)->name());
+ }
+ q_item->setData(Qt::UserRole, qflist[x].at(rand)->name());
+ LQListWidget->addItem(q_item);
+ current_test_questions.insert(q_item, qflist[x].at(rand));
+ if ((qflist[x].at(rand)->flag() >= 0) && (qflist[x].at(rand)->flag() < 20)) {
+ if (!flags.contains(current_db_f[qflist[x].at(rand)->flag()]))
+ { flags << current_db_f[qflist[x].at(rand)->flag()]; } }
+ qApp->processEvents();
+ }
+ for (int i = 0; i < qflist[x].size(); ++i) {
+ if (!randlist.contains(i)) { unusedqlist << qflist[x].at(i); }
+ }
+ progress.setValue(c + current_db_questions.size() + 1); // PROGRESS >>>>
+ qApp->processEvents();
+ }
+ int rand; QList<int> randlist;
+ int y = current_test_qnum - current_test_questions.size();
+ int z = current_db_questions.size() + current_test_passmark.count();
+ for (int i = 0; i < y; ++i) {
+ random_2:
+ do {
+ rand = (qrand() + client_number) % unusedqlist.size();
+ } while (randlist.contains(rand));
+ if (current_test_use_groups) {
+ if (!unusedqlist.at(rand)->group().isEmpty()) {
+ if (groups.contains(unusedqlist.at(rand)->group())) { goto random_2; }
+ else { groups << unusedqlist.at(rand)->group(); }
+ }
+ }
+ randlist << rand;
+ QListWidgetItem * q_item = new QListWidgetItem;
+ if (hideQuestionNamesCheckBox->isChecked()) {
+ q_item->setText(QString("%1").arg(LQListWidget->count() + 1));
+ } else {
+ q_item->setText(unusedqlist.at(rand)->name());
+ }
+ q_item->setData(Qt::UserRole, unusedqlist.at(rand)->name());
+ LQListWidget->addItem(q_item);
+ current_test_questions.insert(q_item, unusedqlist.at(rand));
+ if ((unusedqlist.at(rand)->flag() >= 0) && (unusedqlist.at(rand)->flag() < 20)) {
+ if (!flags.contains(current_db_f[unusedqlist.at(rand)->flag()]))
+ { flags << current_db_f[unusedqlist.at(rand)->flag()]; } }
+ progress.setValue(i + z + 1); // PROGRESS >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+ qApp->processEvents();
+ }
+ }
+
+ ITW_test_fnum->setText(QString("%1").arg(flags.count()));
+ ITW_test_flags->setText(flags.join(", "));
+
+ if (qApp->arguments().count() > 2) {
+ if (qApp->arguments().at(1) == "-port") {
+ getReady();
+ }
+ }
+}
View
10 iTestClient/env_vars.cpp
@@ -0,0 +1,10 @@
+#include "main_window.h"
+
+void MainWindow::varinit()
+{
+ // GLOBAL
+ // iTestClient version
+ ver = "1.2.0"; f_ver = 1.2;
+ // Supported iTest DB file version
+ itos_ver = "1.2"; f_itos_ver = 1.2;
+}
View
1 database_editor/i18n.qrc → iTestClient/i18n.qrc
@@ -3,5 +3,6 @@
<file>i18n/Slovak.qm</file>
<file>i18n/Russian.qm</file>
<file>i18n/Turkish.qm</file>
+ <file>i18n/Portuguese.qm</file>
</qresource>
</RCC>
View
517 iTestClient/i18n/Portuguese.ts
@@ -0,0 +1,517 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS><TS version="1.1" language="tr">
+<context>
+ <name>AboutWidget</name>
+ <message>
+ <location filename="../about_widget.cpp" line="10"/>
+ <source>Version</source>
+ <translation>Versão</translation>
+ </message>
+ <message>
+ <location filename="../about_widget.cpp" line="13"/>
+ <source>iTest is a Qt application consisting of a Database Editor and a Test Writer designed for easy computerised examination.</source>
+ <translation type="obsolete">O iTest é uma programa Qt constituido por um Editor de Bases de Dados e por um Escritor de Testes, desenvolvido para facilitar os ezames computorizados.</translation>
+ </message>
+ <message>
+ <location filename="../about_widget.cpp" line="16"/>
+ <source>This programme is distributed under the terms of the GPL v2.</source>
+ <translation>Este programa é distribuido sob os termos da licença GPL v2.</translation>
+ </message>
+ <message>
+ <location filename="../about_widget.cpp" line="20"/>
+ <source>The programme is provided AS IS with ABSOLUTELY NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.</source>
+ <translation>Tradução: &lt;span style=&quot;font-style:italic;&quot;&gt;Eugéne Suter&lt;/span&gt;&lt;br&gt;&lt;br&gt;Este programa é fornecido TAL COMO ESTA sem QUALQUER TIPO DE GARANTIA, INCLUINDO GARANTIAS DE DESIGN, VENDABILIDADE E APTIDÃO PARA UM CERTO PROPÓSITO.</translation>
+ </message>
+ <message>
+ <location filename="../ui_about_widget_v2.cpp" line="127"/>
+ <source>About Qt</source>
+ <translation>Sobre o Qt</translation>
+ </message>
+ <message>
+ <location filename="../about_widget.cpp" line="26"/>
+ <source>This programme uses Qt Open Source Edition version %1.</source>
+ <translation>Este programa usa a edição Livre do Qt (Open Source Edition), versão %1.</translation>
+ </message>
+ <message>
+ <location filename="../about_widget.cpp" line="28"/>
+ <source>Qt is a C++ toolkit for cross-platform application development.</source>
+ <translation>O Qt é um uma biblioteca gráfica para o desenvolvimento de aplicações multi-plataforma.</translation>
+ </message>
+ <message>
+ <location filename="../about_widget.cpp" line="30"/>
+ <source>Qt provides single-source portability across MS Windows, Mac OS X, Linux and all major commercial Unix variants. Qt is also available for embedded devices as Qtopia Core.</source>
+ <translation>O Qt proporciona portabilidade de apenas um código-fonte entre MS Windows, Mac OS X, Linux e todas a grandes variantes comerciais Unix. O Qt também está disponível para sistemas integrados sob a forma de Qtopia Core.</translation>
+ </message>
+ <message>
+ <location filename="../about_widget.cpp" line="32"/>
+ <source>Qt is a Trolltech product. See &lt;span style=&quot;font-style:italic;&quot;&gt;http://www.trolltech.com/qt/&lt;/span&gt; for more information.</source>
+ <translation>O Qt é um produto da Trolltech. Visite &lt;span style=&quot;font-style:italic;&quot;&gt;http://www.trolltech.com/qt/&lt;/span&gt; para mais informações.</translation>
+ </message>
+ <message>
+ <location filename="../ui_about_widget_v2.cpp" line="126"/>
+ <source>About iTest</source>
+ <translation>Sobre o iTest</translation>
+ </message>
+ <message>
+ <location filename="../ui_about_widget_v2.cpp" line="128"/>
+ <source>Close</source>
+ <translation>Fechar</translation>
+ </message>
+ <message>
+ <location filename="../about_widget.cpp" line="13"/>
+ <source>iTest is a Qt application consisting of a Server and a Client designed for easy computerised examination.</source>
+ <translation>O iTest é uma programa Qt constituido por um Servidor e por um Cliente, desenvolvido para facilitar os exames computorizados.</translation>
+ </message>
+</context>
+<context>
+ <name>MainWindow</name>
+ <message>
+ <location filename="../client.cpp" line="16"/>
+ <source>Retrieving test data...</source>
+ <translation>Obtendo os dados do teste...</translation>
+ </message>
+ <message>
+ <location filename="../client.cpp" line="109"/>
+ <source>Save answer log</source>
+ <translation>Gravar registo de respostas</translation>
+ </message>
+ <message>
+ <location filename="../client.cpp" line="109"/>
+ <source>Cannot write file %1:
+%2.</source>
+ <translation>Não foi possível gravar o ficheiro %1:
+%2.</translation>
+ </message>
+ <message>
+ <location filename="../client.cpp" line="223"/>
+ <source>yes</source>
+ <translation>sim</translation>
+ </message>
+ <message>
+ <location filename="../client.cpp" line="223"/>
+ <source>no</source>
+ <translation>não</translation>
+ </message>
+ <message>
+ <location filename="../client.cpp" line="249"/>
+ <source>None</source>
+ <translation>Nenhum</translation>
+ </message>
+ <message>
+ <location filename="../ui_main_window.cpp" line="725"/>
+ <source>iTest - Test Writer</source>
+ <translation type="obsolete">iTest - Escritor de Testes</translation>
+ </message>
+ <message>
+ <location filename="../client.cpp" line="265"/>
+ <source>The host was not found. Please check the host name and port settings.</source>
+ <translation>O anfitrião não foi encontrado. Port favor verifique a nome do anfitrião e as definições das portas.</translation>
+ </message>
+ <message>
+ <location filename="../client.cpp" line="272"/>
+ <source>The connection was refused by the peer. Make sure the iTest server is running, and check that the host name and port settings are correct.</source>
+ <translation>A ligação foi recusada pelo par. Certifique-se de que o servidor do iTest está a funcionar, e verifique se o nome do anfitrião e se as definições das portas estão correctas.</translation>
+ </message>
+ <message>
+ <location filename="../client.cpp" line="277"/>
+ <source>The following error occurred: %1.</source>
+ <translation>Ocorreu o seguinte erro: %1.</translation>
+ </message>
+ <message>
+ <location filename="../database.cpp" line="5"/>
+ <source>Open database file</source>
+ <translation>Abrir ficheiro de base de dados</translation>
+ </message>
+ <message>
+ <location filename="../database.cpp" line="5"/>
+ <source>iTest off-line test sessions (*.itos);;All files (*.*)</source>
+ <translation>Sessões de teste off-line iTest (*.itos);;Todos os ficheiros (*.*)</translation>
+ </message>
+ <message>
+ <location filename="../database.cpp" line="10"/>
+ <source>Output file path</source>
+ <translation>Localização do ficheiro de destino</translation>
+ </message>
+ <message>
+ <location filename="../database.cpp" line="10"/>
+ <source>answers.itcl</source>
+ <translation>respostas.itcl</translation>
+ </message>
+ <message>
+ <location filename="../database.cpp" line="10"/>
+ <source>iTest off-line client log (*.itcl)</source>
+ <translation>Registo off-line de clientes iTest (*.itcl)</translation>
+ </message>
+ <message>
+ <location filename="../database.cpp" line="16"/>
+ <source>Loading test data...</source>
+ <translation>Carregando os dados do teste...</translation>
+ </message>
+ <message>
+ <location filename="../database.cpp" line="38"/>
+ <source>iTest version notice</source>
+ <translation>Nota sobre a versão iTest</translation>
+ </message>
+ <message>
+ <location filename="../database.cpp" line="36"/>
+ <source>There is a newer version of iTest available.
+Nonetheless, this version is able to open the database file you selected,
+but you are most probably missing a whole bunch of cool new features.</source>
+ <translation>Existe uma versão mais actual do iTest disponível.
+Embora esta versão consiga abrir a base de dados que seleccionou,
+é bem provável que não possa usufruir das novas funcionalidades disponíveis.</translation>
+ </message>
+ <message>
+ <location filename="../database.cpp" line="38"/>
+ <source>You need a newer version of iTest to open this database file.</source>
+ <translation>É necessária uma versão mais recente do iTest para abrir este ficheiro de base de dados.</translation>
+ </message>
+ <message>
+ <location filename="../database.cpp" line="198"/>
+ <source>Reading database file...</source>
+ <translation>Lendo ficheiro de base de dados...</translation>
+ </message>
+ <message>
+ <location filename="../database.cpp" line="212"/>
+ <source>Open database</source>
+ <translation>Abrir base de dados</translation>
+ </message>
+ <message>
+ <location filename="../database.cpp" line="212"/>
+ <source>Cannot read file %1:
+%2.</source>
+ <translation>Não foi possível ler o ficheiro %1:
+%2.</translation>
+ </message>
+ <message>
+ <location filename="../database.cpp" line="234"/>
+ <source>Generating test...</source>
+ <translation>A gerar o teste...</translation>
+ </message>
+ <message>
+ <location filename="../main.cpp" line="231"/>
+ <source>Finish the exam</source>
+ <translation>Terminar o teste</translation>
+ </message>
+ <message>
+ <location filename="../main.cpp" line="231"/>
+ <source>Are you sure you want to finish? Once you click Finish there is no going back.</source>
+ <translation>Deseja mesmo terminar o teste? Assim que clicar em Terminar, não é possível voltar atrás.</translation>
+ </message>
+ <message>
+ <location filename="../main.cpp" line="231"/>
+ <source>&amp;Finish</source>
+ <translation>&amp;Terminar</translation>
+ </message>
+ <message>
+ <location filename="../main.cpp" line="231"/>
+ <source>&amp;Cancel</source>
+ <translation>&amp;Cancelar</translation>
+ </message>
+ <message>
+ <location filename="../main.cpp" line="326"/>
+ <source>Your name, please.</source>
+ <translation>O seu nome, por favor.</translation>
+ </message>
+ <message>
+ <location filename="../main.cpp" line="326"/>
+ <source>You cannot proceed unless you give us your name.</source>
+ <translation>Não pode proceder sem fornecer o seu nome.</translation>
+ </message>
+ <message>
+ <location filename="../main.cpp" line="395"/>
+ <source>Exam finished</source>
+ <translation>Teste terminado</translation>
+ </message>
+ <message>
+ <location filename="../main.cpp" line="395"/>
+ <source>You have run out of time. Your answers are being sent.</source>
+ <translation>A seu tempo acabou. As suas respostas estão a ser enviadas.</translation>
+ </message>
+ <message>
+ <location filename="../main.cpp" line="423"/>
+ <source>iTest - Load test data</source>
+ <translation type="obsolete">iTest - Carregar os dados do teste</translation>
+ </message>
+ <message>
+ <location filename="../main.cpp" line="423"/>
+ <source>Invalid data received. There might be something wrong with the server.</source>
+ <translation>Os dados recebidos são inválidos. Poderá existir um problema com o servidor.</translation>
+ </message>
+ <message>
+ <location filename="../ui_main_window.cpp" line="726"/>
+ <source>Connect to an iTest server</source>
+ <translation>Ligar a um servidor iTest</translation>
+ </message>
+ <message>
+ <location filename="../ui_main_window.cpp" line="727"/>
+ <source>&lt;b&gt;Server name&lt;/b&gt;</source>
+ <translation>&lt;b&gt;Nome do servidor&lt;/b&gt;</translation>
+ </message>
+ <message>
+ <location filename="../ui_main_window.cpp" line="728"/>
+ <source>&lt;b&gt;Server port&lt;/b&gt;</source>
+ <translation>&lt;b&gt;Porta do servidor&lt;/b&gt;</translation>
+ </message>
+ <message>
+ <location filename="../ui_main_window.cpp" line="729"/>
+ <source>Connect</source>
+ <translation>Ligar</translation>
+ </message>
+ <message>
+ <location filename="../ui_main_window.cpp" line="730"/>
+ <source>Use an iTest database file</source>
+ <translation>Usar um ficheiro de base de dados iTest</translation>
+ </message>
+ <message>
+ <location filename="../ui_main_window.cpp" line="731"/>
+ <source>&lt;b&gt;Database file path&lt;/b&gt;</source>
+ <translation>&lt;b&gt;Localização do ficheiro de base de dados&lt;/b&gt;</translation>
+ </message>
+ <message>
+ <location filename="../ui_main_window.cpp" line="738"/>
+ <source>Browse</source>
+ <translation>Navegar</translation>
+ </message>
+ <message>
+ <location filename="../ui_main_window.cpp" line="733"/>
+ <source>Load</source>
+ <translation>Carregar</translation>
+ </message>
+ <message>
+ <location filename="../ui_main_window.cpp" line="734"/>
+ <source>&lt;b&gt;Save answers to&lt;/b&gt;</source>
+ <translation>&lt;b&gt;Gravar as respostas para&lt;/b&gt;</translation>
+ </message>
+ <message>
+ <location filename="../ui_main_window.cpp" line="735"/>
+ <source>If connected to an iTest server, results will be sent automatically. You only need this file if there is no network available or in case of connection breakdown.</source>
+ <translation>Se estiver ligado a um servidor iTest, os resultados serão enviados automaticamente. Este ficheiro só é necessário se não houver uma rede disponível ou se houver uma quebra na ligação.</translation>
+ </message>
+ <message>
+ <location filename="../ui_main_window.cpp" line="736"/>
+ <source>$HOME/TestName-Date-SurnameName.itcl, where $HOME is the directory of the current user&apos;s profile on Windows and the home directory on Unix/Linux/Mac OS</source>
+ <translation>$HOME/NomeTeste-Data-ApelidoNome.itcl, em que $HOME é a pasta do perfil do utilizador no Windows e a pasta de início no Unix/Linux/Mac OS</translation>
+ </message>
+ <message>
+ <location filename="../ui_main_window.cpp" line="737"/>
+ <source>Use default</source>
+ <translation>Usar defeito</translation>
+ </message>
+ <message>
+ <location filename="../ui_main_window.cpp" line="739"/>
+ <source>&lt;b&gt;Other settings&lt;/b&gt;</source>
+ <translation>&lt;b&gt;Outras definições&lt;/b&gt;</translation>
+ </message>
+ <message>
+ <location filename="../ui_main_window.cpp" line="740"/>
+ <source>Hide question names, show numbers instead</source>
+ <translation>Esconder os nomes das perguntas, mostrar apenas os números</translation>
+ </message>
+ <message>
+ <location filename="../ui_main_window.cpp" line="741"/>
+ <source>&lt;b&gt;Test information&lt;/b&gt;</source>
+ <translation>&lt;b&gt;Informações sobre o teste&lt;/b&gt;</translation>
+ </message>
+ <message>
+ <location filename="../ui_main_window.cpp" line="752"/>
+ <source>Test name</source>
+ <translation>Nome do teste</translation>
+ </message>
+ <message>
+ <location filename="../ui_main_window.cpp" line="756"/>
+ <source>Database date</source>
+ <translation>Data da base de dados</translation>
+ </message>
+ <message>
+ <location filename="../ui_main_window.cpp" line="760"/>
+ <source>Test date</source>
+ <translation>Data do teste</translation>
+ </message>
+ <message>
+ <location filename="../ui_main_window.cpp" line="764"/>
+ <source>Test time</source>
+ <translation>Tempo para o teste</translation>
+ </message>
+ <message>
+ <location filename="../ui_main_window.cpp" line="768"/>
+ <source>Number of questions</source>
+ <translation>Número de questões</translation>
+ </message>
+ <message>
+ <location filename="../ui_main_window.cpp" line="772"/>
+ <source>Number of flags</source>
+ <translation>Número de categorias</translation>
+ </message>
+ <message>
+ <location filename="../ui_main_window.cpp" line="776"/>
+ <source>Flag names</source>
+ <translation>Nomes das categorias</translation>
+ </message>
+ <message>
+ <location filename="../ui_main_window.cpp" line="784"/>
+ <source>Comments</source>
+ <translation>Comentários</translation>
+ </message>
+ <message>
+ <location filename="../ui_main_window.cpp" line="746"/>
+ <source>Data</source>
+ <translation>Dados</translation>
+ </message>
+ <message>
+ <location filename="../ui_main_window.cpp" line="803"/>
+ <source>Quit</source>
+ <translation>Saír</translation>
+ </message>
+ <message>
+ <location filename="../ui_main_window.cpp" line="787"/>
+ <source>About</source>
+ <translation>Sobre</translation>
+ </message>
+ <message>
+ <location filename="../ui_main_window.cpp" line="788"/>
+ <source>Ready</source>
+ <translation>Pronto</translation>
+ </message>
+ <message>
+ <location filename="../ui_main_window.cpp" line="789"/>
+ <source>&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;/head&gt;&lt;body style=&quot; white-space: pre-wrap; font-family:MS Shell Dlg 2; font-size:8.25pt; font-weight:400; font-style:normal; text-decoration:none;&quot;&gt;&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:20pt;&quot;&gt;Welcome!&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation>&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;/head&gt;&lt;body style=&quot; white-space: pre-wrap; font-family:MS Shell Dlg 2; font-size:8.25pt; font-weight:400; font-style:normal; text-decoration:none;&quot;&gt;&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:20pt;&quot;&gt;Bem vindo!&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
+ </message>
+ <message>
+ <location filename="../ui_main_window.cpp" line="790"/>
+ <source>Your name:</source>
+ <translation>O seu nome:</translation>
+ </message>
+ <message>
+ <location filename="../ui_main_window.cpp" line="791"/>
+ <source>When you are ready to begin the examination, click the Start button below.</source>
+ <translation>Quando estiver pronto para começar o teste, clique no botão Iniciar abaixo.</translation>
+ </message>
+ <message>
+ <location filename="../ui_main_window.cpp" line="792"/>
+ <source>Start</source>
+ <translation>Iniciar</translation>
+ </message>
+ <message>
+ <location filename="../ui_main_window.cpp" line="793"/>
+ <source>a)</source>
+ <translation>a)</translation>
+ </message>
+ <message>
+ <location filename="../ui_main_window.cpp" line="794"/>
+ <source>b)</source>
+ <translation>b)</translation>
+ </message>
+ <message>
+ <location filename="../ui_main_window.cpp" line="795"/>
+ <source>c)</source>
+ <translation>c)</translation>
+ </message>
+ <message>
+ <location filename="../ui_main_window.cpp" line="796"/>
+ <source>d)</source>
+ <translation>d)</translation>
+ </message>
+ <message>
+ <location filename="../ui_main_window.cpp" line="797"/>
+ <source>Show remaining time</source>
+ <translation>Mostrar o tempo restante</translation>
+ </message>
+ <message>
+ <location filename="../ui_main_window.cpp" line="798"/>
+ <source>minute(s)</source>
+ <translation>minuto(s)</translation>
+ </message>
+ <message>
+ <location filename="../ui_main_window.cpp" line="799"/>
+ <source>Last question</source>
+ <translation>Última questão</translation>
+ </message>
+ <message>
+ <location filename="../ui_main_window.cpp" line="800"/>
+ <source>Next question</source>
+ <translation>Próxima questão</translation>
+ </message>
+ <message>
+ <location filename="../ui_main_window.cpp" line="801"/>
+ <source>Finish</source>
+ <translation>Terminar</translation>
+ </message>
+ <message>
+ <location filename="../ui_main_window.cpp" line="808"/>
+ <source>Question</source>
+ <translation>Questão</translation>
+ </message>
+ <message>
+ <location filename="../ui_main_window.cpp" line="812"/>
+ <source>Answered correctly</source>
+ <translation>Respondido correctamente</translation>
+ </message>
+ <message>
+ <location filename="../ui_main_window.cpp" line="816"/>
+ <source>Answer</source>
+ <translation>Resposta</translation>
+ </message>
+ <message>
+ <location filename="../ui_main_window.cpp" line="820"/>
+ <source>Correct answer</source>
+ <translation>Resposta correcta</translation>
+ </message>
+ <message>
+ <location filename="../ui_main_window.cpp" line="822"/>
+ <source>&lt;b&gt;Results:&lt;/b&gt;</source>
+ <translation>&lt;b&gt;Resultados:&lt;/b&gt;</translation>
+ </message>
+ <message>
+ <location filename="../ui_main_window.cpp" line="823"/>
+ <source>&lt;b&gt;Score:&lt;/b&gt;</source>
+ <translation>&lt;b&gt;Cotação:&lt;/b&gt;</translation>
+ </message>
+ <message>
+ <location filename="../ui_main_window.cpp" line="824"/>
+ <source>&lt;b&gt;Name:&lt;/b&gt;</source>
+ <translation>&lt;b&gt;Nome:&lt;/b&gt;</translation>
+ </message>
+ <message>
+ <location filename="../client.cpp" line="211"/>
+ <source>%1 out of %2 (%3)</source>
+ <translation>%1 em %2 (%3)</translation>
+ </message>
+ <message>
+ <location filename="../client.cpp" line="211"/>
+ <source>PASSED</source>
+ <translation>APROVADO</translation>
+ </message>
+ <message>
+ <location filename="../client.cpp" line="211"/>
+ <source>FAILED</source>
+ <translation>REPROVADO</translation>
+ </message>
+ <message>
+ <location filename="../database.cpp" line="168"/>
+ <source>Total</source>
+ <translation>Total</translation>
+ </message>
+ <message>
+ <location filename="../ui_main_window.cpp" line="780"/>
+ <source>Pass mark</source>
+ <translation>Nota de aprovação</translation>
+ </message>
+ <message>
+ <location filename="../ui_main_window.cpp" line="802"/>
+ <source>New test</source>
+ <translation>Novo teste</translation>
+ </message>
+ <message>
+ <location filename="../ui_main_window.cpp" line="725"/>
+ <source>iTestClient</source>
+ <translation>iTestClient</translation>
+ </message>
+ <message>
+ <location filename="../main.cpp" line="423"/>
+ <source>iTestClient - Load test data</source>
+ <translation>iTestClient - Carregar os dados do teste</translation>
+ </message>
+</context>
+</TS>
View
999 test_writer/i18n/Russian.ts → iTestClient/i18n/Russian.ts
@@ -1,477 +1,522 @@
-<?xml version="1.0" encoding="utf-8"?>