forked from DOMjudge/DOMjura
-
Notifications
You must be signed in to change notification settings - Fork 0
/
judging.cpp
47 lines (38 loc) · 1.08 KB
/
judging.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include "judging.h"
#include <QJsonObject>
#include "submission.h"
namespace DJ
{
namespace Model
{
Judging::Judging(QJsonObject judging,
QHash<QString, Submission *> submissions,
QObject *parent) : QObject(parent)
{
this->id = judging.value("id").toInt();
QString submissionId = judging.value("submission_id").toString();
if (submissions.contains(submissionId))
{
this->submission = submissions[submissionId];
}
else
{
this->submission = nullptr;
}
QString outcome = judging.value("judgement_type_id").toString("?");
this->correct = outcome == "AC";
}
int Judging::getId()
{
return this->id;
}
Submission *Judging::getSubmission()
{
return this->submission;
}
bool Judging::isCorrect()
{
return this->correct;
}
} // namespace Model
} // namespace DJ