Uploaded image for project: 'Sakai'
  1. Sakai
  2. SAK-2232

tests and quizzes reports the latest grade to gradebook, but claims to report best

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: CLOSED
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.1
    • Fix Version/s: 2.1.0
    • Labels:
      None

      Description

      One of our faculty considers this critical. If you take the same assessment more than once, tests and quizzes claims to report the best score to Gradebook. It claims this in Settings/Grading. There's no way to change the option, but if you look at a released test, it shows options Average and Best, with Bests chosen and the choice grayed out.

      We think best actually makes sense.

      The following patch, against 2090, will implement best. Note that the student will now see the latest in the Tests and Quizzes feedback, but the best in Gradebook. I believe that's right. After taking a test, the student will want to see feedback on their latest attempt. So Tests and Quizes shows that. But Gradebook will show the best result.

          • ./sam.hold/tool/src/java/org/sakaiproject/tool/assessment/facade/AssessmentGradingFacadeQueries.java Sun Oct 9 19:52:25 2005
          • ./sam/tool/src/java/org/sakaiproject/tool/assessment/facade/AssessmentGradingFacadeQueries.java Sun Oct 9 20:30:24 2005
            ***************
          • 281,286 ****
          • 281,320 ----
            }
            }

      + public AssessmentGradingData getBestGrade(AssessmentGradingIfc data) {
      + try {
      + Long publishedId = data.getPublishedAssessment().getPublishedAssessmentId();
      + String agentId = data.getAgentId();
      + Object[] objects = new Object[3];
      + objects[0] = publishedId;
      + objects[1] = agentId;
      + objects[2] = new Boolean(true);
      + Type[] types = new Type[3];
      + types[0] = Hibernate.LONG;
      + types[1] = Hibernate.STRING;
      + types[2] = Hibernate.BOOLEAN;
      + ArrayList scores = (ArrayList) getHibernateTemplate().find("from AssessmentGradingData a where a.publishedAssessment.publishedAssessmentId=? and a.agentId=? and a.forGrade=? order by submittedDate DESC", objects, types);
      + if (scores.isEmpty())
      + return null;
      +
      + AssessmentGradingData best = null;
      + float bestvalue = 0.0f;
      +
      + Iterator iter = scores.iterator();
      + while (iter.hasNext()) {
      + AssessmentGradingData idata = (AssessmentGradingData) iter.next();
      + if (best == null || idata.getFinalScore().floatValue() > bestvalue)

      { + best = idata; + bestvalue = idata.getFinalScore().floatValue(); + }

      + }
      + return best;
      + } catch (Exception e)

      { + e.printStackTrace(); + return null; + }

      + }
      +
      public void saveTotalScores(ArrayList data) {
      try {
      Iterator iter = data.iterator();
      ***************

          • 439,444 ****
          • 473,479 ----
      • @param data The AssesmentGradingIfc representing the new score
        */
        private void notifyGradebook(AssessmentGradingIfc data) {
        + data = getBestGrade(data);
        // If the assessment is published to the gradebook, make sure to update the scores in the gradebook
        String toGradebook = data.getPublishedAssessment().getEvaluationModel().getToGradeBook();
        if (GradebookServiceHelper.gradebookExists(GradebookFacade.getGradebookUId()) && toGradebook.equals(EvaluationModelIfc.TO_DEFAULT_GRADEBOOK.toString())){

        Gliffy Diagrams

          Zeplin

            Attachments

              Issue Links

                Activity

                  People

                  Assignee:
                  marith Margaret Petit (Inactive)
                  Reporter:
                  hedrick Charles Hedrick
                  Votes:
                  0 Vote for this issue
                  Watchers:
                  0 Start watching this issue

                    Dates

                    Created:
                    Updated:
                    Resolved:

                      Git Integration