Problem importing quizzes

Started by Shades, 02.11.2022, 23:20

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Shades

SMF 2.1.2

Hey Dave,

I got the quiz installed and working but having trouble importing the quizzes from Film & Theatre. Specifically Pack 6b & Pack 6c. I get the following error:

QuoteError
Type of error
Database
Error message
Database Error: Data too long for column 'question_text' at row 1
File
/home/******/public_html/******/Sources/Quiz/Db.php
Line
2419
URL of page causing the error
https://******.com/?action=admin;area=quiz;sa=quizimporter

Backtrace information
#0: smf_db_error()
Called from /home/******/public_html/******/Sources/Subs-Db-mysql.php on line 494
#1: smf_db_query()
Called from /home/******/public_html/******/Sources/Subs-Db-mysql.php on line 802
#2: smf_db_insert()
Called from /home/******/public_html/******/Sources/Quiz/Db.php on line 2419
#3: ImportQuizQuestion()
Called from /home/******/public_html/******/Sources/Quiz/Admin.php on line 2343
#4: import_quiz()
Called from /home/******/public_html/******/Sources/Quiz/Admin.php on line 2658
#5: GetQuizImportData()
Called from /home/******/public_html/******/Sources/Quiz/Admin.php on line 198
#6: SMFQuizAdmin()
Called from /home/******/public_html/******/Sources/Admin.php on line 509
#7: AdminMain()
Called from /home/******/public_html/******/index.php on line 192

Thanks,
Shades
ShadesWeb.com - Custom Logos & SMF Themes
BikerHound.com - Motorcycle Events
  •  

Dave

Hi Shades

I see from the dowload page there are 44 quizzes in that pack. As I don't have access to my PC at the moment I cant remember if the are 2 or more xml files in the zip.

If there are only 2 it might be because the quiz doesn't like to import more that 20 quizzes in a pack, although I think one set does have more and did work ok on my site.

It also might be one of the questions exceeds the character limit for a question itself. There is a way to increase the limit but without looking at the code I cant remember where to change it.

I will have a look tomorrow morning and reply again

Dave
traffic.gif
  •  

Dave

When I woke up this morning I remembered this was an old problem.

It's because of the title var which is set to 255.

Go to your phpMyAdmin, select your database at the top of the left column.

In the right hand panel look for the table 'smf_quiz_question', see attachments

Now click on 'Structure'

In the next window on line 3 you should see '3   question_text' at the end of that line click on 'Change'.

Now change the value 255 to 512 and then click on 'Save'

You should now have no problems importing quizzes with long question titles.

Regards

Dave

traffic.gif
  •  

 
With the nights now getting longer, there's no better time to sign up and play quizzes and games. It costs nothing to join so come in and have some fun
Example