diff --git a/utility.js b/utility.js index 7398a67..b7eb742 100644 --- a/utility.js +++ b/utility.js @@ -278,8 +278,8 @@ module.exports = { if (submitAnswer) testcase.answer = answer.replace('#', i); - if (!list.includes(testcase.input)) throw `找不到文件 ${testcase.input}`; - if (!list.includes(testcase.output)) throw `找不到文件 ${testcase.output}`; + if (testcase.input !== '-' && !list.includes(testcase.input)) throw `找不到文件 ${testcase.input}`; + if (testcase.output !== '-' && !list.includes(testcase.output)) throw `找不到文件 ${testcase.output}`; res[s].cases.push(testcase); } } diff --git a/views/problem.ejs b/views/problem.ejs index 7ab6bb4..587e6c3 100644 --- a/views/problem.ejs +++ b/views/problem.ejs @@ -54,7 +54,7 @@ if (contest) { <% } %>
- 评测方式:<%= testcases ? (testcases.spj ? 'Special Judge' : '文本比较') : '无测试数据' %> + 评测方式:<%= (testcases && !testcases.error) ? (testcases.spj ? 'Special Judge' : '文本比较') : '无测试数据' %> 题目类型:<%= { 'submit-answer': '答案提交', 'interaction': '交互', 'traditional': '传统' }[problem.type] %>
@@ -197,7 +197,7 @@ if (contest) { <% if (problem.type === 'submit-answer') { %> <% let cases = []; - if (testcases) { + if (testcases && !testcases.error) { for (let subtasks of testcases) { for (let testcase of subtasks.cases) { cases.push(testcase.answer);