implemented V2/SVK test
This commit is contained in:
parent
5f9356a7f7
commit
b8c869ff39
16 changed files with 432 additions and 29 deletions
|
@ -4,3 +4,4 @@ add_subdirectory(VerbEnd)
|
|||
add_subdirectory(Genus)
|
||||
add_subdirectory(Plural)
|
||||
add_subdirectory(AkkusativDativ)
|
||||
add_subdirectory(V2Svk)
|
||||
|
|
36
source/SubTests/V2Svk/CMakeLists.txt
Normal file
36
source/SubTests/V2Svk/CMakeLists.txt
Normal file
|
@ -0,0 +1,36 @@
|
|||
cmake_minimum_required(VERSION 3.6)
|
||||
|
||||
project(V2Svk LANGUAGES CXX)
|
||||
|
||||
find_package(Qt5Widgets REQUIRED)
|
||||
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
|
||||
qt5_wrap_ui(UI_HEADERS
|
||||
V2SvkWidget.ui
|
||||
)
|
||||
|
||||
add_library(${PROJECT_NAME}
|
||||
V2SvkWidget.cpp
|
||||
V2SvkModel.cpp
|
||||
${UI_HEADERS}
|
||||
)
|
||||
|
||||
set_target_properties(${PROJECT_NAME}
|
||||
PROPERTIES CXX_STANDARD 14
|
||||
)
|
||||
|
||||
target_include_directories(${PROJECT_NAME}
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
PRIVATE
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
|
||||
target_link_libraries(${PROJECT_NAME}
|
||||
PRIVATE
|
||||
CheckableItem
|
||||
CheckableTest
|
||||
CheckableTestModel
|
||||
Qt5::Widgets
|
||||
)
|
77
source/SubTests/V2Svk/V2SvkModel.cpp
Normal file
77
source/SubTests/V2Svk/V2SvkModel.cpp
Normal file
|
@ -0,0 +1,77 @@
|
|||
#include "V2SvkModel.h"
|
||||
|
||||
V2SvkModel::V2SvkModel(QObject *parent)
|
||||
: CheckableTestModel(parent)
|
||||
{
|
||||
m_tests = {
|
||||
{ "W-Frage",
|
||||
{ "Affe", "Affe", "Affe", "Affe", "Schwein", "Schwein", "Schwein", "Schwein",
|
||||
"Gans" , "Gans", "Gans", "Gans"} },
|
||||
{ "Verbtrennung",
|
||||
{ "", "Affe", "", "", "", "", "", "Schwein", "" , "", "Gans", ""} },
|
||||
{ "SVK: /-st/",
|
||||
{ "Affe", "Affe", "Affe", "Affe", "Schwein", "Schwein", "Schwein", "Schwein",
|
||||
"Gans" , "Gans", "Gans", "Gans"} },
|
||||
|
||||
{ "Objekt-Topikalisierung",
|
||||
{ "Affe", "Affe", "Affe", "Affe", "Schwein", "Schwein", "Schwein", "Schwein",
|
||||
"Gans" , "Gans", "Gans", "Gans"} },
|
||||
{ "SVK: Stamm",
|
||||
{ "Affe", "Affe", "Affe", "Affe", "Schwein", "Schwein", "Schwein", "Schwein",
|
||||
"Gans" , "Gans", "Gans", "Gans"} },
|
||||
|
||||
{ "Temporaladverb Präsens",
|
||||
{ "Affe", "Affe", "Schwein", "Schwein", "Gans", "Gans" } },
|
||||
{ "SKV: /-e/ o. Stamm",
|
||||
{ "Affe", "Affe", "Schwein", "Schwein", "Gans", "Gans" } },
|
||||
|
||||
{ "Temporaladverb Perfekt",
|
||||
{ "Affe", "Affe", "Schwein", "Schwein", "Gans", "Gans" } },
|
||||
{ "Verbtrennung",
|
||||
{ "Affe", "Affe", "Schwein", "Schwein", "Gans", "Gans" } },
|
||||
{ "SVK: /-e/ o. Stamm",
|
||||
{ "Affe", "Affe", "Schwein", "Schwein", "Gans", "Gans" } },
|
||||
{ "Partizip",
|
||||
{ "Affe", "Affe", "Schwein", "Schwein", "Gans", "Gans" } },
|
||||
};
|
||||
}
|
||||
|
||||
unsigned int V2SvkModel::getV2Points()
|
||||
{
|
||||
size_t points = 0;
|
||||
|
||||
for (auto testIndex : { 0, 1, 3, 5, 7, 8 })
|
||||
{
|
||||
const auto &test = m_tests.at(testIndex);
|
||||
|
||||
for (const auto &item : test.items())
|
||||
{
|
||||
if (item.isChecked())
|
||||
{
|
||||
points++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return points;
|
||||
}
|
||||
|
||||
unsigned int V2SvkModel::getSvkPoints()
|
||||
{
|
||||
size_t points = 0;
|
||||
|
||||
for (auto testIndex : { 2, 4, 6, 9, 10 })
|
||||
{
|
||||
const auto &test = m_tests.at(testIndex);
|
||||
|
||||
for (const auto &item : test.items())
|
||||
{
|
||||
if (item.isChecked())
|
||||
{
|
||||
points++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return points;
|
||||
}
|
14
source/SubTests/V2Svk/V2SvkModel.h
Normal file
14
source/SubTests/V2Svk/V2SvkModel.h
Normal file
|
@ -0,0 +1,14 @@
|
|||
#pragma once
|
||||
|
||||
#include "CheckableTestModel.h"
|
||||
|
||||
class V2SvkModel : public CheckableTestModel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
V2SvkModel(QObject *parent);
|
||||
|
||||
unsigned int getV2Points();
|
||||
unsigned int getSvkPoints();
|
||||
};
|
21
source/SubTests/V2Svk/V2SvkWidget.cpp
Normal file
21
source/SubTests/V2Svk/V2SvkWidget.cpp
Normal file
|
@ -0,0 +1,21 @@
|
|||
#include "V2SvkWidget.h"
|
||||
#include "ui_V2SvkWidget.h"
|
||||
|
||||
#include "V2SvkModel.h"
|
||||
|
||||
V2SvkWidget::V2SvkWidget(QWidget *parent)
|
||||
: QWidget(parent)
|
||||
, ui(new Ui::V2SvkWidget)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
V2SvkWidget::~V2SvkWidget()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void V2SvkWidget::setV2SvkModel(V2SvkModel *model)
|
||||
{
|
||||
ui->v2SvkTableView->setModel(model);
|
||||
}
|
23
source/SubTests/V2Svk/V2SvkWidget.h
Normal file
23
source/SubTests/V2Svk/V2SvkWidget.h
Normal file
|
@ -0,0 +1,23 @@
|
|||
#pragma once
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
class V2SvkModel;
|
||||
|
||||
namespace Ui {
|
||||
class V2SvkWidget;
|
||||
};
|
||||
|
||||
class V2SvkWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private:
|
||||
Ui::V2SvkWidget *ui;
|
||||
|
||||
public:
|
||||
V2SvkWidget(QWidget *parent = nullptr);
|
||||
~V2SvkWidget();
|
||||
|
||||
void setV2SvkModel(V2SvkModel *model);
|
||||
};
|
24
source/SubTests/V2Svk/V2SvkWidget.ui
Normal file
24
source/SubTests/V2Svk/V2SvkWidget.ui
Normal file
|
@ -0,0 +1,24 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>V2SvkWidget</class>
|
||||
<widget class="QWidget" name="V2SvkWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QTableView" name="v2SvkTableView"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
Loading…
Add table
Add a link
Reference in a new issue