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

Export to portfolio produces HTML snippet not complete html document

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reopened
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.2.6, 2.3, 2.4, 2.8.1
    • Fix Version/s: FRONTEND
    • Component/s: Glossary, Portfolio
    • Labels:
    • Testing Instructions:
      Hide

      Test requirements

      1. Enable Portfolios (Home ► Site administration ► Advanced features) and the file download to be enabled for the site
      2. Enable File download (Home ► Site administration ► Plugins ► Portfolios ► Manage portfolios)
      3. Enable assignment 2.2

      Test 1: New assignment html export (For master only)

      1. Create new assignment with Online text => yes
      2. As a student submit assignment
      3. After submission select "File download" and click "Export to portfolio"
      4. Select "Html" and click "Next" and then "continue"
      5. Check downloaded html, make sure it's a valid html with contents wrapped in <head> <body> etc. tags

      Test 2: Forum html export

      1. Create new Forum and add a discussion
      2. View discussion (By clicking on newly created discussion)
      3. Try export whole discussion (Button on top left) and a single post (link in post on right "Export to portfolio")
      4. Check downloaded html, make sure it's a valid html with contents wrapped in <head> <body> etc. tags

      Test 3: Data activity html export

      1. Create database activity and add a entry
      2. Try export to portfolio as html and make sure it's a valid html with contents wrapped in <head> <body> etc. tags

      Test 4: Glossary activity html export

      1. Create a Glossary activity and add a entry
      2. Try export to portfolio as html and make sure it's a valid html with contents wrapped in <head> <body> etc. tags

      Test 5: Chat html export

      1. Create a chat activity
      2. Add few chat discussions and close chat window.
      3. As teacher/Admin view old chat session and you should see "Export to portfolio"
      4. Try export to portfolio as html and make sure it's a valid html with contents wrapped in <head> <body> etc. tags

      Test 6: Online assignment html export

      1. Create online assignment
      2. As a student submit assignment
      3. After submission select "File download" and click "Export to portfolio"
      4. Select "Html" and click "Next" and then "continue"
      5. Make sure it's a valid html with contents wrapped in <head> <body> etc. tags. There is a warning div outside html, I will create another issue for that

      Test 7: Leap2A portfolio format

      1. For all above try download as Leap2A portfolio format and make sure you don't encounter any notice/error
      Show
      Test requirements Enable Portfolios (Home ► Site administration ► Advanced features) and the file download to be enabled for the site Enable File download (Home ► Site administration ► Plugins ► Portfolios ► Manage portfolios) Enable assignment 2.2 Test 1: New assignment html export (For master only) Create new assignment with Online text => yes As a student submit assignment After submission select "File download" and click "Export to portfolio" Select "Html" and click "Next" and then "continue" Check downloaded html, make sure it's a valid html with contents wrapped in <head> <body> etc. tags Test 2: Forum html export Create new Forum and add a discussion View discussion (By clicking on newly created discussion) Try export whole discussion (Button on top left) and a single post (link in post on right "Export to portfolio") Check downloaded html, make sure it's a valid html with contents wrapped in <head> <body> etc. tags Test 3: Data activity html export Create database activity and add a entry Try export to portfolio as html and make sure it's a valid html with contents wrapped in <head> <body> etc. tags Test 4: Glossary activity html export Create a Glossary activity and add a entry Try export to portfolio as html and make sure it's a valid html with contents wrapped in <head> <body> etc. tags Test 5: Chat html export Create a chat activity Add few chat discussions and close chat window. As teacher/Admin view old chat session and you should see "Export to portfolio" Try export to portfolio as html and make sure it's a valid html with contents wrapped in <head> <body> etc. tags Test 6: Online assignment html export Create online assignment As a student submit assignment After submission select "File download" and click "Export to portfolio" Select "Html" and click "Next" and then "continue" Make sure it's a valid html with contents wrapped in <head> <body> etc. tags. There is a warning div outside html, I will create another issue for that Test 7: Leap2A portfolio format For all above try download as Leap2A portfolio format and make sure you don't encounter any notice/error
    • Affected Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_28_STABLE
    • Pull Master Branch:
      wip-mdl-36569-prepare-package

      Description

      When exporting Glossary/chat/forum etc using portfolio API, the HTML produced by the exporter is not well formed. (The exported file does not contain a HTML, HEAD, or BODY tag, it only contains an HTML snippet)

      Original report:

      Found while testing MDLQA-4762:

      When exporting a glossary entry using the portfolio API, the HTML produced by the exporter is not well formed. (The exported file does not contain a HTML, HEAD, or BODY tag, it only contains an HTML snippet)

      Steps to Reproduce:
      1. Login as a student, and access the glossary activity.
      2. Create a glossary entry containing ONLY text.
      3. Try exporting an entry made by you, selecting file download as the portfolio.
      4. Save the file locally then open it and check that all data has been exported correctly.

      Expected result: HTML file is well formed and VALID
      Actual result: HTML file only contains a code snippet.

      Sample export:

      <table class="glossarypost dictionary" cellspacing="0">
      <tr valign="top">
      <td class="entry">
      <div class="concept"><h3 class="main">Test</h3></div> 
      <p>This is a TEST</p></td></tr>
      </table>

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated: