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

mod_h5pactivity_get_results: Invalid response value detected (duration)

XMLWordPrintable

    • MOODLE_39_STABLE
    • MOODLE_39_STABLE
    • MDL-68871-master
    • Hide

      For this test it is necessary to have a terminal with curl to call Moodle web services and MDK.

      Prepare scenario:

      1. open a terminal in your moodle instance and execute the command: "mdk run webservices"
      2. Copy the provided "testws.php" into the root folder of your moodle instance. This file will generate the curl commands to execute into a terminal.
      3. Login as admin and create a course with two different h5p activities using the provided H5P files (big-quiz-example-11.h5p and image-sequencing-3-110117.h5p).
      4. Access both activities as admin and wait until you see the content.
      5. Enrol a student user to that course.

      Manual testing:

      1. Login as student into the course with the two h5p activities.
      2. Access both activities and complete them (answer the questions proposed until you get a score).
      3. Open the URL of the testws.php. Would be something like http://YOUINSTANCE/testws.php
        1. Check that under the title "CURL commands for mod_h5pactivity_get_results" you have a text area with two curl commands (can be more if you retry some of the activities).
      4. Copy all the commands from the text area and paste them into a terminal
        1. Check that all responses start with something like "{"activityid":"
        2. Check that no error appears.

       
       

      Show
      For this test it is necessary to have a terminal with curl to call Moodle web services and MDK. Prepare scenario: open a terminal in your moodle instance and execute the command: "mdk run webservices" Copy the provided " testws.php " into the root folder of your moodle instance. This file will generate the curl commands to execute into a terminal. Login as admin and create a course with two different h5p activities using the provided H5P files ( big-quiz-example-11.h5p  and  image-sequencing-3-110117.h5p ). Access both activities as admin and wait until you see the content. Enrol a student user to that course. Manual testing: Login as student into the course with the two h5p activities. Access both activities and complete them (answer the questions proposed until you get a score). Open the URL of the testws.php. Would be something like http://YOUINSTANCE/testws.php Check that under the title "CURL commands for mod_h5pactivity_get_results" you have a text area with two curl commands (can be more if you retry some of the activities). Copy all the commands from the text area and paste them into a terminal Check that all responses start with something like " {"activityid": " Check that no error appears.    
    • Moppies Kanban

      I'm getting an "Invalid response value detected" error when calling the WS mod_h5pactivity_get_results. More details:

      attempts => Invalid response value detected: duration => Invalid response value detected: Invalid external api response: the value is \"4 seconds\" of PHP type \"string\", the server was expecting \"int\" type

      It seems the WS is returning the duration already formatted, but it should be returned as an integer.

      EDIT: I tried setting the duration as a hardcoded integer and then another error is thrown:

      attempts => Invalid response value detected: results => Invalid response value detected: options => Invalid response value detected: Error in response - Missing following required key in a single structure: correctanswer"}

      I'm having these errors with a drag&drop type, I attached it to this issue.

        1. big-quiz-example-11.h5p
          1.40 MB
        2. drag-and-drop-712.h5p
          1.01 MB
        3. image-sequencing-3-110117.h5p
          889 kB
        4. mark-the-words-2-1408.h5p
          684 kB
        5. Screenshot_1.png
          Screenshot_1.png
          143 kB
        6. Screenshot_2.png
          Screenshot_2.png
          104 kB
        7. testws.php
          3 kB

            tusefomal Ferran Recio
            dpalou Dani Palou
            Simey Lameze Simey Lameze
            Sara Arjona (@sarjona) Sara Arjona (@sarjona)
            Janelle Barcega Janelle Barcega
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 day, 3 hours, 14 minutes
                1d 3h 14m

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