core: objective

This commit is contained in:
undefined committed 2021-07-29 00:26:32 +08:00
1 parent de5b908272
commit 47b7866053
14 files changed
+31 -18

No files matched your search

@@ -54,7 +54,7 @@ const problemConfigSchema = {
def: problemConfigSchemaDef,
properties: {
key: { type: 'string', pattern: '[0-9a-f]{32}' },
type: { enum: ['default', 'interactive', 'submit_answer', 'subjective', 'remote_judge'] },
type: { enum: ['default', 'interactive', 'submit_answer', 'objective', 'remote_judge'] },
subType: { type: 'string' },
langs: { type: 'array', items: { type: 'string' } },
target: { type: 'string' },
@@ -2,7 +2,7 @@ import React from 'react';
import { sortBy } from 'lodash';
import request from 'vj/utils/request';
export default class SubjectiveContainer extends React.PureComponent {
export default class ObjectiveContainer extends React.PureComponent {
constructor(args) {
super(args);
this.state = {};
+1 -1
View File
@@ -28,7 +28,7 @@ problem_type.default: 'Type: Default'
problem_type.fileio: 'Type: FileIO ({0})'
problem_type.interactive: 'Type: Interactive'
problem_type.remote_judge: 'Type: RemoteJudge'
problem_type.subjective: 'Type: Subjective'
problem_type.objective: 'Type: Objective'
problem_type.submit_answer: 'Type: SubmitAnswer'
problem-category-delim: '|'
problem-subcategory-delim: ', '
+1 -1
View File
@@ -558,7 +558,7 @@ problem_type.default: 传统题
problem_type.fileio: '文件IO ({0})'
problem_type.interactive: 交互题
problem_type.remote_judge: 远端评测题
problem_type.subjective: 客观题
problem_type.objective: 客观题
problem_type.submit_answer: 提交答案题
problem-category-delim: '|'
problem-subcategory-delim: 、
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@hydrooj/ui-default",
"version": "4.13.12",
"version": "4.13.13",
"author": "undefined <i@undefined.moe>",
"license": "AGPL-3.0",
"main": "hydro.js",
@@ -171,7 +171,7 @@ const page = new NamedPage(['problem_detail', 'contest_detail_problem', 'homewor
unmountReact();
}
async function loadSubjective() {
async function loadObjective() {
try {
let s = '';
try {
@@ -189,15 +189,15 @@ const page = new NamedPage(['problem_detail', 'contest_detail_problem', 'homewor
const props = yaml.load(s);
if (!(props instanceof Array)) return;
$('.outer-loader-container').show();
const [{ default: Subjective }, React, ReactDOM] = await Promise.all([
import('vj/components/subjective-question/index'),
const [{ default: Objective }, React, ReactDOM] = await Promise.all([
import('vj/components/objective-question/index'),
import('react'),
import('react-dom'),
]);
ReactDOM.render(
<div className="section__body typo">
<Subjective panel={props} target={UiContext.postSubmitUrl}></Subjective>
<Objective panel={props} target={UiContext.postSubmitUrl}></Objective>
</div>,
$('.problem-content').get(0),
);
@@ -265,7 +265,7 @@ const page = new NamedPage(['problem_detail', 'contest_detail_problem', 'homewor
$('span.tags').show();
});
$('[name="problem-sidebar__download').on('click', handleClickDownloadProblem);
if (UiContext.pdoc.config?.type === 'subjective') loadSubjective();
if (UiContext.pdoc.config?.type === 'objective') loadObjective();
if (pagename !== 'contest_detail_problem') initChart();
});
@@ -41,7 +41,7 @@
<ul class="problem__tags">
<span class="bp3-tag bp3-large bp3-minimal problem__tag-item">{{ _('ID') }}: {{ pdoc.docId }}</span>
<span class="bp3-tag bp3-large bp3-minimal problem__tag-item bp3-icon-standard bp3-icon-book">{{ _('problem_type.' + pdoc.config.type).format(pdoc.config.subType) }}</span>
{% if pdoc.config.type != 'subjective' and pdoc.config.type != 'submit_answer' %}
{% if pdoc.config.type != 'objective' and pdoc.config.type != 'submit_answer' %}
<span class="bp3-tag bp3-large bp3-minimal problem__tag-item bp3-icon-standard bp3-icon-stopwatch">{{ pdoc.config.timeMax if pdoc.config.timeMax == pdoc.config.timeMin else pdoc.config.timeMin+'~'+pdoc.config.timeMax }}ms</span>
<span class="bp3-tag bp3-large bp3-minimal problem__tag-item bp3-icon-standard bp3-icon-comparison">{{ pdoc.config.memoryMax if pdoc.config.memoryMax == pdoc.config.memoryMin else pdoc.config.memoryMin+'~'+pdoc.config.memoryMax }}MiB</span>
{% endif %}