Celebrate Excellence in Education: Nominate Outstanding Educators by April 15!
Found this content helpful? Log in or sign up to leave a like!
Hi! I would like to know if there's a way to check the total time spent on Canvas as a teacher. I know students have this feature, but as for me I can only check the times where I logged and how many times I've seen a page. What I would really like to know is the total amount of hours spent on the page as a teacher. Can't find this statistic anywhere.
Solved! Go to Solution.
The instructor can see the total amount of time that any user, including teachers, from the People page. It shows the last activity and the total time. The last activity is fairly reliable, but the total time is not reliable and I would not trust it for any kind of "minimum time spent in the course" measurement. I have not found it to be a useful predictor of student success for my stats class either (we analyze the course each semester to determine what shows a significant relation with success). Where I have found it helpful is when a student is failing and the number is low, it validates that the student is not putting in the time.
See the View Users section of How do I use the People page in a course as an instructor? for more details on last activity and total activity.
I download the last activity and total activity information from the Canvas REST API for all of our courses every night. This allows me to track how much time students spend over time. The number in you see on the People page is the current amount. If it says someone spent 519 hours in a course (that's what Canvas reports for me in my stats class last semester), I have no idea whether I was overly active at the beginning of the semester and then slacked off at the end of was consistent in my time throughout the course. The same thing applies for the last activity. If a student was last active this week on Wednesday, it doesn't tell me that the time before that was three weeks ago.
I know that the Access Report will show you have many times you've viewed a page, but I am not sure what you're asking about when you want to know the total amount of hours spent on a page. I don't know of anywhere in Canvas that tells how long was spent on a specific page, just how many times you've viewed it.
The instructor can see the total amount of time that any user, including teachers, from the People page. It shows the last activity and the total time. The last activity is fairly reliable, but the total time is not reliable and I would not trust it for any kind of "minimum time spent in the course" measurement. I have not found it to be a useful predictor of student success for my stats class either (we analyze the course each semester to determine what shows a significant relation with success). Where I have found it helpful is when a student is failing and the number is low, it validates that the student is not putting in the time.
See the View Users section of How do I use the People page in a course as an instructor? for more details on last activity and total activity.
I download the last activity and total activity information from the Canvas REST API for all of our courses every night. This allows me to track how much time students spend over time. The number in you see on the People page is the current amount. If it says someone spent 519 hours in a course (that's what Canvas reports for me in my stats class last semester), I have no idea whether I was overly active at the beginning of the semester and then slacked off at the end of was consistent in my time throughout the course. The same thing applies for the last activity. If a student was last active this week on Wednesday, it doesn't tell me that the time before that was three weeks ago.
I know that the Access Report will show you have many times you've viewed a page, but I am not sure what you're asking about when you want to know the total amount of hours spent on a page. I don't know of anywhere in Canvas that tells how long was spent on a specific page, just how many times you've viewed it.
Which API request do you use to pull the last activity and total activity information?
The Enrollments API requests provide those values. You can get it through the REST API or GraphQL.
The numbers are not reliable, though. It's better to get the data each day and look at the differences rather than taking the total. That way you have tracking rather than a single point in time.
Would you share your API call and any details? My organization has been looking for this and it has been hard for me to note that we cannot measure time sepnt, as you have all noted. However, we may be able to track access blips and time between those to measure some level of activity.
We use the API for several things, but would appreciate nudge in the right direction and specific calls.
Edit: After I posted this, I noticed I was on a page asking about teacher time. I changed all the StudentEnrollment to TeacherEnrollment. That also makes the GraphQL approach so much faster because there are limited teachers per course. I did not update the rest of the information -- it refers to student enrollments. Using GraphQL with terms is probably the fastest way to get all of the information for instructors. The request that took 35.9 seconds for students took 8.9 seconds for instructors.
The link I provided in the message you're responding to takes you to the main page for the Enrollments API. The reason I didn't list a specific API endpoint is because there are several that will return the information. You can list enrollments for a course, a section, or user. There are other ways to get an enrollment from that API as well, but I use the course endpoint.
For GraphQL, you could do something like this:
query enrollmentActivity($courseId: ID!) {
course(id: $courseId) {
enrollmentsConnection(filter: {types: TeacherEnrollment}) {
nodes {
lastActivityAt
totalActivityTime
state
user {
_id
sisId
sortableName
}
}
}
}
}
and then pass Canvas course ID in the variables section. Make sure you pass one of your course IDs and not one of mine.
{ "courseId": 3750081 }
You can play around with GraphQL through the GraphQL Explorer by adding /graphiql to the end of your dashboard URL. Once you have it working the way you want, you can use it programmatically with the GraphQL API.
The enrollment API, which is where this data comes from, is an expensive one. Expect that you will need to use pagination. With the REST API calls, you can typically get up to 100 at a time, so if none of your classes exceed that, then you can get each class with a single call. Otherwise, it will involve bookmarks and the page=# will not work.The graphql approach allows you up to 60 seconds and is more likely to return an entire dataset with a single call.
Both of the above approaches need you to get a list of courses and iterate through them.
You could -- highly not recommended -- fetch the enrollments for your entire instance using graphql. This will certainly require pagination unless you're a small school in your first semester. Change the 12345 to be your account number.
query allEnrollmentActivity {
account(id: "12345") {
coursesConnection(first: 100, after: "") {
nodes {
_id
sisId
name
enrollmentsConnection(filter: {types: TeacherEnrollment}) {
nodes {
lastActivityAt
totalActivityTime
state
user {
_id
sisId
sortableName
}
}
}
}
pageInfo {
endCursor
hasNextPage
}
}
}
}
That request took me about 4.25 seconds to make with just 100 courses. In theory, I could go about 1400 (60 seconds / 4.25 seconds per 100 enrollments) but it may not work that way. When I requested 1000 courses, it timed out. 500 courses took me about 16 seconds. It is dependent on the number of enrollments in each class, so use a smaller number than you think you should be able to get.
What will happen when you get the results is that there will be a pageInfo object in the results.
"pageInfo": {
"endCursor": "MTAw",
"hasNextPage": true
}
The hasNextPage lets me know whether I'm done or not. The endCursor becomes the value for the "after" in the next request.
For example, my next request would start
query allEnrollmentActivity {
account(id: "12345") {
coursesConnection(first: 100, after: "MTAw") {
The pagination is not why I do not recommend getting them for all courses. We've been using Canvas since 2012 and there is no reason for us to repeatedly download the enrollments for the last 12 years when I just want the current semester. There is no way to filter courses with that request. It's better to get a list of courses that you want and then request the enrollments.
You could get the results by term. Our Spring 2024 term has a SIS ID of "2024a". We're small, so I was able to fetch all this in one request -- but it took 35.9 seconds. It would be safer to use pagination.
query termEnrollmentActivity {
term(sisId: "2024a") {
coursesConnection {
nodes {
_id
name
sisId
enrollmentsConnection(filter: {types: TeacherEnrollment}) {
nodes {
lastActivityAt
totalActivityTime
state
user {
_id
sisId
sortableName
}
}
}
}
}
}
}
Finally, I'm using "state" as one of the properties returned. This gives you all of the enrollment states. You can filter off enrollment states to get only the "active" students, for example. Active doesn't mean they're actively participating, it means they're still enrolled in the course.
Through the GraphQL Explorer, it only allows you to specify one state at at time
filter: {types: TeacherEnrollment, states: active}
However, you can manually edit the code to provide an array list.
filter: {types: TeacherEnrollment, states: [active, completed]}
If you filter by state you will (1) get the results faster and (2) potentially not need to include the state in the request.
In addition to the great information @James provided, I wanted to quickly say that even if the time spent on a page is available somewhere that neither of us is aware of right now, I'd take that information with a pretty big grain of salt. I can just leave Canvas open on my browser and walk away for a few hours, and when I come back, much of that time will count towards my course time.
There's really no great way for Canvas to determine if students are reading something, watching an embedded video, or have left the computer entirely. There is also a question of whether all activity is captured or not... Certain browser privacy extensions might block some data form being captured. Activity in Canvas apps is supposed to be captured, but I think there are some specific scenarios where it might not be. Overall I personally don't view the statistic as very accurate or something to take much action on. Perhaps at best for students who show really low activity time you could do a check in and see how they're doing...
I will somewhat assume this might be something that school/campus leadership is asking to see for an annual review or something (as I've been asked about this kind of data for my campus as well). I would try going down any other route possible that trying to get stats on time spent in Canvas because of the issues i mentioned above. If you want to show how much you do, I think the count of pages, discussions, etc would be a more accurate measure to show (even though I know leadership often likes to think in terms of hours).
-Chris
To participate in the Instructure Community, you need to sign up or log in:
Sign In