SMF Quiz

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

Previous topic - Next topic

Kindred

well, that is hardly the fault of this mod...   that problem is because you changed something basic to the core SMF. I'm surprised that you only get the error in the quiz...  it should be appearing with every page load.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

FrizzleFried

...all I did was install Quiz to a stock SMF 2.0.2... ?  Not sure whats up.  Everything appears to be working OK BTW.


Kindred

well, you said that you had changed the logout array....  this mod doesn't change that
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

FrizzleFried

Any suggestions on what to do / where to look to rectify the problem regardless of whether the mod caused the problem or not... by chance?

GlitchPC

Just noticed today...

I got an error today with the Quiz after viewing the Statistics but, the error referred to a template from a different mod.  So, I removed the error from the Admin log...disabled template evaluations and viewed Statistics, again.

I received the following error:

http://glitchpc.net/index.php?action=SMFQuiz;sa=statistics
2: Division by zeroFile: /xxx/xxx/xxxxx/xxxxxxxx/xxxxxxxx/Themes/default/SMFQuiz.template.php
Line: 1129


Any help with this error?

Thanks, in advance...

Kindred

What is that line of code?
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

GlitchPC

Kindred,

Here's the line of code you requested:

$percentage = ($hardestQuizesRow['percentage_incorrect'] / $max) * 100;

Dave J

Quote from: GlitchPC on March 21, 2012, 10:03:02 PM
Just noticed today...

I got an error today with the Quiz after viewing the Statistics but, the error referred to a template from a different mod.  So, I removed the error from the Admin log...disabled template evaluations and viewed Statistics, again.

I received the following error:

http://glitchpc.net/index.php?action=SMFQuiz;sa=statistics
2: Division by zeroFile: /xxx/xxx/xxxxx/xxxxxxxx/xxxxxxxx/Themes/default/SMFQuiz.template.php
Line: 1129


Any help with this error?

Thanks, in advance...

I can't replicate that no matter what I do I get no errors at all.

So a suggestion.

1. Try un-installing the mod that the error referred to in the first place and see if it still happens when you access the stats. If it doesn't then the fault may be with the other mod.

2. The other thing is that the code is calling for the stats to be shown realting to the 'easiestQuizesRow'. Do you have Quizzes installed? They don't have to have been played. If yes then revert back to 1.
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.

GlitchPC

#468
davejo,

I have a total of 6 quizzes added.  I had, recently, made some file replacements...as you had suggested in a PM...remember?

Afterwards...I cleared the stats because I changed the time it should take to answer a question...and reset all the stats so that all who took the quizzes could take them, again, under the new settings.

So far...only one quiz has been taken...under the new time settings.  This person did not miss a question.  So, if the 'percentage_incorrect' is "0"...then, there will be an issue based on the code Kindred requested, correct?


Edit...

Now that someone else has taken the quiz...and when I click "Statistics"...that error no longer appears.

Dave J

Quote from: GlitchPC on March 22, 2012, 09:17:39 AM
davejo,

I have a total of 6 quizzes added.  I had, recently, made some file replacements...as you had suggested in a PM...remember?

Afterwards...I cleared the stats because I changed the time it should take to answer a question...and reset all the stats so that all who took the quizzes could take them, again, under the new settings.

So far...only one quiz has been taken...under the new time settings.  This person did not miss a question.  So, if the 'percentage_incorrect' is "0"...then, there will be an issue based on the code Kindred requested, correct?


Edit...

Now that someone else has taken the quiz...and when I click "Statistics"...that error no longer appears.

very strange...I had all the quizzes installed on the test site but no one has played a quiz and there was no error.

Maybe it had something to do with the changes to the times...and that the cache had not fully cleared.

So I guess that the problem has now gone away?
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.

Ozzie

or maybe its the division by zero error that only occurs when it is trying to insert a integer into a data file and there is nothing to input as there was no quizzes played ( or so i read whilst looking up the error) there is sommat you can add to the line of code like if no data dont print error or sommat like that i aint no coder so dont know.......

2000+ games available to download

GlitchPC

davejo,

Yes...the error no longer appears.  I believe Ozzie may be onto something...

eric1234

Argh, sorry i thought that thread was a support thread >.<

Is this talking to me >.<

Quote from: emanuele on March 20, 2012, 03:23:39 PM
Easiest way to solve it should be to open SMFQuizAdmin.php, then look for:
function ParseLeagueMessage($message, $quizLeagueName, $oldPosition, $newPosition, $positionMovement, $id_quiz_league)
{
global $user_settings, $scripturl;

// @TODO single replace
$message = str_replace("{quiz_league_name}", $quizLeagueName, $message);
$message = str_replace("{old_position}", $oldPosition, $message);
$message = str_replace("{new_position}", $newPosition, $message);
$message = str_replace("{position_movement}", $positionMovement, $message);
$message = str_replace("{quiz_league_link}", $scripturl . '?action=SMFQuiz;sa=quizleagues;id=' . $id_quiz_league, $message);
return $message;
}


and replace it with:
if (!function_exists('ParseLeagueMessage'))
{
function ParseLeagueMessage($message, $quizLeagueName, $oldPosition, $newPosition, $positionMovement, $id_quiz_league)
{
global $user_settings, $scripturl;

// @TODO single replace
$message = str_replace("{quiz_league_name}", $quizLeagueName, $message);
$message = str_replace("{old_position}", $oldPosition, $message);
$message = str_replace("{new_position}", $newPosition, $message);
$message = str_replace("{position_movement}", $positionMovement, $message);
$message = str_replace("{quiz_league_link}", $scripturl . '?action=SMFQuiz;sa=quizleagues;id=' . $id_quiz_league, $message);
return $message;
}
}


BTW, is probably better if you use the support topic for that kind of questions. ;)

Kindred

if yuo are getting that error message (duplicate function) then either
a) you installed the quiz mod twice
or
b) you have another mod which created an identically named function.

In the case of a), you will have to manually remove the duplicate code
in the case of b), there are much larger issues... you would have to rename one of the functions and every reference to it for the mod.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

GlitchPC

It's me, again, Margaret... :laugh:

Can anyone take a look at the attached image and please tell me what template...and where in that template I can find the code to edit the color/style/class for those column headers?  I really would appreciate it.

Thanks, in advance...

GlitchPC

Politely bumping...

Dave J

Quote from: GlitchPC on March 24, 2012, 10:39:58 PM
It's me, again, Margaret... :laugh:

Can anyone take a look at the attached image and please tell me what template...and where in that template I can find the code to edit the color/style/class for those column headers?  I really would appreciate it.

Thanks, in advance...

I had a brief look and I could not find the edits for that...but I always thought it was got from the CSS for the mod itself...hopefully someone will answer as I would like to know also.
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.

FrizzleFried

Well... I am still having the same problem.  Quiz installs without error.  Everything appears as it is supposed to.  Unfortunately when I go to play the quiz,  the quiz window pops up... then nothing.   

I HAVE installed this on a clean version of SMF and it worked fine.   There IS some sort of conflict going on with my DEFAULT,  but highly modified theme.... but if it's not throwing out an error I have NO idea how to go about fixing the problem.

ANY suggestions would be greatly appreciated.

SMF 2.0.2
DEFAULT theme (with many modifications)

Thanks!


Shades.

Quote from: davejo on March 04, 2012, 04:12:19 AM
Quote from: mrselnombre on March 03, 2012, 04:00:54 PM
I'd really like to try this mod.
Does anyone have the quiz packs?

Want to see if i can get it working.


First thing you need to do is install the quiz even though you dont have any images or questions.

Then download the tables and images I have uploaded (13Mb) here

Once you have done that then go to your cPanel for your site, run 'phpMyadmin' and delete the 12 tables that start with the name smf_quiz.

Once you have done that, open the file 'create database tables for quiz.sql' in 'Notepad++' if you don't have it installed get it...it's free, and this will not add any formatting to the text either which is very important.

The copy the text, (CTRL+A).

Go to your database and click on 'SQL' at the top of the page and paste (CTRL+V)the text from the database file into the box. Once you have done that click on go....wait for a while until the text disappears then click on you database name to see if the tables have been installed. If yes then close 'cPanel'.

Now go to the location where your SMF site is installed go to
Quote/public_html/Themes/default/images/quiz_images
using the folders provided by me overite the existing 2 folders 'Questions' & Quizes'

Once you have done that go to you site and clear out the cache and your quiz should be safe to run.

I have tested this method on my test site and it worked twice so there should be no reason that I can think of that it wont work on yours.

As I'm not sure if the link I have provided for the files is allowed PM me if the staff delete it and I'll send the link that way.

Worked like a charm! Thanks! ;)

Only problem I'm having is the search feature...searching for certain quizzes, even though they're there, the search feature produces a page with nothing found. Is there any fix for that or did I miss it somewhere. I've read this support thread back to page 19 but I might have overlooked it!??
ShadesWeb.com - Custom Logos - My Themes on SMF | My Themes on ShadesWeb
https://shadesweb.com

BikerHound.com - Sniffing out the road ahead
https://bikerhound.com

Dream as if you'll live forever; Live as if you'll die today. - James Dean

Dave J

Quote from: Shades. on March 28, 2012, 09:02:17 PM
Worked like a charm! Thanks! ;)

Only problem I'm having is the search feature...searching for certain quizzes, even though they're there, the search feature produces a page with nothing found. Is there any fix for that or did I miss it somewhere. I've read this support thread back to page 19 but I might have overlooked it!??

Glad it's working for you OK.

I have tried this on all three forums I have set up and it works on all of them, including my test sites one of which is a fresh install of SMF 2.0.2...see screen shot.

What should happen is when you type into the search box it should populate an area below it, as seen in the image, of all the possible matches to your entry. Then all you do is click on one of them and the quiz should open ready to play.

If thats not happeneing it's possible you need to run the 'Database' maintenance 'Optimize all tables' and maybe go through and clear the site cache etc too.

If that doesn't work then I have no idea why it wont. 
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: