-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Describe the bug
In training mode, when an annotator first sees a training document, before they've clicked on anything, every field shows the "incorrect" marker with the explanation box.
Expected behavior
A field should only be marked as incorrect once the user has actively selected a wrong option, not before they've selected anything at all.
Additional context
The issue lies in this line:
| } else if ((this.document_type == DocumentType.Training) && (this.annotationData[elemConfig.name] !== null)) { |
The explanation boxes are hidden if the annotationData value for this field is JavaScript null, but not if the value is JavaScript undefined (i.e. the key is not present at all in the annotationData). We should check for undefined as well as null.
We specifically should not rely on the standard JS definition of "falsy", since false may be a correct answer for a two-valued radio button set.
Workaround
My current workaround is to enable pre-annotation for the project and then set a pre-annotation value on the training documents that explicitly sets every field value to null.