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

convert created/started times to arrays to keep track of proofreader time #5

Open
dxenes1 opened this issue Oct 18, 2021 · 1 comment
Assignees

Comments

@dxenes1
Copy link
Collaborator

dxenes1 commented Oct 18, 2021

No description provided.

@dxenes1
Copy link
Collaborator Author

dxenes1 commented Oct 21, 2021

Currently for tasks we keep track of

  • when a task is created, attribute created
  • when a task is opened, attribute opened
  • when a task if closed, attribute closed

However, if a proofreader starts a task and steps away, there is no way for us in the backend to store the information of what time was actually spent proofreading versus paused, afk, etc.

Theres a couple of ways to get around this, for now one idea is to have a duration attribute added Task schema that is a strictly positive counter of how many seconds a proofreader has spent on a task.

This is how it would work:

  1. Task is created. duration is set to 0 by default.
  2. Task is opened. open time is recorded (this is already built). In the frontend django app, we use a cookie to keep track of the user session. Here we have multiple cases:

Case 1: task is completed in one sitting:
the frontend sends a PATCH request to the completed task ID that adds the current duration with the session cookie time delta. duration = duration + session.time. The task is marked as closed. No additions to duration can happen after a task is closed.

Case 2. task is not complete (user pauses or exits)
the frontend sends a PATCH request to the unfinished task ID that adds the current duration with the session cookie time delta. duration = duration + session.time. Since the task is open still, more additions to duration can happen.

Capability to build out:

  • add duration attribute, Number type, default to 0.
  • add a patch function for duration in the url tasks/{task_id}/duration/ that adds the request response to the current duration and updates it in the MongoDB doc

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

No branches or pull requests

2 participants