Uploaded image for project: 'Sakai'
  1. Sakai
  2. SAK-40579

Assignments List (Student): The UI can crash when findSubmissionForUser returns more than one result

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: RESOLVED
    • Priority: Blocker
    • Resolution: Incorporated
    • Affects Version/s: 12.3, 19.0
    • Fix Version/s: None
    • Component/s: Assignments
    • Labels:
      None
    • Test Plan:
      Hide

      Please add a Test Plan here.

      Show
      Please add a Test Plan here.

      Description

      One student reported this error in Assignments, this only happens in a particular context aka site, the interface is broken for that particular student:

      I've checked the method and looks good to me:

      @Override
      public AssignmentSubmission findSubmissionForUser(String assignmentId, String userId) {
      return (AssignmentSubmission) sessionFactory.getCurrentSession().createCriteria(AssignmentSubmission.class)
      .add(Restrictions.eq("assignment.id", assignmentId))
      .createAlias("submitters", "s")
      .add(Restrictions.eq("s.submitter", userId))
      .uniqueResult();
      }

      I've also executed the queries in the database and I'm only able to find one result for that student, looks really weird that throws a non-unique error:

      SELECT * FROM asn_submission_submitter where submitter = 'xxxxxxxxx' and submission_id in (SELECT submission_id FROM asn_submission where assignment_id = 'yyyyyyyyyyyyyy');

      This query returns only one row, the submission that the student submitted, I don't have a single clue why findSubmissionForUser is failing for this user.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  ern Earle R Nietzel
                  Reporter:
                  farreri Miguel Pellicer
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  5 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Git Source Code