News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

SMF Quiz

Started by Diego Andrés, February 18, 2009, 01:08:19 PM

Previous topic - Next topic

Dave J

Quote from: Kindred on March 07, 2012, 01:50:36 PM

I have no idea what database changes or code changes davejo has done -- since he has yet to answer my question (posed twice already) but it is not needed.

I'm sorry Kindred I thought you had read what I have done.

Ok here goes.

As you know there are no defualt quizzes with the mod, so what I have done is to extract the tables from my test site with 546 quizzes and I have attached them along with their images etc as a file. All those, willing to do so, have to do is install the quiz mod, then go into phpmyadmin and delete the current 12 tables that are created when the mod installs.

Once that is done then they open the sql file i have attached into Notepad++ and copy the text into a "Run SQL query/queries on database" window and run the query...this will then create the tables that hold the quizzes.

What should be noted is that some people are not using the default smf_ prefix on their tables so it means they will have to go through the sql file and manually remove the prefix.

And thats all there is too it.

If you want to removed the 'SMFQuiz' attachment I have in that post feel free to do so...the only reason I posted it is because someone was having problems installing the mod.. and that version I have posted will install without error on a clean install of SMF2.0.2

If you need to know anything else please ask


If you want quizzes to add to the new SMF2.1 quiz mod go here . There are also walkthroughs in the forum to explain how to install them and other tips.

vindinacho

Hi all,
I managed to get the mod installed with your help and started using the quiz, tried to add a question and when I hit save I got the following error.

Wrong value type sent to the database. Integer expected. (id_quiz)

I found this same error in the first page of this thread, but as far as I can see there was no answer given, does anyone have a "simple answer" to allow me to go further ?

Thanks
Vin

FrizzleFried

#422
What am I doing wrong?

I installed the mod package fine.

I followed the instructions to update my mySQL database... I deleted the old 12 entries,  used Notebook++ to paste them in... saved... they showed up.... in the admin I can see them... in the game i can see them... but when i go to play a game it opens the quiz window... I hit the play button and it continues to LOAD LOAD LOAD... never ending?  The little load bar moves but nothing happens.

My error logs read:

Quotehttp://aha-forums.com/index.php?action=admin;area=quiz;a78f7f0=8d5c9b7222ca7d3213b94477f1aa89f5
Apply Filter: Only show the errors with the same message
2: Invalid argument supplied for foreach()
Apply Filter: Only show the errors from this file
File: /home/ahaforum/public_html/Themes/default/SMFQuizAdmin.template.php (main sub template - eval?)
Line: 1740

and

Quotehttp://aha-forums.com/index.php?action=admin;area=quiz;a78f7f0=8d5c9b7222ca7d3213b94477f1aa89f5
Apply Filter: Only show the errors with the same message
8: Trying to get property of non-object
Apply Filter: Only show the errors from this file
File: /home/ahaforum/public_html/Sources/SMFQuizAdmin.php
Line: 2408


EDIT #2:  Those errors appear to be related to the QUIZ ADMIN side not the continual loading issue... as the error log shows a much earlier time for the errors vs when I've attempted to play the quiz.

The quiz window still just... sits there... loading...

EDIT #3: I verified the 12 QUIZ files are in the mySQL database.   The questions are there... answers... what not... the proper graphics are where they are supposed to be... the quizzes all load up on the menu... graphics etc... I can choose a quiz... when I hit the PLAY triangle button it pops up the quiz window... which sits there...

No error is generated evidently.






Dave J

Quote from: vindinacho on March 07, 2012, 04:03:33 PM
Hi all,
I managed to get the mod installed with your help and started using the quiz, tried to add a question and when I hit save I got the following error.

Wrong value type sent to the database. Integer expected. (id_quiz)

I found this same error in the first page of this thread, but as far as I can see there was no answer given, does anyone have a "simple answer" to allow me to go further ?

Thanks
Vin

Quote from: FrizzleFried on March 07, 2012, 06:48:05 PM
What am I doing wrong?

I installed the mod package fine.

I followed the instructions to update my mySQL database... I deleted the old 12 entries,  used Notebook++ to paste them in... saved... they showed up.... in the admin I can see them... in the game i can see them... but when i go to play a game it opens the quiz window... I hit the play button and it continues to LOAD LOAD LOAD... never ending?  The little load bar moves but nothing happens.

My error logs read:

Quotehttp://aha-forums.com/index.php?action=admin;area=quiz;a78f7f0=8d5c9b7222ca7d3213b94477f1aa89f5
Apply Filter: Only show the errors with the same message
2: Invalid argument supplied for foreach()
Apply Filter: Only show the errors from this file
File: /home/ahaforum/public_html/Themes/default/SMFQuizAdmin.template.php (main sub template - eval?)
Line: 1740

and

Quotehttp://aha-forums.com/index.php?action=admin;area=quiz;a78f7f0=8d5c9b7222ca7d3213b94477f1aa89f5
Apply Filter: Only show the errors with the same message
8: Trying to get property of non-object
Apply Filter: Only show the errors from this file
File: /home/ahaforum/public_html/Sources/SMFQuizAdmin.php
Line: 2408


EDIT #2:  Those errors appear to be related to the QUIZ ADMIN side not the continual loading issue... as the error log shows a much earlier time for the errors vs when I've attempted to play the quiz.

The quiz window still just... sits there... loading...

EDIT #3: I verified the 12 QUIZ files are in the mySQL database.   The questions are there... answers... what not... the proper graphics are where they are supposed to be... the quizzes all load up on the menu... graphics etc... I can choose a quiz... when I hit the PLAY triangle button it pops up the quiz window... which sits there...

No error is generated evidently.

Sorry but I cannot answer either of those questions as they are not errors I have personally seen.


Just for clarification...the database changes I have posted have worked on 3 different sites with different settings and names etc without errors.

I would suggest going back...removing everything to do with the quiz...including checking the files manually and starting again. Install the mod and try to create a quiz without making the changes to the database as I suggest and see if you then have the issues, save the whole database and then do database changes. If you have issues before the database changes then it must be in your templates somewhere.

Again I should point out that I'm not a coder and that everything I have done has worked for me and a few others. So I'm sorry I can't be of more help...I just help out wherever I can.
If you want quizzes to add to the new SMF2.1 quiz mod go here . There are also walkthroughs in the forum to explain how to install them and other tips.

vindinacho

Hi Davejo,

I installed the mod from the modsite, not yours, the error shown is on this one.
But I am going to try yours on my test site as I have seen it on your site and quite impressed.
I will let you know how it goes.

Thanks
Vin

FrizzleFried

Can anyone suggest how I can capture what appears to be an error or something that pops on screen for a split second when I click the play button and the new window opens up ... it does it about 1/2 the time... I can see what appears to be an error but it then goes black... it's so fast I cant tell what's up.


FrizzleFried

I just un-installed and deleted the 12 MySQL entries...I then re-installed and made a test quiz.

Nope... it doesn't work.

:(

I got no errors when I install either.

:(


vindinacho

Hi Davejo,

I installed the quiz without problem after a quick learning curve on file types (rar, zio etc)
But it's there so thanks.

I tried downloading the quizzes but for some reason I cannot get them from the RS site ?
Is there any other way I can get them - email perhaps ?

Thanks
Vin

vindinacho

See attached

Thanks Vin

Dave J

Quote from: vindinacho on March 08, 2012, 04:16:17 AM
See attached

Thanks Vin

I have just tested the one I've posted and it works for me and I have just been to the host and it's definately there so I'm sending you the link via PM. If it still doesnt work I'll host it on my test site for download...but not till I get home this evening.
If you want quizzes to add to the new SMF2.1 quiz mod go here . There are also walkthroughs in the forum to explain how to install them and other tips.

ethankcvds

Quote from: vindinacho on March 08, 2012, 04:16:17 AM
See attached

Thanks Vin


If you're using services like rapidshare to download you have to download to your computer or else it is not going to do anything accept return an error.
No Pm's for support please!

vindinacho

Yep tried that, hit download to pc loads of times. I'm on Mac but guessing thats not the problem

FrizzleFried

#432
Welp... I am not officially bummed out.   I ran a test install of SMF 2.0.2 and installed just quiz.  Of course it works.  I have a ******-ton of work in to my current installation so re-installing isn't going to happen.  I have to determine WHY it's not working on my current installation somehow.  Hard to do when you don't know WTF you're doing, eh?

:(

EDIT: Now I am even more bummed... I just directly the test site to my current database and... it worked. 

The problem is somewhere in the code/theme...


EDIT #2:  Well... that "error" message I thought might be isn't..  On the working test site it pops up for a split second too... followed by the quiz.

:(




FrizzleFried

Here is a possible round-about-way of getting this done... just want opinions from those in the know.

Could I set up QUIZ on my test forum... point it to my current forums database... then alter the link in my current forum to look for SMFQUIZ in the directory of the test forum?   Would that work?  If so,  any suggestions on how to alter the forwarding link?


vindinacho

Hi everyone,
Just want to say thanks for the great support on this forum, in two days I have managed to put the quiz site on my test forum all up and running.
So far it seems to be working ok.

I have just one question for Davejo, I imported all the quizzes thanks, it doesn't look like I can disable and enable individual quizes, by toggling the white/yellow lock, or actually even within the individual quiz setup. - They still work even after disabling.

Just wondered if you had come across this and found anyway around it. Effectively I just want to run one quiz, and then run another on another day and so on, but not have 500 for users to pick from if that makes sense.

Hope you or anyone can help.

Thanks
Vin

Dave J

Hi Vin,

Glad you got it working OK...at least my directions did work for you.

As far as disabling quizzes, I managed to do it the following way:

Admin/Configuration/Quiz/Quizzes and then disable each quiz individually by clicking on the padlock under the 'Functions' column, there doesn't seem to be an option for mass disabling...I have just tested this on my test site and once the quiz is disabled and the padlock icon next to it goes gold then it's disabled and can't be seen on the forum quiz page.

See attachment below
If you want quizzes to add to the new SMF2.1 quiz mod go here . There are also walkthroughs in the forum to explain how to install them and other tips.

vindinacho

Hi, thanks

Yes I did that, I tried again disabling all quizes except two.
The two I left enabled now only show up in "New Quizes" and "Popular Quizes" but unfortunately all the quizes show up still in "Random unplayed Quizes"

See the screenshot - It appears disabling does not restrict them from showing under the Random heading, do you know of any way to either remove the Random from the theme, or disabling - I don't really want the Random part there anyway ?

Thanks
Vin


Dave J

Quote from: vindinacho on March 09, 2012, 04:37:55 AM
See the screenshot - It appears disabling does not restrict them from showing under the Random heading, do you know of any way to either remove the Random from the theme, or disabling - I don't really want the Random part there anyway ?

Thanks
Vin

It'll probably be in one of the templates somewhere Vin,

I'll take a look and do some testing on my test site and if I get I get it removed without errors I'll let you know.
If you want quizzes to add to the new SMF2.1 quiz mod go here . There are also walkthroughs in the forum to explain how to install them and other tips.

vindinacho

Ok I'm already doing the same now.

Thanks

Dave J

Ok I have found the section of code in

/Themes/default/SMFQuiz.template.php.

I have removed the section of code that relates to the 'Random Unplayed Quizzes' and the 'Quiz Search', as if your only having one quiz there is nothing to search for, and all seems to be ok with no errors being reported whilst trying to play or administrate the quiz mod.

I have attached the modified template below, just rename the existing version in your default themes folder and upload the one below.

Hope that helps
If you want quizzes to add to the new SMF2.1 quiz mod go here . There are also walkthroughs in the forum to explain how to install them and other tips.

Advertisement: