Examples of ISIXmlSection


Examples of org.cast.isi.ISIXmlSection

        return firstResponse.getScore();
      return null;
    }
   
    private boolean needsReview(ISIPrompt prompt, User user) {
      ISIXmlSection section = prompt.getSection();
      SectionStatus sectionStatus = sectionService.getSectionStatus(user, section);
      return (sectionStatus == null) || !sectionStatus.getReviewed();
    }
View Full Code Here

Examples of org.cast.isi.ISIXmlSection

    this();
    this.type = type;
  }
 
  public boolean isDelayFeedback() {
    ISIXmlSection section = getSection();
    return (section != null) && section.isDelayFeedback();
  }
View Full Code Here

Examples of org.cast.isi.ISIXmlSection

  }

  public DelayedFeedbackSingleSelectForm(String id, IModel<Prompt> mcPrompt,
      IModel<XmlSection> currentSectionModel) {
    super(id, mcPrompt);
    ISIXmlSection section = getIsiXmlSection(currentSectionModel);
    location = new ContentLoc(section.getSectionAncestor()).getLocation();
    lockResponse = (section != null) && section.isLockResponse();
  }
View Full Code Here

Examples of org.cast.isi.ISIXmlSection

    if (location.equals(getLocation()))
      target.addComponent(this);
  }
 
  private 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

    addOrReplace(new Label("instructions", getInstructions()));
    super.onBeforeRender();
  }

  private boolean isLastPageInSection() {
    ISIXmlSection section = getSection();
    return (section != null) && (section.isLastPageInSection());
  }
View Full Code Here

Examples of org.cast.isi.ISIXmlSection

 
  private static final long serialVersionUID = 1L;

  public PageNumberLink(String id, int targetPageNum) {
    super(id, ISIApplication.get().getReadingPageClass());
    ISIXmlSection target = ISIApplication.get().getPageNum(targetPageNum);
    if (target!=null)
      setParameter("loc", target.getContentLoc().getLocation());
    else {
      setEnabled(false);
      this.add(new ClassAttributeModifier("off"));
    }
  }
View Full Code Here

Examples of org.cast.isi.ISIXmlSection

    add(chapterRepeater);

    for (XmlDocument doc : ISIApplication.get().getStudentContent()) { // For each XML Document
      for (XmlSection rs : doc.getTocSection().getChildren()) { // For each chapter in the document; tends to be only one.

        final ISIXmlSection rootSection = (ISIXmlSection) rs;
        WebMarkupContainer rootSectionContainer = new WebMarkupContainer(chapterRepeater.newChildId());
        chapterRepeater.add(rootSectionContainer);

        rootSectionContainer.add(new Label("title", rs.getTitle()));
        rootSectionContainer.add(new Label("subtitle", rootSection.getSubTitle()));

        if (rootSection.equals(currentRootSection))
          rootSectionContainer.add(new ClassAttributeModifier("open"));

        WebMarkupContainer table = new WebMarkupContainer("periodTable");
        rootSectionContainer.add(table);

        table.add(new Label("periodName", new PropertyModel<String>(ISISession.get().getCurrentPeriodModel(), "name")));

        // Add non-section children as Super Section Labels
        // TODO: Lame hack for differences between IQWST/FS
        // TODO: Have TeacherToc create a custom repeater that can be extended by subclasses?
        RepeatingView superSectionRepeater = new RepeatingView("superSectionRepeater");
        for (XmlSection rc : rootSection.getChildren()) {
          ISIXmlSection rootChild = (ISIXmlSection) rc;
          WebMarkupContainer superSectionContainer = new WebMarkupContainer(superSectionRepeater.newChildId());
          superSectionRepeater.add(superSectionContainer);
          if (rootChild.isSuperSection()) {
            superSectionContainer.add(new Label("superSectionTitle", rootChild.getTitle()));
            if (rootChild.getChildren().size() > 1) {
              superSectionContainer.add(new SimpleAttributeModifier("colspan", String.valueOf(rootChild.getChildren().size())));
            }
          } else {
            superSectionContainer.add(new EmptyPanel("superSectionTitle"));
          }
        }
        table.add(superSectionRepeater);
       
        // List Sections across the top of the table.
        table.add(new ListView<ISIXmlSection>("sectionList", rootSection.getSectionChildren()) {
          private static final long serialVersionUID = 1L;
          @Override
          protected void populateItem(ListItem<ISIXmlSection> item) {
            ISIXmlSection sec = item.getModelObject();
            BookmarkablePageLink<ISIStandardPage> link = new SectionLinkFactory().linkToPage("sectionLink", sec);
            item.add(link);
            link.add(ISIApplication.get().iconFor(sec));
          }
        });

        // List students and their appropriate status messages
        // get the list of students in this period
        UserCriteriaBuilder c = new UserCriteriaBuilder();
        c.setRole(Role.STUDENT);
        c.setPeriod(ISISession.get().getCurrentPeriodModel());

        // add the students to the table
        table.add(new ListView<User>("student", new UserListModel(c)) {
          private static final long serialVersionUID = 1L;

          // for each student add the following fields
          @Override
          protected void populateItem(ListItem<User> userItem) {
            final User student = userItem.getModelObject();
            userItem.add(new StudentFlagPanel("flagPanel", student, mFlagMap.getObject()));
            userItem.add(new Label("studentName", student.getSortName()));

            // The cells in the table are status indications
            userItem.add(new ListView<ISIXmlSection>("statusCell", rootSection.getSectionChildren()) {
              private static final long serialVersionUID = 1L;

              @Override
              protected void populateItem(ListItem<ISIXmlSection> sectionItem) {
                final ISIXmlSection sec = sectionItem.getModelObject();

                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.");
                    } else {
View Full Code Here

Examples of org.cast.isi.ISIXmlSection

   * @return
   */
  protected ISIXmlSection getCurrentSection() {
    if (loc == null)
      loc = ISIApplication.get().getBookmarkLoc();
    ISIXmlSection currentRootSection = null;
    ISIXmlSection currentPage = (loc == null ? null : loc.getSection());
    if (currentPage != null)
      currentRootSection = (ISIXmlSection) currentPage.getXmlDocument().getTocSection().getChild(0); // "level1"
    return currentRootSection;
  }
View Full Code Here

Examples of org.cast.isi.ISIXmlSection

    if (mCurrentPage == null) {
      setModel(new XmlSectionModel(ISIApplication.get().getPageNum(1)));
    }

    ISIXmlSection rootSection = ISIXmlSection.getRootSection(getCurrentSection());
 
    // Current Section's Page Repeater with prev/next
    PageNavPanel pageNavPanelTop = new PageNavPanel("pageNavPanelTop", getModel());
    add(pageNavPanelTop);
   
   
    /*********
     * Other *
     *********/
    // Jump to a certain page
    add(new QuickFlipForm("quickFlipForm", true));
   
    // Chapter Title (xml level 1)
    add(new Label("title", rootSection.getTitle()));   
  }
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.