Skip to content

Commit 037a75b

Browse files
committed
work on testing client
1 parent 71d4b66 commit 037a75b

File tree

3 files changed

+295
-8
lines changed

3 files changed

+295
-8
lines changed

client/mainwindow.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,7 @@ void MainWindow::fill_patterns_list_form()
556556
this->pattern_btn_test_list.push_back(new QPushButton(this));
557557
this->pattern_btn_test_list[i]->setText("Тест");
558558
this->pattern_laoyut_list[i]->addWidget(this->pattern_btn_test_list[i]);
559+
connect(this->pattern_btn_test_list[i], &QPushButton::clicked, [this, lambda] { this->on_to_test_btn_clicked(lambda); });
559560

560561
this->ui->pattern_list_2->addLayout(this->pattern_laoyut_list[i]);
561562
if (int(i) != int(data.size()) - 1)
@@ -623,7 +624,7 @@ pattern_info_t MainWindow::get_pattern_info(QString name)
623624
return {query.value(0).toString(), query.value(1).toString(), query.value(2).toString(), query.value(3).toString()};
624625
}
625626

626-
void MainWindow::on_more_btn_clicked(QString name)
627+
void MainWindow::on_more_btn_clicked(const QString& name)
627628
{
628629
this->ui->screen_stacked->setCurrentIndex((int)screen::more_pattern);
629630
this->ui->name_more->setText("Название: " + name);
@@ -651,6 +652,11 @@ void MainWindow::on_more_btn_clicked(QString name)
651652
this->ui->img_more->setPixmap(this->pattern_pic);
652653
}
653654

655+
void MainWindow::on_to_test_btn_clicked(const QString &name)
656+
{
657+
this->ui->screen_stacked->setCurrentIndex((int)screen::test_pattern);
658+
}
659+
654660
void MainWindow::on_to_register_clicked()
655661
{
656662
this->ui->screen_stacked->setCurrentIndex((int)screen::registration);

client/mainwindow.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,10 @@ class MainWindow : public QMainWindow
5757
MainWindow(QWidget *parent = nullptr);
5858
~MainWindow();
5959

60-
void on_more_btn_clicked(QString name);
60+
/*открытие подробного описания паттерна*/
61+
void on_more_btn_clicked(const QString& name);
62+
/*открытие теста по паттерну*/
63+
void on_to_test_btn_clicked(const QString& name);
6164

6265
private slots:
6366
void on_login_2_clicked();
@@ -100,7 +103,8 @@ private slots:
100103
personal_area = 2,
101104
patterns = 3,
102105
result_test = 4,
103-
more_pattern = 5
106+
more_pattern = 5,
107+
test_pattern = 6
104108
};
105109
enum class type_forward
106110
{

client/mainwindow.ui

Lines changed: 282 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<item>
2929
<widget class="QStackedWidget" name="screen_stacked">
3030
<property name="currentIndex">
31-
<number>3</number>
31+
<number>5</number>
3232
</property>
3333
<widget class="QWidget" name="login">
3434
<layout class="QHBoxLayout" name="horizontalLayout_2">
@@ -460,7 +460,7 @@
460460
<x>0</x>
461461
<y>0</y>
462462
<width>254</width>
463-
<height>460</height>
463+
<height>458</height>
464464
</rect>
465465
</property>
466466
<layout class="QVBoxLayout" name="verticalLayout_4">
@@ -574,7 +574,7 @@
574574
<rect>
575575
<x>0</x>
576576
<y>0</y>
577-
<width>237</width>
577+
<width>240</width>
578578
<height>395</height>
579579
</rect>
580580
</property>
@@ -702,8 +702,8 @@
702702
<rect>
703703
<x>0</x>
704704
<y>0</y>
705-
<width>655</width>
706-
<height>594</height>
705+
<width>658</width>
706+
<height>599</height>
707707
</rect>
708708
</property>
709709
<property name="minimumSize">
@@ -822,6 +822,283 @@
822822
</item>
823823
</layout>
824824
</widget>
825+
<widget class="QWidget" name="test_tmp">
826+
<layout class="QVBoxLayout" name="verticalLayout_6">
827+
<item>
828+
<widget class="QTabWidget" name="tabWidget">
829+
<property name="currentIndex">
830+
<number>1</number>
831+
</property>
832+
<widget class="QWidget" name="info">
833+
<attribute name="title">
834+
<string>Введение</string>
835+
</attribute>
836+
<layout class="QVBoxLayout" name="verticalLayout_7">
837+
<item>
838+
<spacer name="verticalSpacer_14">
839+
<property name="orientation">
840+
<enum>Qt::Vertical</enum>
841+
</property>
842+
<property name="sizeHint" stdset="0">
843+
<size>
844+
<width>20</width>
845+
<height>40</height>
846+
</size>
847+
</property>
848+
</spacer>
849+
</item>
850+
<item>
851+
<widget class="QLabel" name="label_10">
852+
<property name="text">
853+
<string>Вам предложено пройти тест, состоящий из 10 вопросов. Время на прохождение: 10 минут. По окончании тестирования можно просмотреть свой результат в 3-ей вкладке. Вопросы в тесте могут быть четырех видов: выбор одного ответа из четырех, выбор нескольких ответов из четырех, вписать ответ на вопрос, установить соответствие.</string>
854+
</property>
855+
<property name="alignment">
856+
<set>Qt::AlignCenter</set>
857+
</property>
858+
<property name="wordWrap">
859+
<bool>true</bool>
860+
</property>
861+
</widget>
862+
</item>
863+
<item>
864+
<widget class="QPushButton" name="to_test">
865+
<property name="text">
866+
<string>Перейти к тестированию</string>
867+
</property>
868+
</widget>
869+
</item>
870+
<item>
871+
<spacer name="verticalSpacer_13">
872+
<property name="orientation">
873+
<enum>Qt::Vertical</enum>
874+
</property>
875+
<property name="sizeHint" stdset="0">
876+
<size>
877+
<width>20</width>
878+
<height>40</height>
879+
</size>
880+
</property>
881+
</spacer>
882+
</item>
883+
</layout>
884+
</widget>
885+
<widget class="QWidget" name="testing">
886+
<property name="accessibleName">
887+
<string/>
888+
</property>
889+
<attribute name="title">
890+
<string>Тестирование</string>
891+
</attribute>
892+
<layout class="QVBoxLayout" name="verticalLayout_8">
893+
<item>
894+
<widget class="QProgressBar" name="progress_bar">
895+
<property name="enabled">
896+
<bool>false</bool>
897+
</property>
898+
<property name="value">
899+
<number>0</number>
900+
</property>
901+
<property name="textVisible">
902+
<bool>true</bool>
903+
</property>
904+
</widget>
905+
</item>
906+
<item>
907+
<widget class="QStackedWidget" name="type_answers">
908+
<property name="currentIndex">
909+
<number>0</number>
910+
</property>
911+
<widget class="QWidget" name="start_test">
912+
<layout class="QVBoxLayout" name="verticalLayout_11">
913+
<item>
914+
<spacer name="verticalSpacer_16">
915+
<property name="orientation">
916+
<enum>Qt::Vertical</enum>
917+
</property>
918+
<property name="sizeHint" stdset="0">
919+
<size>
920+
<width>20</width>
921+
<height>40</height>
922+
</size>
923+
</property>
924+
</spacer>
925+
</item>
926+
<item>
927+
<widget class="QLabel" name="label_11">
928+
<property name="text">
929+
<string>Вы готовы к тестированию по паттерну &quot;Тест&quot;? Вам будет дано 10 минут на 10 вопросов.</string>
930+
</property>
931+
<property name="alignment">
932+
<set>Qt::AlignCenter</set>
933+
</property>
934+
<property name="wordWrap">
935+
<bool>true</bool>
936+
</property>
937+
</widget>
938+
</item>
939+
<item>
940+
<widget class="QPushButton" name="start_testing">
941+
<property name="text">
942+
<string>Да, начать тестирование</string>
943+
</property>
944+
</widget>
945+
</item>
946+
<item>
947+
<spacer name="verticalSpacer_15">
948+
<property name="orientation">
949+
<enum>Qt::Vertical</enum>
950+
</property>
951+
<property name="sizeHint" stdset="0">
952+
<size>
953+
<width>20</width>
954+
<height>40</height>
955+
</size>
956+
</property>
957+
</spacer>
958+
</item>
959+
</layout>
960+
</widget>
961+
</widget>
962+
</item>
963+
<item>
964+
<layout class="QHBoxLayout" name="horizontalLayout_7">
965+
<item>
966+
<widget class="QPushButton" name="prev_button">
967+
<property name="text">
968+
<string>Предыдущий вопрос</string>
969+
</property>
970+
</widget>
971+
</item>
972+
<item>
973+
<widget class="QPushButton" name="check_button">
974+
<property name="text">
975+
<string>Ответить</string>
976+
</property>
977+
</widget>
978+
</item>
979+
<item>
980+
<widget class="QPushButton" name="next_button">
981+
<property name="text">
982+
<string>Следующий вопрос</string>
983+
</property>
984+
</widget>
985+
</item>
986+
<item>
987+
<widget class="QPushButton" name="done">
988+
<property name="text">
989+
<string>Закончить тест</string>
990+
</property>
991+
</widget>
992+
</item>
993+
</layout>
994+
</item>
995+
</layout>
996+
</widget>
997+
<widget class="QWidget" name="result">
998+
<attribute name="title">
999+
<string>Результаты</string>
1000+
</attribute>
1001+
<layout class="QVBoxLayout" name="verticalLayout_9">
1002+
<item>
1003+
<widget class="QStackedWidget" name="result_stacked_widget">
1004+
<property name="currentIndex">
1005+
<number>1</number>
1006+
</property>
1007+
<widget class="QWidget" name="to_show_2">
1008+
<layout class="QHBoxLayout" name="horizontalLayout_8">
1009+
<item>
1010+
<spacer name="horizontalSpacer_15">
1011+
<property name="orientation">
1012+
<enum>Qt::Horizontal</enum>
1013+
</property>
1014+
<property name="sizeHint" stdset="0">
1015+
<size>
1016+
<width>40</width>
1017+
<height>20</height>
1018+
</size>
1019+
</property>
1020+
</spacer>
1021+
</item>
1022+
<item>
1023+
<widget class="QPushButton" name="to_show">
1024+
<property name="text">
1025+
<string>Просмотр результатов</string>
1026+
</property>
1027+
</widget>
1028+
</item>
1029+
<item>
1030+
<spacer name="horizontalSpacer_16">
1031+
<property name="orientation">
1032+
<enum>Qt::Horizontal</enum>
1033+
</property>
1034+
<property name="sizeHint" stdset="0">
1035+
<size>
1036+
<width>40</width>
1037+
<height>20</height>
1038+
</size>
1039+
</property>
1040+
</spacer>
1041+
</item>
1042+
</layout>
1043+
</widget>
1044+
<widget class="QWidget" name="show">
1045+
<layout class="QVBoxLayout" name="verticalLayout_10">
1046+
<item>
1047+
<widget class="QScrollArea" name="scrollArea_3">
1048+
<property name="widgetResizable">
1049+
<bool>true</bool>
1050+
</property>
1051+
<widget class="QWidget" name="scrollAreaWidgetContents_3">
1052+
<property name="geometry">
1053+
<rect>
1054+
<x>0</x>
1055+
<y>0</y>
1056+
<width>620</width>
1057+
<height>343</height>
1058+
</rect>
1059+
</property>
1060+
<layout class="QVBoxLayout" name="verticalLayout_12">
1061+
<item>
1062+
<layout class="QVBoxLayout" name="layout_show"/>
1063+
</item>
1064+
</layout>
1065+
</widget>
1066+
</widget>
1067+
</item>
1068+
<item>
1069+
<layout class="QHBoxLayout" name="horizontalLayout_9">
1070+
<item>
1071+
<spacer name="horizontalSpacer_17">
1072+
<property name="orientation">
1073+
<enum>Qt::Horizontal</enum>
1074+
</property>
1075+
<property name="sizeHint" stdset="0">
1076+
<size>
1077+
<width>40</width>
1078+
<height>20</height>
1079+
</size>
1080+
</property>
1081+
</spacer>
1082+
</item>
1083+
<item>
1084+
<widget class="QPushButton" name="pushButton">
1085+
<property name="text">
1086+
<string>К списку паттернов</string>
1087+
</property>
1088+
</widget>
1089+
</item>
1090+
</layout>
1091+
</item>
1092+
</layout>
1093+
</widget>
1094+
</widget>
1095+
</item>
1096+
</layout>
1097+
</widget>
1098+
</widget>
1099+
</item>
1100+
</layout>
1101+
</widget>
8251102
</widget>
8261103
</item>
8271104
</layout>

0 commit comments

Comments
 (0)