Skip to content

Commit

Permalink
core: fix bugs (#702)
Browse files Browse the repository at this point in the history
  • Loading branch information
pandadtdyy authored Dec 14, 2023
1 parent 55b4e1a commit 453d907
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 23 deletions.
4 changes: 2 additions & 2 deletions packages/hydrooj/locales/ko.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -456,8 +456,8 @@ Numeric PID: 문제 번호
Oh, the user doesn't have any contributions!: 아직 기여가 없습니다.
Oh, the user hasn't created any discussions yet!: 아직 토론을 시작하지 않았습니다.
Oh, the user hasn't submitted yet!: 아직 제출하지 않았습니다 _(:зゝ∠)
Oh, there is no task in the queue!: 대기열이 비었습니다.
Oh, there are no tasks that match the filter!: 결과 없음
Oh, there is no task in the queue!: 대기열이 비었습니다.
Ok: OK
Only A-Z, a-z, 0-9 and _ are accepted: A-Z, a-z, 0-9 와 _만 허용됨
Oops, there are no results.: 결과 없음
Expand Down Expand Up @@ -544,9 +544,9 @@ Quit Scratchpad: Editor 닫기
Quote: 문구
Rank: 순위
ranking: 순위
Read all record codes: 모든 기록 코드 읽기
Read data of own problems: 자신의 문제 데이터 읽기
Read data of problem: 문제 데이터 읽기
Read record codes: 점수 읽기
Ready (☆▽☆): 준비 완료! (☆▽☆)
Ready: 준비됨
Recent {0} Records: 최근 {0} 점수
Expand Down
2 changes: 1 addition & 1 deletion packages/hydrooj/locales/zh_TW.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -351,9 +351,9 @@ QQ Group: QQ 群
QQ Visibility: QQ 可見性
Quit Scratchpad: 退出線上程式設計模式
Rank: 排名
Read all record codes: 讀取所有記錄的程式碼
Read data of own problems: 讀取自己題目的資料
Read data of problem: 讀取題目資料
Read record codes: 讀取記錄的程式碼
Ready (☆▽☆): 馬上開始 (☆▽☆)
Ready: 即將開始
Recent {0} Records: 最近 {0} 條記錄
Expand Down
1 change: 1 addition & 0 deletions packages/hydrooj/src/handler/contest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,7 @@ export class ContestEditHandler extends Handler {
if (beginAtMoment.isSameOrAfter(endAt)) throw new ValidationError('duration');
const beginAt = beginAtMoment.toDate();
const lockAt = lock ? moment(endAt).add(-lock, 'minutes').toDate() : null;
if (lockAt && contestDuration) throw new ValidationError('lockAt', 'duration');
await problem.getList(domainId, pids, this.user.hasPerm(PERM.PERM_VIEW_PROBLEM_HIDDEN) || this.user._id, true);
if (tid) {
await contest.edit(domainId, tid, {
Expand Down
1 change: 1 addition & 0 deletions packages/hydrooj/src/handler/manage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ class SystemUserImportHandler extends SystemHandler {
groups[data.group].push(email);
}
if (data.school) payload.school = data.school;
if (data.studentId) payload.studentId = data.studentId;
} catch (e) { }
udocs.push({
email, username, password, displayName, payload,
Expand Down
19 changes: 6 additions & 13 deletions packages/hydrooj/src/handler/problem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -489,19 +489,12 @@ export class ProblemSubmitHandler extends ProblemDetailHandler {
const langRange = (typeof this.pdoc.config === 'object' && this.pdoc.config.langs)
? Object.fromEntries(this.pdoc.config.langs.map((i) => [i, setting.langs[i]?.display || i]))
: setting.SETTINGS_BY_KEY.codeLang.range;
this.response.body = {
langRange,
pdoc: this.pdoc,
udoc: this.udoc,
tdoc: this.tdoc,
tsdoc: this.tsdoc,
title: this.pdoc.title,
page_name: this.tdoc
? this.tdoc.rule === 'homework'
? 'homework_detail_problem_submit'
: 'contest_detail_problem_submit'
: 'problem_submit',
};
this.response.body.langRange = langRange;
this.response.body.page_name = this.tdoc
? this.tdoc.rule === 'homework'
? 'homework_detail_problem_submit'
: 'contest_detail_problem_submit'
: 'problem_submit';
}

@param('lang', Types.Name)
Expand Down
2 changes: 1 addition & 1 deletion packages/hydrooj/src/model/builtin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export const PERMS = [
Permission('perm_problem', PERM.PERM_VIEW_PROBLEM_HIDDEN, 'View hidden problems'),
Permission('perm_problem', PERM.PERM_SUBMIT_PROBLEM, 'Submit problem'),
Permission('perm_problem', PERM.PERM_READ_PROBLEM_DATA, 'Read data of problem'),
Permission('perm_record', PERM.PERM_READ_RECORD_CODE, 'Read record codes'),
Permission('perm_record', PERM.PERM_READ_RECORD_CODE, 'Read all record codes'),
Permission('perm_record', PERM.PERM_READ_RECORD_CODE_ACCEPT, 'Read record codes after accept'),
Permission('perm_record', PERM.PERM_REJUDGE_PROBLEM, 'Rejudge problems'),
Permission('perm_record', PERM.PERM_REJUDGE, 'Rejudge records'),
Expand Down
4 changes: 2 additions & 2 deletions packages/ui-default/locales/ko.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -460,8 +460,8 @@ Numeric PID: 문제 번호
Oh, the user doesn't have any contributions!: 아직 기여가 없습니다.
Oh, the user hasn't created any discussions yet!: 아직 토론을 시작하지 않았습니다.
Oh, the user hasn't submitted yet!: 아직 제출하지 않았습니다 _(:зゝ∠)
Oh, there is no task in the queue!: 대기열이 비었습니다.
Oh, there are no tasks that match the filter!: 결과 없음
Oh, there is no task in the queue!: 대기열이 비었습니다.
Ok: OK
Only A-Z, a-z, 0-9 and _ are accepted: A-Z, a-z, 0-9 와 _만 허용됨
Oops, there are no results.: 결과 없음
Expand Down Expand Up @@ -547,9 +547,9 @@ Quit Scratchpad: Editor 닫기
Quote: 문구
Rank: 순위
ranking: 순위
Read all record codes: 모든 기록 코드 읽기
Read data of own problems: 자신의 문제 데이터 읽기
Read data of problem: 문제 데이터 읽기
Read record codes: 점수 읽기
Ready (☆▽☆): 준비 완료! (☆▽☆)
Ready: 준비됨
Recent {0} Records: 최근 {0} 점수
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-default/locales/zh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -721,9 +721,9 @@ Quote: 引用
Rank: 排名
Ranked Users: 排名用户
ranking: 排名
Read all record codes: 读取所有记录的代码
Read data of own problems: 读取自己题目的数据
Read data of problem: 读取题目数据
Read record codes: 读取记录的代码
Ready (☆▽☆): 马上开始 (☆▽☆)
Ready: 即将开始
Recent {0} Records: 最近 {0} 条记录
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-default/locales/zh_TW.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -352,9 +352,9 @@ QQ Group: QQ 群
QQ Visibility: QQ 可見性
Quit Scratchpad: 退出線上程式設計模式
Rank: 排名
Read all record codes: 讀取所有記錄的程式碼
Read data of own problems: 讀取自己題目的資料
Read data of problem: 讀取題目資料
Read record codes: 讀取記錄的程式碼
Ready (☆▽☆): 馬上開始 (☆▽☆)
Ready: 即將開始
Recent {0} Records: 最近 {0} 條記錄
Expand Down
4 changes: 2 additions & 2 deletions packages/ui-default/templates/contest_edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ <h2 class="section__title">{{ _('Contest Settings') }}</h2>
value:tdoc.allowViewCode|default(true),
row:false
}) }}
<div style="display: none" class="contest-rule-settings contest-rule--acm contest-rule--ioi contest-rule--strictioi">
<div style="display: none" class="contest-rule-settings contest-rule--acm contest-rule--ioi">
{{ form.form_text({
columns:4,
label:'Lock (minutes)',
Expand All @@ -170,7 +170,7 @@ <h2 class="section__title">{{ _('Contest Settings') }}</h2>
row:false
}) }}
</div>
<div style="display: none" class="contest-rule-settings contest-rule--oi">
<div style="display: none" class="contest-rule-settings contest-rule--oi contest-rule--ioi contest-rule--ledo contest-rule--strictioi">
{{ form.form_text({
columns:4,
label:'Flexable Duration',
Expand Down

0 comments on commit 453d907

Please sign in to comment.