UQM 2.0 - Predictions Extensions

All web design discussion, including Ultimate Quiz MOD support.

Moderator: CricketMX Forum Moderators

subvertbeats
Know-It-All
Know-It-All
Posts: 113
Joined: Thu Jan 14, 2010 6:07 pm

hey battye

It is indeed correct (ID 10).

its the only Quiz in the DB.

and of course when I load control_quiz.php?mode=enter_answers&id=10 the page loads just fine and I am shown all the questions to enter the correct results.

Its only when I submit the answers that the SQL error occurs
User avatar
battye
Site Admin
Site Admin
Posts: 14391
Joined: Sun Jan 11, 2004 8:26 am
Location: Australia
Contact:

Alright then, FIND in control_quiz.php

Code: Select all

                 $users[$i] = $row['quiz_player'];
AFTER ADD

Code: Select all

                 echo '>>'. $row['quiz_stats_id'] . '<br />';
We need to find which stats id this thing is failing on.
CricketMX.com in 2022: Still the home of bat's, rat's and other farmyard animals!

"OK, life [as you chose to define it] repeats until there are no more lessons to be learned." - nrnoble (June 12, 2005)
"the new forum looks awesome, it's getting bigger & better" - p2p-sharing-rules (11 Jan, 2008)
"Looks like CMX is not only getting bigger...but, also getting better!!" - moongirl (14 Dec, 2007)
subvertbeats
Know-It-All
Know-It-All
Posts: 113
Joined: Thu Jan 14, 2010 6:07 pm

Same as before - no output:
>>

Warning: Cannot modify header information - headers already sent by (output started at /home/mmadent/public_html/foru/control_quiz.php:64) in /home/mmadent/public_html/foru/includes/functions.php on line 3543
subvertbeats
Know-It-All
Know-It-All
Posts: 113
Joined: Thu Jan 14, 2010 6:07 pm

I do notice in the code that after populating that users array:

Code: Select all

$users[$i] = $row['quiz_player'];
the array is never read / used
User avatar
battye
Site Admin
Site Admin
Posts: 14391
Joined: Sun Jan 11, 2004 8:26 am
Location: Australia
Contact:

Hmm, yeah I think I commented that all out. I see no reason why you can't comment that line out too if you want.

But that shouldn't be the cause of the problem.

FIND:

Code: Select all

               $sql = 'SELECT * FROM ' . QUIZ_STATISTICS_TABLE . '
                     WHERE quiz_question_id = ' . $question_id_set[$i] . '
                     ORDER BY quiz_question_id ASC';
BEFORE ADD

Code: Select all

echo 'OUT('.$i.'): ' . $question_id_set[$i] . '<br />';
CricketMX.com in 2022: Still the home of bat's, rat's and other farmyard animals!

"OK, life [as you chose to define it] repeats until there are no more lessons to be learned." - nrnoble (June 12, 2005)
"the new forum looks awesome, it's getting bigger & better" - p2p-sharing-rules (11 Jan, 2008)
"Looks like CMX is not only getting bigger...but, also getting better!!" - moongirl (14 Dec, 2007)
subvertbeats
Know-It-All
Know-It-All
Posts: 113
Joined: Thu Jan 14, 2010 6:07 pm

Output from that command is:
OUT(0): 40
User avatar
battye
Site Admin
Site Admin
Posts: 14391
Joined: Sun Jan 11, 2004 8:26 am
Location: Australia
Contact:

Can you post the contents of the row in the statistics table where quiz_stats_id = 40
Thanks

Edit: I mean quiz_question_id not stats_id
CricketMX.com in 2022: Still the home of bat's, rat's and other farmyard animals!

"OK, life [as you chose to define it] repeats until there are no more lessons to be learned." - nrnoble (June 12, 2005)
"the new forum looks awesome, it's getting bigger & better" - p2p-sharing-rules (11 Jan, 2008)
"Looks like CMX is not only getting bigger...but, also getting better!!" - moongirl (14 Dec, 2007)
subvertbeats
Know-It-All
Know-It-All
Posts: 113
Joined: Thu Jan 14, 2010 6:07 pm

edit: full listings for question 40 (one for each of the 56 entries):

quiz_stats_id quiz_question_id Stigande quiz_id quiz_answer quiz_correct quiz_player
447 40 10 Jay Hieron 0 1045
359 40 10 Jay Hieron 0 1187
590 40 10 Jay Hieron 0 767
370 40 10 Jay Hieron 0 245
579 40 10 Jay Hieron 0 141
436 40 10 Jay Hieron 0 924
612 40 10 Jay Hieron 0 942
524 40 10 Jay Hieron 0 1386
601 40 10 Jay Hieron 0 56
623 40 10 Jay Hieron 0 80
425 40 10 Jay Hieron 0 220
546 40 10 Jay Hieron 0 234
568 40 10 Joe Riggs 0 1395
502 40 10 Jay Hieron 0 933
491 40 10 Jay Hieron 0 991
645 40 10 Jay Hieron 0 995
392 40 10 Joe Riggs 0 202
480 40 10 Jay Hieron 0 282
535 40 10 Jay Hieron 0 926
469 40 10 Jay Hieron 0 118
656 40 10 Jay Hieron 0 952
414 40 10 Joe Riggs 0 930
634 40 10 Joe Riggs 0 958
381 40 10 Jay Hieron 0 90
513 40 10 Jay Hieron 0 940
557 40 10 Jay Hieron 0 1231
458 40 10 Jay Hieron 0 93
403 40 10 Jay Hieron 0 208
293 40 10 Jay Hieron 0 403
106 40 10 Jay Hieron 0 88
172 40 10 Jay Hieron 0 288
161 40 10 Jay Hieron 0 1202
238 40 10 Joe Riggs 0 116
326 40 10 Jay Hieron 0 1003
128 40 10 Jay Hieron 0 1035
249 40 10 Jay Hieron 0 1391
62 40 10 Jay Hieron 0 917
117 40 10 Jay Hieron 0 130
51 40 10 Joe Riggs 0 945
260 40 10 Joe Riggs 0 1008
150 40 10 Jay Hieron 0 959
84 40 10 Joe Riggs 0 772
271 40 10 Joe Riggs 0 1232
304 40 10 Jay Hieron 0 827
139 40 10 Jay Hieron 0 1055
282 40 10 Jay Hieron 0 120
227 40 10 0 810
183 40 10 Jay Hieron 0 1029
205 40 10 Jay Hieron 0 99
194 40 10 Jay Hieron 0 773
216 40 10 Jay Hieron 0 733
73 40 10 Jay Hieron 0 902
337 40 10 Jay Hieron 0 119
348 40 10 Joe Riggs 0 89
315 40 10 Joe Riggs 0 377
95 40 10 Joe Riggs 0 967
User avatar
battye
Site Admin
Site Admin
Posts: 14391
Joined: Sun Jan 11, 2004 8:26 am
Location: Australia
Contact:

I don't see any reason why it wouldn't be working. You haven't tried to "cancel" this question?
CricketMX.com in 2022: Still the home of bat's, rat's and other farmyard animals!

"OK, life [as you chose to define it] repeats until there are no more lessons to be learned." - nrnoble (June 12, 2005)
"the new forum looks awesome, it's getting bigger & better" - p2p-sharing-rules (11 Jan, 2008)
"Looks like CMX is not only getting bigger...but, also getting better!!" - moongirl (14 Dec, 2007)
subvertbeats
Know-It-All
Know-It-All
Posts: 113
Joined: Thu Jan 14, 2010 6:07 pm

battye wrote:I don't see any reason why it wouldn't be working. You haven't tried to "cancel" this question?
No, not at all :/
subvertbeats
Know-It-All
Know-It-All
Posts: 113
Joined: Thu Jan 14, 2010 6:07 pm

Hey battye

Looking through that result set more closely I see this:

227 40 10 0 810

Note that for this table entry, there is no data for the quiz_answer field.

Could this be causing it?

And if so, if I insert an answer there, assuming it fixes it, is there a way to validate that the form entry for submissions is complete and that no questions have been left unanswered?
User avatar
battye
Site Admin
Site Admin
Posts: 14391
Joined: Sun Jan 11, 2004 8:26 am
Location: Australia
Contact:

Okay, seeing this was the last change we made after things seemed to be working, maybe try undoing this change: ?
subvertbeats wrote:
battye wrote:OPEN quiz.php

FIND around line 60

Code: Select all

					$result = $db->sql_query($sql);
					while( $row = $db->sql_fetchrow($result) )
REPLACE WITH

Code: Select all

					$result = $db->sql_query($sql);
					while( $row = $db->sql_fetchrow($result) && $_POST['question' . $question_id_set[$i]] != 'cancelled' )
Then if a match is cancelled, enter the word cancelled as the answer.
thanks (again!) battye....

One q on this....

You say quiz.php, around line 60

In my quiz.php, these lines occur around line 1140.
In control_quiz.php, they occur around line 60.

Im thinking this change needs to be in control_quiz.php, but it would be great if you could confirm that.
CricketMX.com in 2022: Still the home of bat's, rat's and other farmyard animals!

"OK, life [as you chose to define it] repeats until there are no more lessons to be learned." - nrnoble (June 12, 2005)
"the new forum looks awesome, it's getting bigger & better" - p2p-sharing-rules (11 Jan, 2008)
"Looks like CMX is not only getting bigger...but, also getting better!!" - moongirl (14 Dec, 2007)
subvertbeats
Know-It-All
Know-It-All
Posts: 113
Joined: Thu Jan 14, 2010 6:07 pm

Hi battye

I will try that but its just a while condition right? and its working since we are getting the error inside of that while statement.

Did you see my post above about that entry with no question answer data?

Is that not the likely cause here?
User avatar
battye
Site Admin
Site Admin
Posts: 14391
Joined: Sun Jan 11, 2004 8:26 am
Location: Australia
Contact:

Isn't "Jay Hieron" and "Joe Riggs" in the quiz_answer field?

I don't know what Stigande is, but it's not a UQM column.

Yeah it's a while loop, but from the test earlier you saw how >> was appearing only once. You listed a few dozen records for quiz_question_id = 40 - so something is not working.

I don't know why it would be working perfectly a week ago but failing now.
CricketMX.com in 2022: Still the home of bat's, rat's and other farmyard animals!

"OK, life [as you chose to define it] repeats until there are no more lessons to be learned." - nrnoble (June 12, 2005)
"the new forum looks awesome, it's getting bigger & better" - p2p-sharing-rules (11 Jan, 2008)
"Looks like CMX is not only getting bigger...but, also getting better!!" - moongirl (14 Dec, 2007)
subvertbeats
Know-It-All
Know-It-All
Posts: 113
Joined: Thu Jan 14, 2010 6:07 pm

Ahhh right...

Ignore Stigande thats just a button label in a swedish version of mysql :)

Question 40 is like all the other questions a multiple choice:

Possible answers for Q 40 were:

- Jay Hieron
- Joe Riggs
- Draw

There are 56 quiz entries

Each question (11 total questions), for each players entry (56 total entries) has a row in the phpbb_quiz_statistics table (616 rows total)

The issue i see with that data posted up there is in one particular row:

227 40 10 0 810

There is no answer in that row!

If it were valid, then, inbetween the 10 and the 0, would be the question answer.
It should be either 'Jay Hieron', 'Joe Riggs' or 'Draw'.

It suggests that somehow the player submitted the quiz, and was permitted to do so, even though no selection was made for the answer to this particular question.
I havent yet checked the other questions in the table for this player (id 810) to see if any further Q's have missing answers.
Post Reply