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

"Number of annotations" for a user in a project includes rejected/timed out #408

Open
ianroberts opened this issue Apr 2, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@ianroberts
Copy link
Member

Describe the bug

@property
def num_annotations(self):
"""Number of annotations completed by this annotator in this project"""
count = 0
for d in self.project.documents.filter(doc_type=DocumentType.ANNOTATION):
count += d.annotations.filter(user=self.annotator).count()
return count

The comment on this property (of the AnnotatorProject join-table class) suggests that it is supposed to count the number of completed annotations for the given user on the given project, but it actually counts all Annotation objects in the project that reference the user, including those that are rejected, timed-out or pending. Since a timed-out document can be issued to the same user again later in their annotation cycle, this can lead to the situation where the UI suggests the user has annotated more documents than are available in the project:

Screenshot 2024-04-02 at 17 57 30

Expected behavior

The total should only count completed documents (or possibly completed and rejected), not timed out or pending (in progress).

@ianroberts ianroberts added the bug Something isn't working label Apr 2, 2024
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