turkle icon indicating copy to clipboard operation
turkle copied to clipboard

Should workers be able to work on expired assignments?

Open hltcoe-bot opened this issue 4 years ago • 5 comments

This shouldn't be possible for sites that have a cron job set up. For other sites, workers will be reminded of abandoned assignments past expiration and when they resume the assignment they see this:

image

There are a lot of options here...

Poster: Cash Costello id: 218

hltcoe-bot avatar Aug 07 '20 15:08 hltcoe-bot

The "Task Assignment has expired" message is generated by a jQuery.countdown timer. My original intent for the code was that it would inform users when a Task Assignment expired while they were working on the Task. While the cron job will delete expired TAs, without the countdown timer users won't know their TA has expired until they try to submit the Assignment.

I hadn't previously considered the case where someone would try to resume work on an expired TA. This could happen even with a cron job, if the task expires before the next cron job execution.

Adding logic to the task_assignment view to check for expired assignments should address this.

Poster: Craig Harman

hltcoe-bot avatar Aug 07 '20 15:08 hltcoe-bot

So you're saying we should reject people from working on expired assignments? Redirect them back to the index page?

Poster: Cash Costello

hltcoe-bot avatar Aug 07 '20 15:08 hltcoe-bot

Let's make a distinction between deleted TaskAssignments (where the cron job has deleted the TaskAssignment instance from the database, possibly while the user still is working on the Task in their browser) and expired TaskAssignments (where the TaskAssignment still exists in the database but expires_at has already passed).

The JavaScript timer was originally intended to warn users who were trying to work on deleted TaskAssignments.

If someone tries to submit an expired TaskAssignment, they should be allowed to do so, since in this case the TaskAssignment has not been reclaimed by someone else.

If someone tries to resume working on a Task Assignment when the expires_at time has already passed, I'd be inclined to allow them to do so and just set expires_at to be the current time plus Batch.allotted_assignment_time.

Am I missing any use cases?

Poster: Craig Harman

hltcoe-bot avatar Aug 07 '20 15:08 hltcoe-bot

I think those are the two possibilities. The only change to code here as described above is when a user views an expired task, we extend their timeout. This would happen in views.py

Poster: Cash Costello

hltcoe-bot avatar Aug 07 '20 15:08 hltcoe-bot

changed title from Should workers be able to work on expired assignments to Should workers be able to work on expired assignments{+?+}

Poster: Cash Costello

hltcoe-bot avatar Aug 07 '20 15:08 hltcoe-bot