by Michael Hughes.
I'm not sure it's as simple as just looking up a field in the database! As things like activity & course completion & restrict access conditions allow the definition of "complete" to be changed. It's not a just a straight up X activities"completed" out of Y activities defined. (They also define *how* activities can be determined as "completed").
For instance you may create 10 activities, but a restrict access condition on one of them may mean that a student doesn't see 1 of them, so they're really doing 9 activities.
You'd probably want to look at the course and activity completion APIs to see if these can give you the data you're looking for, as these are responsible for both setting the definitions of "complete" as well as evaluating if the student has met all of the conditions to be viewed as "complete".
For instance you may create 10 activities, but a restrict access condition on one of them may mean that a student doesn't see 1 of them, so they're really doing 9 activities.
You'd probably want to look at the course and activity completion APIs to see if these can give you the data you're looking for, as these are responsible for both setting the definitions of "complete" as well as evaluating if the student has met all of the conditions to be viewed as "complete".