mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
judge&ui: fix bugs
This commit is contained in:
1 parent
76745639c1
commit
0195ba361e
2 files changed
+11
-2
No files matched your search
@@ -39,7 +39,7 @@ export async function judge({
|
|||||||
memory: 0,
|
memory: 0,
|
||||||
};
|
};
|
||||||
if (typeof ansInfo[0] === 'string') {
|
if (typeof ansInfo[0] === 'string') {
|
||||||
if (answer[0].trim() === answers[key].trim()) {
|
if (ansInfo[0].trim() === answers[key].trim()) {
|
||||||
totalScore += score;
|
totalScore += score;
|
||||||
totalStatus = Math.max(totalStatus, STATUS.STATUS_ACCEPTED);
|
totalStatus = Math.max(totalStatus, STATUS.STATUS_ACCEPTED);
|
||||||
next({
|
next({
|
||||||
|
|||||||
@@ -224,9 +224,18 @@ const page = new NamedPage(['problem_detail', 'contest_detail_problem', 'homewor
|
|||||||
$('.problem-content .typo').append(document.getElementsByClassName('nav__item--round').length
|
$('.problem-content .typo').append(document.getElementsByClassName('nav__item--round').length
|
||||||
? '<input type="submit" disabled class="button rounded primary" value="登录后提交" />'
|
? '<input type="submit" disabled class="button rounded primary" value="登录后提交" />'
|
||||||
: '<input type="submit" class="button rounded primary" value="提交" />');
|
: '<input type="submit" class="button rounded primary" value="提交" />');
|
||||||
$('input.objective-input').on('input', (e) => {
|
$('input.objective-input[type!=checkbox]').on('input', (e) => {
|
||||||
ans[e.target.name] = e.target.value;
|
ans[e.target.name] = e.target.value;
|
||||||
});
|
});
|
||||||
|
$('input.objective-input[type=checkbox]').on('input', (e) => {
|
||||||
|
if (e.target.checked) {
|
||||||
|
if (ans[e.target.name] === undefined) ans[e.target.name] = [];
|
||||||
|
ans[e.target.name].push(e.target.value);
|
||||||
|
} else {
|
||||||
|
ans[e.target.name] = ans[e.target.name].filter((v) => v !== e.target.value);
|
||||||
|
}
|
||||||
|
console.log(ans);
|
||||||
|
});
|
||||||
$('input[type="submit"]').on('click', (e) => {
|
$('input[type="submit"]').on('click', (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
request
|
request
|
||||||
|
|||||||
Reference in new issue
Block a user