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

Missing format parameters in feedback_item_exporter

XMLWordPrintable

    • MOODLE_34_STABLE, MOODLE_404_STABLE
    • MOODLE_404_STABLE, MOODLE_405_STABLE, MOODLE_500_STABLE
    • MDL-62230-404
    • MDL-62230-405
    • Hide

      Prerequisite

      1. Log in as admin
      2. Go to Site administration > Advanced features and set Enable web services to Yes
      3. Go to Site administration > Server > Web services > Manage protocols and enable REST protocol
      4. Go to Site administration > Server > Web services > External services and Add an External service
        Set the following fields:
        • Name: Test Service
        • Enabled: Yes
      5. Add functions to the service "Test Service" and choose the function with the name mod_feedback_get_items
      6. Go to Site administration > Server > Web services > Manage tokens
      7. Click "Create a token"
      8. Create a token for the admin user, select the service "Test Service"
      9. Save the token and use it to replace the string <TOKEN> in the web service calls below.
      10. Go to Site administration > Plugins > Filters > Manage filters and set Active? to "On" for the Multi-language content filter. 

      Testing

      1. Create a course
      2. Add a Feedback activity
      3. Execute the following query to obtain the ID of the new feedback:

        SELECT * FROM feedback;
        

      4. Add a Multiple choice question
        • Question:

          <span class="multilang" lang="en">Moodle (EN)</span><span class="multilang" lang="de">Moodle (DE)</span>
          

        • Multiple choice values:

          <span class="multilang" lang="en">Moodle (EN) 1</span><span class="multilang" lang="de">Moodle (DE) 1</span>
          <span class="multilang" lang="en">Moodle (EN) 2</span><span class="multilang" lang="de">Moodle (DE) 2</span>
          <span class="multilang" lang="en">Moodle (EN) 3</span><span class="multilang" lang="de">Moodle (DE) 3</span>
          

      5. Execute the following webservice request:

        $ curl --silent "<WWWROOT>/webservice/rest/server.php?moodlewsrestformat=json" --data "moodlewssettingfilter=1&wstoken=<TOKEN>&wsfunction=mod_feedback_get_items&feedbackid=<ID>" | python -m "json.tool"
        

      6. Confirm that returned name/presentation item values are correctly formatted:

        "name": "Moodle (EN)",
        "presentation": "r>>>>>Moodle (EN) 1\r|Moodle (EN) 2\r|Moodle (EN) 3",
        

      Show
      Prerequisite Log in as admin Go to Site administration > Advanced features and set Enable web services to Yes Go to Site administration > Server > Web services > Manage protocols and enable REST protocol Go to Site administration > Server > Web services > External services and Add an External service Set the following fields: Name: Test Service Enabled: Yes Add functions to the service " Test Service " and choose the function with the name mod_feedback_get_items Go to Site administration > Server > Web services > Manage tokens Click " Create a token" Create a token for the admin user, select the service " Test Service " Save the token and use it to replace the string <TOKEN> in the web service calls below. Go to Site administration > Plugins > Filters > Manage filters and set Active? to " On " for the Multi-language content  filter.  Testing Create a course Add a Feedback activity Execute the following query to obtain the ID of the new feedback: SELECT * FROM feedback; Add a Multiple choice question Question: <span class="multilang" lang="en">Moodle (EN)</span><span class="multilang" lang="de">Moodle (DE)</span> Multiple choice values: <span class="multilang" lang="en">Moodle (EN) 1</span><span class="multilang" lang="de">Moodle (DE) 1</span> <span class="multilang" lang="en">Moodle (EN) 2</span><span class="multilang" lang="de">Moodle (DE) 2</span> <span class="multilang" lang="en">Moodle (EN) 3</span><span class="multilang" lang="de">Moodle (DE) 3</span> Execute the following webservice request: $ curl --silent "<WWWROOT>/webservice/rest/server.php?moodlewsrestformat=json" --data "moodlewssettingfilter=1&wstoken=<TOKEN>&wsfunction=mod_feedback_get_items&feedbackid=<ID>" | python -m "json.tool" Confirm that returned name/presentation item values are correctly formatted: "name": "Moodle (EN)", "presentation": "r>>>>>Moodle (EN) 1\r|Moodle (EN) 2\r|Moodle (EN) 3",
    • Hide

      Code verified against automated checks.

      Checked MDL-62230 using repository: https://github.com/paulholden/moodle/

      More information about this report

      Built on: Wed Mar 19 11:02:23 UTC 2025

      Show
      Code verified against automated checks. Checked MDL-62230 using repository: https://github.com/paulholden/moodle/ MOODLE_404_STABLE (0 errors / 0 warnings) [branch: MDL-62230-404 | CI Job ] MOODLE_405_STABLE (0 errors / 0 warnings) [branch: MDL-62230-405 | CI Job ] main (0 errors / 0 warnings) [branch: MDL-62230 | CI Job ] More information about this report Built on: Wed Mar 19 11:02:23 UTC 2025
    • Show
      Launching automatic jobs for branch MDL-62230 -404 https://ci.moodle.org/view/Testing/job/DEV.02%20-%20Developer-requested%20PHPUnit/18668/ PHPUnit (sqlsrv) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/63952/ Behat (NonJS - boost and classic) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/63953/ Behat (Firefox - boost) Launching automatic jobs for branch MDL-62230 -405 https://ci.moodle.org/view/Testing/job/DEV.02%20-%20Developer-requested%20PHPUnit/18669/ PHPUnit (sqlsrv) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/63954/ Behat (NonJS - boost and classic) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/63955/ Behat (Firefox - boost) Launching automatic jobs for branch MDL-62230 https://ci.moodle.org/view/Testing/job/DEV.02%20-%20Developer-requested%20PHPUnit/18670/ PHPUnit (sqlsrv) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/63956/ Behat (NonJS - boost and classic) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/63957/ Behat (Firefox - boost) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/63958/ Behat (Firefox - classic) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/63959/ App tests (stable app version) Built on: Wed Mar 19 10:30:36 UTC 2025

      The fields name and presentation are missing some parameters in the exporter get_format_parameters_for_xxx method. Specifically, noclean => true and para => false.

      Adding those two parameters will make the exporter to behave the same way that the web version (see mod/feedback/item/numeric/lib.php or mod/feedback/item/textarea/lib.php where all the text passed through format_text is formatted using those options).

      This is making the app to not display correctly some texts (see MOBILE-2367 where we applied a local temporary patch).

       

        1. 62230 test - 404.png
          62230 test - 404.png
          74 kB
        2. 62230 test - 405.png
          62230 test - 405.png
          74 kB
        3. 62230 test - 500.png
          62230 test - 500.png
          74 kB
        4. 62230 test - main.png
          62230 test - main.png
          70 kB

            pholden Paul Holden
            jleyva Juan Leyva
            Daniel Ziegenberg Daniel Ziegenberg
            Sara Arjona (@sarjona) Sara Arjona (@sarjona)
            Andrew Gosali Andrew Gosali
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours, 33 minutes
                2h 33m

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