MCPcopy Create free account
hub / github.com/Project-LemonLime/Project_LemonLime / taskJudgedDisplay

Method taskJudgedDisplay

src/judgingdialog.cpp:301–336  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

299}
300
301void 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
338void JudgingDialog::contestantJudgingStart(const QString &contestantName) {
339 bool isOnMaxValue =

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected