# |
Aug 8th 2008, 08:49 |
tbranyen_ |
i'm having trouble understanding where your bottleneck is |
# |
Aug 8th 2008, 08:49 |
ammadsaleem1 |
now what can be done |
# |
Aug 8th 2008, 08:49 |
ammadsaleem1 |
questons |
# |
Aug 8th 2008, 08:48 |
ammadsaleem1 |
yupthats real world quizzes |
# |
Aug 8th 2008, 08:48 |
tbranyen_ |
haha yeah |
# |
Aug 8th 2008, 08:48 |
TommyO |
'change the correct answer' wow, that's a weird quiz. |
# |
Aug 8th 2008, 08:48 |
ammadsaleem1 |
so ... |
# |
Aug 8th 2008, 08:48 |
ammadsaleem1 |
and finally the total score for the Quiz for the user is calculated |
# |
Aug 8th 2008, 08:47 |
ammadsaleem1 |
the Quiz maker can change the anser any time |
# |
Aug 8th 2008, 08:47 |
ammadsaleem1 |
for each anser we need to calculate fast response bonus, partial score and total score |
# |
Aug 8th 2008, 08:47 |
TommyO |
ammadsaleem1: I would do it on answer save if you want real-time |
# |
Aug 8th 2008, 08:46 |
ammadsaleem1 |
and then from the scorecard a leader board is being generated |
# |
Aug 8th 2008, 08:46 |
tbranyen_ |
still thats pretty simplistic for any database engine |
# |
Aug 8th 2008, 08:46 |
ammadsaleem1 |
each has it in its scorecard |
# |
Aug 8th 2008, 08:46 |
ammadsaleem1 |
2000 players have attempted a question in a quiz |
# |
Aug 8th 2008, 08:46 |
tbranyen_ |
over 10k records i would consider massive |
# |
Aug 8th 2008, 08:45 |
tbranyen_ |
that doesn't seem very massive |
# |
Aug 8th 2008, 08:45 |
ammadsaleem1 |
we have shared hosting plus we want the results to be real time |
# |
Aug 8th 2008, 08:45 |
ammadsaleem1 |
the Quiz maker updates the answer of the question, then all the player who have attempted the question, their scores get recalculated |
# |
Aug 8th 2008, 08:44 |
pgcd_away |
tommy0: thanks |
# |
Aug 8th 2008, 08:44 |
TommyO |
or scheduler |
# |
Aug 8th 2008, 08:44 |
TommyO |
ammadsaleem1: sounds like the work of a cron job |
# |
Aug 8th 2008, 08:44 |
tbranyen_ |
Because the former is a horrible idea and the latter can be done by just adding a script to the rc local or windows startup |
# |
Aug 8th 2008, 08:43 |
tbranyen_ |
whenever someone hits the site or whenever the server starts? |
# |
Aug 8th 2008, 08:43 |
tbranyen_ |
ammadsaleem1 a mass database update when? |
# |
Aug 8th 2008, 08:43 |
ammadsaleem1 |
? |
# |
Aug 8th 2008, 08:43 |
ammadsaleem1 |
can cake help me in this regard |
# |
Aug 8th 2008, 08:43 |
TommyO |
pgcd_away: $this->model() |
# |
Aug 8th 2008, 08:43 |
TommyO |
pgcd_away: see Helper class, which all helpers, including your, inherits. it has a model() method |
# |
Aug 8th 2008, 08:42 |
ammadsaleem1 |
? |
# |
Aug 8th 2008, 08:42 |
ammadsaleem1 |
is there any other solution to the probelm |
# |
Aug 8th 2008, 08:41 |
ammadsaleem1 |
since it may cause script time out, so i am going for threading |
# |
Aug 8th 2008, 08:41 |
ammadsaleem1 |
The thing I want to carry out is to perform a mass database update |
# |
Aug 8th 2008, 08:39 |
pgcd_away |
of course, i might resort to good old foreach, if needed |
# |
Aug 8th 2008, 08:39 |
TommyO |
it is stateless |
# |
Aug 8th 2008, 08:39 |
TommyO |
ammadsaleem1: do you understand PHP? the application starts on each new visit and ends when the page is returned to the client |
# |
Aug 8th 2008, 08:39 |
pgcd_away |
I tried using $this->data in the helper, but the fields are grouped by model, and I'd like to avoid having to use model names in the helper... |
# |
Aug 8th 2008, 08:38 |
ammadsaleem1 |
no just when the appliction on the Server starts |
# |
Aug 8th 2008, 08:38 |
pgcd_away |
if i have a helper that sets default values for fields with a certain name (in any model), what's the best way to make sure the defaults don't overwrite the actual values when they are available? |
# |
Aug 8th 2008, 08:37 |
TheBig |
in which you can use standard functions as beforeFilter() and so on... |
# |
Aug 8th 2008, 08:36 |
TheBig |
anyway you should work in AppController |