News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

SMF Quiz

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

Previous topic - Next topic

Shades.

So now Im back on the quiz page and it says:

QuoteYou have the following outstanding Quiz Sessions to be completed:
Mar 07 2021 - CBBC Programs -Question 10
Mar 07 2021 - Computer Terms -Question 10

So I click on: Mar 07 2021 - CBBC Programs -Question 10 and it takes me to the screen to play the quiz and I see:
QuoteYou will be given 10 questions
You will have 35 seconds to answer each question
This quiz can be played 4 times
This quiz is configured to show correct answers after submitting answer
You currently have a session for this quiz open and therefore this previous session will be resumed
So I clicked on Play and it says Start Quiz, I click on that and it says:
QuoteQuiz Completed!

Your Statistics

You answered a total of 10 questions
You answered 1 correctly
You answered 9 incorrectly
You did not answer 10 questions in time
You took a total of 46 seconds to answer the questions
Oh dear, you really were poor in that quiz.

These results have been submitted to the database, click the button below to finish

But the scores ARE recorded! :o
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

Not sure why it's doing that Shades.

I have installed it on my live site and I get the same error. It doesn't do it on the test site though. Not sure what the problem is with that.

I will investigate tomorrow.
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.

Shades.

OK thanks Im just glad to see it in action again but not ready to put it on my live site yet!

The only error in my logs is:
QuoteType of error: Critical
https://xxxx.com/xxxx/index.php?action=SMFQuizEnd;id_quiz=3;questions=10;correct=6;incorrect=4;timeouts=0;id_session=ee1a6b19f144eaeefd35cd4441342187;total_seconds=68;creator_id=1;totalResumes=0&_=1615144043098 Call to undefined function mysql_escape_string()

Also didn't know if you seen my other post a page back lol! https://www.simplemachines.org/community/index.php?topic=293949.msg4083996#msg4083996
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 07, 2021, 02:24:58 PM

Also didn't know if you seen my other post a page back lol! https://www.simplemachines.org/community/index.php?topic=293949.msg4083996#msg4083996

Yes I did read that. I will change the text tomorrow 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.

Dave J

I have found out the error is caused by php7.

I have reverted my site temporarily to php5.6 and the error doesn't happen.

As I'm not a coder I'm not sure what needs to be done to resolve it.

Maybe someone reading this might be able to help us; unless you know Shades?
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.

Shades.

Well darn! No I'm clueless about that as I am no coder either I just follow directions real good lol! :D
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

It seems that the issue is definitely related to php.

And there was an error on the test site, the reason it didn't show up is because I was regarded as the writer of the question and therefore it didn't try to save the score, therefore it didn't try to run that part of the code.

So it's back to the drawing board.

I am going to remove the link to the mod until I can find out what the problem is and if possible fix it. I might even pay someone to look at it for me. Once I have an update I will re-post here to let you know.

I have changed the 'Readme' text to show the point you raised Shades.
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.

Shades.

Quote from: Dave J on March 08, 2021, 04:05:56 AM
It seems that the issue is definitely related to php.

And there was an error on the test site, the reason it didn't show up is because I was regarded as the writer of the question and therefore it didn't try to save the score, therefore it didn't try to run that part of the code.

So it's back to the drawing board.

I am going to remove the link to the mod until I can find out what the problem is and if possible fix it. I might even pay someone to look at it for me. Once I have an update I will re-post here to let you know.

I have changed the 'Readme' text to show the point you raised Shades.
Thanks and good job for what you have done and if I can help please let me know!
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

OK all errors are now sorted it now works on PHP7. Thanks to VB who steered me in the right direction

I have now uploaded a new set of files to take in the changes made. As before just click on the link in my signature to download.

The following changes have been made:

1.Readme text updated to make users aware of the possible differences in the database table prefixes. Thanks to Shades for the heads up. I have also re-read the instructions and hopefully made them a little clearer

2. SMFQuizEnd.php code changed to allow quizzes to be saved without the mysql error.

3. Missing 'bar.gif', which was in previous versions of SMF default theme images folder, but now uses 'bar_stats.png' for 'Statistics', 'SMFQuiz.template.php' template code changed to use the same image.

4. In a previous post I mention about my test site. That has now been removed as I have installed the new version on my live site.

==========================

Shades, so you don't have to download the whole thing again, unless you want to, I have attached the 2 files to this post so all you have to do it overwrite the existing ones in your set up.

One last thing I would say is that, as mentioned in a previous post, I am not a coder, I dabble, some may say we are the worst type, but I really like this mod and it seems a shame for it not to be used again now we have 'Ruffle' to make it work.

thanks and regards

Dave
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.

Shades.

Great Job Dave J! 8)
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

Shades.

What does it mean by
QuoteYou did not answer 0 questions in time
I answered 9 out of 10 and everything works great just wondering what that was meant for and if anyone knows how/where to remove it!? Cause no matter good or bad you do in the Quizzes that phrase never changes. :o
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

Shades.

I see what it's meant for now:
Quote
You answered a total of 10 questions
You answered 3 correctly
You answered 6 incorrectly
You did not answer 1 questions in time
You took a total of 106 seconds to answer the questions
That was not your best effort now was it?

These results have been submitted to the database, click the button below to finish

It just looks weird or didn't make sense when it just said "You did not answer 0 questions in time". I'm still looking for where to edit that though?
Maybe change it to "You ran out of time with 0 questions".
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

Shades.

Ok I found it if anyone else wants to change it.

Open "../Themes/default/scripts/quiz_scripts/QuizClient.js"

Find: quizStatsOutput += "<br/>You did not answer <font color=\"#F5F54A\">" + timeout_count + "</font> questions in time";
Replace with: quizStatsOutput += "<br/>You ran out of time with <font color=\"#F5F54A\">" + timeout_count + "</font> questions";
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 08, 2021, 06:53:37 PM
Ok I found it if anyone else wants to change it.

Open "../Themes/default/scripts/quiz_scripts/QuizClient.js"

Find: quizStatsOutput += "<br/>You did not answer <font color=\"#F5F54A\">" + timeout_count + "</font> questions in time";
Replace with: quizStatsOutput += "<br/>You ran out of time with <font color=\"#F5F54A\">" + timeout_count + "</font> questions";

Thanks Shades
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.

Dave J

Updates:

a. QuizClient.js: Change 'You did not answer 0 questions in time' to 'You ran out of time with 0 questions'

b. Category database table text: There was an issue with category 1 never being populated when the quizzes were installed. It's now been assigned 'Spare'

c. Quizzes: The packs have been re-numbered and I found that the Technology quiz was already in the Transport pack so this has been merged and renamed and numbered. 'Kids' has also been given a pack number.

d. Folder dates: All dates have been removed from the folders. The reason for this is because when updates are done the whole 'Readme first.txt' has to be updated with the new folder names too.

Thanks to Shades for his help.

A new link has been posted.
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.

Dave J

The quiz has now been checked and double checked for errors.

I have now removed the download link from my signature and put a link to my website where where I have created a category relating to the install of every aspect of the Quiz, Categories and new quizzes that I have made.

In order to download anything from my site you will need to register.
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.

Jotade29

Hi, now i installed this mod, but when i create a quizz this error drop me...

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

How i fix it?

Thanks,

Version: 2.0.19
Quote from: Diego Andrés on August 12, 2023, 02:20:18 AMI'm afraid convincing Jotade to upgrade to SMF 2.1 will require bigger effort than your work sanitizing Unicode characters  :laugh:

Diego Andrés

During a quiz session?
You might need to go into the quiz_session table and add a default value of 0 for id_quiz

SMF Tricks - Free & Premium Responsive Themes for SMF.

Jotade29

Hi @Diego Andrés

is it in the quiz_session table? The first thing I have done is check that the id_quiz of ALL the tables are INT, then I have gone to the table quiz_session as you have told me, I have entered the column id_session, and by default I have specified a value = 0, and not it works. If I go into the smf_quiz table it won't let me touch the default of the id_quizz column. The error I get when I go into administration, and I ask questions, fill the question, and when I give to save, I get the wrong type error that an INT was expected.
Quote from: Diego Andrés on August 12, 2023, 02:20:18 AMI'm afraid convincing Jotade to upgrade to SMF 2.1 will require bigger effort than your work sanitizing Unicode characters  :laugh:

Diego Andrés

Quote from: Ivan. on January 06, 2022, 01:49:12 PMquiz_session as you have told me, I have entered the column id_session

Except I said it'd be the id_quiz column.
I checked it yesterday and it appears it's the only id_quiz column without a default value, in the quiz_session table.

Might be worth trying

SMF Tricks - Free & Premium Responsive Themes for SMF.

Advertisement: