Bug in SimpleQuiz 2.0.1800 – data-layout attribute empty, quiz fails to initiali
- Ralf
-
Topic Author
- Offline
- New Member
-
Less
More
- Posts: 1
- Thank you received: 0
4 months 1 week ago - 4 months 1 week ago #1
by Ralf
Bug in SimpleQuiz 2.0.1800 – data-layout attribute empty, quiz fails to initiali was created by Ralf
Subject:
Bug in SimpleQuiz 2.0.1800 – data-layout attribute empty, quiz fails to initialize
System information:
After updating to SimpleQuiz 2.0.1800, the quiz no longer works. Initialization fails because the data-layout attribute in the HTML is empty.
Expected behavior:
Actual behavior:
Root cause:The initialization code in sq.min.js checks:
Since data-layout is empty, SQQuiz is never instantiated. The quiz displays all questions, but no functionality works (pagination, timer, start button).
Configuration:
Second bug:
The "Custom JS" field in the menu item (tab "Advanced") is not rendered in the HTML output. JavaScript code entered there does not appear in the page source.
Workaround:
Manual initialization via JavaScript in the template:
Request:
Kind regards
Ralf
Bug in SimpleQuiz 2.0.1800 – data-layout attribute empty, quiz fails to initialize
System information:
- Joomla: 5.4.2
- SimpleQuiz: 2.0.1800
- Template: YooTheme
- PHP: 8.3.1.9
After updating to SimpleQuiz 2.0.1800, the quiz no longer works. Initialization fails because the data-layout attribute in the HTML is empty.
Expected behavior:
Code:
<div class="sq_instance" data-layout="quiz" data-uid="xsnys311" data-qid="1">
Actual behavior:
Code:
<div class="sq_instance" data-layout="" data-uid="xsnys311" data-qid="1">
Root cause:The initialization code in sq.min.js checks:
Code:
if ("quiz" == jQuery(this).data("layout"))
Since data-layout is empty, SQQuiz is never instantiated. The quiz displays all questions, but no functionality works (pagination, timer, start button).
Configuration:
- Menu item type: "Single Quiz"
- Quiz ID: 1
- Timer: 30 minutes
- Questions per page: 3
- Pre-text position: As intro with start button
- Yes, on every page load
- The quiz worked until January 11, 2026
- The file sq.min.js was modified on January 13, 2026
Second bug:
The "Custom JS" field in the menu item (tab "Advanced") is not rendered in the HTML output. JavaScript code entered there does not appear in the page source.
Workaround:
Manual initialization via JavaScript in the template:
Code:
jQuery(document).ready(function() {
var el = document.querySelector('.sq_instance[data-layout=""]');
if (!el) return;
var uid = el.getAttribute('data-uid');
var qid = el.getAttribute('data-qid');
var opts = Joomla.getOptions("com_simplequiz")[uid];
jQuery(el).find('.question_wrapper, .sq_timer, .sq-complete-test').hide();
jQuery(el).find('.simplequiz_pre_text').show();
sq_quizzes[uid] = new SQQuiz(uid, qid, jQuery(el));
sq_quizzes[uid].page_count = opts.page_count;
sq_quizzes[uid].questions_per_page = opts.questions_per_page;
sq_quizzes[uid].submit_on_last_page = opts.submit_on_last_page;
sq_quizzes[uid].pre_text_position = opts.pre_text_position;
sq_quizzes[uid].timer_info.isTimerQuiz = opts.timer_seconds > 0;
sq_quizzes[uid].timer_info.timer_seconds = opts.timer_seconds;
jQuery(el).find('.start-quiz').off('click').click(function() {
jQuery(el).find('.simplequiz_pre_text').slideUp();
jQuery(el).find('.sq_timer, .sq-complete-test').show();
jQuery(el).find('.question_wrapper').fadeIn();
sq_quizzes[uid].showPage(1);
sq_quizzes[uid].startTimer();
});
});
Request:
- Please set data-layout="quiz" correctly for menu item type "Single Quiz"
- Please render the "Custom JS" field from the menu item properly
Kind regards
Ralf
Last edit: 4 months 1 week ago by Ralf.
Please Log in or Create an account to join the conversation.
- Christopher Mavros
-
- Offline
- Administrator
-
4 months 1 week ago #2
by Christopher Mavros
Christopher Mavros
me@mavxr.com
If you like our extensions, please rate us on the JED!
Replied by Christopher Mavros on topic Bug in SimpleQuiz 2.0.1800 – data-layout attribute empty, quiz fails to initiali
Hello Ralf and thank you for posting!
Can you please check if you have a template override?
Both issues seem related to the quiz/default.php (previously just quiz.php layout) file being overwritten.
Let me know if you need help updating template overrides.
Can you please check if you have a template override?
Both issues seem related to the quiz/default.php (previously just quiz.php layout) file being overwritten.
Let me know if you need help updating template overrides.
Christopher Mavros
me@mavxr.com
If you like our extensions, please rate us on the JED!
Please Log in or Create an account to join the conversation.
Moderators: Christopher Mavros