增加测试点文件名显示

This commit is contained in:
Himit_ZH 2021-07-31 13:46:41 +08:00
parent 6cba427b1f
commit a687678ec0
6 changed files with 64 additions and 36 deletions

View File

@ -441,7 +441,7 @@ public class ProblemServiceImpl extends ServiceImpl<ProblemMapper, Problem> impl
for (ProblemCase problemCase : problemCaseList) {
JSONObject jsonObject = new JSONObject();
jsonObject.set("caseId", null);
jsonObject.set("caseId", problemCase.getId());
jsonObject.set("score", problemCase.getScore());
jsonObject.set("inputName", problemCase.getInput());
jsonObject.set("outputName", problemCase.getOutput());

View File

@ -98,6 +98,11 @@ public class JudgeRun {
final Integer score = ((JSONObject) testcaseList.get(index)).getInt("score", 0);
final Long maxOutputSize = Math.max(((JSONObject) testcaseList.get(index)).getLong("outputSize", 0L) * 2, 16 * 1024 * 1024L);
// 输入文件名
final String inputFileName = ((JSONObject) testcaseList.get(index)).getStr("inputName");
// 输出文件名
final String outputFileName = ((JSONObject) testcaseList.get(index)).getStr("outputName");
if (!isSpj) {
futureTasks.add(new FutureTask<>(new Callable<JSONObject>() {
@Override
@ -114,6 +119,8 @@ public class JudgeRun {
isRemoveEOFBlank);
result.set("caseId", caseId);
result.set("score", score);
result.set("inputFileName", inputFileName);
result.set("outputFileName", outputFileName);
return result;
}
}));
@ -136,6 +143,8 @@ public class JudgeRun {
getUserOutput);
result.set("caseId", caseId);
result.set("score", score);
result.set("inputFileName", inputFileName);
result.set("outputFileName", outputFileName);
return result;
}
}));

View File

@ -186,9 +186,13 @@ public class JudgeStrategy {
Integer memory = jsonObject.getLong("memory").intValue();
Integer status = jsonObject.getInt("status");
Long caseId = jsonObject.getLong("caseId");
String inputFileName = jsonObject.getStr("inputFileName");
String outputFileName = jsonObject.getStr("outputFileName");
JudgeCase judgeCase = new JudgeCase();
judgeCase.setTime(time).setMemory(memory)
.setStatus(status)
.setInputData(inputFileName)
.setOutputData(outputFileName)
.setPid(problem.getId())
.setUid(judge.getUid())
.setCaseId(caseId)

View File

@ -233,6 +233,9 @@ export const m = {
Shared:'Shared',
Unshared:'Unshared',
Shared_successfully:'Shared successfully',
Input_File:'Input File',
Output_File:'Output File',
Unknown:'Unknown',
// /views/oj/rank/ACMRank.vue
ACM_Ranklist: 'ACM Ranklist',

View File

@ -235,6 +235,9 @@ export const m = {
Shared:'分享',
Unshared:'不分享',
Shared_successfully:'分享成功',
Input_File:'输入文件',
Output_File:'输出文件',
Unknown:'未知',
// /views/oj/rank/ACMRank.vue
ACM_Ranklist: 'ACM 排行榜',

View File

@ -123,45 +123,54 @@
v-for="(item, index) in testCaseResult"
:key="index"
>
<div
class="test-detail-item"
:style="getTestCaseResultColor(item.status)"
v-if="item.status == JUDGE_STATUS_RESERVE.ac"
>
<span>Test #{{ index + 1 }}:</span>
<h2>{{ JUDGE_STATUS[item.status]['short'] }}</h2>
<div style="text-align:center;">
{{ item.time }}ms/{{ item.memory }}KB
<el-tooltip placement="top">
<div slot="content">
{{ $t('m.Input_File') }}{{
item.inputData ? item.inputData : $t('m.Unknown')
}}<br />{{ $t('m.Output_File') }}{{
item.outputData ? item.outputData : $t('m.Unknown')
}}
</div>
<div class="test-run-static">
<span v-if="item.score != null">
{{ item.score }} <i class="el-icon-success"></i>
</span>
<span v-else>
<i class="el-icon-success"></i>
</span>
<div
class="test-detail-item"
:style="getTestCaseResultColor(item.status)"
v-if="item.status == JUDGE_STATUS_RESERVE.ac"
>
<span>Test #{{ index + 1 }}:</span>
<h2>{{ JUDGE_STATUS[item.status]['short'] }}</h2>
<div style="text-align:center;">
{{ item.time }}ms/{{ item.memory }}KB
</div>
<div class="test-run-static">
<span v-if="item.score != null">
{{ item.score }} <i class="el-icon-success"></i>
</span>
<span v-else>
<i class="el-icon-success"></i>
</span>
</div>
</div>
</div>
<div
class="test-detail-item"
:style="getTestCaseResultColor(item.status)"
v-else
>
<span>Test #{{ index + 1 }}: </span>
<h2>{{ JUDGE_STATUS[item.status]['short'] }}</h2>
<div style="text-align:center;">
{{ item.time }}ms/{{ item.memory }}KB
<div
class="test-detail-item"
:style="getTestCaseResultColor(item.status)"
v-else
>
<span>Test #{{ index + 1 }}: </span>
<h2>{{ JUDGE_STATUS[item.status]['short'] }}</h2>
<div style="text-align:center;">
{{ item.time }}ms/{{ item.memory }}KB
</div>
<div class="test-run-static">
<span v-if="item.score != null">
{{ item.score }} <i class="el-icon-error"></i>
</span>
<span v-else>
<i class="el-icon-error"></i>
</span>
</div>
</div>
<div class="test-run-static">
<span v-if="item.score != null">
{{ item.score }} <i class="el-icon-error"></i>
</span>
<span v-else>
<i class="el-icon-error"></i>
</span>
</div>
</div>
</el-tooltip>
</el-col>
</el-row>
</el-card>