Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-31433

Gradebook scale type item, FINALGRADE = 0/(null)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Minor Minor
    • None
    • 2.0.7
    • Gradebook
    • None
    • 2.0.7, ORACLE
    • Oracle
    • MOODLE_20_STABLE
    • Hide

      Anyway, I have a little work around to show "-" for those records with 0, when turn gradebook editing off.

      In the lib/gradelib.php:

      function grade_format_gradevalue_real($value, $grade_item, $decimals, $localized) {
      if ($grade_item->gradetype == GRADE_TYPE_SCALE) {
      if (!$scale = $grade_item->load_scale())

      { return get_string('error'); }

      + //Longfei-OIT, 1/30/2012; Jira 393; weird value "0", should be "(null)" in DB
      + if ($value == 0)
      + return '-';
      $value = $grade_item->bounded_grade($value);
      return format_string($scale->scale_items[$value-1]);

      } else

      { return format_float($value, $decimals, $localized); }

      }

      Show
      Anyway, I have a little work around to show "-" for those records with 0, when turn gradebook editing off. In the lib/gradelib.php: function grade_format_gradevalue_real($value, $grade_item, $decimals, $localized) { if ($grade_item->gradetype == GRADE_TYPE_SCALE) { if (!$scale = $grade_item->load_scale()) { return get_string('error'); } + //Longfei-OIT, 1/30/2012; Jira 393; weird value "0", should be "(null)" in DB + if ($value == 0) + return '-'; $value = $grade_item->bounded_grade($value); return format_string($scale->scale_items [$value-1] ); } else { return format_float($value, $decimals, $localized); } }

      The FINALGRADE in the GRADE_GRADES table is 0.

      Last Friday, one instructor created about 20 manual grade items in her gradebook, and the type was SCALE (Absent, Excused, Present). From what I learned (not sure if it's correct or not), in the GRADE_GRADES table, all of the FINALGRADE for the SCALE type of items should be 1, 2, 3. However, today, in our database (ORACLE) I found most of them are "0", and some are "(null)". When I made the gradebook editable, the ones with value "0" and "(null)" show as "No garde". When I turned the editing off, the ones with "0" show as "Absent", and the ones with "(null)" show as "-".

      I have no idea why there are records with "0" in the database tables, I thought either should be 1, 2, 3 or just no record for those students (still not graded yet). Also, I have no idea where the "Absent" comes from for those records with FINALGRADE as 0 in the GRADE_GRADES table when editing off. I think there is something to do with the lib/grade/grade_scale.php.

      I am wondering how those records (with FINALGRADE as 0/(null) for manual SCALE type of homework).

            Unassigned Unassigned
            longfeiyu Longfei Yu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.