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

check_qt_var_name_restrictions does not handle self::USE_RAW_DATA case

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.5.2, 3.6
    • Fix Version/s: 3.5.3
    • Component/s: Questions
    • Labels:
    • Testing Instructions:
      Hide

      This is quite hard to test, because getting qtype_opaque + qbehaviour_opaque installed requires a question engine that you don't have.

      If you have them installed, then it is trivial to reproduce the problem and verify the fix by running the qbehaviour_opaque PHPUnit tests.

      I suggest that on this occasion, you just look at how simple the patch is, and trust me that I have tested that it fix the but.

      Also, all the normal Moodle automated tests will catch any possible regressions.

      Show
      This is quite hard to test, because getting qtype_opaque + qbehaviour_opaque installed requires a question engine that you don't have. If you have them installed, then it is trivial to reproduce the problem and verify the fix by running the qbehaviour_opaque PHPUnit tests. I suggest that on this occasion, you just look at how simple the patch is, and trust me that I have tested that it fix the but. Also, all the normal Moodle automated tests will catch any possible regressions.
    • Affected Branches:
      MOODLE_35_STABLE, MOODLE_36_STABLE
    • Fixed Branches:
      MOODLE_35_STABLE
    • Pull from Repository:
    • Pull 3.5 Branch:
    • Pull Master Branch:

      Description

      MDL-41090 added a check check_qt_var_name_restrictions without accounting for the self::USE_RAW_DATA case.

      This causes problems for qtype_opaque which I am about to fix. Running the unit tests for qbehaviour_opaque was giving:

      qbehaviour_opaque_test::test_wrong_three_times
      Invalid argument supplied for foreach()
       
      /var/www/html/20180913_020000_209_tt_overnight_full/question/engine/questionattempt.php:1188
      /var/www/html/20180913_020000_209_tt_overnight_full/question/engine/questionattempt.php:1169
      /var/www/html/20180913_020000_209_tt_overnight_full/question/engine/questionusage.php:675
      /var/www/html/20180913_020000_209_tt_overnight_full/question/engine/questionusage.php:609
      /var/www/html/20180913_020000_209_tt_overnight_full/question/engine/tests/helpers.php:751
      /var/www/html/20180913_020000_209_tt_overnight_full/question/behaviour/opaque/tests/opaquebehaviour_test.php:73
      /var/www/html/20180913_020000_209_tt_overnight_full/lib/phpunit/classes/advanced_testcase.php:80
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              timhunt Tim Hunt
              Reporter:
              timhunt Tim Hunt
              Peer reviewer:
              Mahmoud Kassaei
              Integrator:
              Eloy Lafuente (stronk7)
              Tester:
              CiBoT
              Participants:
              Component watchers:
              Tim Hunt, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                12/Nov/18