Пример #1
0
  public String getSelectedStudentGrades() {
    if (currentGradebook == null) {
      return "<p>" + msgs.getString("no_gradebook_selected") + "</p>";
    }

    if (currentGradebook.getUsernames() == null || currentGradebook.getUsernames().isEmpty()) {
      return "<p>"
          + msgs.getFormattedMessage(
              "no_grades_in_gradebook",
              new Object[] {StringEscapeUtils.escapeHtml(currentGradebook.getTitle())})
          + "</p>";
    }

    if (selectedStudent == null || selectedStudent.equals("")) {
      return msgs.getString("select_participant");
    }

    StudentGrades selStudent =
        gradebookManager.getStudentByGBAndUsername(currentGradebook, selectedStudent);
    if (selStudent != null) {
      selStudent.setGradebook(currentGradebook);
      return selStudent.formatGrades();
    }

    return msgs.getString("select_participant");
  }
Пример #2
0
 public String getFirstStudentGrades() {
   if (currentGradebook == null) {
     return "<p>" + msgs.getString("no_gradebook_selected") + "</p>";
   }
   Set students = currentGradebook.getStudents();
   if (students.size() == 0) {
     return "<p>"
         + msgs.getFormattedMessage(
             "no_grades_in_gradebook",
             new Object[] {StringEscapeUtils.escapeHtml(currentGradebook.getTitle())})
         + "</p>";
   }
   if (currentGradebook.getFirstUploadedUsername() != null) {
     StudentGrades student =
         currentGradebook.studentGrades(currentGradebook.getFirstUploadedUsername());
     return student.formatGrades();
   } else {
     StudentGrades student = (StudentGrades) students.iterator().next();
     return student.formatGrades();
   }
 }
Пример #3
0
  public String getCurrentStudentGrades() {

    if (currentGradebook == null) {
      return "<p>" + msgs.getString("no_gradebook_selected") + "</p>";
    }
    if (currentStudent == null) {
      return "<p>"
          + msgs.getFormattedMessage(
              "no_grades_for_user",
              new Object[] {StringEscapeUtils.escapeHtml(currentGradebook.getTitle())})
          + "</p>";
    }
    return currentStudent.formatGrades();
  }