One option is to do something like the "completed_at" timestamp; we may not
necessarily be concerned with the number of grades a workflow has received.
We could just stamp it and say "graded".

Concurrency would be less important at that point.


On Wed, Mar 26, 2014 at 10:12 AM, David Ormsbee <notifications@github.com>wrote:

> In apps/openassessment/assessment/peer_api.py:
>
> > -        timeout,
> > -        graded_by
> > -    )
> > -    return sub
> > +    try:
> > +        peer_workflows = list(PeerWorkflow.objects.raw(
> > +            "select pw.id, pw.submission_uuid "
> > +            "from assessment_peerworkflow pw "
> > +            "left join assessment_peerworkflowitem pwi "
> > +            "on pw.id=pwi.author_id "
> > +            "where pw.item_id=%s "
> > +            "and pw.course_id=%s "
> > +            "and pw.student_id<>%s "
> > +            "and pw.graded_count < %s "
> > +            "and pw.id not in (select pwi.author_id from assessment_peerworkflowitem pwi where pwi.scorer_id=%s) "
> > +            "and (pwi.scorer_id is NULL or pwi.assessment_id is not NULL or pwi.started_at > %s) "
>
> Ok, so my big concerns are unfounded. I do have a smaller concenr that the
> value of graded_count may become a source of trouble concurrency wise,
> leading to some inconsistencies. For instance, if two assessments are
> submitted at the same time, they might both see the current value of
> graded_count as 1, and both set it to 2 when they're finished. But that's
> relatively minor in the grand scheme of things and I wouldn't have held up
> this PR for it. Thank you.
>
> --
> Reply to this email directly or view it on GitHub<https://github.com/edx/edx-ora2/pull/208/files#r10977461>
> .
>