sensei icon indicating copy to clipboard operation
sensei copied to clipboard

Quizzes stopped working

Open m1r0 opened this issue 3 years ago • 0 comments

When viewing a newly created quiz, you see PHP warnings and a There are no questions for this Quiz yet. Check back soon. message.

Steps to Reproduce

  1. Create a course.
  2. Create a lesson for the course.
  3. Add a quiz block to the lesson.
  4. Add a few questions.
  5. Publish the lesson and the course.
  6. Go to the lessons page and click the View Quiz button.

What I Expected

To see the quiz questions.

What Happened Instead

I see multiple PHP warnings and a There are no questions for this Quiz yet. Check back soon. message. The warnings are:

Warning: array_rand(): Second argument has to be between 1 and the number of elements in the array in /srv/users/user2cbb06c9/apps/user2cbb06c9/public/wp-content/plugins/sensei-lms/includes/class-sensei-lesson.php on line 3618

PHP / WordPress / Sensei LMS version

PHP: 7.2 WordPress: 6.0.1 Sensei LMS: 4.6.1

Screenshot / Video

image

https://user-images.githubusercontent.com/1612178/184430231-3d67da73-2ecf-42b3-a2b2-59d77f11773a.mp4

Context / Source

https://wordpress.org/support/topic/warning-array_rand/ p1660333161000649-slack-C02P7FHLVR9

m1r0 avatar Aug 12 '22 19:08 m1r0