Skip to content

Training documents show "incorrect" explanation for every field on a blank form #417

@ianroberts

Description

@ianroberts

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions