예제 #1
0
  private void loadAndShowResultDetails(String assignmentId, String username) {
    eventBus.fireEvent(
        new StatusChangedEvent(StatusChangedEvent.StatusType.ACTION, "Incarca rezultate..."));
    service.getUserResults(
        courseId,
        assignmentId,
        username,
        new AsyncCallback<EvaluationResult[]>() {

          @Override
          public void onFailure(Throwable caught) {
            GWT.log("StatisticsPresenter.loadAndShowResultDetails()", caught);
          }

          @Override
          public void onSuccess(EvaluationResult[] result) {
            eventBus.fireEvent(new StatusChangedEvent(StatusChangedEvent.StatusType.RESET, null));
            String resultsHTML = "";
            for (int i = 0; i < result.length; i++) {
              resultsHTML += result[i].toHTML();
            }
            widget.displayResultDetails(resultsHTML);
          }
        });
  }
예제 #2
0
  @Override
  public void go(final HasWidgets container) {
    this.container = container;
    eventBus.fireEvent(
        new StatusChangedEvent(StatusChangedEvent.StatusType.ACTION, "Incarca statistici..."));
    service.getAllResults(
        courseId,
        new AsyncCallback<StudentInfo[]>() {

          @Override
          public void onFailure(Throwable caught) {
            GWT.log("StatisticsPresenter.getAllResults()", caught);
          }

          @Override
          public void onSuccess(StudentInfo[] result) {
            container.clear();
            studentsInfo = result;
            widget.displayInfo(username, assignments, result);
            container.add((com.google.gwt.user.client.ui.Widget) widget);
            eventBus.fireEvent(new StatusChangedEvent(StatusChangedEvent.StatusType.RESET, null));
          }
        });
  }