mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
ui: fix objective radiobox loadAns (#792)
This commit is contained in:
1 parent
f04b55d69b
commit
45600eafcb
1 file changed
+4
-2
@@ -254,11 +254,13 @@ const page = new NamedPage(['problem_detail', 'contest_detail_problem', 'homewor
|
||||
for (const [id, val] of Object.entries(ans)) {
|
||||
if (Array.isArray(val)) {
|
||||
for (const v of val) {
|
||||
$(`.objective_${id} input[value=${v}]`).prop('checked', true);
|
||||
if (val.length === 1
|
||||
&& val.charCodeAt(0) >= 65 && val.charCodeAt(0) <= 90) $(`.objective_${id} input[value=${v}]`).prop('checked', true);
|
||||
}
|
||||
}
|
||||
$(`.objective_${id} input[type=text], .objective_${id} textarea`).val(val);
|
||||
$(`.objective_${id}.radiobox [value="${val}"]`).prop('checked', true);
|
||||
if (val.length === 1
|
||||
&& val.charCodeAt(0) >= 65 && val.charCodeAt(0) <= 90) $(`.objective_${id}.radiobox [value="${val}"]`).prop('checked', true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user