Examples of ISIXmlSection


Examples of org.cast.isi.ISIXmlSection

    UserModel mUser = new UserModel(ISISession.get().getUser());
    IModel<User> mTargetUser = ISISession.get().getTargetUserModel();
    boolean teacher = mUser.getObject().getRole().equals(Role.TEACHER);

    ISIXmlSection currentPage = (ISIXmlSection) mSection.getObject(); // FIXME: XmlSectionModel should be genericized to fix this and similar hacks
    ISIXmlSection currentSection = currentPage.getSectionAncestor(); // May be itself
   
    add(new PageLinkPanel("pageLinkPanel", new XmlSectionModel(currentSection), mSection));

    // Previous & Next Links
    int currentPageNum = ISIApplication.get().getStudentContent().getLabelIndex(ISIXmlSection.SectionType.PAGE, currentPage);
    add(new PageNumberLink("previousPage", currentPageNum-1));
    add(new PageNumberLink("nextPage", currentPageNum+1));

    add(new Label("sectionTitle", currentSection.getTitle()));   

    // If this is a student then add the checkbox for a student.  If this is a teacher then add the checkbox for the teacher
    if (!teacher) {
    // Section Complete Toggle Icon
      SectionCompleteToggleLink toggle = new StudentSectionCompleteToggleImageLink("sectionCompleteToggle", new XmlSectionModel(currentSection)) {
View Full Code Here

Examples of org.cast.isi.ISIXmlSection

  }

  protected WebMarkupContainer makePromptContainer(String newChildId, ISIPrompt prompt) {
    WebMarkupContainer rvPromptList = new WebMarkupContainer(newChildId);
   
    ISIXmlSection section = getSection(prompt);
    rvPromptList.add(new Label("responseHeader", section.getCrumbTrailAsString(1, 1)));
     
    // Prompt Icon
    rvPromptList.add(ISIApplication.get().iconFor(section.getSectionAncestor()));
   
    // Add the title and link to the page where this note is located
    BookmarkablePageLink<ISIStandardPage> link = new SectionLinkFactory().linkToPage("contentLink", section);
    link.add(new Label("contentLinkTitle", section.getTitle()));
    rvPromptList.add(link);
    List<ISIResponse> responses = getResponsesFor(prompt);

    // Show the score
    rvPromptList.add(new StudentScorePanel("responseScore", getModels(responses)));
View Full Code Here

Examples of org.cast.isi.ISIXmlSection

    if (location.equals(getLocation()))
      target.addComponent(this);
  }
 
  public String getLocation() {
    ISIXmlSection sectionAncestor = loc.getSection().getSectionAncestor();
    return sectionAncestor.getContentLoc().getLocation();
  }
View Full Code Here

Examples of org.cast.isi.ISIXmlSection

    User user = getUser();
    return (user != null) && user.getRole().subsumes(Role.TEACHER);
  }

  private boolean isCompleteAndLocked() {
    ISIXmlSection section = loc.getSection();
    String location = getLocation();
    return section.isLockResponse() && isComplete(location, getUser());
  }
View Full Code Here

Examples of org.cast.isi.ISIXmlSection

    IModel<List<ISIResponse>> responseList = responseService.getAllNotebookResponsesByStudent(ISISession.get().getTargetUserModel())
    responseMap = new TreeMap<ISIPrompt, List<ISIResponse>>();

    // Loop through the responses.  Group them by prompt, starting with the response added
    // to the notebook most recently.
    ISIXmlSection currentChapterSection = currentChapterLoc.getSection();
    for (ISIResponse r : responseList.getObject()) {

      // check if the response is a child of the current chapter, if so add it to the response map
      ISIPrompt prompt = (ISIPrompt) r.getPrompt();
      ISIXmlSection promptSection = new ContentLoc(prompt.getContentElement().getContentLocation()).getSection();
     
      if (promptSection != null) {
        if (currentChapterSection.isAncestorOf(promptSection)) {
          if (responseMap.containsKey(r.getPrompt()))
            responseMap.get(r.getPrompt()).add(r);
View Full Code Here

Examples of org.cast.isi.ISIXmlSection

 
  /* (non-Javadoc)
   * @see org.cast.isi.service.ISectionService#setCompleted(org.cast.cwm.data.User, org.cast.isi.data.ContentLoc, boolean)
   */
  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

Examples of org.cast.isi.ISIXmlSection

 
  /* (non-Javadoc)
   * @see org.cast.isi.service.ISectionService#adjustMessageCount(org.cast.cwm.data.User, org.cast.isi.data.ContentLoc, org.cast.cwm.data.Role, int)
   */
  public void adjustMessageCount (User student, ContentLoc loc, Role role, int amount) {
    ISIXmlSection sec = loc.getSection().getSectionAncestor();
    if (sec == null) {
      throw new IllegalArgumentException("Content Location not valid");
    }
    Session s = Databinder.getHibernateSession();
    SectionStatus stat = getSectionStatus(student, sec);
View Full Code Here

Examples of org.cast.isi.ISIXmlSection

 
  /* (non-Javadoc)
   * @see org.cast.isi.service.ISectionService#setReviewed(org.cast.cwm.data.User, org.cast.isi.data.ContentLoc, boolean)
   */
  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");
View Full Code Here

Examples of org.cast.isi.ISIXmlSection

 
  /* (non-Javadoc)
   * @see org.cast.isi.service.ISectionService#toggleReviewed(org.cast.cwm.data.User, org.cast.isi.data.ContentLoc)
   */
  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");
View Full Code Here

Examples of org.cast.isi.ISIXmlSection

    eventService.saveEvent("section:" + (stat.getReviewed() ? "reviewed" : "not reviewed"), null, loc.getLocation());
    return stat;
  }

  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");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.