Package org.cast.isi.data

Examples of org.cast.isi.data.SectionStatus


      return false;
    return status.getCompleted();
  }
 
  protected boolean isReviewed() {
    SectionStatus status = sectionService.getSectionStatus(getUser(), sectionContentLocation);     
    if (status == null)
      return false;
    return status.getReviewed();
  }
View Full Code Here


                Link<ISIXmlSection> link = new Link<ISIXmlSection>("link") {
                  private static final long serialVersionUID = 1L;

                  @Override
                  public void onClick() {
                    SectionStatus stat = getUserSectionStatus(student, sec);
                    ISIXmlSection targetSection = new SectionLinkFactory().sectionLinkDest(sec);
                    Class<? extends ISIStandardPage> pageType = ISIApplication.get().getReadingPageClass();
                    ISISession.get().setStudentModel(new HibernateObjectModel<User>(student));
                    PageParameters param = new PageParameters();

                    // TODO: This first statement is a hack.  For some reason, getUnreadStudentMessages()
                    // is able to be out of sync with FeedbackMessage.isUnread() flag and is displaying
                    // the wrong icon on the page.  See ISIApplication.statusIconFor() as well.
                    String s = null;
                    if (stat != null && stat.getUnreadStudentMessages() > 0 && (s = responseService.locationOfFirstUnreadMessage(student, sec)) != null) {
                      param.put("loc", s);
                    } else if (stat != null && stat.getCompleted() && !stat.getReviewed()){
                      ISIXmlSection section = targetSection.getSectionAncestor().firstPageWithResponseGroup();
                      if (section != null)
                        param.put("loc", (new ContentLoc(section).getLocation()));
                      else
                        throw new IllegalStateException("Section without response areas marked Ready For Review - should automatically be reviewed.");
View Full Code Here

      }     
    };
  }

  protected SectionStatus getUserSectionStatus(User student, ISIXmlSection section) {
    SectionStatus status = mStatusMap.getObject().get(student.getId())!=null ? mStatusMap.getObject().get(student.getId()).get(new ContentLoc(section).getLocation()) : null;
    return status;
  }
View Full Code Here

    else
      return getStringResource("isi.sectionToggleLinks.instructions.markComplete","");
  }

  protected boolean isLocked() {
    SectionStatus status = sectionService.getSectionStatus(getUser(), sectionContentLocation);     
    if (status == null)
      return false;
    return status.getLocked();
  }
View Full Code Here

 
  /* (non-Javadoc)
   * @see org.cast.isi.service.ISectionService#sectionIsCompleted(org.cast.cwm.data.User, java.lang.String)
   */
  public boolean sectionIsCompleted (User person, String loc) {
    SectionStatus stat = getSectionStatus(person, loc);
    if (stat==null || !stat.getCompleted())
      return false;
    return true;
  }
View Full Code Here

 
  /* (non-Javadoc)
   * @see org.cast.isi.service.ISectionService#sectionIsCompleted(org.cast.cwm.data.User, org.cast.isi.ISIXmlSection)
   */
  public boolean sectionIsCompleted (User person, ISIXmlSection xs) {
    SectionStatus stat = getSectionStatus(person, xs);
    if (stat==null || !stat.getCompleted())
      return false;
    return true;
  }
View Full Code Here

  public SectionStatus setCompleted (User person, ContentLoc loc, boolean complete) {
    ISIXmlSection sec = loc.getSection().getSectionAncestor();
    if (sec == null)
      return null;
    Session s = Databinder.getHibernateSession();
    SectionStatus stat = getSectionStatus(person, sec);
    if (stat == null) {
      stat = new SectionStatus(person, new ContentLoc(sec).getLocation(), complete);
      s.save(stat);
    } else {
      stat.setCompleted(complete);
    }
    // If there are no response groups, automatically mark as Reviewed
    if (!sec.hasResponseGroup()) {
      stat.setReviewed(complete);
    }
    cwmService.flushChanges();
    eventService.saveEvent("section:" + (complete ? "done" : "not done"), null, loc.getLocation());
    return stat;
  }
View Full Code Here

    ISIXmlSection sec = loc.getSection().getSectionAncestor();
    if (sec == null) {
      throw new IllegalArgumentException("Content Location not valid");
    }
    Session s = Databinder.getHibernateSession();
    SectionStatus stat = getSectionStatus(student, sec);
    if (stat == null) {
      stat = new SectionStatus(student, new ContentLoc(sec).getLocation(), false);
      s.save(stat);
    }
    if (role.equals(Role.STUDENT))
      stat.setUnreadStudentMessages(stat.getUnreadStudentMessages() + amount);
    else
      stat.setUnreadTeacherMessages(stat.getUnreadTeacherMessages() + amount);
    cwmService.flushChanges();
  }
View Full Code Here

 
  /* (non-Javadoc)
   * @see org.cast.isi.service.ISectionService#sectionIsReviewed(org.cast.cwm.data.User, java.lang.String)
   */
  public boolean sectionIsReviewed (User person, String loc) {
    SectionStatus stat = getSectionStatus(person, loc);
    if (stat == null || !stat.getReviewed()) {
      return false;
    }
    return true;
  }
View Full Code Here

 
  /* (non-Javadoc)
   * @see org.cast.isi.service.ISectionService#sectionIsReviewed(org.cast.cwm.data.User, org.cast.isi.ISIXmlSection)
   */
  public boolean sectionIsReviewed (User person, ISIXmlSection xs) {
    SectionStatus stat = getSectionStatus(person, xs);
    if (stat == null || !stat.getReviewed()) {
      return false;
    }
    return true;
  }
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.