| 299 | } |
| 300 | |
| 301 | void JudgingDialog::taskJudgedDisplay(const QString &taskName, const QList<QList<int>> &scoreList, |
| 302 | const int mxScore) { |
| 303 | bool isOnMaxValue = |
| 304 | ui->logViewer->verticalScrollBar()->value() == ui->logViewer->verticalScrollBar()->maximum(); |
| 305 | QTextBlockFormat blockFormat; |
| 306 | blockFormat.setLeftMargin(15); |
| 307 | cursor->insertBlock(blockFormat); |
| 308 | QTextCharFormat charFormat; |
| 309 | QTextCharFormat scoreFormat; |
| 310 | charFormat.setFontPointSize(10); |
| 311 | scoreFormat.setFontPointSize(10); |
| 312 | scoreFormat.setFontWeight(QFont::Bold); |
| 313 | scoreFormat.setForeground(QBrush(Qt::darkCyan)); |
| 314 | int allScore = 0; |
| 315 | |
| 316 | for (const auto &i : scoreList) { |
| 317 | int miScore = 2147483647; |
| 318 | |
| 319 | for (auto j : i) { |
| 320 | if (j >= 0) |
| 321 | miScore = qMin(miScore, j); |
| 322 | |
| 323 | if (miScore <= 0) |
| 324 | break; |
| 325 | } |
| 326 | |
| 327 | allScore += miScore; |
| 328 | } |
| 329 | |
| 330 | cursor->insertText(tr("Score of Task %1 : ").arg(taskName), charFormat); |
| 331 | cursor->insertText(tr("%1 / %2\n").arg(allScore).arg(mxScore), scoreFormat); |
| 332 | QScrollBar *bar = ui->logViewer->verticalScrollBar(); |
| 333 | |
| 334 | if (isOnMaxValue) |
| 335 | bar->setValue(bar->maximum()); |
| 336 | } |
| 337 | |
| 338 | void JudgingDialog::contestantJudgingStart(const QString &contestantName) { |
| 339 | bool isOnMaxValue = |
nothing calls this directly
no outgoing calls
no test coverage detected