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

fix(classifier): set started_at timestamp when annotation starts #7216

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

eatyourgreens
Copy link
Contributor

  • add metadata._inProgress to classifications, and set it to true when a volunteer first updates an annotation.
  • set classification.metadata.started_at to the current time when metadata._inProgress changes from false to true.

Staging branch URL: https://pr-{NUMBER}.pfe-preview.zooniverse.org

Fixes #7215.

This is zooniverse/front-end-monorepo#6449 adapted for PFE's redux store. It updates classification.metadata.started_at the first time that you interact with a subject, eg. by answering a question or drawing a mark from a drawing task.

Required Manual Testing

  • Does the non-logged in home page render correctly?
  • Does the logged in home page render correctly?
  • Does the projects page render correctly?
  • Can you load project home pages?
  • Can you load the classification page?
  • Can you submit a classification?
  • Does talk load correctly?
  • Can you post a talk comment?

Review Checklist

  • Does it work in all major browsers: Firefox, Chrome, Edge, Safari?
  • Does it work on mobile?
  • Can you npm ci and app works as expected?
  • If the component is in coffeescript, is it converted to ES6? Is it free of eslint errors? Is the conversion its own commit?
  • Are the tests passing locally and on GitHub Actions?

Optional

@coveralls
Copy link

coveralls commented Nov 8, 2024

Coverage Status

coverage: 56.652% (-0.007%) from 56.659%
when pulling 89b1650 on eatyourgreens:classification-started-at
into 131d101 on zooniverse:master.

- add `metadata._inProgress` to classifications, and set it to true when a volunteer first updates an annotation.
- set `classification.metadata.started_at` to the current time when `metadata._inProgress` is set to true.
@@ -51,6 +51,7 @@ function createNewClassification(project, workflow, subject, goldStandardMode, l
// Delete the metadata key because we don't want volunteers to see it.
subject.update({ 'metadata.intervention': undefined });
const newMetadata = {
_inProgress: false,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The underscore here ensures that the Panoptes JS Client will automatically remove this property when it saves the classification to the API.
https://github.com/zooniverse/panoptes-javascript-client/blob/721b696dccecf86a35614244ab29d19d1a62c3b7/lib/json-api-client/model.js#L17-L38

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Classification started_at can be off by hours or days
3 participants