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

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.5.2, 3.6
    • 3.5.3
    • Questions
    • MOODLE_35_STABLE, MOODLE_36_STABLE
    • MOODLE_35_STABLE
    • 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.

    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

              timhunt Tim Hunt
              timhunt Tim Hunt
              Mahmoud Kassaei Mahmoud Kassaei
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              CiBoT CiBoT
              Safat Shahin, Tim Hunt, Ilya Tregubov, Kevin Percy, Mathew May, Mihail Geshoski, Shamim Rezaie
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                12/Nov/18