judgels
judgels copied to clipboard
Support editing clarification answer
Won't be supporting editing clarification for now, as it will be confusing for contestants.
I agree that sometimes this can be confusing for contestants, but it is still a good-to-have feature, and leave the discretion to the SC whether they want to update the answer. In onsite contests, SC has the option to notify a single contestant if needed, such as point changes in case of rejudging, or necessary clarification answer change. This is actually being done in IOI.
Even if there is no way to notify the contestant, it is [arguably] better to change an obviously wrong and misleading answer to a clarification rather than leaving it wrong until the end of the contest.
Thus, reopening this issue for tracking and/or further discussion.
OK.
Possible Implementation
In the GET /api/v2/contest-web/{contestJid}/config
endpoint, we have clarificationCount
field that indicates the number of answered clarifications. This count is used by the client to determine whether to show an alert. See:
https://github.com/ia-toki/judgels/blob/f9dda1b046989eef2b78c794c31c75e5b9697007/judgels-client/src/routes/contests/contests/single/components/ContestClarificationsWidget/ContestClarificationsWidget.jsx#L25
A possible approach is to replace this field with another, e.g. lastClarificationTime
, to account for edited clarifications. When the the timestamp differs from the last timestamp, we show the alert.
Then, in the client, we can show edited clarification in red (danger) background:
To indicate in the database that an answer is edited, we can add another column. Or, alternatively, we can have a convention that if the answer starts with EDIT:
, it means that the answer has been edited.