Split subtest 1 in four blocks
This commit is contained in:
parent
a09e9a5351
commit
8678fdb207
@ -14,7 +14,9 @@ DataModel::DataModel(QObject *parent)
|
|||||||
, m_results(this)
|
, m_results(this)
|
||||||
, m_akkusativ(this)
|
, m_akkusativ(this)
|
||||||
, m_dativ(this)
|
, m_dativ(this)
|
||||||
, m_v2Svk(this)
|
, m_wfModel(this)
|
||||||
|
, m_otModel(this)
|
||||||
|
, m_tPrModel(this)
|
||||||
, m_tPeModel(this)
|
, m_tPeModel(this)
|
||||||
, m_passiv(this)
|
, m_passiv(this)
|
||||||
, m_genitiv(this)
|
, m_genitiv(this)
|
||||||
@ -25,8 +27,12 @@ DataModel::DataModel(QObject *parent)
|
|||||||
connect(&m_verbEnd, &VerbEndModel::dataChanged, this, &DataModel::verbEndModelChanged);
|
connect(&m_verbEnd, &VerbEndModel::dataChanged, this, &DataModel::verbEndModelChanged);
|
||||||
connect(&m_akkusativ, &AkkusativModel::dataChanged, this, &DataModel::akkusativModelChanged);
|
connect(&m_akkusativ, &AkkusativModel::dataChanged, this, &DataModel::akkusativModelChanged);
|
||||||
connect(&m_dativ, &DativModel::dataChanged, this, &DataModel::dativModelChanged);
|
connect(&m_dativ, &DativModel::dataChanged, this, &DataModel::dativModelChanged);
|
||||||
connect(&m_v2Svk, &V2SvkModel::dataChanged, this, &DataModel::v2SvkModelChanged);
|
|
||||||
|
connect(&m_wfModel, &WFModel::dataChanged, this, &DataModel::v2SvkModelChanged);
|
||||||
|
connect(&m_otModel, &OTModel::dataChanged, this, &DataModel::v2SvkModelChanged);
|
||||||
|
connect(&m_tPrModel, &TPrModel::dataChanged, this, &DataModel::v2SvkModelChanged);
|
||||||
connect(&m_tPeModel, &TPeModel::dataChanged, this, &DataModel::v2SvkModelChanged);
|
connect(&m_tPeModel, &TPeModel::dataChanged, this, &DataModel::v2SvkModelChanged);
|
||||||
|
|
||||||
connect(&m_passiv, &PassivModel::dataChanged, this, &DataModel::passivModelChanged);
|
connect(&m_passiv, &PassivModel::dataChanged, this, &DataModel::passivModelChanged);
|
||||||
connect(&m_genitiv, &GenitivModel::dataChanged, this, &DataModel::genitivModelChanged);
|
connect(&m_genitiv, &GenitivModel::dataChanged, this, &DataModel::genitivModelChanged);
|
||||||
}
|
}
|
||||||
@ -36,8 +42,12 @@ void DataModel::write(const QString &filename) const
|
|||||||
ESGRAF48::DataModel dataModel;
|
ESGRAF48::DataModel dataModel;
|
||||||
|
|
||||||
m_metaData.write(*dataModel.mutable_metadata());
|
m_metaData.write(*dataModel.mutable_metadata());
|
||||||
m_v2Svk.write(*dataModel.mutable_v2svk());
|
|
||||||
|
m_wfModel.write(*dataModel.mutable_v2svk());
|
||||||
|
m_otModel.write(*dataModel.mutable_v2svk());
|
||||||
|
m_tPrModel.write(*dataModel.mutable_v2svk());
|
||||||
m_tPeModel.write(*dataModel.mutable_v2svk());
|
m_tPeModel.write(*dataModel.mutable_v2svk());
|
||||||
|
|
||||||
m_verbEnd.write(*dataModel.mutable_verbend());
|
m_verbEnd.write(*dataModel.mutable_verbend());
|
||||||
m_genus.write(*dataModel.mutable_genus());
|
m_genus.write(*dataModel.mutable_genus());
|
||||||
m_akkusativ.write(*dataModel.mutable_akkusativ());
|
m_akkusativ.write(*dataModel.mutable_akkusativ());
|
||||||
@ -75,8 +85,12 @@ void DataModel::read(const QString &filename)
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_metaData.read(dataModel.metadata());
|
m_metaData.read(dataModel.metadata());
|
||||||
m_v2Svk.read(dataModel.v2svk());
|
|
||||||
|
m_wfModel.read(dataModel.v2svk());
|
||||||
|
m_otModel.read(dataModel.v2svk());
|
||||||
|
m_tPrModel.read(dataModel.v2svk());
|
||||||
m_tPeModel.read(dataModel.v2svk());
|
m_tPeModel.read(dataModel.v2svk());
|
||||||
|
|
||||||
m_verbEnd.read(dataModel.verbend());
|
m_verbEnd.read(dataModel.verbend());
|
||||||
m_genus.read(dataModel.genus());
|
m_genus.read(dataModel.genus());
|
||||||
m_akkusativ.read(dataModel.akkusativ());
|
m_akkusativ.read(dataModel.akkusativ());
|
||||||
@ -153,8 +167,10 @@ void DataModel::dativModelChanged()
|
|||||||
|
|
||||||
void DataModel::v2SvkModelChanged()
|
void DataModel::v2SvkModelChanged()
|
||||||
{
|
{
|
||||||
m_results.setV2Result(m_v2Svk.getV2Points() + m_tPeModel.getV2Points());
|
m_results.setV2Result(m_wfModel.getV2Points() + m_otModel.getV2Points()
|
||||||
m_results.setSvkResult(m_v2Svk.getSvkPoints() + m_tPeModel.getSvkPoints());
|
+ m_tPrModel.getV2Points() + m_tPeModel.getV2Points());
|
||||||
|
m_results.setSvkResult(m_wfModel.getSvkPoints() + m_otModel.getSvkPoints()
|
||||||
|
+ m_tPrModel.getSvkPoints() + m_tPeModel.getSvkPoints());
|
||||||
|
|
||||||
emit modelChanged();
|
emit modelChanged();
|
||||||
}
|
}
|
||||||
|
@ -6,8 +6,12 @@
|
|||||||
#include "PluralModel.h"
|
#include "PluralModel.h"
|
||||||
#include "AkkusativModel.h"
|
#include "AkkusativModel.h"
|
||||||
#include "DativModel.h"
|
#include "DativModel.h"
|
||||||
#include "V2SvkModel.h"
|
|
||||||
|
#include "WFModel.h"
|
||||||
|
#include "OTModel.h"
|
||||||
|
#include "TPrModel.h"
|
||||||
#include "TPeModel.h"
|
#include "TPeModel.h"
|
||||||
|
|
||||||
#include "PassivModel.h"
|
#include "PassivModel.h"
|
||||||
#include "GenitivModel.h"
|
#include "GenitivModel.h"
|
||||||
|
|
||||||
@ -27,7 +31,9 @@ public:
|
|||||||
AkkusativModel m_akkusativ;
|
AkkusativModel m_akkusativ;
|
||||||
DativModel m_dativ;
|
DativModel m_dativ;
|
||||||
|
|
||||||
V2SvkModel m_v2Svk;
|
WFModel m_wfModel;
|
||||||
|
OTModel m_otModel;
|
||||||
|
TPrModel m_tPrModel;
|
||||||
TPeModel m_tPeModel;
|
TPeModel m_tPeModel;
|
||||||
|
|
||||||
PassivModel m_passiv;
|
PassivModel m_passiv;
|
||||||
|
@ -19,7 +19,9 @@ protobuf_generate_cpp(V2Svk_PROTO_SRCS V2Svk_PROTO_HDRS ${V2Svk_PROTO_FILES})
|
|||||||
|
|
||||||
add_library(${PROJECT_NAME}
|
add_library(${PROJECT_NAME}
|
||||||
V2SvkWidget.cpp
|
V2SvkWidget.cpp
|
||||||
V2SvkModel.cpp
|
WFModel.cpp
|
||||||
|
OTModel.cpp
|
||||||
|
TPrModel.cpp
|
||||||
TPeModel.cpp
|
TPeModel.cpp
|
||||||
${UI_HEADERS}
|
${UI_HEADERS}
|
||||||
${V2Svk_PROTO_SRCS}
|
${V2Svk_PROTO_SRCS}
|
||||||
|
105
source/SubTests/V2Svk/OTModel.cpp
Normal file
105
source/SubTests/V2Svk/OTModel.cpp
Normal file
@ -0,0 +1,105 @@
|
|||||||
|
#include "OTModel.h"
|
||||||
|
|
||||||
|
OTModel::OTModel(QObject *parent)
|
||||||
|
: CheckableTestModel(parent)
|
||||||
|
{
|
||||||
|
m_tests = {
|
||||||
|
{"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"}},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned int OTModel::getV2Points()
|
||||||
|
{
|
||||||
|
unsigned int points = 0;
|
||||||
|
|
||||||
|
for (auto testIndex : {0})
|
||||||
|
{
|
||||||
|
const auto &test = m_tests.at(testIndex);
|
||||||
|
|
||||||
|
for (const auto &item : test.items())
|
||||||
|
{
|
||||||
|
if (item.isChecked())
|
||||||
|
{
|
||||||
|
points++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return points;
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned int OTModel::getSvkPoints()
|
||||||
|
{
|
||||||
|
unsigned int points = 0;
|
||||||
|
|
||||||
|
for (auto testIndex : {1})
|
||||||
|
{
|
||||||
|
const auto &test = m_tests.at(testIndex);
|
||||||
|
|
||||||
|
for (const auto &item : test.items())
|
||||||
|
{
|
||||||
|
if (item.isChecked())
|
||||||
|
{
|
||||||
|
points++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return points;
|
||||||
|
}
|
||||||
|
|
||||||
|
void OTModel::write(ESGRAF48::V2SvkModel &model) const
|
||||||
|
{
|
||||||
|
auto writeFourVals = [&](ESGRAF48::V2SvkModel::FourEach *modelData, int testIndex) {
|
||||||
|
if (modelData != nullptr)
|
||||||
|
{
|
||||||
|
const auto &testItems = m_tests.at(testIndex).items();
|
||||||
|
|
||||||
|
modelData->set_affe1(testItems[0].isChecked());
|
||||||
|
modelData->set_affe2(testItems[1].isChecked());
|
||||||
|
modelData->set_affe3(testItems[2].isChecked());
|
||||||
|
modelData->set_affe4(testItems[3].isChecked());
|
||||||
|
modelData->set_schwein1(testItems[4].isChecked());
|
||||||
|
modelData->set_schwein2(testItems[5].isChecked());
|
||||||
|
modelData->set_schwein3(testItems[6].isChecked());
|
||||||
|
modelData->set_schwein4(testItems[7].isChecked());
|
||||||
|
modelData->set_gans1(testItems[8].isChecked());
|
||||||
|
modelData->set_gans2(testItems[9].isChecked());
|
||||||
|
modelData->set_gans3(testItems[10].isChecked());
|
||||||
|
modelData->set_gans4(testItems[11].isChecked());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
writeFourVals(model.mutable_objtop(), 0);
|
||||||
|
writeFourVals(model.mutable_svkstamm(), 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
void OTModel::read(const ESGRAF48::V2SvkModel &model)
|
||||||
|
{
|
||||||
|
auto readFourVals = [&](const ESGRAF48::V2SvkModel::FourEach &modelData, int testIndex) {
|
||||||
|
auto &testItems = m_tests.at(testIndex).items();
|
||||||
|
|
||||||
|
testItems[0].setState(modelData.affe1());
|
||||||
|
testItems[1].setState(modelData.affe2());
|
||||||
|
testItems[2].setState(modelData.affe3());
|
||||||
|
testItems[3].setState(modelData.affe4());
|
||||||
|
testItems[4].setState(modelData.schwein1());
|
||||||
|
testItems[5].setState(modelData.schwein2());
|
||||||
|
testItems[6].setState(modelData.schwein3());
|
||||||
|
testItems[7].setState(modelData.schwein4());
|
||||||
|
testItems[8].setState(modelData.gans1());
|
||||||
|
testItems[9].setState(modelData.gans2());
|
||||||
|
testItems[10].setState(modelData.gans3());
|
||||||
|
testItems[11].setState(modelData.gans4());
|
||||||
|
};
|
||||||
|
|
||||||
|
readFourVals(model.objtop(), 0);
|
||||||
|
readFourVals(model.svkstamm(), 1);
|
||||||
|
|
||||||
|
emit dataChanged(index(0, 0), index(rowCount() - 1, columnCount() - 1));
|
||||||
|
}
|
18
source/SubTests/V2Svk/OTModel.h
Normal file
18
source/SubTests/V2Svk/OTModel.h
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "CheckableTestModel.h"
|
||||||
|
#include "V2SvkModel.pb.h"
|
||||||
|
|
||||||
|
class OTModel : public CheckableTestModel
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
OTModel(QObject *parent);
|
||||||
|
|
||||||
|
unsigned int getV2Points();
|
||||||
|
unsigned int getSvkPoints();
|
||||||
|
|
||||||
|
void write(ESGRAF48::V2SvkModel &model) const;
|
||||||
|
void read(const ESGRAF48::V2SvkModel &model);
|
||||||
|
};
|
89
source/SubTests/V2Svk/TPrModel.cpp
Normal file
89
source/SubTests/V2Svk/TPrModel.cpp
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
#include "TPrModel.h"
|
||||||
|
|
||||||
|
TPrModel::TPrModel(QObject *parent)
|
||||||
|
: CheckableTestModel(parent)
|
||||||
|
{
|
||||||
|
m_tests = {
|
||||||
|
{"Temporaladverb Präsens", {"Affe", "Affe", "Schwein", "Schwein", "Gans", "Gans"}},
|
||||||
|
{"SKV: /-e/ o. Stamm", {"Affe", "Affe", "Schwein", "Schwein", "Gans", "Gans"}},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned int TPrModel::getV2Points()
|
||||||
|
{
|
||||||
|
unsigned int points = 0;
|
||||||
|
|
||||||
|
for (auto testIndex : {0})
|
||||||
|
{
|
||||||
|
const auto &test = m_tests.at(testIndex);
|
||||||
|
|
||||||
|
for (const auto &item : test.items())
|
||||||
|
{
|
||||||
|
if (item.isChecked())
|
||||||
|
{
|
||||||
|
points++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return points;
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned int TPrModel::getSvkPoints()
|
||||||
|
{
|
||||||
|
unsigned int points = 0;
|
||||||
|
|
||||||
|
for (auto testIndex : {1})
|
||||||
|
{
|
||||||
|
const auto &test = m_tests.at(testIndex);
|
||||||
|
|
||||||
|
for (const auto &item : test.items())
|
||||||
|
{
|
||||||
|
if (item.isChecked())
|
||||||
|
{
|
||||||
|
points++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return points;
|
||||||
|
}
|
||||||
|
|
||||||
|
void TPrModel::write(ESGRAF48::V2SvkModel &model) const
|
||||||
|
{
|
||||||
|
auto writeTwoVals = [&](ESGRAF48::V2SvkModel::TwoEach *modelData, int testIndex) {
|
||||||
|
if (modelData != nullptr)
|
||||||
|
{
|
||||||
|
const auto &testItems = m_tests.at(testIndex).items();
|
||||||
|
|
||||||
|
modelData->set_affe1(testItems[0].isChecked());
|
||||||
|
modelData->set_affe2(testItems[1].isChecked());
|
||||||
|
modelData->set_schwein1(testItems[2].isChecked());
|
||||||
|
modelData->set_schwein2(testItems[3].isChecked());
|
||||||
|
modelData->set_gans1(testItems[4].isChecked());
|
||||||
|
modelData->set_gans2(testItems[5].isChecked());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
writeTwoVals(model.mutable_temppraes(), 0);
|
||||||
|
writeTwoVals(model.mutable_svke1(), 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
void TPrModel::read(const ESGRAF48::V2SvkModel &model)
|
||||||
|
{
|
||||||
|
auto readTwoVals = [&](const ESGRAF48::V2SvkModel::TwoEach &modelData, int testIndex) {
|
||||||
|
auto &testItems = m_tests.at(testIndex).items();
|
||||||
|
|
||||||
|
testItems[0].setState(modelData.affe1());
|
||||||
|
testItems[1].setState(modelData.affe2());
|
||||||
|
testItems[2].setState(modelData.schwein1());
|
||||||
|
testItems[3].setState(modelData.schwein2());
|
||||||
|
testItems[4].setState(modelData.gans1());
|
||||||
|
testItems[5].setState(modelData.gans2());
|
||||||
|
};
|
||||||
|
|
||||||
|
readTwoVals(model.temppraes(), 0);
|
||||||
|
readTwoVals(model.svke1(), 1);
|
||||||
|
|
||||||
|
emit dataChanged(index(0, 0), index(rowCount() - 1, columnCount() - 1));
|
||||||
|
}
|
18
source/SubTests/V2Svk/TPrModel.h
Normal file
18
source/SubTests/V2Svk/TPrModel.h
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "CheckableTestModel.h"
|
||||||
|
#include "V2SvkModel.pb.h"
|
||||||
|
|
||||||
|
class TPrModel : public CheckableTestModel
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
TPrModel(QObject *parent);
|
||||||
|
|
||||||
|
unsigned int getV2Points();
|
||||||
|
unsigned int getSvkPoints();
|
||||||
|
|
||||||
|
void write(ESGRAF48::V2SvkModel &model) const;
|
||||||
|
void read(const ESGRAF48::V2SvkModel &model);
|
||||||
|
};
|
@ -1,7 +1,9 @@
|
|||||||
#include "V2SvkWidget.h"
|
#include "V2SvkWidget.h"
|
||||||
#include "ui_V2SvkWidget.h"
|
#include "ui_V2SvkWidget.h"
|
||||||
|
|
||||||
#include "V2SvkModel.h"
|
#include "WFModel.h"
|
||||||
|
#include "OTModel.h"
|
||||||
|
#include "TPrModel.h"
|
||||||
#include "TPeModel.h"
|
#include "TPeModel.h"
|
||||||
|
|
||||||
V2SvkWidget::V2SvkWidget(QWidget *parent)
|
V2SvkWidget::V2SvkWidget(QWidget *parent)
|
||||||
@ -10,6 +12,8 @@ V2SvkWidget::V2SvkWidget(QWidget *parent)
|
|||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
ui->wfTableView->horizontalHeader()->hide();
|
ui->wfTableView->horizontalHeader()->hide();
|
||||||
|
ui->otTableView->horizontalHeader()->hide();
|
||||||
|
ui->tprTableView->horizontalHeader()->hide();
|
||||||
ui->tpeTableView->horizontalHeader()->hide();
|
ui->tpeTableView->horizontalHeader()->hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -18,11 +22,21 @@ V2SvkWidget::~V2SvkWidget()
|
|||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
void V2SvkWidget::setV2SvkModel(V2SvkModel *model)
|
void V2SvkWidget::setWFModel(WFModel *model)
|
||||||
{
|
{
|
||||||
ui->wfTableView->setModel(model);
|
ui->wfTableView->setModel(model);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void V2SvkWidget::setOTModel(OTModel *model)
|
||||||
|
{
|
||||||
|
ui->otTableView->setModel(model);
|
||||||
|
}
|
||||||
|
|
||||||
|
void V2SvkWidget::setTPrModel(TPrModel *model)
|
||||||
|
{
|
||||||
|
ui->tprTableView->setModel(model);
|
||||||
|
}
|
||||||
|
|
||||||
void V2SvkWidget::setTPeModel(TPeModel *model)
|
void V2SvkWidget::setTPeModel(TPeModel *model)
|
||||||
{
|
{
|
||||||
ui->tpeTableView->setModel(model);
|
ui->tpeTableView->setModel(model);
|
||||||
|
@ -2,7 +2,9 @@
|
|||||||
|
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
|
||||||
class V2SvkModel;
|
class WFModel;
|
||||||
|
class OTModel;
|
||||||
|
class TPrModel;
|
||||||
class TPeModel;
|
class TPeModel;
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
@ -20,6 +22,8 @@ public:
|
|||||||
V2SvkWidget(QWidget *parent = nullptr);
|
V2SvkWidget(QWidget *parent = nullptr);
|
||||||
~V2SvkWidget();
|
~V2SvkWidget();
|
||||||
|
|
||||||
void setV2SvkModel(V2SvkModel *model);
|
void setWFModel(WFModel *model);
|
||||||
|
void setOTModel(OTModel *model);
|
||||||
|
void setTPrModel(TPrModel *model);
|
||||||
void setTPeModel(TPeModel *model);
|
void setTPeModel(TPeModel *model);
|
||||||
};
|
};
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#include "V2SvkModel.h"
|
#include "WFModel.h"
|
||||||
|
|
||||||
V2SvkModel::V2SvkModel(QObject *parent)
|
WFModel::WFModel(QObject *parent)
|
||||||
: CheckableTestModel(parent)
|
: CheckableTestModel(parent)
|
||||||
{
|
{
|
||||||
m_tests = {
|
m_tests = {
|
||||||
@ -11,24 +11,14 @@ V2SvkModel::V2SvkModel(QObject *parent)
|
|||||||
{"SVK: /-st/",
|
{"SVK: /-st/",
|
||||||
{"Affe", "Affe", "Affe", "Affe", "Schwein", "Schwein", "Schwein", "Schwein", "Gans",
|
{"Affe", "Affe", "Affe", "Affe", "Schwein", "Schwein", "Schwein", "Schwein", "Gans",
|
||||||
"Gans", "Gans", "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"}},
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int V2SvkModel::getV2Points()
|
unsigned int WFModel::getV2Points()
|
||||||
{
|
{
|
||||||
unsigned int points = 0;
|
unsigned int points = 0;
|
||||||
|
|
||||||
for (auto testIndex : {0, 1, 3, 5})
|
for (auto testIndex : {0, 1})
|
||||||
{
|
{
|
||||||
const auto &test = m_tests.at(testIndex);
|
const auto &test = m_tests.at(testIndex);
|
||||||
|
|
||||||
@ -44,11 +34,11 @@ unsigned int V2SvkModel::getV2Points()
|
|||||||
return points;
|
return points;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int V2SvkModel::getSvkPoints()
|
unsigned int WFModel::getSvkPoints()
|
||||||
{
|
{
|
||||||
unsigned int points = 0;
|
unsigned int points = 0;
|
||||||
|
|
||||||
for (auto testIndex : {2, 4, 6})
|
for (auto testIndex : {2})
|
||||||
{
|
{
|
||||||
const auto &test = m_tests.at(testIndex);
|
const auto &test = m_tests.at(testIndex);
|
||||||
|
|
||||||
@ -64,21 +54,17 @@ unsigned int V2SvkModel::getSvkPoints()
|
|||||||
return points;
|
return points;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool V2SvkModel::isValidIndex(const QModelIndex &index) const
|
bool WFModel::isValidIndex(const QModelIndex &index) const
|
||||||
{
|
{
|
||||||
switch (index.row())
|
if (index.row() == 1)
|
||||||
{
|
{
|
||||||
case 1:
|
|
||||||
return index.column() == 1 || index.column() == 7 || index.column() == 10;
|
return index.column() == 1 || index.column() == 7 || index.column() == 10;
|
||||||
case 5:
|
}
|
||||||
case 6:
|
|
||||||
return index.column() < 6;
|
|
||||||
default:
|
|
||||||
return CheckableTestModel::isValidIndex(index);
|
return CheckableTestModel::isValidIndex(index);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void V2SvkModel::write(ESGRAF48::V2SvkModel &model) const
|
void WFModel::write(ESGRAF48::V2SvkModel &model) const
|
||||||
{
|
{
|
||||||
auto writeOneVal = [&](ESGRAF48::V2SvkModel::OneEach *modelData, int testIndex) {
|
auto writeOneVal = [&](ESGRAF48::V2SvkModel::OneEach *modelData, int testIndex) {
|
||||||
if (modelData != nullptr)
|
if (modelData != nullptr)
|
||||||
@ -91,20 +77,6 @@ void V2SvkModel::write(ESGRAF48::V2SvkModel &model) const
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
auto writeTwoVals = [&](ESGRAF48::V2SvkModel::TwoEach *modelData, int testIndex) {
|
|
||||||
if (modelData != nullptr)
|
|
||||||
{
|
|
||||||
const auto &testItems = m_tests.at(testIndex).items();
|
|
||||||
|
|
||||||
modelData->set_affe1(testItems[0].isChecked());
|
|
||||||
modelData->set_affe2(testItems[1].isChecked());
|
|
||||||
modelData->set_schwein1(testItems[2].isChecked());
|
|
||||||
modelData->set_schwein2(testItems[3].isChecked());
|
|
||||||
modelData->set_gans1(testItems[4].isChecked());
|
|
||||||
modelData->set_gans2(testItems[5].isChecked());
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
auto writeFourVals = [&](ESGRAF48::V2SvkModel::FourEach *modelData, int testIndex) {
|
auto writeFourVals = [&](ESGRAF48::V2SvkModel::FourEach *modelData, int testIndex) {
|
||||||
if (modelData != nullptr)
|
if (modelData != nullptr)
|
||||||
{
|
{
|
||||||
@ -127,14 +99,9 @@ void V2SvkModel::write(ESGRAF48::V2SvkModel &model) const
|
|||||||
|
|
||||||
writeFourVals(model.mutable_wfrage(), 0);
|
writeFourVals(model.mutable_wfrage(), 0);
|
||||||
writeOneVal(model.mutable_verbtrennung1(), 1);
|
writeOneVal(model.mutable_verbtrennung1(), 1);
|
||||||
writeFourVals(model.mutable_svkst(), 2);
|
|
||||||
writeFourVals(model.mutable_objtop(), 3);
|
|
||||||
writeFourVals(model.mutable_svkstamm(), 4);
|
|
||||||
writeTwoVals(model.mutable_temppraes(), 5);
|
|
||||||
writeTwoVals(model.mutable_svke1(), 6);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void V2SvkModel::read(const ESGRAF48::V2SvkModel &model)
|
void WFModel::read(const ESGRAF48::V2SvkModel &model)
|
||||||
{
|
{
|
||||||
auto readOneVal = [&](const ESGRAF48::V2SvkModel::OneEach &modelData, int testIndex) {
|
auto readOneVal = [&](const ESGRAF48::V2SvkModel::OneEach &modelData, int testIndex) {
|
||||||
auto &testItems = m_tests.at(testIndex).items();
|
auto &testItems = m_tests.at(testIndex).items();
|
||||||
@ -144,17 +111,6 @@ void V2SvkModel::read(const ESGRAF48::V2SvkModel &model)
|
|||||||
testItems[10].setState(modelData.gans());
|
testItems[10].setState(modelData.gans());
|
||||||
};
|
};
|
||||||
|
|
||||||
auto readTwoVals = [&](const ESGRAF48::V2SvkModel::TwoEach &modelData, int testIndex) {
|
|
||||||
auto &testItems = m_tests.at(testIndex).items();
|
|
||||||
|
|
||||||
testItems[0].setState(modelData.affe1());
|
|
||||||
testItems[1].setState(modelData.affe2());
|
|
||||||
testItems[2].setState(modelData.schwein1());
|
|
||||||
testItems[3].setState(modelData.schwein2());
|
|
||||||
testItems[4].setState(modelData.gans1());
|
|
||||||
testItems[5].setState(modelData.gans2());
|
|
||||||
};
|
|
||||||
|
|
||||||
auto readFourVals = [&](const ESGRAF48::V2SvkModel::FourEach &modelData, int testIndex) {
|
auto readFourVals = [&](const ESGRAF48::V2SvkModel::FourEach &modelData, int testIndex) {
|
||||||
auto &testItems = m_tests.at(testIndex).items();
|
auto &testItems = m_tests.at(testIndex).items();
|
||||||
|
|
||||||
@ -174,11 +130,6 @@ void V2SvkModel::read(const ESGRAF48::V2SvkModel &model)
|
|||||||
|
|
||||||
readFourVals(model.wfrage(), 0);
|
readFourVals(model.wfrage(), 0);
|
||||||
readOneVal(model.verbtrennung1(), 1);
|
readOneVal(model.verbtrennung1(), 1);
|
||||||
readFourVals(model.svkst(), 2);
|
|
||||||
readFourVals(model.objtop(), 3);
|
|
||||||
readFourVals(model.svkstamm(), 4);
|
|
||||||
readTwoVals(model.temppraes(), 5);
|
|
||||||
readTwoVals(model.svke1(), 6);
|
|
||||||
|
|
||||||
emit dataChanged(index(0, 0), index(rowCount() - 1, columnCount() - 1));
|
emit dataChanged(index(0, 0), index(rowCount() - 1, columnCount() - 1));
|
||||||
}
|
}
|
@ -3,12 +3,12 @@
|
|||||||
#include "CheckableTestModel.h"
|
#include "CheckableTestModel.h"
|
||||||
#include "V2SvkModel.pb.h"
|
#include "V2SvkModel.pb.h"
|
||||||
|
|
||||||
class V2SvkModel : public CheckableTestModel
|
class WFModel : public CheckableTestModel
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
V2SvkModel(QObject *parent);
|
WFModel(QObject *parent);
|
||||||
|
|
||||||
unsigned int getV2Points();
|
unsigned int getV2Points();
|
||||||
unsigned int getSvkPoints();
|
unsigned int getSvkPoints();
|
||||||
@ -16,6 +16,5 @@ public:
|
|||||||
void write(ESGRAF48::V2SvkModel &model) const;
|
void write(ESGRAF48::V2SvkModel &model) const;
|
||||||
void read(const ESGRAF48::V2SvkModel &model);
|
void read(const ESGRAF48::V2SvkModel &model);
|
||||||
|
|
||||||
protected:
|
bool isValidIndex(const QModelIndex &index) const;
|
||||||
bool isValidIndex(const QModelIndex &index) const override;
|
|
||||||
};
|
};
|
@ -48,8 +48,12 @@ void MainWindow::setupUi()
|
|||||||
ui->pluralWidget->setModel(&m_dataModel.m_plural);
|
ui->pluralWidget->setModel(&m_dataModel.m_plural);
|
||||||
ui->akkusativDativWidget->setAkkusativModel(&m_dataModel.m_akkusativ);
|
ui->akkusativDativWidget->setAkkusativModel(&m_dataModel.m_akkusativ);
|
||||||
ui->akkusativDativWidget->setDativModel(&m_dataModel.m_dativ);
|
ui->akkusativDativWidget->setDativModel(&m_dataModel.m_dativ);
|
||||||
ui->v2SvkWidget->setV2SvkModel(&m_dataModel.m_v2Svk);
|
|
||||||
|
ui->v2SvkWidget->setWFModel(&m_dataModel.m_wfModel);
|
||||||
|
ui->v2SvkWidget->setOTModel(&m_dataModel.m_otModel);
|
||||||
|
ui->v2SvkWidget->setTPrModel(&m_dataModel.m_tPrModel);
|
||||||
ui->v2SvkWidget->setTPeModel(&m_dataModel.m_tPeModel);
|
ui->v2SvkWidget->setTPeModel(&m_dataModel.m_tPeModel);
|
||||||
|
|
||||||
ui->lateSkillsWidget->setPassivModel(&m_dataModel.m_passiv);
|
ui->lateSkillsWidget->setPassivModel(&m_dataModel.m_passiv);
|
||||||
ui->lateSkillsWidget->setGenitivModel(&m_dataModel.m_genitiv);
|
ui->lateSkillsWidget->setGenitivModel(&m_dataModel.m_genitiv);
|
||||||
ui->resultWidget->setModel(&m_dataModel.m_results);
|
ui->resultWidget->setModel(&m_dataModel.m_results);
|
||||||
|
Reference in New Issue
Block a user