| 239 | return total; |
| 240 | } |
| 241 | int Task::writeToJson(QJsonObject &in) { |
| 242 | WRITE_JSON(in, problemTitle); |
| 243 | WRITE_JSON(in, sourceFileName); |
| 244 | WRITE_JSON(in, inputFileName); |
| 245 | WRITE_JSON(in, outputFileName); |
| 246 | WRITE_JSON(in, standardInputCheck); |
| 247 | WRITE_JSON(in, standardOutputCheck); |
| 248 | WRITE_JSON(in, taskType); |
| 249 | WRITE_JSON(in, subFolderCheck); |
| 250 | WRITE_JSON(in, comparisonMode); |
| 251 | WRITE_JSON(in, diffArguments); |
| 252 | WRITE_JSON(in, realPrecision); |
| 253 | auto specialJudge = this->specialJudge; |
| 254 | specialJudge.replace(QDir::separator(), '/'); |
| 255 | WRITE_JSON(in, specialJudge); |
| 256 | if (taskType == Task::Interaction) { |
| 257 | auto interactor = this->interactor; |
| 258 | interactor.replace(QDir::separator(), '/'); |
| 259 | WRITE_JSON(in, interactor); |
| 260 | auto grader = this->grader; |
| 261 | grader.replace(QDir::separator(), '/'); |
| 262 | WRITE_JSON(in, grader); |
| 263 | WRITE_JSON(in, interactorName); |
| 264 | } |
| 265 | |
| 266 | if (taskType == Task::Communication || taskType == Task::CommunicationExec) { |
| 267 | auto sourceFilesPath = this->sourceFilesPath; |
| 268 | auto sourceFilesName = this->sourceFilesName; |
| 269 | for (auto &filePath : sourceFilesPath) { |
| 270 | filePath.replace(QDir::separator(), '/'); |
| 271 | } |
| 272 | for (auto &fileName : sourceFilesName) { |
| 273 | fileName.replace(QDir::separator(), '/'); |
| 274 | } |
| 275 | WRITE_JSON(in, sourceFilesPath); |
| 276 | WRITE_JSON(in, sourceFilesName); |
| 277 | |
| 278 | auto graderFilesPath = this->graderFilesPath; |
| 279 | auto graderFilesName = this->graderFilesName; |
| 280 | for (auto &filePath : graderFilesPath) { |
| 281 | filePath.replace(QDir::separator(), '/'); |
| 282 | } |
| 283 | for (auto &fileName : graderFilesName) { |
| 284 | fileName.replace(QDir::separator(), '/'); |
| 285 | } |
| 286 | WRITE_JSON(in, graderFilesPath); |
| 287 | WRITE_JSON(in, graderFilesName); |
| 288 | } |
| 289 | |
| 290 | QJsonObject compilerConfiguration; |
| 291 | for (auto [x, y] : this->compilerConfiguration.asKeyValueRange()) { |
| 292 | compilerConfiguration[x] = y; |
| 293 | } |
| 294 | WRITE_JSON(in, compilerConfiguration); |
| 295 | |
| 296 | WRITE_JSON(in, answerFileExtension); |
| 297 | |
| 298 | QJsonArray testCases; |
no outgoing calls
no test coverage detected