Bug P by D quiz results not obeying correct question order

Status
Not open for further replies.

Morrus

Customer
The Personality by D quiz isn't acting as I'd expect it to. I have six questions, with their order set in the question manager as 1,2,3,4,5,6 as you'd expect. For many, though, the answer to Q1 is appearing in the middle rather than first when viewing their results. So they're getting things like this:

"Here's my results, a direct copy and paste: "Dexterity 16, Constitution 8, Greetings, adventurer! Here are your real-life abiility scores: Strength 8, Intelligence 14, Wisdom 14, Charisma 8."​

The bolded bit is the Q1 result, and should be appearing first.
 
Do you have the Order set for the questions? I just looked at the code and it builds the result in that order.
 
I figured it out. If you edit dbtech/vbquiz/actions/quizcomplete.php

Find
PHP:
        //Get all answers for the quiz
        $answer_query = $vbulletin->db->query_read("
            SELECT 
                qa.*, 
                qq.question_type
            FROM " . TABLE_PREFIX . "dbtech_vbquiz_answer qa 
            LEFT JOIN " . TABLE_PREFIX . "dbtech_vbquiz_question qq ON qa.question_id = qq.question_id 
            WHERE 
                qa.quiz_id    = " . intval($id) . " 
            ORDER BY 
                qa.sort_order
        ");

and replace it with

PHP:
        //Get all answers for the quiz
        $answer_query = $vbulletin->db->query_read("
            SELECT 
                qa.*, 
                qq.question_type
            FROM " . TABLE_PREFIX . "dbtech_vbquiz_answer qa 
            LEFT JOIN " . TABLE_PREFIX . "dbtech_vbquiz_question qq ON qa.question_id = qq.question_id 
            WHERE 
                qa.quiz_id    = " . intval($id) . " 
            ORDER BY 
                qq.sort_order, qa.sort_order
        ");

I'll fix it in the next version.
 
Status
Not open for further replies.

Legacy vBQuiz

vBulletin 3.8.x vBulletin 4.x.x
Seller
DragonByte Technologies
Release date
Last update
Total downloads
435
Customer rating
0.00 star(s) 0 ratings
Top