moodleou / moodle-qtype_varnumunit

Moodle variable numeric sets question type with units.
0 stars 7 forks source link

Warning: Undefined array key "text" with Moodle 4.4 #12

Open leonstr opened 1 month ago

leonstr commented 1 month ago

Steps to reproduce issue

  1. Install plugin set, create course, go to course's question bank.
  2. Click Create a new question ..., select Variable numeric set with units and click Add.
  3. Set:
    1. Question name.
    2. Question text.
    3. Answer 1:
    4. 15, +/-: 1, Grade: 100%
    5. Unit 1:
    6. match('cm')
    7. Grade: 100%
  4. Click Save changes.

Expected results

The question is saved.

Actual results

Whoops\Exception\ErrorException thrown with message "Undefined array key "text""

Stacktrace:
#4 Whoops\Exception\ErrorException in /var/www/moodle/question/type/varnumunit/questiontype.php:121
#3 default_error_handler in /var/www/moodle/question/type/varnumunit/questiontype.php:121
#2 qtype_varnumunit:save_units in /var/www/moodle/question/type/varnumunit/questiontype.php:205
#1 qtype_varnumunit:save_question_options in /var/www/moodle/question/type/questiontypebase.php:538
#0 question_type:save_question in /var/www/moodle/question/bank/editquestion/question.php:294