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.
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:
gate-teamware/frontend/src/components/AnnotationRenderer.vue
Line 337 in 5e7b5c4
The explanation boxes are hidden if the
annotationDatavalue for this field is JavaScriptnull, but not if the value is JavaScriptundefined(i.e. the key is not present at all in theannotationData). We should check forundefinedas well asnull.We specifically should not rely on the standard JS definition of "falsy", since
falsemay 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.