Hi battye, lets use this thread to discuss extending UQM 2.0 for Predictions.
Ive not yet installed UQM 2.0 (next job for coming days now that b3 is released), but as far as I know I need to extend it to support the following:
PHASE 1 (Needed)
1. Competition/Quiz Categories (eg may have a category for English Premier League predictions, another for boxing predictions etc) [PART OF STANDARD UQM 2.0]
2. For each competition, allow admin to post a set of questions with no answer yet (the questions are to predict sports fixtures yet to be played, possible answers: Team A Win, Team B Win, Draw) [COMPLETE]
3. For each competition, allow answers to be submitted by forum users, and their responses stored [PART OF STANDARD UQM 2.0]
4. After the event has happened, allow admin to enter correct answers [COMPLETE]
5. Once correct answers are entered, for each competition:
a) Auto-assessment of submitted predictions against actual results [PART OF STANDARD UQM 2.0]
b) Display to admin ranked list of users (ordered in ascending priority of incorrect picks), with columns to show user name, number of incorrect predictions, number of correct predictions (to support us easily assessing winners, and giving out prizes) [PART OF STANDARD UQM 2.0]
6. Replace the word 'Quiz' throughout all GUI elements, other than copyright notices (makes more sense if changed to 'Competition' or 'Prediction Competition'). Also change 'Quizzes' to 'Competitions' [COMPLETE]
7. Remove display of the right/wrong totals after submitting a quiz (as the correct answers - i.e the actual results - wont be available at the time of submission) [COMPLETE]
8. Remove display of the time taken to complete the quiz (not necessary) [COMPLETE]
PHASE 2 (Maybe do this in future)
9. Public page (per competition) to show ranked list of users as per 5.b) [PART OF STANDARD UQM 2.0]
10. Ongoing league table (user gets 1 point for 1 correct pick. Needs to support categories - eg option to show league table for each category, as well as overall combined league table) [TO BE DONE]
11. Way to initialize new league tables, and archive old ones for later access (to support having a league run from date x to date y, then a new league from date y to date z) [TO BE DONE]
Anything in phase 2 needs to have functions to retrospectively support existing data (eg if we add league tables, it would be necessary to have the league tables initialized with data from competitions in a specified data range
So, perhaps you could start by replying and letting me know your thoughts and ideas on all of this,
Thanks again battye!
UQM 2.0 - Predictions Extensions
Moderator: CricketMX Forum Moderators
-
- Know-It-All
- Posts: 113
- Joined: Thu Jan 14, 2010 6:07 pm
Last edited by subvertbeats on Fri Jan 22, 2010 4:39 pm, edited 3 times in total.
subvertbeats, this shouldn't be too much of a problem to do. Let me know when you've installed UQM and I'll have a look at some code changes for you 
Thanks

Thanks
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)
"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)
-
- Know-It-All
- Posts: 113
- Joined: Thu Jan 14, 2010 6:07 pm
Hey battye
Progress:
b3 Installed, and working.
Created categories (one less thing to do from the list above)
Cant create quiz as Im not allowed to submit the quiz without the answers.
Progress:
b3 Installed, and working.
Created categories (one less thing to do from the list above)
Cant create quiz as Im not allowed to submit the quiz without the answers.
-
- Know-It-All
- Posts: 113
- Joined: Thu Jan 14, 2010 6:07 pm
Update: Tested creation of a quiz where answers are provided up front - all working well, but of course this isnt going to work for predictions....
Other things I noticed that dont really make sense in this context, and would be great if could be changed:
- The word 'Quiz' throughout all GUI elements, other than copyright notices (makes more sense if changed to 'Competition' or 'Prediction Competition')
- Displaying the right/wrong totals after submitting a quiz (as the correct answers - i.e the actual results - wont be available at the time of submission)
- Displaying the time taken to complete the quiz (not necessary)
Also, have looked at the statistics page, and unless Im missing something obvious (quite possible) it should address Requirements 5a) and 5b) from the original post here.......
Other things I noticed that dont really make sense in this context, and would be great if could be changed:
- The word 'Quiz' throughout all GUI elements, other than copyright notices (makes more sense if changed to 'Competition' or 'Prediction Competition')
- Displaying the right/wrong totals after submitting a quiz (as the correct answers - i.e the actual results - wont be available at the time of submission)
- Displaying the time taken to complete the quiz (not necessary)
Also, have looked at the statistics page, and unless Im missing something obvious (quite possible) it should address Requirements 5a) and 5b) from the original post here.......
-
- Know-It-All
- Posts: 113
- Joined: Thu Jan 14, 2010 6:07 pm
Updated OP with additional requirements and status.
Ok1. Competition/Quiz Categories (eg may have a category for English Premier League predictions, another for boxing predictions etc) [PART OF STANDARD UQM 2.0]
My suggestion, just enter something. What I write for you will overwrite whatever you put in originally, so rather than changing the whole submission checking system - just enter something2. For each competition, allow admin to post a set of questions with no answer yet (the questions are to predict sports fixtures yet to be played, possible answers: Team A Win, Team B Win, Draw) [TO BE DONE]

Ok3. For each competition, allow answers to be submitted by forum users, and their responses stored [PART OF STANDARD UQM 2.0]
Yes, I will write the script that lets you do this. It will only be basic as only you/admins will be seeing it (no templating or anything like that) but it will do the trick.4. After the event has happened, allow admin to enter correct answers [TO BE DONE]
I might be able to go one better here, I will try and have the script automatically update the statistics table for you - but in case you want to post the results on the forum or in an email, etc... when you run this script (the script will let you enter the correct answers, and will then scan the database for users who did the quiz and determine their scores) it will also give a display of the users results so you can copy/paste them.5. Once correct answers are entered, for each competition:
a) Auto-assessment of submitted predictions against actual results [PART OF STANDARD UQM 2.0]
b) Display to admin ranked list of users (ordered in ascending priority of incorrect picks), with columns to show user name, number of incorrect predictions, number of correct predictions (to support us easily assessing winners, and giving out prizes) [PART OF STANDARD UQM 2.0]
You can do this yourself. In the language files included in the zip, open them (they are in language/en) and replace all instances of "Quiz" with whatever term you want to use. A "find and replace" (Ctrl+H on Windows I think) will do this for you in Notepad.6. Replace the word 'Quiz' throughout all GUI elements, other than copyright notices (makes more sense if changed to 'Competition' or 'Prediction Competition'). Also change 'Quizzes' to 'Competitions' [TO BE DONE]
This is a setting in the ACP, turn "Show answers" to off. There is another change you will need to make, but I will explain that later.7. Remove display of the right/wrong totals after submitting a quiz (as the correct answers - i.e the actual results - wont be available at the time of submission) [TO BE DONE]
In the ACP have you set "Time limit per question" to 0? I can't remember if that stops the time displaying or not, or if it only stops the quiz caring about the time it took... regardless, try it out and if it doesn't work I will give you the template change to make to stop the time from appearing.8. Remove display of the time taken to complete the quiz (not necessary) [TO BE DONE]
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)
"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)
-
- Know-It-All
- Posts: 113
- Joined: Thu Jan 14, 2010 6:07 pm
Not sure I understand that: The only available answers are 'Team A', 'Team B', or 'Draw'.battye wrote:My suggestion, just enter something. What I write for you will overwrite whatever you put in originally, so rather than changing the whole submission checking system - just enter something2. For each competition, allow admin to post a set of questions with no answer yet (the questions are to predict sports fixtures yet to be played, possible answers: Team A Win, Team B Win, Draw) [TO BE DONE]Just one word only, something like tba
If I enter another option 'TBA' then users will be able to erroneously select that choice when they enter, and I would like to prevent that happening.
Perhaps you're suggesting I maybe put all the answers as 'Draw' initially?
Thanks!battye wrote:Yes, I will write the script that lets you do this. It will only be basic as only you/admins will be seeing it (no templating or anything like that) but it will do the trick.4. After the event has happened, allow admin to enter correct answers [TO BE DONE]
That would be perfect!battye wrote:I might be able to go one better here, I will try and have the script automatically update the statistics table for you - but in case you want to post the results on the forum or in an email, etc... when you run this script (the script will let you enter the correct answers, and will then scan the database for users who did the quiz and determine their scores) it will also give a display of the users results so you can copy/paste them.5. Once correct answers are entered, for each competition:
a) Auto-assessment of submitted predictions against actual results [PART OF STANDARD UQM 2.0]
b) Display to admin ranked list of users (ordered in ascending priority of incorrect picks), with columns to show user name, number of incorrect predictions, number of correct predictions (to support us easily assessing winners, and giving out prizes) [PART OF STANDARD UQM 2.0]
Thanks battye.....I was hoping all the strings would be externalized - I'll work on that shortly.battye wrote:You can do this yourself. In the language files included in the zip, open them (they are in language/en) and replace all instances of "Quiz" with whatever term you want to use. A "find and replace" (Ctrl+H on Windows I think) will do this for you in Notepad.6. Replace the word 'Quiz' throughout all GUI elements, other than copyright notices (makes more sense if changed to 'Competition' or 'Prediction Competition'). Also change 'Quizzes' to 'Competitions' [TO BE DONE]
Thanks, that would be great. That option is off.battye wrote:This is a setting in the ACP, turn "Show answers" to off. There is another change you will need to make, but I will explain that later.7. Remove display of the right/wrong totals after submitting a quiz (as the correct answers - i.e the actual results - wont be available at the time of submission) [TO BE DONE]
In the ACP have you set "Time limit per question" to 0? I can't remember if that stops the time displaying or not, or if it only stops the quiz caring about the time it took... regardless, try it out and if it doesn't work I will give you the template change to make to stop the time from appearing.[/quote]8. Remove display of the time taken to complete the quiz (not necessary) [TO BE DONE]
Yes, I have that car set to 0, and it still displays.
Ive just commented out
Code: Select all
{TIME_SUMMARY}
Hopefully that shoud do the trick....
Thanks!
Last edited by subvertbeats on Tue Jan 19, 2010 1:30 pm, edited 2 times in total.
Oh right, I misunderstood that (I didn't realise it was multiple choice). Yes, I meant put all of the answers as "draw", just so that an option is specified and the quiz will submit.Not sure I understand that: The only available answers are 'Team A', 'Team B', or 'Draw'.
If I enter another option 'TBA' then users will be able to erroneously select that choice when they enter, and I would like to prevent that happening.
Perhaps you're suggesting I maybe put all the answers as 'Draw' initially?
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)
"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)
-
- Know-It-All
- Posts: 113
- Joined: Thu Jan 14, 2010 6:07 pm
Cool, gotcha.....thank you.
Ive done the language changes, and also got rid of the submit time notification.
Interestingly on submitting a competition Im getting:
[phpBB Debug] PHP Notice: in file /quiz.php on line 1015: Undefined variable: total_time_allowed
[phpBB Debug] PHP Notice: in file /quiz.php on line 1016: Undefined variable: total_time_allowed
Now $total_time_allowed is being set in a function that only runs if the following is true
And I definitely have that var set to 0.
The quiz does submit correctly, or seems to, but that error is thrown
Ive done the language changes, and also got rid of the submit time notification.
Interestingly on submitting a competition Im getting:
[phpBB Debug] PHP Notice: in file /quiz.php on line 1015: Undefined variable: total_time_allowed
[phpBB Debug] PHP Notice: in file /quiz.php on line 1016: Undefined variable: total_time_allowed
Now $total_time_allowed is being set in a function that only runs if the following is true
Code: Select all
if ($config['quiz_time_limit_per_question'] > 0)
The quiz does submit correctly, or seems to, but that error is thrown
Did you edit quiz.php?
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)
"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)
-
- Know-It-All
- Posts: 113
- Joined: Thu Jan 14, 2010 6:07 pm
Nope, though I may have made an error with the time limit - I dont think I have, but to verify, I just retyped 0 and hit submit again in the acp.
Then Ive gone to validate the setting and see if I still get the error, so I refreshed the quiz submission page and got the cheating warning:
Then Ive gone to validate the setting and see if I still get the error, so I refreshed the quiz submission page and got the cheating warning:
Not sure how to get round that? Tried going back to the list of quizzes and selecting the quiz again but the same warning is displayed.You are seeing this error because one of several events might have occurred:
- A cheating attempt may have been detected. You cannot leave a competition and later re-enter it without going through the save process.
- You have tried to resubmit a competition that you have exceeded the time limit on
- You have already played this competition, and the admin does not allow multiple attempts.
Open quiz.php and find on line 27:
Those errors will disappear now.
Cheating attempts happen because you refreshed the quiz submission page. It is to stop people from refreshing the page in order to reset the time limit. So don't ever refresh a quiz page
Code: Select all
error_reporting(E_ALL | E_NOTICE);
Cheating attempts happen because you refreshed the quiz submission page. It is to stop people from refreshing the page in order to reset the time limit. So don't ever refresh a quiz page

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)
"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)
-
- Know-It-All
- Posts: 113
- Joined: Thu Jan 14, 2010 6:07 pm
Thanks battye
you want me to comment out that line?
And as for the cheating part - understood - but in the context of no timelimit, shouldnt that be disabled?
And as is the case now, its been triggered, how do I get back into the quiz?
Thanks!
Ben
you want me to comment out that line?
And as for the cheating part - understood - but in the context of no timelimit, shouldnt that be disabled?
And as is the case now, its been triggered, how do I get back into the quiz?
Thanks!
Ben
Yes, comment out that line.
As for getting back in, you will need to remove the particular row from the quiz_progressive table corresponding to the quiz_id and your user_id. I think this is probably a feature I should write into the code come to think of it.
As for getting back in, you will need to remove the particular row from the quiz_progressive table corresponding to the quiz_id and your user_id. I think this is probably a feature I should write into the code come to think of it.
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)
"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)
-
- Know-It-All
- Posts: 113
- Joined: Thu Jan 14, 2010 6:07 pm
Ref getting back in - yes I think that would be a useful feature....
Another question for you.....with saved quizzes, will the users be able to submit their answers, and (optionally) any time before the event happens go in and change their predictions (this is the desired functionality) ?
Related to this I thought of something that is necessary - a very important function - close the quiz/comp for new entries (ideally automatically at a given date time, but for now a manual switch would be just fine).
Otherwise we'll get users cheating I guess...
Another question for you.....with saved quizzes, will the users be able to submit their answers, and (optionally) any time before the event happens go in and change their predictions (this is the desired functionality) ?
Related to this I thought of something that is necessary - a very important function - close the quiz/comp for new entries (ideally automatically at a given date time, but for now a manual switch would be just fine).
Otherwise we'll get users cheating I guess...