Bug Short answer quizes not being scored correctly.

Status
Not open for further replies.

kcwayland

Customer
bug1.jpgbug2.jpg

So we are creating Quizes with short answer and then judging them, but each time the score comes out to 0% on the review quiz side. Any idea why that might be?

3/3 would be 100%, yes?
 
Ok, so I think I see the issue. It calculates correctly if I go into AdminCp and tell it to recalculate the high scores. Do I have to do that manually, or how often will it do it on its own?
 
Sorry, it's a bug in the code.
I'll fix it in the next release. If you want to fix it yourself manually for now
Open dbtech/vbquiz/actions/quizcomm.php

About line 714 you'll find

PHP:
            $vbulletin->db->query_write("
                UPDATE " . TABLE_PREFIX . "dbtech_vbquiz_taken 
                SET 
                    percent_result_id    = " . intval($percent_total) . ", 
                    final_score            = " . intval($final_score) . ", 
                    possible_score        = " . intval($possible_score) . ", 
                    judged                = '1', 
                    judgerid            = " . intval($vbulletin->userinfo['userid']) . "  
                WHERE 
                    taken_id            = " . intval($subid)
            );
Change it to
PHP:
            $vbulletin->db->query_write("
                UPDATE " . TABLE_PREFIX . "dbtech_vbquiz_taken 
                SET 
                    percent_result_id    = " . intval($percent_total) . ", 
                    final_score            = " . intval($final_score) . ", 
                    possible_score        = " . intval($possible_score) . ", 
                    final_result_text    = '" . intval($percent_total) . "%', 
                    judged                = '1', 
                    judgerid            = " . intval($vbulletin->userinfo['userid']) . "  
                WHERE 
                    taken_id            = " . intval($subid)
            );

After that, when you judge a quiz it should display correctly.
 
Sorry, it's a bug in the code.
I'll fix it in the next release. If you want to fix it yourself manually for now
Open dbtech/vbquiz/actions/quizcomm.php

About line 714 you'll find

PHP:
            $vbulletin->db->query_write("
                UPDATE " . TABLE_PREFIX . "dbtech_vbquiz_taken 
                SET 
                    percent_result_id    = " . intval($percent_total) . ", 
                    final_score            = " . intval($final_score) . ", 
                    possible_score        = " . intval($possible_score) . ", 
                    judged                = '1', 
                    judgerid            = " . intval($vbulletin->userinfo['userid']) . "  
                WHERE 
                    taken_id            = " . intval($subid)
            );
Change it to
PHP:
            $vbulletin->db->query_write("
                UPDATE " . TABLE_PREFIX . "dbtech_vbquiz_taken 
                SET 
                    percent_result_id    = " . intval($percent_total) . ", 
                    final_score            = " . intval($final_score) . ", 
                    possible_score        = " . intval($possible_score) . ", 
                    final_result_text    = '" . intval($percent_total) . "%', 
                    judged                = '1', 
                    judgerid            = " . intval($vbulletin->userinfo['userid']) . "  
                WHERE 
                    taken_id            = " . intval($subid)
            );

After that, when you judge a quiz it should display correctly.

Awesome! I'll try it out. Thanks!
 
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
Back
Top