Package org.cast.isi.data

Examples of org.cast.isi.data.SectionStatus


  /* (non-Javadoc)
   * @see org.cast.isi.service.ISectionService#sectionReviewable(org.cast.cwm.data.User, org.cast.isi.ISIXmlSection)
   */
  public boolean sectionReviewable (User person, ISIXmlSection xs) {
    SectionStatus stat = getSectionStatus(person, xs);
    // teacher can only review if the sectionstatus exists, the student has completed
    // and there are no outstanding feedback messages for this section
    if (stat == null || stat.getCompleted() == null || stat.getCompleted() == false
        || stat.getUnreadTeacherMessages() > 0) {
      return false;
    }
    return true;
  }
View Full Code Here


   */
  public SectionStatus setReviewed (User person, ContentLoc loc, boolean reviewed) {
    ISIXmlSection sec = loc.getSection().getSectionAncestor();
    if (sec == null)
      return null;
    SectionStatus stat = getSectionStatus(person, sec);
    if (stat == null || !stat.getCompleted()) {
      throw new IllegalStateException("Should not be able to adjust a review on an uncomplete or non-existant section status");
    } else {
      stat.setReviewed(reviewed);
    }
    cwmService.flushChanges();
    eventService.saveEvent("section:" + (reviewed ? "reviewed" : "not reviewed"), null, loc.getLocation());
    return stat;
  }
View Full Code Here

   */
  public SectionStatus toggleReviewed (User person, ContentLoc loc) {
    ISIXmlSection sec = loc.getSection().getSectionAncestor();
    if (sec == null)
      return null;
    SectionStatus stat = getSectionStatus(person, sec);
    if (stat == null || !stat.getCompleted()) {
      throw new IllegalStateException("Should not be able to adjust a review on an uncomplete or non-existant section status");
    } else {
      boolean reviewed = stat.getReviewed();
      stat.setReviewed(!reviewed);
    }
    cwmService.flushChanges();
    eventService.saveEvent("section:" + (stat.getReviewed() ? "reviewed" : "not reviewed"), null, loc.getLocation());
    return stat;
  }
View Full Code Here

  public SectionStatus setLocked(User person, ContentLoc loc, boolean locked) {
    ISIXmlSection sec = loc.getSection().getSectionAncestor();
    if (sec == null)
      return null;
    SectionStatus stat = getSectionStatus(person, sec);
    if (stat == null || !stat.getCompleted()) {
      throw new IllegalStateException("Should not be able to adjust a lock on an uncomplete or non-existant section status");
    } else {
      stat.setLocked(locked);
    }
    cwmService.flushChanges();
    return stat;
  }
View Full Code Here

        this.targetUserModel = targetUserModel;
      }

      @Override
      public Component getIconFor(ISIXmlSection section) {
        SectionStatus stat = sectionService.getSectionStatus(targetUserModel.getObject(), section);
        return ISIApplication.get().studentStatusIconFor(section, stat);         
      }
View Full Code Here

        this.targetUserModel = targetUserModel;
      }

      @Override
      public Component getIconFor(ISIXmlSection section) {
        SectionStatus stat = sectionService.getSectionStatus(targetUserModel.getObject(), section);
        return ISIApplication.get().teacherStatusIconFor(section, stat);         
      }
View Full Code Here

    User user = targetUserModel.getObject();
    return !(prompt.isDelayFeedback() && needsReview(prompt, user));
  }
 
  private boolean needsReview(ISIPrompt prompt, User user) {
    SectionStatus sectionStatus = sectionService.getSectionStatus(user, prompt.getSection());
    return (sectionStatus == null) || !sectionStatus.getReviewed();
  }
View Full Code Here

    when(sectionXmlSection.getContentLoc()).thenReturn(sectionContentLoc);
    sectionSectionXmlModel = new Model(sectionXmlSection);

    when(pageXmlSection.getSectionAncestor()).thenReturn(sectionXmlSection);
   
    sectionStatus = new SectionStatus();
    sectionStatus.setCompleted(false);
    sectionStatus.setReviewed(false);
    sectionStatus.setLocked(false);
    setupInjectedServices();
View Full Code Here

TOP

Related Classes of org.cast.isi.data.SectionStatus

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.