What's new
[XB] Quizzes

[XB] Quizzes [Paid] 2.0.4 Patch Level 1

No permission to buy ($75.00)
Hey Painbaker I got a file health check error after upgrading. Any ideas?

src/addons/OzzModz/Quiz/icon.png Unexpected contents
 
As soon as I uploaded I got this error.

  • ErrorException: Template error: [E_USER_WARNING] Method canViewQuiz is not callable on the given object (XFMG\XF\Entity\User)
  • src/XF/Template/Templater.php:1278
  • Generated by: Unknown account
  • Feb 11, 2025 at 5:53 PM

Stack trace​

#0 [internal function]: XF\Template\Templater->handleTemplateError(512, '[E_USER_WARNING...', '/home/chtas/pub...', 1278)
#1 src/XF/Template/Templater.php(1278): trigger_error('Method canViewQ...', 512)
#2 internal_data/code_cache/navigation_cache.php(866): XF\Template\Templater->method(Object(XFMG\XF\Entity\User), 'canViewQuiz', Array)
#3 src/XF/Template/Templater.php(8151): XF\Pub\App->{closure}(Object(MaZ\AMP\XF\Template\Templater), 'forums', Array)
#4 src/XF/Pub/App.php(634): XF\Template\Templater->renderNavigationClosure(Object(Closure), 'forums', Array)
#5 src/XF/Pub/App.php(585): XF\Pub\App->getNavigation(Array, 'forums')
#6 src/XF/App.php(2573): XF\Pub\App->renderPageHtml('












...', Array, Object(XF\Mvc\Reply\View), Object(XF\Mvc\Renderer\Html))
#7 src/XF/Mvc/Dispatcher.php(414): XF\App->renderPage('












...', Object(XF\Mvc\Reply\View), Object(XF\Mvc\Renderer\Html))
#8 src/XF/Mvc/Dispatcher.php(66): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#9 src/XF/App.php(2826): XF\Mvc\Dispatcher->run()
#10 src/XF.php(806): XF\App->run()
#11 index.php(23): XF::runApp('XF\\Pub\\App')
#12 {main}

Request state​

array(4) {
["url"] => string(54) "/threads/chaka-khan-released-ck-november-22-1988.5450/"
["referrer"] => bool(false)
["_GET"] => array(0) {
}
["_POST"] => array(0) {
}
}
 
Does it keep appearing again?
It's ok when you rebuild addon data - XF extension classes are deactivated, while template modifications and other add-on content remain active and can cause errors.

Ah ok and no it was just that one time. Thanks!
 
@Painbaker

Thank for last update, fantastic! (y)

1) I have a little more knowledge from the next quiz. Several users accidentally clicked "Complete Quiz" instead of moving to the next question, which caused frustration. Would it be possible to add a simple confirmation dialog (e.g., "Are you sure you want to end this quiz?" – Yes/No)? This would help prevent accidental submissions.

2) Would it be possible to introduce a "Fetured" function, similar to pinned threads in the forum?
  • Allow marking certain quizzes as recommended
  • Display them prominently in the quiz section
  • Optionally include them in a widget for better visibility
Thanks for your consideration!
 
I installed the quiz, but have some troubles:

- Quiz completion log: Can not delete here. ("Du hast keine Rechte, diese Seite anzusehen oder diese Aktion auszuführen.")

- Where do I enable the explanation? I don't find that, it does not show that?

- One time it crashed:
  • XF\Db\InvalidQueryException: MySQL statement prepare error [1064]: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') ASC LIMIT 10' at line 5
  • src\XF\Db\AbstractStatement.php:230
  • Stack-Trace​

    SELECT `xf_ozzmodz_quiz_question`.*
    FROM `xf_ozzmodz_quiz_question`

    WHERE (`xf_ozzmodz_quiz_question`.`quiz_id` = 2) AND (`xf_ozzmodz_quiz_question`.`question_state` = 'visible') AND (`xf_ozzmodz_quiz_question`.`question_id` IN (1))
    ORDER BY FIELD(`xf_ozzmodz_quiz_question`.`question_id`, ) ASC
    LIMIT 10

Kind regards

Wolfgang
 
- Quiz completion log: Can not delete here. ("Du hast keine Rechte, diese Seite anzusehen oder diese Aktion auszuführen.")


You must have this permission to delete completion records:

1741520764857.png


Where do I enable the explanation? I don't find that, it does not show that?
Do you mean correct answer explain?

1741520839140.png

You can set it on the add and edit question page. For the quiz player, it is displayed only after the user answers the question.


- One time it crashed:
  • XF\Db\InvalidQueryException: MySQL statement prepare error [1064]: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') ASC LIMIT 10' at line 5
  • src\XF\Db\AbstractStatement.php:230
  • Stack-Trace​

    SELECT `xf_ozzmodz_quiz_question`.*
    FROM `xf_ozzmodz_quiz_question`

    WHERE (`xf_ozzmodz_quiz_question`.`quiz_id` = 2) AND (`xf_ozzmodz_quiz_question`.`question_state` = 'visible') AND (`xf_ozzmodz_quiz_question`.`question_id` IN (1))
    ORDER BY FIELD(`xf_ozzmodz_quiz_question`.`question_id`, ) ASC
    LIMIT 10
Can you send the full stacktrace?
 
Dear Painbaker,

thank you for your quick reply!

First question concerning permission to delete completion records works now - thank you!

Second question concerning correct answer explain still does not work? If I fill the explanation text, it is not shown after a user completes the quiz. It is never shown.

Third question concerning MariaDB:
Code:
XF\Db\InvalidQueryException: MySQL statement prepare error [1064]: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') ASC LIMIT 10' at line 5
src\XF\Db\AbstractStatement.php:230
Generiert von: [URL='https://www.****.info/forum/admin.php?users/****-at.1/edit']****.at[/URL]
8 März 2025 um 17:49


Stack-Trace
SELECT `xf_ozzmodz_quiz_question`.*
            FROM `xf_ozzmodz_quiz_question`
         
            WHERE (`xf_ozzmodz_quiz_question`.`quiz_id` = 2) AND (`xf_ozzmodz_quiz_question`.`question_state` = 'visible') AND (`xf_ozzmodz_quiz_question`.`question_id` IN (1))
            ORDER BY FIELD(`xf_ozzmodz_quiz_question`.`question_id`, ) ASC
LIMIT 10
------------

#0 src\XF\Db\Mysqli\Statement.php(207): XF\Db\AbstractStatement->getException('MySQL statement...', 1064, '42000')
#1 src\XF\Db\Mysqli\Statement.php(46): XF\Db\Mysqli\Statement->getException('MySQL statement...', 1064, '42000')
#2 src\XF\Db\Mysqli\Statement.php(61): XF\Db\Mysqli\Statement->prepare()
#3 src\XF\Db\AbstractAdapter.php(96): XF\Db\Mysqli\Statement->execute()
#4 src\XF\Mvc\Entity\Finder.php(1447): XF\Db\AbstractAdapter->query('SELECT `xf_ozzm...')
#5 src\addons\OzzModz\Quiz\ControllerPlugin\Quiz.php(387): XF\Mvc\Entity\Finder->fetch()
#6 src\addons\OzzModz\Quiz\Pub\Controller\QuizItem.php(252): OzzModz\Quiz\ControllerPlugin\Quiz->actionResults(Object(OzzModz\Quiz\Entity\QuizItem), '/forum/quiz/tes...')
#7 src\XF\Mvc\Dispatcher.php(362): OzzModz\Quiz\Pub\Controller\QuizItem->actionResults(Object(XF\Mvc\ParameterBag))
#8 src\XF\Mvc\Dispatcher.php(265): XF\Mvc\Dispatcher->dispatchClass('OzzModz\\Quiz:Qu...', 'Results', Object(XF\Mvc\RouteMatch), Object(OzzModz\Quiz\Pub\Controller\QuizItem), NULL)
#9 src\XF\Mvc\Dispatcher.php(121): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(OzzModz\Quiz\Pub\Controller\QuizItem), NULL)
#10 src\XF\Mvc\Dispatcher.php(63): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#11 src\XF\App.php(2826): XF\Mvc\Dispatcher->run()
#12 src\XF.php(806): XF\App->run()
#13 index.php(23): XF::runApp('XF\\Pub\\App')
#14 {main}

Status der Anfrage
array(4) {
  ["url"] => string(28) "/forum/quiz/test-2.2/results"
  ["referrer"] => string(43) "[URL]https://www.***.info/forum/quiz/test-2.2/[/URL]"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}
Server-Fehlerprotokoll

Kind regards

Wolfgang
 
Last edited by a moderator:
Painbaker updated [XB] Quizzes with a new update entry:

2.0.4 Patch Level 1

  • Hide "select all" checkbox when no inline moderation actions available in quiz completion/play log
  • Avoid SQL error when displaying results for quiz play attempt with no visible questions
  • Setup "View correct answers for own quiz results" and "View correct answers explanations for own quiz results" default permissions for new installations

Read the rest of this update entry...
 
Dear @Painbaker ,

THANK YOU very much - all perfect solutions that work perfectly now! Cool work!

Anyway, the entire quiz is perfect!

Please allow some days, I need to translate some sentences into german language and fill the content for some quizzes. Then I will review your rather perfect work.

Kind regards

Wolfgang
 
Back
Top