コード例 #1
0
  // ----------------------------------------------------------
  protected void beforeAppendToResponse(WOResponse response, WOContext context) {
    log.debug("appendToResponse()");

    subStats = new HashMap<AssignmentOffering, Submission.CumulativeStats>();
    offerings.setObjectArray(assignmentOfferings(courseOfferings()));
    if (log.isDebugEnabled()) {
      log.debug("assignment offerings:");
      for (AssignmentOffering ao : offerings.allObjects()) {
        log.debug("\t" + ao);
      }
    }

    NSMutableArray<Submission> staffSubs = new NSMutableArray<Submission>();
    NSArray<User> admins = User.administrators(localContext());

    for (AssignmentOffering ao : offerings.displayedObjects()) {
      // Stuff the index variable into the public key so the group/stats
      // methods will work for us
      assignmentOffering = ao;
      NSArray<UserSubmissionPair> subs =
          Submission.submissionsForGrading(
              localContext(),
              ao,
              true, // omitPartners
              omitStaff,
              studentStats());
      userGroup().setObjectArray(subs);

      @SuppressWarnings("unchecked")
      NSArray<User> staff =
          ERXArrayUtilities.arrayByAddingObjectsFromArrayWithoutDuplicates(
              ao.courseOffering().staff(), admins);
      staffSubs.addAll(
          extractSubmissions(
              Submission.submissionsForGrading(
                  localContext(),
                  ao,
                  true, // omitPartners
                  staff,
                  null)));
    }

    staffSubmissionGroup.setObjectArray(staffSubs);

    selectedUserSubmissionForPickerDialog = null;
    allUserSubmissionsForNavigationForPickerDialog = null;

    super.beforeAppendToResponse(response, context);
  }
コード例 #2
0
  // ----------------------------------------------------------
  public WOComponent repartner() {
    for (UserSubmissionPair pair : userGroup().allObjects()) {
      Submission sub = pair.submission();

      if (sub != null && sub.result() != null) {
        for (Submission psub : sub.result().submissions()) {
          if (psub != sub
              && psub.assignmentOffering().assignment() != sub.assignmentOffering().assignment()) {
            log.warn(
                "found partner submission "
                    + psub.user()
                    + " #"
                    + psub.submitNumber()
                    + "\non incorrect assignment offering "
                    + psub.assignmentOffering());

            NSArray<AssignmentOffering> partnerOfferings =
                AssignmentOffering.objectsMatchingQualifier(
                    localContext(),
                    AssignmentOffering.courseOffering
                        .dot(CourseOffering.course)
                        .eq(sub.assignmentOffering().courseOffering().course())
                        .and(
                            AssignmentOffering.courseOffering
                                .dot(CourseOffering.students)
                                .eq(psub.user()))
                        .and(
                            AssignmentOffering.assignment.eq(
                                sub.assignmentOffering().assignment())));
            if (partnerOfferings.count() == 0) {
              log.error(
                  "Cannot locate correct assignment "
                      + "offering for partner"
                      + psub.user()
                      + " #"
                      + psub.submitNumber()
                      + "\non incorrect assignment offering "
                      + psub.assignmentOffering());
            } else {
              if (partnerOfferings.count() > 1) {
                log.warn(
                    "Multiple possible offerings for "
                        + "partner "
                        + psub.user()
                        + " #"
                        + psub.submitNumber()
                        + "\non incorrect assignment offering "
                        + psub.assignmentOffering());
                for (AssignmentOffering ao : partnerOfferings) {
                  log.warn("\t" + ao);
                }
              }

              psub.setAssignmentOfferingRelationship(partnerOfferings.get(0));
            }
          }
        }
      }
    }
    applyLocalChanges();
    return null;
  }
コード例 #3
0
 // ----------------------------------------------------------
 public String markCompleteStatusIndicatorId() {
   return idFor.get("markCompleteStatusIndicator_" + assignmentOffering.id());
 }
コード例 #4
0
 // ----------------------------------------------------------
 public String tableId() {
   return idFor.get("submissionsTable_" + assignmentOffering.id());
 }