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

Feedback has wrong numbers in excel export file

    XMLWordPrintable

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 3.5.11, 3.6.9, 3.7.5, 3.8.2
    • None
    • Feedback
    • 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

            Unassigned Unassigned
            иванскляров Иван Скляров
            Amaia Anabitarte, Carlos Escobedo, Laurent David, Sabina Abellan, Sara Arjona (@sarjona)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: