TinyPortal

Development => Block Codes => Topic started by: jacortina on October 30, 2007, 01:04:23 AM

Title: TP Quiz Script (PHP Article)
Post by: jacortina on October 30, 2007, 01:04:23 AM
* * * Updated File Below * * *
See: http://www.tinyportal.net/index.php?topic=19688.msg160871#msg160871

All that was asked for was a simple script with just a couple of extra capabilities.

;D

Paste the contents of the attached "jquiz.php-article.txt" into a new PHP Article. There are only a few lines for configuration within the script:
$q_dir = 'quizfiles';                   // relative to forum base directory
$q_prefix = 'quiz';                     // filenames of XML quiz files must start with this (case-sensitive) string
$q_XML_help = 'Sources/JQuizXML.php';   // Location of XML Format 'help' file.

$q_admin_grps = array(2);               // Groups to admin quizzes (2-Global Moderators)
$q_mod_grps = array(2);                 // Groups to moderate/approve group changes
$q_mod_users = array();                 // Users allowed to moderate/approve group changes

$q_retake_pass = 'true';                // Can users re-take quizzes that they've passed?
        //      Can be overridden with per-quiz parameters.


It's set up to look for the XML Quiz files it uses in the directory 'quizfiles' and look for them as starting with the characters 'quiz' (put the files from the 'quizfiles.zip' into that directory; they're all the same three question quiz, but with different additional parameters).

Access to the Admin menu limited to forum admins and members of groups given in the array shown. Give a lot of information about the quizzes and is necessary for creation (or re-creation) of the DB table to keep scores. The other arrays are for those who can approve/dismiss pending membergroup changes which can be 'earned' by passing quizzes configure for that. Final config variable is for default behavior to handle passed test re-taking (can or cannot); this can be overridden by parameters in a quiz itself.

The last of the three files, 'JQuizXML.php', contains a single function to display instructions for the XML Quiz file itself. This script will handle the original format, but without any extra capabilities. The script is set up to look for it in the Sources directory. If it doesn't find it, the link for it won't show up so it IS optional.

Play with it. Beat on it. Complain about it.

I'm only about halfway through yanking the hard-coded text values and putting them in $txt strings for easier customization and translation.

I already see that this can be easily adapted to do surveys (saving answers) and Group Join Requests.

Here a couple of screenshots (Main Menu for all Users and Admin Menu)
Title: Re: TP Quiz Script (PHP Article)
Post by: tick on October 30, 2007, 01:10:48 AM
One word for ya.  OUTSTANDING!!!!
Title: Re: TP Quiz Script (PHP Article)
Post by: jacortina on October 30, 2007, 03:24:00 AM
Arrrggghhh! Last minute changes.

Use this one for the PHP Article.
Title: Re: TP Quiz Script (PHP Article)
Post by: Xarcell on October 30, 2007, 02:12:02 PM
Ok, here's the first complaint lol...

When I try to create score table:

QuoteBLOB/TEXT column 'misc' can't have a default value
File: /home/.abigaildryer/xarcell/vestatt.org/Sources/Load.php(1735) : eval()'d code(305) : eval()'d code
Line: 425

:P

Thanks for working on this J.A.Cortina



EDIT:
Actually it also said I was running 1.1.3, was DB was 1.1.2. SO i upgraded to 1.1.4, then it still said my DB was 1.1.2. So then I run the upgrade.php and it fixed that part. However, the initial error still exists.
Title: Re: TP Quiz Script (PHP Article)
Post by: Xarcell on October 30, 2007, 02:33:38 PM
I tried using your updated j.quiz.php-article and got this error:

Quote
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in /home/.abigaildryer/xarcell/vestatt.org/Sources/Load.php(1735) : eval()'d code(305) : eval()'d code on line 575
Title: Re: TP Quiz Script (PHP Article)
Post by: IchBin on October 30, 2007, 02:52:41 PM
Weird... Just tried it myself and didn't have any errors.
Title: Re: TP Quiz Script (PHP Article)
Post by: jacortina on October 30, 2007, 03:27:56 PM
Yes, I changed the (currently unused) misc field from a varchar to a text at the last minute after considering it's possible use to hold the (imploded) answers submitted and/or to allow for 'tell us a little about yourself' membergroup application data. It was one of the things addressed in the re-upload.

As with IchBin, I'm not experiencing that error and I can't find anything in the code.

Line 575 (in my editor) is the 2nd < tr > in this group:
echo '<table width="100%">';
echo '<tr><td width="20%" align="right"><b>Quiz Server Path:&nbsp;</b></td><td align="left">'.$boarddir.'/'.$q_dir.'/</td></tr>';
echo '<tr><td width="20%" align="right"><b>Quiz File Prefix:&nbsp;</b></td><td align="left">'.$q_prefix.' (above directory scanned for files named \''.$q_prefix.'*.xml\')</td></tr>';
echo '<tr><td width="20%" align="right"><b>Quiz Admin Groups:&nbsp;</b></td><td align="left">'.(count($q_admin_grps) ? implode(', ',$q_admin_grps) : 'None').'</td></tr>';
echo '<tr><td width="20%" align="right"><b>Quiz Mod Groups:&nbsp;</b></td><td align="left">'.(count($q_admin_grps) ? implode(', ',$q_mod_grps) : 'None').(count($q_mod_users) ? (' + Users '.implode(', ',$q_mod_users)) : '').'</td></tr>';
echo '<tr><td width="20%" align="right"><b>Can Retake Passed:&nbsp;</b></td><td align="left">'.(strtolower($q_retake_pass) == 'true' ? 'Yes' : 'No').' (board default - can be overridden in quiz parameters).</td></tr>';
echo '</table>';


Are you sure you got the full file when downloading? Should have 943 lines (it's a bit too big to include in a post, which is why I have to use an attachment).
Title: Re: TP Quiz Script (PHP Article)
Post by: Rus on October 30, 2007, 03:43:14 PM
This sounds great, definitely something to think about.
Title: Re: TP Quiz Script (PHP Article)
Post by: G6Cad on October 30, 2007, 08:03:32 PM
No errors for me, works wonders and thank you kindly for sharing it with us JA :)
Title: Re: TP Quiz Script (PHP Article)
Post by: Xarcell on October 30, 2007, 08:57:30 PM
I have 944 lines ???

Space after 943 :-\

I will attempt on a different site and report back.
Title: Re: TP Quiz Script (PHP Article)
Post by: Xarcell on October 30, 2007, 09:04:50 PM
Ok, I tried a different site and DB. It created tables with any trouble.

Now I'm off to play it with.

Mind if I write a Doc on it?
Title: Re: TP Quiz Script (PHP Article)
Post by: Xarcell on October 30, 2007, 09:07:54 PM
When I click "XML Format Info"

I get:

Parse error: syntax error, unexpected T_FUNCTION in /home/.abigaildryer/xarcell/inspireromance.com/smf/Sources/JQuizXML.php on line 3

What is: "Qualifiers"

And there is a line in the php txt file. Is it missing something, or can the uncommented line supposed to be removed?

line 22:
Quote
                                //      Can be overridden with per-quiz parameters.
Title: Re: TP Quiz Script (PHP Article)
Post by: jacortina on October 30, 2007, 09:36:39 PM
First of all - here's the complete JQuizXML.php file (I did have an extra space on that first line between '?' and 'php', but it worked fine on my host):

<?php

function print_XML_quiz_format() {
print ( 
'<pre>' )  ;
echo 
'
&lt;?xml version="1.0"?&gt;
&lt;QUIZ&gt;

&lt;QUESTION&gt;
&lt;TEXT&gt;Who was the fifth president of the United States?&lt;/TEXT&gt;
&lt;CHOICES&gt;James Monroe| James Madison| John Quincy Adams&lt;/CHOICES&gt;
&lt;ANSWER&gt;James Monroe&lt;/ANSWER&gt;
&lt;/QUESTION&gt;

&lt;QUESTION&gt;
&lt;TEXT&gt;What city is the capital of Maine?&lt;/TEXT&gt;
&lt;POINTS&gt;2&lt;/POINTS&gt;
&lt;CHOICES&gt;Augusta&lt;/CHOICES&gt;
&lt;ANSWER&gt;Augusta&lt;/ANSWER&gt;
&lt;/QUESTION&gt;

&lt;QUESTION&gt;
&lt;TEXT&gt;When was the US Constitution signed?&lt;/TEXT&gt;
&lt;CHOICES&gt;1789| 1776| 1787&lt;/CHOICES&gt;
&lt;ANSWER&gt;1789&lt;/ANSWER&gt;
&lt;/QUESTION&gt;

&lt;TITLE&gt;&lt;/TITLE&gt;
&lt;NOSCORE&gt;&lt;/NOSCORE&gt;
&lt;PASS_THRESHOLD&gt;&lt;/PASS_THRESHOLD&gt;
&lt;PREREQS&gt;&lt;/PREREQS&gt;
&lt;PM_ON_PASS&gt;&lt;/PM_ON_PASS&gt;
&lt;GROUP_ON_PASS&gt;&lt;/GROUP_ON_PASS&gt;
&lt;GROUPS_MODE&gt;&lt;/GROUPS_MODE&gt;
&lt;RETAKE_PASSED&gt;true&lt;/RETAKE_PASSED&gt;
&lt;DEBUG&gt;&lt;/DEBUG&gt;

&lt;/QUIZ&gt;

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

&lt;QUESTION&gt;
&lt;TEXT&gt;--- Text to appear to \'ask\' the question ---&lt;/TEXT&gt;
&lt;POINTS&gt;--- Optional - Number of points earned for answering question; ---&lt;/POINTS&gt;
                  if not given, question will be scored as one (1) point.
&lt;CHOICES&gt;--- Choices for multiple choice, pipe (\'|\') delimited; ---&lt;/CHOICES&gt;
                   supply only one entry to prompt for typed text answer. 
&lt;ANSWER&gt;--- Corrrect answer for question; if question is of the ---&lt;/ANSWER&gt;
                  typed text kind, text matching is NOT case sensitive
&lt;/QUESTION&gt;

An arbitrary number of question \'sets\' can be included, but the
&lt;ANSWER&gt;&lt;/ANSWER&gt; MUST come last in each set (just
before the &lt;/QUESTION&gt; tag).


All of the following Quiz Paramters are optional, with default behavior programmed into
the script:

&lt;TITLE&gt;&lt;/TITLE&gt;
The title to be used in display (and PM\'s) for the quiz.

&lt;NOSCORE&gt;&lt;/NOSCORE&gt;
Insert the word \'true\' to suppress the recording of scores for this quiz. Default is
to record scores. Note that if membergroup change in other than AUTO mode is selected
via parameters below, they will never occur as the scoring record is used to hold the
membergroup change information.

&lt;PASS_THRESHOLD&gt;&lt;/PASS_THRESHOLD&gt;
Number of points necessary to \'pass\' the quiz. Note that this is the total of points
for questions answered correctly rather than just number of questions answered correctly.
Default is to set the passing mark to be equal to total number of points (perfect score
needed to pass).

&lt;PREREQS&gt;&lt;/PREREQS&gt;
Specifications to determine qualifiers (if any) to take the quiz (or even see it in the
quiz list). See below for details*.

&lt;PM_ON_PASS&gt;&lt;/PM_ON_PASS&gt;
Pipe (\'|\') delimited list of User Numbers of those to receive a PM when a quiz-taker
passes this quiz. Default is none.

&lt;GROUP_ON_PASS&gt;&lt;/GROUP_ON_PASS&gt;
Membergroup number(s) of groups to join and/or leave upon receiving a passing score on
the quiz. Pipe (\'|\') delimited. Default is none. Group to join given as number only,
group to leave given as negative. If more then one of either type is given, only the
LAST will be considered.
(Ex. 1: &lt;GROUP_ON_PASS&gt;12&lt;/GROUP_ON_PASS&gt; - join group 12.)
(Ex. 2: &lt;GROUP_ON_PASS&gt;12|-11&lt;/GROUP_ON_PASS&gt; - join group 12 and leave group 11).
{NOTE: ONLY additional membergoups will be effected. Will NOT drop or add a member\'s
primary membergroup. Will NOT consider groups 1-3 nor any post-count based group numbers.)

&lt;GROUPS_MODE&gt;&lt;/GROUPS_MODE&gt;
If any entries given in \'GROUPS_ON_PASS\' entry above, specify whether such group change(s)
require approval or should be automatic. Default is to require approval. Insert the text
\'AUTO\' to make such change(s) automatic.

&lt;RETAKE_PASSED&gt;true&lt;/RETAKE_PASSED&gt;
In-script configuration value $quiz_retake_pass can be overridden by inserting value of
\'true\' or \'false\' here to specify whether or not a quiz can be retaken by a user after
having passed it. Will default to the scripts configuration value (and if that\'s missing,
will default to false - no retaking passed quizzes.

&lt;DEBUG&gt;&lt;/DEBUG&gt;
If present at all (no value necessary), will prevent users from taking the quiz. Useful
for Admins to check and review the paramters (especially the qualifiers / pre-requisites).
Clicking a quiz in the Admin Menu will show how the quiz parameters \'look\' to the script.


* Specifying Pre-Requisites / Qualifications:

\'Sets\' of conditions can be enered, pipe (\'|\') delimited. These sets are all \'OR\'ed
(a user matching any of the individual sets will be able to see and take the quiz).

Each set consists of one or more \'conditions\', plus-sign (\'+\') delimited. These
conditions are all \'AND\'ed (user must match ALL of the conditions in a given set to
match the set).

Condition specifications can be given for group membership or non-membership, whether a user
has previously passed another quiz, post count, and absolute user ID number. Parentheses can
be used, if desired, but will not affect the processing.

Group Membership/Non-membership:
 G10 - User MUST be member of membergroup 10.
-G11 - User MUST NOT be member of membergroup 11.

Previous quiz record:
 Qtest1 - User MUST have passed quiz [test1].
-Qtest2 - User MUST NOT have passed quiz [test2].

Post Count:
 P20  - User MUST have made 20 posts or more.
-P100 - User MUST have made LASS THAN 100 posts.

User Specification:
 U199 - User is User # 199.
-U221 - User is NOT User # 221.

Example Sets:
(G12)+(-Qtest3) - Matched by members of membergroup 12 who have NOT passed quiz [test3].
(Qtest4)+(P250) - Matched by users who\'ve passed quiz [test4] AND have made at least 250 posts.

Example Full Pre-Requisites:
(G13)|(G12)+(Qtest1)|(U123)+(P500)
                  Any member of group 13 -OR- members of group 12 who have
                  already passed quiz [test1] -OR- user # 123 after they
                  have made their 500th post.

'
;

print ( 
'</pre>' )  ;
}

?>


And the point of that os to display this:
-------------------------------------------------

<?xml version="1.0"?>
<QUIZ>

<QUESTION>
<TEXT>Who was the fifth president of the United States?</TEXT>
<CHOICES>James Monroe| James Madison| John Quincy Adams</CHOICES>
<ANSWER>James Monroe</ANSWER>
</QUESTION>

<QUESTION>
<TEXT>What city is the capital of Maine?</TEXT>
<POINTS>2</POINTS>
<CHOICES>Augusta</CHOICES>
<ANSWER>Augusta</ANSWER>
</QUESTION>

<QUESTION>
<TEXT>When was the US Constitution signed?</TEXT>
<CHOICES>1789| 1776| 1787</CHOICES>
<ANSWER>1789</ANSWER>
</QUESTION>

<TITLE></TITLE>
<NOSCORE></NOSCORE>
<PASS_THRESHOLD></PASS_THRESHOLD>
<PREREQS></PREREQS>
<PM_ON_PASS></PM_ON_PASS>
<GROUP_ON_PASS></GROUP_ON_PASS>
<GROUPS_MODE></GROUPS_MODE>
<RETAKE_PASSED></RETAKE_PASSED>
<DEBUG></DEBUG>

</QUIZ>

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

<QUESTION>
<TEXT>--- Text to appear to 'ask' the question ---</TEXT>
<POINTS>--- Optional - Number of points earned for answering question; ---</POINTS>
                  if not given, question will be scored as one (1) point.
<CHOICES>--- Choices for multiple choice, pipe ('|') delimited; ---</CHOICES>
                   supply only one entry to prompt for typed text answer.
<ANSWER>--- Corrrect answer for question; if question is of the ---</ANSWER>
                  typed text kind, text matching is NOT case sensitive
</QUESTION>

An arbitrary number of question 'sets' can be included, but the
<ANSWER></ANSWER> MUST come last in each set (just
before the </QUESTION> tag).


All of the following Quiz Paramters are optional, with default behavior programmed into
the script:

<TITLE></TITLE>
The title to be used in display (and PM's) for the quiz.

<NOSCORE></NOSCORE>
Insert the word 'true' to suppress the recording of scores for this quiz. Default is
to record scores. Note that if membergroup change in other than AUTO mode is selected
via parameters below, they will never occur as the scoring record is used to hold the
membergroup change information.

<PASS_THRESHOLD></PASS_THRESHOLD>
Number of points necessary to 'pass' the quiz. Note that this is the total of points
for questions answered correctly rather than just number of questions answered correctly.
Default is to set the passing mark to be equal to total number of points (perfect score
needed to pass).

<PREREQS></PREREQS>
Specifications to determine qualifiers (if any) to take the quiz (or even see it in the
quiz list). See below for details*.

<PM_ON_PASS></PM_ON_PASS>
Pipe ('|') delimited list of User Numbers of those to receive a PM when a quiz-taker
passes this quiz. Default is none.

<GROUP_ON_PASS></GROUP_ON_PASS>
Membergroup number(s) of groups to join and/or leave upon receiving a passing score on
the quiz. Pipe ('|') delimited. Default is none. Group to join given as number only,
group to leave given as negative. If more then one of either type is given, only the
LAST will be considered.
(Ex. 1: <GROUP_ON_PASS>12</GROUP_ON_PASS> - join group 12.)
(Ex. 2: <GROUP_ON_PASS>12|-11</GROUP_ON_PASS> - join group 12 and leave group 11).
{NOTE: ONLY additional membergoups will be effected. Will NOT drop or add a member's
primary membergroup. Will NOT consider groups 1-3 nor any post-count based group numbers.)

<GROUPS_MODE></GROUPS_MODE>
If any entries given in 'GROUPS_ON_PASS' entry above, specify whether such group change(s)
require approval or should be automatic. Default is to require approval. Insert the text
'AUTO' to make such change(s) automatic.

<RETAKE_PASSED></RETAKE_PASSED>
In-script configuration value $quiz_retake_pass can be overridden by inserting value of
'true' or 'false' here to specify whether or not a quiz can be retaken by a user after
having passed it. Will default to the scripts configuration value (and if that's missing,
will default to false - no retaking passed quizzes.

<DEBUG></DEBUG>
If present at all (no value necessary), will prevent users from taking the quiz. Useful
for Admins to check and review the paramters (especially the qualifiers / pre-requisites).
Clicking a quiz in the Admin Menu will show how the quiz parameters 'look' to the script.


* Specifying Pre-Requisites / Qualifications:

'Sets' of conditions can be enered, pipe ('|') delimited. These sets are all 'OR'ed
(a user matching any of the individual sets will be able to see and take the quiz).

Each set consists of one or more 'conditions', plus-sign ('+') delimited. These
conditions are all 'AND'ed (user must match ALL of the conditions in a given set to
match the set).

Condition specifications can be given for group membership or non-membership, whether a user
has previously passed another quiz, post count, and absolute user ID number. Parentheses can
be used, if desired, but will not affect the processing.

Group Membership/Non-membership:
G10 - User MUST be member of membergroup 10.
-G11 - User MUST NOT be member of membergroup 11.

Previous quiz record:
Qtest1 - User MUST have passed quiz [test1].
-Qtest2 - User MUST NOT have passed quiz [test2].

Post Count:
P20  - User MUST have made 20 posts or more.
-P100 - User MUST have made LASS THAN 100 posts.

User Specification:
U199 - User is User # 199.
-U221 - User is NOT User # 221.

Example Sets:
(G12)+(-Qtest3) - Matched by members of membergroup 12 who have NOT passed quiz [test3].
(Qtest4)+(P250) - Matched by users who've passed quiz [test4] AND have made at least 250 posts.

Example Full Pre-Requisites:
(G13)|(G12)+(Qtest1)|(U123)+(P500)
                  Any member of group 13 -OR- members of group 12 who have
                  already passed quiz [test1] -OR- user # 123 after they
                  have made their 500th post.
Title: Re: TP Quiz Script (PHP Article)
Post by: jacortina on October 30, 2007, 09:44:15 PM
That file should handle a lot of the Docs as far as creating a Quiz file goes.

As to your question about Qualifiers... That's restrictions or pre-requisites.

Because this script/article will have to be available to all (you don't want to make multiple copies with different permissions), the script allows the Quizzes themselves to hold information about who can or cannot take them (or even see them on their lists).

Including the line:
<PREREQS>G10</PREREQS>
means the quiz is only open to member of membergroup 10.

<PREREQS>-G10</PREREQS>
means the quiz is open to those NOT in membergroup 10.

It CAN get more invloved than that, but it's really just a matter of whether or not the quiz should be restricted and to/from whom.

Title: Re: TP Quiz Script (PHP Article)
Post by: jacortina on October 30, 2007, 09:48:04 PM
Quote from: Xarcell on October 30, 2007, 09:07:54 PM
And there is a line in the php txt file. Is it missing something, or can the uncommented line supposed to be removed?

line 22:
Quote
                                //      Can be overridden with per-quiz parameters.

Looks like a commented line to me. And it's a follow-on to the comment text above it:
$q_retake_pass = 'true';                // Can users re-take quizzes that they've passed?
        //      Can be overridden with per-quiz parameters.
Title: Re: TP Quiz Script (PHP Article)
Post by: Xarcell on October 30, 2007, 11:57:10 PM
Wow, you really put alot of work into it, it's very flexible. It was ALOT more than I was hoping for. Well done...

I have a few more questions though.

Do you think this would qualify as a module? Or better to perhaps turn it into one?

Maybe write some block snippets (or if module, blocks themselves) to show recent tests, or latest passed, or a user's latest tests and scores, etc. Which ever is needed?

The only other thing I wish I would have asked for, is an optional time limit on a quiz. <TIME>in seconds</TIME> or something. I really appreciate everything you've done so far. If you don't want or have time to add it, I understand. I'm grateful with what you've given us so far...

Also, we should come up with a way to share quizzes that we have created. I plan to write quite a few, and I don't mind sharing them with anyone else that wishes to use them. I guess for the time being we can attach them to our post in this topic.

Again nice work, and a BIG THANK YOU...
Title: Re: TP Quiz Script (PHP Article)
Post by: jacortina on October 31, 2007, 12:31:05 AM
Well, as work progressed, things just jumped out. Things like being able to have more options than one question - one point. Or having the option to NOT track a score.

And, given a more flexible system of modules as 'plug-ins' rather than built in bundles, I'd say it could work that way. There's a much more limited set of configuration paramters in this than, say, the Calendar block I've worked on. And simple 'auxiliary' blocks which pull query information from the table wouldn't be hard at all.

A sharing mechanism (other than simply swapping around files to FTP into place) sounds like an interesting thing to look into.

And I'll give some thought to the TIME parameter. But because they can simply stop before the end of the quiz and start it over later (and sooner or later that'll become common knowledge), I don't know if that will be all that useful.

I WAS considering a parameter to prevent re-taking a test until a given period of time had passed (in days), so if they bombed it, they can't just jump back in but would have to wait a day, a week, whatever.
Title: Re: TP Quiz Script (PHP Article)
Post by: Xarcell on November 06, 2007, 11:45:56 PM
Quote from: J.A.Cortina on October 31, 2007, 12:31:05 AM
I WAS considering a parameter to prevent re-taking a test until a given period of time had passed (in days), so if they bombed it, they can't just jump back in but would have to wait a day, a week, whatever.

That would be nice to have.

Also I was wondering if it would be possible to add a subject to the quiz, that offer information on what the test is about at the top?

Maybe also add a <hint></hint> tag that offer some info/hint somewhere to help explain or solve each question? Perhaps displayed above or below the save button?

EDIT: I also forgot about requesting a "credit" tag. For those of use who write the quizzes, then share them. We might want to put our credits in there somewhere.
Title: Re: TP Quiz Script (PHP Article)
Post by: IchBin on November 06, 2007, 11:59:05 PM
I should write a TP support quiz for the top 20 questions continually asked each day. ;)
Title: Re: TP Quiz Script (PHP Article)
Post by: jacortina on November 07, 2007, 12:01:27 AM
Adding SUBJECT would be pretty easy. Have it display with the first question when taking a quiz. 'Info' link when a Subject is present on the user's quiz list.

A 'hint', eh? Again, adding it in is no problem. Have to think about best (easiest) way to have it display. Of course, somebody's going to ask for a 'hint cost' penalty, then. ;)

Haven't really come up with a way to enforce a time limit (on taking a specific quiz).

Quote from: IchBin™ on November 06, 2007, 11:59:05 PM
I should write a TP support quiz for the top 20 questions continually asked each day. ;)
But the answer will always be: C) Use the Search.   ;D

If it isn't B) That's an SMF question.
Title: Re: TP Quiz Script (PHP Article)
Post by: IchBin on November 07, 2007, 12:09:11 AM
hahaha.... too true JAC.
Title: Re: TP Quiz Script (PHP Article)
Post by: Xarcell on November 07, 2007, 01:20:40 AM
I was wondering something else as well. I've already begun writing several quizzes.

Would it be possiable to add a various points per answer? (maybe: <points>3| 2| 4</points><answer>hhh| ooo| kkk</answer>)

Some of the quzzies I wanted to write, would have answer's like:
In this case, there is no wrong or right answer. If it's too much trouble, don't worry about it. I'll try to find a way to work around it.

Lastly, do you take tips for your work?
Title: Re: TP Quiz Script (PHP Article)
Post by: jacortina on November 07, 2007, 02:34:01 AM
I'd have to think about the variable points.

The second approaches the area of the the survey form and I will be working on enabling that. That could, obviously, use the variable points (for suitability/compatability/what's your geek/sports/gearhead factor type questionaires), but for other types of surveys it would also tend to make the retention of the answers desirable.

I'd also assume that there's not so much a 'passing' score as there will be ranges (1-4 not a geek; 5-9 slightly nerdy; 10-13 geek; 14+ super-geek).

Note that this probably won't get worked on for several weeks as I've got a couple of other projects going.

Title: Re: TP Quiz Script (PHP Article)
Post by: wilsy on November 18, 2007, 11:27:57 AM
Hi all,

Does anyone have a demo up and running?

Regards,

Wilsy.
Title: Re: TP Quiz Script (PHP Article)
Post by: Xarcell on November 18, 2007, 11:52:06 AM
I did, until I screwed something up on my site experimenting causing & fixing bugs & errors for DOCUMENTATION.

It works great.
Title: Re: TP Quiz Script (PHP Article)
Post by: wilsy on November 18, 2007, 12:10:14 PM
I've just put one up at: -

http://rewindlancs.com/forum/index.php?page=45

It would be nice if there could be a league table incorporated.

Does anyone have some quizzes already created that they would like to share? If so please could you attach to your post?

This is a superb script!

Regards,

Wilsy.
Title: Re: TP Quiz Script (PHP Article)
Post by: Xarcell on November 18, 2007, 01:00:24 PM
I just lost all of mine yesterday. But most of the quizzies I created were romance questions.
Title: Re: TP Quiz Script (PHP Article)
Post by: wilsy on November 18, 2007, 01:11:59 PM
That's a real pity :(
Title: Re: TP Quiz Script (PHP Article)
Post by: jacortina on November 20, 2007, 01:08:20 AM
Quote from: wilsy on November 18, 2007, 12:10:14 PM
It would be nice if there could be a league table incorporated.

I think that there'd be too many variations desired for how different sites would use such a league or tournament ranking table to try to incorporate the possibilities into the main script.

I see that as more of a job for a block and with a single DB table (and referencing standard SMF tables), it shouldn't be too hard.

Quote from: wilsy on November 18, 2007, 12:10:14 PMThis is a superb script!

Thanks.
Title: Re: TP Quiz Script (PHP Article)
Post by: wilsy on November 20, 2007, 04:07:07 PM
QuoteThanks.

No JAC, thank you!  :)

Regards,

Rick.
Title: Re: TP Quiz Script (PHP Article)
Post by: Xarcell on December 12, 2007, 09:39:24 PM
Any improvements on this?
Title: Re: TP Quiz Script (PHP Article)
Post by: jacortina on December 13, 2007, 01:36:41 PM
Nope.

Haven't gotten back to it recently (besides a few bouts of 'conceptualizing').

Most likely won't be before end-of-year.
Title: Re: TP Quiz Script (PHP Article)
Post by: wilsy on December 13, 2007, 03:48:53 PM
Thanks for the quick update JA. I hope you have a great Xmas and wonderful New Year.

Regards,

Wilsy.
Title: Re: TP Quiz Script (PHP Article)
Post by: alhaudhie on January 13, 2008, 05:56:28 AM
what should i do to resolve this...

This is NOT a passing score.

Scores not being recorded because the Quiz Score Table does not exist.
Contact the Administrator.


BLOB/TEXT column 'misc' can't have a default value
File: /home/myforum/public_html/v10/Sources/Load.php(1764) : eval()'d code(209) : eval()'d code
Line: 425
Title: Re: TP Quiz Script (PHP Article)
Post by: jacortina on January 14, 2008, 01:18:03 PM
Quote from: alhaudhie on January 13, 2008, 05:56:28 AM
what should i do to resolve this...

This is NOT a passing score.

Scores not being recorded because the Quiz Score Table does not exist.
Contact the Administrator.


BLOB/TEXT column 'misc' can't have a default value
File: /home/myforum/public_html/v10/Sources/Load.php(1764) : eval()'d code(209) : eval()'d code
Line: 425

That looks like you're using the old script. As the first post notes, an update was attached to: http://www.tinyportal.net/index.php?topic=19688.msg160871#msg160871.

And to all...

Things will be easing up, so I'll be looking to implement the enhancements requested.
Title: Re: TP Quiz Script (PHP Article)
Post by: Xarcell on March 23, 2008, 02:37:11 PM
Any progress on this?

I was wondering if it could be converted into a module. Add a xml file upload to it, along with the other things discussed previously.

Title: Re: TP Quiz Script (PHP Article)
Post by: G6Cad on March 23, 2008, 03:17:48 PM
It*s been a long whilde since he was online Xar, dont know whay though  :-\
Title: Re: TP Quiz Script (PHP Article)
Post by: wilsy on May 02, 2008, 08:08:43 AM
Hi all,

I note that JA was around in March, maybe he will get a notification, read this post and appreciate how much he has been missed.

Still very much looking forward to the further development of the quiz.

Regards,

Wilsy.
Title: Re: TP Quiz Script (PHP Article)
Post by: wilsy on June 08, 2008, 09:05:51 AM
I see JA still hasnt been around since March. Would it be possible for the hugely talented JP Deni or someone equally as talented to take this one forward? ;)

A quiz script would just be the best addition - at one of my forums the members are taking part in a daily quiz hosted elsewhere!  :(

Regards,

Wilsy.
Title: Re: TP Quiz Script (PHP Article)
Post by: Xarcell on December 10, 2009, 02:44:12 AM
any chance we can get this updated to 2.0 RC2?
Title: Re: TP Quiz Script (PHP Article)
Post by: Xarcell on February 22, 2010, 03:52:43 AM
This is in the process of being updated to work with SMF 2.0