/    Sign up×
Community /Pin to ProfileBookmark

Do you think this will work…

Hi

[B]Introduction[/B]
I am creating an e-learning website that allows people to buy Education Courses for other people (college friends etc…). Receivers of these Courses have to sign into the website to complete one tutorial every day for the duration of the course… they cannot complete more than one tutorial each day. If receivers do not complete a tutorial each day, then they immediately fail the course, however the buyer can assign a number of lifelines to the user so they can miss a number of days during the duration of the course.

Receivers will need to choose their timezone so that the site will know the start and end of each specific users day.

[B]Help Required[/B]
I need some way of automating the courses and tutorials, to check if tutorials have been completed the previous day and to set up tutorials for the current day… so i have decided that the best way (IMO) is to create a cron script that will run at the very start of each users day.

Considering each user will be from a different timezone, the cron will need to run every hour, on the hour (24 times a day at ##:00:01) however each time it runs, it will only need to query the courses who’s day starts on the current hour that the script is running (current server hour)

So considering the cron will be running at the very start of each users day, it can check the status of yesterdays tutorial and prepare the tutorial for the current day…

I have tried to illustrate this in the image below… do you think this will work effectively… thanks in advance for your help…

[IMG]http://i796.photobucket.com/albums/yy242/oo7ml/automation.jpg[/IMG]

to post a comment
PHP

8 Comments(s)

Copy linkTweet thisAlerts:
@eval_BadCode_Oct 16.2011 — I think that will work. It's not how I usually approach these problems, but it's completely up to you. I would probably hard-code the logic (which you're putting into a cron job / stored procedure) into the application layer.

Just to be safe, you might want to do it by half hours. A lot of people have odd daylight savings timezones where they're actually +/- a half hour. ?

Sorry I didn't take a close look at it.

Are lifelines course-specific or can lifelines be used on other courses? (Maybe it's in the wrong table- courses instead of users)
Copy linkTweet thisAlerts:
@oo7mlauthorOct 17.2011 — Hi, thanks for your reply... lifelines are specific to each course...

Can you elaborate on what you mean by "hard coding the logic into the application layer"... thanks in advance
Copy linkTweet thisAlerts:
@eval_BadCode_Oct 17.2011 — Instead of running the cron job every hour, I would do it on a per-request basis. When someone logs in, or views a page- I would update their hours at that point in time.

I may not even update anything, I might just record their movement through the site and upon their request, or my own investigation, render the difference between what they are required to see/do and what they actually did look at/do.

While you do seem to have a lot invested in this "did they do the mission" type of data, it may not need to be so blatant. It's actually just meta-data. Just take a look at everything they did, is x, y, and z in there? If it is then they did the x,y, and z "mission".
Copy linkTweet thisAlerts:
@oo7mlauthorOct 17.2011 — Ok thanks but i need to run various reports from time to time and i don't think they would be accurate if i data dependant on the user loggin in... what do you think about this as the reporting is very important...
Copy linkTweet thisAlerts:
@eval_BadCode_Oct 18.2011 — If a tree falls in the woods ... ?
Copy linkTweet thisAlerts:
@oo7mlauthorOct 18.2011 — Ha... you have lost me now... what do you mean, i am worried about getting this section of the site right as i think it is one of the most crucial parts ?
Copy linkTweet thisAlerts:
@eval_BadCode_Oct 18.2011 — I don't know how else to explain it.

Lets say, for example, you make a robot to turn on the lights in your house every hour. It turns them on and then turns them off (just to see if they're working).

Instead of making this robot, people could check the lights themselves when it actually matters--! when someone is in the room.

After all, what difference does it make if they do or don't work when no one is there to see. ?


So instead of forcing some flag to 1 (where 1 means YES THEY DID THE MISSION). You can say: each mission has a signature, first the user must be signed up for the mission, next they must have logged in 5 times, next they need to have gotten 5/10 answers correct on this question. If they did all of that then they passed. And each time you need to see if they have passed you recheck that they have done this. Otherwise it's possible to have gaps in your REAL data and your meta-data; which one are you going to trust if they disagree?

another example:

Lets say we have 5 electric meter readings:

1AM 0

2AM 200

3AM 500

4AM 920

5AM 1005

I decide that determining the usage from this meter is important. So I create a table called usage: and insert the following:

2AM 200

3AM 300

4AM 420

5AM 195

See how I just made an unnecessary copy of my data. Each time I want to figure out the usage- I should just render it from my real data. That way I'm always working with the same set and things don't get hopelessly complicated by trying to edit meta-data.
Copy linkTweet thisAlerts:
@oo7mlauthorOct 18.2011 — Ha, i love the way you explain things... ?

The problem is, other areas of the site which i have not mentioned rely on this information being accurate by the hour so i do need to run these crons every hour... sorry i probably should have mentioned this at the start but i wanted to focus on my main question...
×

Success!

Help @oo7ml spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...