Calculate pace of work for a student in a program 
*

*A program is a set of tasks.

*A program has a "days to complete" value. This is the expected time that a student should take to complete the program.

*Whenever a student starts a program I log his start time (as a unix time/epoch)

I want to calculate a students pace in a program. So for example, if a program has 5 tasks and a "days to complete" value of 5 days, then the learner must complete 1 task per day in order to be on pace. So on the second day, if the student has completed 2 tasks then he is on pace, if he has completed 3 tasks he is ahead of pace, if he has only compelted 1 task then he is behind on pace. Im not sure whether pace would be expressed as a percentage or what. It seems there are 2 values I need: the students current pace, based on when he started and how many tasks he has compelted, and the expected pace for that day.
Is there a formula I can use for this. Preferably I want to know if a student is on pace/off pace and by how much he is ahead or behind of pace as a percentage.
 A: Suppose the program is expected to take $D$ days and consists of $T$ tasks. Then after the first $k$ days, I "should" have completed $\frac{T}{D} k$ tasks to be "on pace". (Sanity check of that formula: if $k=D$ then I should have completed exactly $\frac{T}{D}D = T$ tasks, i.e. the whole program.)
The student needs to complete an average of $\frac{T}{D}$ tasks per day.
If a student has completed $t$ tasks after $d$ days, then their pace so far is $\frac{t}{d}$. They now need to complete $T-t$ tasks in the remaining $D-d$ days, so they'll need an average pace of $\frac{T-t}{D-d}$ tasks per day for the remainder of the program; this would be the new "expected pace for that day".
There are a couple of percentages that might be worth computing. First, you could decide how fast they're going relative to the expectation by using $$\frac{\text{actual pace so far}}{\text{expected pace}} \times 100\% = \frac{\frac{t}{d}}{\frac{T}{D}} \times 100\% = \frac{tD}{Td} \times 100\%.$$ For your example with $D=5, T=5, d=2, t=3$ I find that the student has been working at $150\%$ of the required pace, i.e. $50\%$ faster than needed.
Second, if a student is behind, you could calculate how much they'll need to speed up in order to finish on time. To do that, we should compare two things we already computed above: the pace so far $\frac{t}{d}$ vs the pace required to finish in time $\frac{T-t}{D-d}$. The ratio will be $$\frac{\text{pace required from here till the end}}{\text{pace so far}} = \frac{\frac{T-t}{D-d}}{\frac{T}{D}} = \frac{(T-t)D}{(D-d)t}.$$
For example, let's use your hypothetical student with $D=5, T=5, d=2, t=1$. The formula gives a ratio of $\frac{20}{3} \approx 6.67$. In other words, this student is in a lot of trouble: they'll need to start working 6.67x as fast if they want to finish on time!
Finally, a couple of warnings about using formulas like these.

*

*These formulas all assume each task takes the same amount of time, but in real life some tasks may be longer or harder than others. So you should take the formulas only as an approximation, and think for yourself about whether students seem to be finding certain tasks faster/slower in a given program.

*I'm not sure if you have a way to account for partly-completed tasks. In the example with 5 tasks and 5 days, if a student works for 2 days and finishes 1.9 tasks, then they're really doing mostly okay. But depending on how you're measuring, you might record them as only having 1 task completed, which makes it look like they're way behind pace. If the program consists of lots of smaller tasks then this won't be a big deal, but if there are just a few big tasks then you might want to try to measure partial tasks in the formulas. For example, if you think a student is around $70\%$ done with the second task then you would use $t = 1.7$.

If some of these are confusing, please comment to ask for clarification and I'll try to follow up :)
