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

Feedback has wrong numbers in excel export file

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.5.11, 3.6.9, 3.7.5, 3.8.2
    • Fix Version/s: None
    • Component/s: Feedback
    • Labels:
    • Affected Branches:
      MOODLE_35_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE

      Description

      If some response of results contains hundredths then we have wrong numbers in the exported excel file. See pictures.

      Because we have the wrong symbol in /mod/feedback/analysis_to_excel.php:

      $xlsformats->procent = $workbook->add_format(['align' => 'left', 'bold' => 1, 'v_align' => 'top', 'num_format' => '#,##0.00%']);
      

      Should be:

      $xlsformats->procent = $workbook->add_format(['align' => 'left', 'bold' => 1, 'v_align' => 'top', 'num_format' => '#,##0.00']);
      

      Because in /lib/excellib.class.php we don't have any percents ('#,##0.00%'):

      public function set_num_format($num_format) {
          $numbers = array();
       
          $numbers[1] = '0';
          $numbers[2] = '0.00';
          $numbers[3] = '#,##0';
          $numbers[4] = '#,##0.00';
          $numbers[11] = '0.00E+00';
          $numbers[12] = '# ?/?';
          $numbers[13] = '# ??/??';
          $numbers[14] = 'mm-dd-yy';
          $numbers[15] = 'd-mmm-yy';
          $numbers[16] = 'd-mmm';
          $numbers[17] = 'mmm-yy';
          $numbers[22] = 'm/d/yy h:mm';
          $numbers[49] = '@';
      

        Attachments

        1. Bug.png
          Bug.png
          98 kB
        2. Feedback page.png
          Feedback page.png
          69 kB
        3. Normal excel.png
          Normal excel.png
          99 kB

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            иванскляров Иван Скляров
            Participants:
            Component watchers:
            Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: