Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ianroberts opened this issue Feb 5, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@ianroberts
Copy link
Member

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.

@ianroberts ianroberts added the bug Something isn't working label Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant