// Differs from superclass version in that it may omit the panel (if no student selected),
  // and will create a READ-ONLY tagging panel to view student's tags.
  protected void addTaggingPanel() {
    if (showXmlContent) {
      WebMarkupContainer tagBox = new WebMarkupContainer("tagBox");
      add(tagBox);
      Boolean toggleState =
          userPreferenceService.getUserPreferenceBoolean(
              ISISession.get().getUserModel(), "tagToggle");
      if (toggleState != null) {
        tagBox.add(new ClassAttributeModifier("open", !toggleState));
      }
      tagBox.setVisible(ISIApplication.get().isTagsOn());

      StateSavingCollapseBoxBehavior behavior =
          new StateSavingCollapseBoxBehavior("tagToggle", getPageName(), "tagToggle");
      tagBox.add(new WebMarkupContainer("tagBoxToggle").add(behavior));

      ContentElement ce = responseService.getOrCreateContentElement(loc).getObject();
      tagBox.add(
          new TagPanel(
              "tagPanel",
              ce,
              ISIApplication.get().getTagLinkBuilder(),
              ISISession.get().getStudentModel().getObject()));
    } else {
      add(
          new WebMarkupContainer("tagBox")
              .add(new WebMarkupContainer("tagBoxToggle"))
              .add(new WebMarkupContainer("tagPanel"))
              .setVisible(false));
    }
  }
 public static SectionIconFactory getIconFactory(boolean teacher) {
   IModel<User> targetUserModel = ISISession.get().getTargetUserModel();
   if (teacher) {
     String type = ISIApplication.get().getNavbarSectionIconsTeacher();
     if (ICON_TYPE_STATUS.equals(type)) {
       return new TeacherStatusSectionIconFactory(targetUserModel);
     } else if (ICON_TYPE_CLASS.equals(type)) {
       return new ClassSectionIconFactory();
     } else {
       return new NullSectionIconFactory();
     }
   } else {
     String type = ISIApplication.get().getNavbarSectionIconsStudent();
     if (ICON_TYPE_STATUS.equals(type)) {
       return new StudentStatusSectionIconFactory(targetUserModel);
     } else if (ICON_TYPE_CLASS.equals(type)) {
       return new ClassSectionIconFactory();
     } else {
       return new NullSectionIconFactory();
     }
   }
 }
  @SuppressWarnings("static-access")
  @Override
  protected void addQuestionsPanel() {
    StateSavingCollapseBoxBorder questionBox =
        new StateSavingCollapseBoxBorder("questionBox", "questionToggle", null, getPageName());
    add(questionBox);
    questionBox.setVisible(ISIApplication.get().isMyQuestionsOn() && (showXmlContent));
    questionContainer = new WebMarkupContainer("questionContainer");
    questionContainer.setOutputMarkupId(true);
    questionBox.add(questionContainer);
    PopupSettings questionPopupSettings = ISIApplication.get().questionPopupSettings;
    questionList =
        new QuestionListView(
            "question",
            QuestionPopup.class,
            questionPopupSettings,
            null,
            (ISISession.get().getTargetUserModel().getObject().getId()));
    questionContainer.add(questionList);
    questionContainer.add(new WebMarkupContainer("qButtonVisible").setVisible(false));

    // teachers can't add new Qs
    add(new WebMarkupContainer("newQuestion").setVisible(false));
  }
 public TeacherReading(final PageParameters parameters) {
   // If there is no student model, tell super constructor that we won't be displaying XML content.
   super(parameters, ISISession.get().getStudentModel() != null);
 }