implemented genus test results
This commit is contained in:
parent
060348fdc5
commit
5bc7edabc6
11 changed files with 129 additions and 61 deletions
|
@ -178,3 +178,21 @@ const CheckableItem &CheckableTestModel::getItem(const QModelIndex &index) const
|
|||
|
||||
throw std::runtime_error("invalid index");
|
||||
}
|
||||
|
||||
unsigned int CheckableTestModel::getPoints() const
|
||||
{
|
||||
size_t points = 0;
|
||||
|
||||
for (const auto &test : m_tests)
|
||||
{
|
||||
for (const auto &item : test.items())
|
||||
{
|
||||
if (item.isChecked())
|
||||
{
|
||||
points++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return points;
|
||||
}
|
||||
|
|
|
@ -28,6 +28,8 @@ public:
|
|||
void write(QJsonObject &json) const;
|
||||
void read(const QJsonObject &json);
|
||||
|
||||
unsigned int getPoints() const;
|
||||
|
||||
private:
|
||||
bool isValidIndex(const QModelIndex &index) const;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue