@Override
  public void setInSlot(Object slot, Widget content) {

    if (content == null) filterPanel.clear();

    if (slot == InvoiceListPresenter.SLOT_filters) {
      filterPanel.clear();
      filterPanel.add(content);
    } else {
      super.setInSlot(slot, content);
    }
  }
Exemplo n.º 2
0
 @Override
 public void setInSlot(Object slot, Widget content) {
   if (slot == HomePresenter.MENU_CONTENT_SLOT) {
     menuPanel.clear();
     if (content != null) {
       menuPanel.add(content);
     }
   } else if (slot == HomePresenter.MAIN_CONTENT_SLOT) {
     contentPanel.clear();
     if (content != null) {
       contentPanel.add(content);
     }
   } else {
     super.setInSlot(slot, content);
   }
 }
Exemplo n.º 3
0
  @Override
  public void displayUsers(Map<Integer, String> users) {
    usersList.clear();

    for (Integer userId : users.keySet()) {
      HTMLPanel panel = new HTMLPanel("");

      Anchor linkToEdit = new Anchor();

      linkToEdit.setText(users.get(userId));

      PlaceRequest placeToGo =
          new PlaceRequest.Builder()
              .nameToken(NameTokens.USER)
              .with(NameTokens.PARAM_ID, String.valueOf(userId))
              .build();
      linkToEdit.setHref("#" + tokenFormatter.toPlaceToken(placeToGo));

      Button deleteButton = new Button();
      deleteButton.setText("X");
      deleteButton.addClickHandler(clickEvent -> getUiHandlers().deleteUser(userId));

      panel.add(linkToEdit);
      panel.add(deleteButton);

      usersList.add(panel);
    }
  }
Exemplo n.º 4
0
 @Override
 public void show(Detail detail) {
   ImageResource res = detail.imageResource();
   if (res.getWidth() > IMG_MAX_WIDTH || res.getHeight() > IMG_MAX_HEIGHT) {
     setInSlot(
         DetailsPresenter.IMAGE,
         new FitImage(res.getSafeUri().asString(), IMG_MAX_WIDTH, IMG_MAX_HEIGHT));
   } else {
     setInSlot(DetailsPresenter.IMAGE, new Image(res));
   }
   main.clear();
   main.add(detail.main());
   side.clear();
   side.add(detail.side());
   title.setText(detail.title());
 }
 /**
  * This method is used to print scored questions data
  *
  * @param scoredQuestionsData
  */
 void setQuestionsPrintData(ArrayList<UserDataDo> scoredQuestionsData) {
   scoredPrintWidget.clear();
   final SortTable sortableTable = new SortTable();
   sortableTable.setStyleName(res.css().tableMain());
   sortableTable.getElement().setId("results");
   sortableTable.setBorderWidth(1);
   sortableTable.setCellPadding(4);
   sortableTable.setCellSpacing(1);
   sortableTable.addColumnHeader(i18n.GL3259(), 0);
   sortableTable.addColumnHeader(i18n.GL0308(), 1);
   sortableTable.addColumnHeader(i18n.GL2229(), 2);
   sortableTable.addColumnHeader(i18n.GL3269(), 3);
   sortableTable.addColumnHeader(i18n.GL2084(), 4);
   sortableTable.addColumnHeader(i18n.GL3261(), 5);
   sortableTable.getRowFormatter().addStyleName(0, res.css().tableHeader());
   // To add scored questions
   scoredQuestionHeading.setText(i18n.GL2282());
   scoredQuestionHeading.getElement().getStyle().setClear(Clear.BOTH);
   scoredQuestionHeading.getElement().getStyle().setPaddingTop(15, Unit.PX);
   scoredQuestionHeading.getElement().getStyle().setPaddingBottom(20, Unit.PX);
   scoredQuestionHeading.getElement().getStyle().setTextAlign(TextAlign.LEFT);
   printWidget.add(scoredQuestionHeading);
   scoredPrintWidget.add(sortableTable);
   scoredPrintWidget.getElement().getStyle().setPaddingTop(15, Unit.PX);
   if (scoredQuestionsData.size() != 0) {
     setSortedData(scoredQuestionsData, sortableTable, true);
   } else {
     Label erroeMsg = new Label();
     erroeMsg.setStyleName(res.css().displayMessageTextForScoredQuestions());
     erroeMsg.setText(i18n.GL3265());
     scoredPrintWidget.add(erroeMsg);
   }
   scoredPrintWidget.setVisible(false);
 }
 /**
  * This method is used to display scored data
  *
  * @param scoredQuestionsData
  */
 void setScoredQuestionsData(ArrayList<UserDataDo> scoredQuestionsData) {
   teacherScoredData.clear();
   final SortTable sortableTable = new SortTable();
   sortableTable.setStyleName(res.css().tableMain());
   sortableTable.getElement().setId("results");
   sortableTable.setBorderWidth(1);
   sortableTable.setCellPadding(4);
   sortableTable.setCellSpacing(1);
   sortableTable.setWidth("800");
   sortableTable.addColumnHeader(i18n.GL3259(), 0);
   sortableTable.addColumnHeader(i18n.GL0308(), 1);
   sortableTable.addColumnHeader(i18n.GL3276(), 2);
   sortableTable.addColumnHeader(i18n.GL3277(), 3);
   sortableTable.addColumnHeader(i18n.GL2084(), 4);
   sortableTable.addColumnHeader(i18n.GL3261(), 5);
   sortableTable.getRowFormatter().addStyleName(0, res.css().tableHeader());
   teacherScoredData.add(sortableTable);
   if (scoredQuestionsData.size() != 0) {
     setSortedData(scoredQuestionsData, sortableTable, false);
   } else {
     Label erroeMsg = new Label();
     erroeMsg.setStyleName(res.css().displayMessageTextForScoredQuestions());
     erroeMsg.setText(i18n.GL3265());
     teacherScoredData.add(erroeMsg);
   }
 }
Exemplo n.º 7
0
 @Override
 public void setInSlot(Object slot, IsWidget content) {
   if (slot == DetailsPresenter.IMAGE) {
     img.clear();
     img.add(content);
   }
 }
Exemplo n.º 8
0
 @Override
 public void setInSlot(Object slot, IsWidget content) {
   if (slot == DataSourcePresenter.TABLE_SLOT) {
     tblRow.clear();
     if (content != null) {
       tblRow.add(content);
     }
   } else {
     super.setInSlot(slot, content);
   }
 }
Exemplo n.º 9
0
  @Override
  protected void onAttach() {
    super.onAttach();
    Element label = chkMineOnly.getElement().getElementsByTagName("label").getItem(0);
    label.getStyle().setTop(14, Unit.PX);

    canCreateStory = hasPermission(PermissionName.STORIES_CAN_CREATE_CONTENT.name());
    panelLoadStories.clear();
    if (!canCreateStory) {
      panelCreateStory.addStyleName("hide");
    }
  }
Exemplo n.º 10
0
  public void showCollectionAddImageWidget() {
    getAddToShelfCollectionButton().setText(i18n.GL0590());
    successMessageLabelText.setText(i18n.GL0547());
    successMessageLabelText.getElement().setAttribute("alt", i18n.GL0547());
    successMessageLabelText.getElement().setAttribute("title", i18n.GL0547());
    addResourceInsteadLabelContainerInCollectionImage.clear();
    addResourceInsteadLabelContainerInCollectionImage.add(addResourceInsteadLabel);

    addResourceInsteadLabel.getElement().getStyle().clearMarginLeft();
    addResourceInsteadLabel.getElement().getStyle().clearMarginTop();
    collectionAddImageContainer.setVisible(true);
    collectionAddedSuccessMessageContainer.setVisible(false);
  }
Exemplo n.º 11
0
 @Override
 public void resetQuestionView() {
   openEndedQuestionText.setHTML("");
   hintsButton.setText(i18n.GL0667());
   hintsButton.getElement().setAttribute("alt", i18n.GL0667());
   hintsButton.getElement().setAttribute("title", i18n.GL0667());
   hintsButton.setStyleName(oeStyle.hintsActiveButton());
   explanaionButton.setStyleName(oeStyle.hintsActiveButton());
   explanationContainer.removeStyleName(oeStyle.explanationTextBorder());
   hintsContainer.clear();
   explanationContainer.clear();
   clearAnswerOptionsContainer();
   openEndedQuestionImage.getElement().removeAttribute("src");
 }
  /** Clear form editor with all data. */
  public void clear() {
    // clear form panel
    headersFormPanel.clear();
    // clear form inputs list
    rows.clear();
    // clear current value
    updateHeadersRawData("");
    // clear raw input
    headersRawInput.setValue(null, true);

    if (headersCodeMirror != null) {
      headersCodeMirror.setValue("");
    }
    loadCodeMirrorForHeaders();
  }
 public ProfileUserTagsResourceView(
     String tagId,
     String labelName,
     String count,
     HTMLPanel followingContainer,
     HTMLPanel tagResourceContainer) {
   initWidget(uiBinder.createAndBindUi(this));
   this.tagId = tagId;
   this.labelName = labelName;
   this.count = count;
   this.followingContainer = followingContainer;
   this.tagResourceContainer = tagResourceContainer;
   tagContainer.setVisible(false);
   userTagsResourceContainerConatiner.clear();
   getData(tagId);
 }
Exemplo n.º 14
0
 private void generateProfile() {
   panel.clear();
   MaterialImage profile = new MaterialImage();
   MaterialLink3 link = new MaterialLink3();
   link.getElement().getStyle().setFontWeight(FontWeight.BOLD);
   link.setTextColor("white");
   link.setText(profileName);
   profile.setType("circle");
   profile.setUrl(profileImageUrl);
   profile.getElement().getStyle().setWidth(60, Unit.PX);
   profile.getElement().getStyle().setHeight(60, Unit.PX);
   panel.add(profile);
   panel.add(link);
   customPanel.getElement().getStyle().setMarginTop(20, Unit.PX);
   panel.add(customPanel);
 }
Exemplo n.º 15
0
 private void onTrendsTabSelected() {
   testsMetricsPanel.showWidget(0);
   mainTabPanel.forceLayout();
   if (!chosenMetrics.isEmpty() && hasChanged) {
     plotTrendsPanel.clear();
     for (Map.Entry<String, MetricDto> entry : chosenMetrics.entrySet()) {
       renderPlots(
           plotTrendsPanel,
           Arrays.asList(entry.getValue().getPlotSeriesDto()),
           entry.getKey(),
           entry.getValue().getPlotSeriesDto().getYAxisMin(),
           true);
     }
     scrollPanelTrends.scrollToBottom();
     hasChanged = false;
   }
 }
Exemplo n.º 16
0
  @Override
  public void setInSlot(Object slot, IsWidget content) {

    if (slot == ProjectPresenter.PROJECT_POSTERS_SLOT) {
      c("ProjectV - setInSlot +++");
      //			Window.alert("clean");
      projectSlot.clear();
      //						projectSlot.add(content);
      if (content != null) {
        projectSlot.add(content);
      }
    } else if (slot == ProjectPresenter.MAP_SLOT) {
      c("ProjectV - setInSlot pour MAP = RARE NORMALEMENT+++");
      mapSlot.clear();
      if (content != null) {
        //				Window.alert("3 - add map widget to project");
        mapSlot.setWidget(content);
      }
    }
  }
  public void setData(List<UserTagsResourceDO> result) {

    tagContainer.setVisible(true);
    TagTextMessage.setText(i18n.GL1915());
    TagTextMessage.getElement().setId("lblTagTextMessage");
    TagTextMessage.getElement().setAttribute("alt", i18n.GL1915());
    TagTextMessage.getElement().setAttribute("title", i18n.GL1915());

    tagMessage.setText(i18n.GL1944());
    tagMessage.getElement().setId("lblTagMessage");
    tagMessage.getElement().setAttribute("alt", i18n.GL1944());
    tagMessage.getElement().setAttribute("title", i18n.GL1944());

    tagContainer.getElement().setAttribute("alt", labelName);
    tagContainer.setTitle(labelName);

    /*if(labelName.length()>=12){
    	labelName = labelName.substring(0, 12) + "...";
    }*/
    tagType.setText(labelName);
    tagType.getElement().setId("lblTagType");
    tagType.getElement().setAttribute("alt", labelName);
    tagType.getElement().setAttribute("title", labelName);

    tagCount.setText(count);
    tagCount.getElement().setId("lblTagCount");
    tagCount.getElement().setAttribute("alt", count);
    tagCount.getElement().setAttribute("title", count);

    userTagsResourceContainerConatiner.clear();
    for (int i = 0; i < result.size(); i++) {
      ProfileUserTagsResourceWidget profileUserTagsResourceWidget =
          new ProfileUserTagsResourceWidget(result.get(i));
      userTagsResourceContainerConatiner.add(profileUserTagsResourceWidget);
    }

    tagContainer.getElement().setId("pnlTagContainer");
    tagScrollPanel.getElement().setId("sbTagScrollPanel");
    userTagsResourceContainerConatiner.getElement().setId("pnlUserTagsResourceContainerConatiner");
  }
Exemplo n.º 18
0
 public void showSuccessMessageWidget(String collectionId) {
   getAddingLabel().setVisible(false);
   getAddToShelfCollectionButton().setVisible(true);
   if (getAddToShelfCollectionButton().getText().equalsIgnoreCase("Add")) {
     getAddToShelfCollectionButton().setText(i18n.GL0691());
     successMessageLabelText.setText(i18n.GL0547());
     successMessageLabelText.getElement().setAttribute("alt", i18n.GL0547());
     successMessageLabelText.getElement().setAttribute("title", i18n.GL0547());
   } else {
     successMessageLabelText.setText(i18n.GL0692());
     successMessageLabelText.getElement().setAttribute("alt", i18n.GL0692());
     successMessageLabelText.getElement().setAttribute("title", i18n.GL0692());
   }
   addCollectionInsteadLabelContainer.clear();
   addResourceInsteadLabel.setText(i18n.GL0685());
   addCollectionInsteadLabelContainer.add(addResourceInsteadLabel);
   addResourceInsteadLabel.getElement().getStyle().setMarginRight(60, Unit.PX);
   // addResourceInsteadLabel.getElement().getStyle().setMarginTop(-15,Unit.PX);
   collectionAddImageContainer.setVisible(false);
   collectionAddedSuccessMessageContainer.setVisible(true);
   workSpaceLink.setHref("#organize&id=" + collectionId + "&eventType=refresh");
 }
 /** Clear form values */
 void clearForm() {
   headersFormPanel.clear();
   rows.clear();
 }
  /**
   * This method is used to print collection breakdown data
   *
   * @param result
   */
  void setCollectionBreakDownPrintData(ArrayList<UserDataDo> result) {
    try {
      printResourceData.clear();
      UserDataDo maxAvgValue =
          Collections.max(
              result,
              new Comparator<UserDataDo>() {
                public int compare(UserDataDo o1, UserDataDo o2) {
                  Long obj1 = new Long(o1.getTimeSpent());
                  Long obj2 = new Long(o2.getTimeSpent());
                  return obj1.compareTo(obj2);
                }
              });

      final AdvancedFlexTable adTable = new AdvancedFlexTable();
      adTable.getElement().setAttribute("style", "background: #fff; width: 1000px;");

      adTable.setHeaderWidget(0, getHeaderLbl(i18n.GL3259(), 35));
      adTable.setHeaderWidget(1, getHeaderLbl(i18n.GL0308(), 55));
      adTable.setHeaderWidget(2, getHeaderLbl(i18n.GL3260(), 600));
      adTable.setHeaderWidget(3, getHeaderLbl(i18n.GL2084(), 110));
      adTable.setHeaderWidget(4, getHeaderLbl(i18n.GL3261(), 50));
      adTable.setHeaderWidget(5, getHeaderLbl(i18n.GL3273(), 60));

      int rowVal = 0;
      for (int i = 0; i < result.size(); i++) {
        adTable.setWidget(rowVal, 0, new Label(String.valueOf(result.get(i).getItemSequence())));

        // set Format
        String resourceCategory =
            result.get(i).getResourceFormat() != null
                ? result.get(i).getResourceFormat().trim()
                : "";
        String categoryStyle = "";
        if (resourceCategory.equalsIgnoreCase("website")
            || resourceCategory.equalsIgnoreCase("webpage")) {
          resourceCategory = "webpage";
          categoryStyle = res.css().category_new_type_webpage();
        } else if (resourceCategory.equalsIgnoreCase("slide")
            || resourceCategory.equalsIgnoreCase("image")) {
          resourceCategory = "image";
          categoryStyle = res.css().category_new_type_image();
        } else if (resourceCategory.equalsIgnoreCase("handout")
            || resourceCategory.equalsIgnoreCase("lesson")
            || resourceCategory.equalsIgnoreCase("textbook")
            || resourceCategory.equalsIgnoreCase("text")) {
          resourceCategory = "text";
          categoryStyle = res.css().category_new_type_text();
        } else if (resourceCategory.equalsIgnoreCase("exam")) {
          resourceCategory = "webpage";
          categoryStyle = res.css().category_new_type_webpage();
        } else if (resourceCategory.equalsIgnoreCase("video")) {
          resourceCategory = "video";
          categoryStyle = res.css().category_new_type_video();
        } else if (resourceCategory.equalsIgnoreCase("interactive")) {
          resourceCategory = "webpage";
          categoryStyle = res.css().category_new_type_interactive();
        } else if (resourceCategory.equalsIgnoreCase("audio")) {
          resourceCategory = "audio";
          categoryStyle = res.css().category_new_type_audio();
        } else {
          categoryStyle = res.css().category_new_type_other();
        }
        Label categorylbl = new Label();
        categorylbl.addStyleName(categoryStyle);
        categorylbl.addStyleName(res.css().setMarginAuto());
        adTable.setWidget(rowVal, 1, categorylbl);

        // Set Question Title
        Label questionTitle = new Label(AnalyticsUtil.html2text(result.get(i).getTitle()));
        questionTitle.setStyleName(res.css().alignCenterAndBackground());
        questionTitle.addStyleName(res.css().alignLeft());
        adTable.setWidget(rowVal, 2, questionTitle);

        // Set time spent
        HorizontalPanel timeSpentpnl = new HorizontalPanel();
        timeSpentpnl.add(AnalyticsUtil.getTimeStampLabel(result.get(i).getAvgTimeSpent()));
        Label progressBar = new Label();
        progressBar.setStyleName(res.css().setProgressBar());
        timeSpentpnl.add(progressBar);
        double maxAvgVal =
            ((double) result.get(i).getAvgTimeSpent()) / ((double) maxAvgValue.getTimeSpent());
        progressBar.getElement().getStyle().setWidth(maxAvgVal * 100, Unit.PX);
        adTable.setWidget(rowVal, 3, timeSpentpnl);

        // set Views label
        // HorizontalPanel viewpnl=new HorizontalPanel();
        Label viewlbl = new Label(Integer.toString(result.get(i).getViews()));
        viewlbl.setStyleName(res.css().alignCenterAndBackground());
        /* viewpnl.add(viewlbl);
        Label viewProgressBar=new Label();
        viewProgressBar.setStyleName(res.css().setProgressBar());
        viewpnl.add(viewProgressBar);
        float maxViewVal = ((float) result.get(i).getViews())/((float) maxViews.getViews());
        viewProgressBar.getElement().getStyle().setWidth(maxViewVal*100, Unit.PX);*/
        adTable.setWidget(rowVal, 4, viewlbl);

        // Set reactions
        int reaction = result.get(i).getAvgReaction();
        HTMLPanel reactionpnl = new HTMLPanel("");
        reactionpnl.add(new AnalyticsReactionWidget(reaction));
        Label reactioncount = new Label();
        reactionpnl.add(reactioncount);
        reactioncount.setText(reaction + "/5");
        reactioncount.setStyleName(res.css().alignCenterAndBackground());
        adTable.setWidget(rowVal, 5, reactionpnl);
        rowVal++;
      }
      printResourceData.add(adTable);
      printWidget.add(printResourceData);
    } catch (Exception e) {
      AppClientFactory.printSevereLogger(
          "CollectionSummaryTeacherView : setCollectionBreakDownPrintData : " + e.getMessage());
    }
  }
  /**
   * This is used to print opened questions data
   *
   * @param result
   */
  void setOpenendedQuestionsPrintData(ArrayList<UserDataDo> result) {
    try {
      printOpendedData.clear();
      int totalUserCount = collectionMetaData.getUserCount();

      final AdvancedFlexTable adTable = new AdvancedFlexTable();
      adTable.getElement().setAttribute("style", "background: #fff; width: 1000px;");

      adTable.setHeaderWidget(0, getHeaderLbl(i18n.GL3259(), 25));
      adTable.setHeaderWidget(1, getHeaderLbl(i18n.GL0308(), 35));
      adTable.setHeaderWidget(2, getHeaderLbl(i18n.GL3260(), 500));
      adTable.setHeaderWidget(3, getHeaderLbl(i18n.GL2084(), 70));
      adTable.setHeaderWidget(4, getHeaderLbl(i18n.GL3261(), 30));
      adTable.setHeaderWidget(5, getHeaderLbl(i18n.GL3273(), 80));

      if (result.size() != 0) {
        for (int i = 0; i < result.size(); i++) {
          adTable.setWidget(i, 0, new Label(String.valueOf(result.get(i).getItemSequence())));

          // Set Question Title
          Label questionTitle =
              new Label(
                  AnalyticsUtil.html2text(
                      result.get(i).getTitle() != null ? result.get(i).getTitle() : ""));
          questionTitle.setStyleName(res.css().alignCenterAndBackground());
          questionTitle.addStyleName(res.css().alignLeft());
          adTable.setWidget(i, 1, questionTitle);

          // Set completion
          HTMLPanel completionpnl = new HTMLPanel("");
          Label progressBar = new Label();
          progressBar.setStyleName(res.css().setProgressBar());
          completionpnl.add(progressBar);
          Label incompleteProgressBar = new Label();
          incompleteProgressBar.setStyleName(res.css().setIncorrectProgressBar());
          completionpnl.add(incompleteProgressBar);
          int attemptedCount = result.get(i).getTotalAttemptUserCount();
          float maxAvgVal = ((float) attemptedCount) / ((float) totalUserCount);
          progressBar.getElement().getStyle().setWidth(maxAvgVal * 100, Unit.PX);
          incompleteProgressBar.getElement().getStyle().setWidth((100 - maxAvgVal * 100), Unit.PX);
          Label studentTextlbl = new Label(attemptedCount + "/" + totalUserCount + " Students");
          studentTextlbl.setStyleName(res.css().alignCenterAndBackground());
          studentTextlbl.getElement().getStyle().setWidth(100, Unit.PX);
          completionpnl.add(studentTextlbl);
          adTable.setWidget(i, 2, completionpnl);

          // Set time spent
          adTable.setWidget(i, 3, AnalyticsUtil.getTimeStampLabel(result.get(i).getAvgTimeSpent()));

          // Set reactions
          int reaction = result.get(i).getAvgReaction();
          HTMLPanel reactionpnl = new HTMLPanel("");
          reactionpnl.add(new AnalyticsReactionWidget(reaction));
          Label reactioncount = new Label();
          reactionpnl.add(reactioncount);
          reactioncount.setText(reaction + "/5");
          reactioncount.setStyleName(res.css().alignCenterAndBackground());
          adTable.setWidget(i, 4, reactionpnl);

          // set View response label
          Label viewResponselbl = new Label("");
          viewResponselbl.setStyleName(res.css().viewResponseTextOpended());
          adTable.setWidget(i, 5, viewResponselbl);
        }
      }
      adTable.getElement().setId("opendedData");
      printOpendedData.add(adTable);
      if (result.size() == 0) {
        Label erroeMsg = new Label();
        erroeMsg.setStyleName(res.css().displayMessageTextForOEQuestions());
        erroeMsg.setText(i18n.GL3264());
        printOpendedData.add(erroeMsg);
      }
      // To add OE questions
      opendedQuestionHeading.setText(i18n.GL3266());
      opendedQuestionHeading.getElement().getStyle().setPaddingTop(15, Unit.PX);
      opendedQuestionHeading.getElement().getStyle().setPaddingBottom(20, Unit.PX);
      opendedQuestionHeading.getElement().getStyle().setTextAlign(TextAlign.LEFT);
      printWidget.add(opendedQuestionHeading);
      printWidget.add(printOpendedData);
      printOpendedData.getElement().getStyle().setPaddingBottom(20, Unit.PX);
    } catch (Exception e) {
      AppClientFactory.printSevereLogger(
          "CollectionSummaryTeacherView : setOpenendedQuestionsPrintData : " + e.getMessage());
    }
  }
  /* (non-Javadoc)
   * @see org.ednovo.gooru.client.mvp.analytics.collectionSummaryTeacher.IsCollectionSummaryTeacherView#setTeacherResourceData(java.util.ArrayList, org.ednovo.gooru.shared.model.analytics.CollectionSummaryMetaDataDo, com.google.gwt.user.client.ui.HTMLPanel)
   */
  @Override
  public void setTeacherResourceData(
      ArrayList<UserDataDo> resourcesData,
      CollectionSummaryMetaDataDo collectionMetaData,
      HTMLPanel loadingImage) {
    this.collectionMetaData = collectionMetaData;

    teacherTabContainer.clearStyles();
    teacherTabContainer.setScoredQuestionsHilight();
    hideAllPanels();
    teacherResourceBreakdownDatapnl.setVisible(true);

    teacherScoredData.clear();
    teacherOpenendedData.clear();
    teacherResourceBreakdownData.clear();
    questionsData.clear();
    openendedData.clear();

    collectionProgressCount = 0;
    questionRowIndex.clear();
    resourceRowIndex.clear();
    // Set collection meta data
    if (collectionMetaData != null) {
      collectionOverViewWidget.setData(collectionMetaData, true);
      collectionSummaryWidget.setDataAnalyticsData(collectionMetaData, null);
      printWidget.add(collectionSummaryWidget);
      printWidget.add(collectionOverViewWidget);
      totalTimeSpentlbl.setText(getTimeSpent(collectionMetaData.getAvgTimeSpent()));
      totalViewlbl.setText(Integer.toString(collectionMetaData.getViews()));
      totalAvgReactionlbl.clear();
      totalAvgReactionlbl.add(new AnalyticsReactionWidget(collectionMetaData.getAvgReaction()));
    }
    Collections.sort(
        resourcesData,
        new Comparator<UserDataDo>() {
          public int compare(UserDataDo o1, UserDataDo o2) {
            Integer obj1 = new Integer(o1.getItemSequence());
            Integer obj2 = new Integer(o2.getItemSequence());
            return obj1.compareTo(obj2);
          }
        });
    // This is used for segrate data based on the category
    for (UserDataDo userDataDo : resourcesData) {
      if (QUESTION.equalsIgnoreCase(userDataDo.getResourceFormat())) {
        if (OE.equalsIgnoreCase(userDataDo.getType())) {
          openendedData.add(userDataDo);
        } else {
          questionsData.add(userDataDo);
        }
        questionRowIndex.add(collectionProgressCount);
      } else {
        resourceData.add(userDataDo);
        resourceRowIndex.add(collectionProgressCount);
      }
      collectionProgressCount++;
    }
    this.allData = resourcesData;
    setScoredQuestionsData(questionsData);
    setQuestionsPrintData(questionsData);
    setOpenendedQuestionsData(openendedData);
    setOpenendedQuestionsPrintData(openendedData);
    setCollectionBreakDown(resourcesData, loadingImage);
    setCollectionBreakDownPrintData(resourcesData);
  }
Exemplo n.º 23
0
 @Override
 public void clearStories() {
   panelStories.clear();
 }
Exemplo n.º 24
0
 public void clearWidgets() {
   sidebarWidgets.clear();
 }
Exemplo n.º 25
0
 @Override
 public void clearPanels() {
   clearPanel.clear();
 }