Potatis Posted March 30, 2008 Share Posted March 30, 2008 Hello, I am trying to develop a merit based competition for students who do online worksheets. I want an incentive for students to do a set of worksheets on as many consecutive days as possible. At the completion of each worksheet set I can easily have the form add points to the database, say 4 points, and if a student does these for 4 days, then they'll have 16 points which would give them a rank, 5 days would give them another 4 points and a higher rank for having 20 total points and so on. But say if on day 5 the student didn't do a worksheet set, I'd like to have 4 points removed from their total score, making them go down a level. If they missed another day, they'd lose another 4. Although it is easy to remove points manually, how can I automate it so that I don't have to check who has done the worksheet set everyday? Is it even possible to do this automatically? Thanks for any help. Quote Link to comment https://forums.phpfreaks.com/topic/98581-automatically-removing-points-from-user/ Share on other sites More sharing options...
fenway Posted March 30, 2008 Share Posted March 30, 2008 Can't be that automatic... though a left join could find them esaily. Quote Link to comment https://forums.phpfreaks.com/topic/98581-automatically-removing-points-from-user/#findComment-504662 Share on other sites More sharing options...
mwasif Posted March 30, 2008 Share Posted March 30, 2008 Make a script to do this and setup cronjob/scheduler to run at the end of the day. Quote Link to comment https://forums.phpfreaks.com/topic/98581-automatically-removing-points-from-user/#findComment-504770 Share on other sites More sharing options...
Potatis Posted March 30, 2008 Author Share Posted March 30, 2008 Ok, thanks very much for your replies. Quote Link to comment https://forums.phpfreaks.com/topic/98581-automatically-removing-points-from-user/#findComment-505032 Share on other sites More sharing options...
fou2enve Posted March 30, 2008 Share Posted March 30, 2008 ive also done this, by using the date and a flat file, if the date didn't match the flat file date, then it was a new day, the query would run, and the flat file updated. cron works, but this is just an alternative. Quote Link to comment https://forums.phpfreaks.com/topic/98581-automatically-removing-points-from-user/#findComment-505035 Share on other sites More sharing options...
aschk Posted March 31, 2008 Share Posted March 31, 2008 Alternatively update the points total the next time a query is done? i.e. i want to know how many points student A has, do the SQL query, and perform a date_sub to find out if they're outside their allotted time. I'd have to think a little about this sort of query because obviously you'll need to work out what happens when a skipped period occurs (i.e. last date was yesterday but before yesterday they missed 3 days). Quote Link to comment https://forums.phpfreaks.com/topic/98581-automatically-removing-points-from-user/#findComment-505548 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.