• A month or so ago we noticed that any of our quizzes that made use of the ‘Show only a specific number of questions’ option stopped working somewhat, it would always show the first 20 questions by ID. We have several 1000 question set quizzes that we like to display 20 random questions at a time and other similar situations but none with such large questions sets. Not sure what would have caused it other than a wp upgrade.

    I found a workaround by simply returning all questions from the fetch() in the WpProQuiz_Model_QuestionMapper and then randomizing and returning only the number of questions I wanted in the WpProQuiz_Controller_Front and WpProQuiz_Controller_Preview showAction() methods. This worked until a couple days ago. We did upgrade to wp-pro-quiz .31 last week, but I was certain I was seeing desired behavior. But now there seems to be no limiting of the questions. Even though my quizzes are setup to display 20 random questions the quizzes get loaded with all questions no matter what.

    https://wordpress.org/plugins/wp-pro-quiz/

Viewing 1 replies (of 1 total)
  • Thread Starter everhart1980

    (@everhart1980)

    Okay so I’ve patched the problem again, in addition to the showAction() method I mentioned above there is now a third location where the quiz questions are loaded from the db:
    WpProQuiz_Controller_Front.ajaxQuizLoadData()
    I applied the same simple shuffle and pairing down logic and everything is back as it was.
    It is a little odd that the questions are being loaded twice in every call to a quiz. The initial call is useless as it just gets overwritten by the same call again in ajaxQuizLoadData().
    Of course that was a solution to even stranger issue that without my little hack quizzes that should only show a specific number of questions do in fact show all without code modification.

Viewing 1 replies (of 1 total)
  • The topic ‘Problem showing only specific number of questions’ is closed to new replies.