Moodle
  1. Moodle
  2. MDL-13427

Export Item Analysis Table to Files (excel or text format) Including <br /> Tags

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.5.4, 1.6.6, 1.7.4, 1.8.4, 1.9
    • Fix Version/s: 1.7.7, 1.8.8, 1.9.4
    • Component/s: Quiz
    • Labels:
      None
    • Affected Branches:
      MOODLE_15_STABLE, MOODLE_16_STABLE, MOODLE_17_STABLE, MOODLE_18_STABLE, MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_17_STABLE, MOODLE_18_STABLE, MOODLE_19_STABLE

      Description

      Overview

      When users export Item Analysis Table to a file, the names of few columns have extract <br /> XHTML tags.

      Steps to Reproduce

      1. Login as an instructor
      2. Go to any course
      3. Go to any quiz with student attempts
      4. Click on 'Reports'
      5. Click on 'Item analysis'
      6. Click on 'Download in Excel format' or 'Download to text format'

      Expected Result

      Column headers should be identical to the webpage.

      What Actually Happens

      A few headers include extract <br /> tags.

      Also see attached screenshots

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            Wen Hao Chuang added a comment -

            Tested on latest 1.5.4+ codes and latest 1.9 codes and both have the same issue. I would guess that 1.6, 1.7, and 1.8 probably also have this issue.

            Show
            Wen Hao Chuang added a comment - Tested on latest 1.5.4+ codes and latest 1.9 codes and both have the same issue. I would guess that 1.6, 1.7, and 1.8 probably also have this issue.
            Hide
            Pierre Pichet added a comment -

            I am currently woring on the item analysis report and will look at this
            but this is a minor problem

            Show
            Pierre Pichet added a comment - I am currently woring on the item analysis report and will look at this but this is a minor problem
            Hide
            Wen Hao Chuang added a comment -

            Pierre, thanks for your work. If possible please make sure the fix in 1.9 will also backport to 1.8, 1.7, 1.6 and 1.5 if at all possible. Thanks!

            Show
            Wen Hao Chuang added a comment - Pierre, thanks for your work. If possible please make sure the fix in 1.9 will also backport to 1.8, 1.7, 1.6 and 1.5 if at all possible. Thanks!
            Hide
            Pierre Pichet added a comment -

            I am waiting for comments like yours (and further testing) before merging to other versions.
            As this code is common to all those versions, it will be easy to merge.
            Next week should be OK.

            Show
            Pierre Pichet added a comment - I am waiting for comments like yours (and further testing) before merging to other versions. As this code is common to all those versions, it will be easy to merge. Next week should be OK.
            Hide
            Tim Hunt added a comment -

            Pierre, just to make sure you spotted that there is a strip_tags function in Moodle, I think in weblib.php.

            Show
            Tim Hunt added a comment - Pierre, just to make sure you spotted that there is a strip_tags function in Moodle, I think in weblib.php.
            Hide
            Pierre Pichet added a comment -

            Thanks, there are also php functions
            Finally I think that we should keep all the complete question text as Excel or Word can handle HTML files.
            Users want the complete output to be available for printing.
            For handling the data and do sorting or other calculations, I will add a new download function with all the table cells filled.
            I can also add some report options although I don't want to double the OU project.

            Show
            Pierre Pichet added a comment - Thanks, there are also php functions Finally I think that we should keep all the complete question text as Excel or Word can handle HTML files. Users want the complete output to be available for printing. For handling the data and do sorting or other calculations, I will add a new download function with all the table cells filled. I can also add some report options although I don't want to double the OU project.
            Hide
            Pierre Pichet added a comment -

            The html donwload solve the problem of having a complete set of data to show, print and modify using a word processor.
            The excel or ODS and CVS usefullness is to have the data in a format that can be used to sort in another way or complete the item analysis.
            So the HTML markup has been removed from the column titles but not from question text has they can have usefull infos although this cannot be displayed in the excel version .xls. Excel can display an HTML file but subdivise the text in different cells if there are some hTML markup. So the HTML version cannot be used to do further analysis.
            However when loaded as a regular .xls file all the question text for example is input with the HTML markups in only ONE cell.
            So the table does not loose its structure and the data can be further processed.
            Thi is why there will be no strip_tags on question text. ( and responses).
            However for CVS there should be a strip_tags and further processing to remove the , \n and \r or or other control characters that could corrupt the file.

            Show
            Pierre Pichet added a comment - The html donwload solve the problem of having a complete set of data to show, print and modify using a word processor. The excel or ODS and CVS usefullness is to have the data in a format that can be used to sort in another way or complete the item analysis. So the HTML markup has been removed from the column titles but not from question text has they can have usefull infos although this cannot be displayed in the excel version .xls. Excel can display an HTML file but subdivise the text in different cells if there are some hTML markup. So the HTML version cannot be used to do further analysis. However when loaded as a regular .xls file all the question text for example is input with the HTML markups in only ONE cell. So the table does not loose its structure and the data can be further processed. Thi is why there will be no strip_tags on question text. ( and responses). However for CVS there should be a strip_tags and further processing to remove the , \n and \r or or other control characters that could corrupt the file.
            Hide
            Pierre Pichet added a comment -

            This is the diff file of the recent improvments.
            First adding the HTML ouput format so that it downloads all the table as seen in the report with the complete question text even figures. The user has to save this from his browser when the session is active so that files on moodle are available.
            Can be imported directly in Word or usual HTML Editor , Power Point etc.
            The usual ODS, XLS and CSV where code clean and index were added so they can be useful for other calcualtions or sorting. They are not useable to edit the table.
            This is the role of the HTML version.
            Because of concerns about OU project and improvements in the multiquestion handling , I have isolated the building of the question array from the attempts content in a function called
            get_questions_atttempts_data ($quiz,&$questions,&$attempts,$attemptselection,$usermax)

            I have test it with a different question types and Microsoft Excel , Word. on PC and Mac
            The only tests not done are on Open Office.
            this is available on
            http://132.208.141.198/moodle_head
            user: moodle pw:moodle
            see also http://moodle.org/mod/forum/discuss.php?d=92376

            Show
            Pierre Pichet added a comment - This is the diff file of the recent improvments. First adding the HTML ouput format so that it downloads all the table as seen in the report with the complete question text even figures. The user has to save this from his browser when the session is active so that files on moodle are available. Can be imported directly in Word or usual HTML Editor , Power Point etc. The usual ODS, XLS and CSV where code clean and index were added so they can be useful for other calcualtions or sorting. They are not useable to edit the table. This is the role of the HTML version. Because of concerns about OU project and improvements in the multiquestion handling , I have isolated the building of the question array from the attempts content in a function called get_questions_atttempts_data ($quiz,&$questions,&$attempts,$attemptselection,$usermax) I have test it with a different question types and Microsoft Excel , Word. on PC and Mac The only tests not done are on Open Office. this is available on http://132.208.141.198/moodle_head user: moodle pw:moodle see also http://moodle.org/mod/forum/discuss.php?d=92376
            Hide
            Tim Hunt added a comment -

            Assigning quiz report issues mentioned in http://docs.moodle.org/en/Development:Quiz_report_enhancements to Jamie.

            Show
            Tim Hunt added a comment - Assigning quiz report issues mentioned in http://docs.moodle.org/en/Development:Quiz_report_enhancements to Jamie.
            Hide
            Jamie Pratt added a comment -

            This is fixed in 2.0.

            Show
            Jamie Pratt added a comment - This is fixed in 2.0.
            Hide
            Jamie Pratt added a comment -

            This is not fixed in 1.8 or 1.9. Assigning it to Tim, to consider.

            Show
            Jamie Pratt added a comment - This is not fixed in 1.8 or 1.9. Assigning it to Tim, to consider.
            Hide
            Tim Hunt added a comment -

            I've just done a basic fix for the originally reported problem: <br> tags in the table headers.

            As Jamie says, this problem has gone away in HEAD, so I have fixed this in 1.7-1.9 branches

            Show
            Tim Hunt added a comment - I've just done a basic fix for the originally reported problem: <br> tags in the table headers. As Jamie says, this problem has gone away in HEAD, so I have fixed this in 1.7-1.9 branches
            Hide
            Sam Hemelryk added a comment -

            Confirmed fixed, tested and everything came out correctly

            Show
            Sam Hemelryk added a comment - Confirmed fixed, tested and everything came out correctly

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: