-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathjudging.cpp
More file actions
39 lines (30 loc) · 852 Bytes
/
Copy pathjudging.cpp
File metadata and controls
39 lines (30 loc) · 852 Bytes
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
#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