diff --git a/components/Timetable.tsx b/components/Timetable.tsx index 052ac14..7e29554 100644 --- a/components/Timetable.tsx +++ b/components/Timetable.tsx @@ -176,9 +176,10 @@ const Timetable = ({ if (openRecordMode) { for (const index in json) { const input = indexToElement[index]; - const td= indexToCell[index]; + const td = indexToCell[index]; if (json[index] !== user) { - td.innerHTML = json[index] + td.innerHTML = json[index]; + td.removeAttribute("bgcolor"); } else { input.checked = true; input.disabled = true; @@ -240,7 +241,9 @@ const Timetable = ({ for (const row of marks) { for (const input of row) { if (input === null) continue; - if (input.value !== "") { + if (input.checked) { + data.selections[input.name] = 1; + } else if (parseFloat(input.value)) { data.selections[input.name] = parseFloat(input.value); } }