cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Community Member

How to get total grade via api for each course?

Hi, i wanna get percentage for total grade and grade level for each courses of each students , how can i get it via canvas api to do it?

please help me ,thanks.

5 Replies
Highlighted
Community Member

Hello lidzhu@gmail.com Welcome to the Canvas Community.  There are several API experts out in the Community (I'm definitely not one of them!) as well as in the Canvas Developers group, which you should think of joining if you are an administrator or developer.  (I just shared your question with the Canvas Developers group.)

That said, assuming you are an administrator, another method may be through the GUI interface itself.  One of the reports that an administrator can generate is a Grade Export report.  When you get to the admin view under SETTINGS and click the REPORT tab, you will see it is one that you can create and export to a CSV file. Here is what you see if you click the question mark icon for the onscreen help regarding the specific report:

226759_grade export.jpg

So until someone else chimes in with the API, perhaps that will suffice for the total grade.  

I'm not sure what you mean regarding "grade level," however, so you may want to clarify for the Community.  Do you mean, for example, "5th grade" or "Sophomore" (depending on your institution)?  If so, that will not come up in the above report.

Hope this helps a bit.

Highlighted
Community Member

hi, Ken Black
thanks for help on it, but i prefer to use api way, thanks for help.

Highlighted
Instructure
Instructure

Hello lidzhu@gmail.com‌, grade data is part of the enrollments api (Enrollments - Canvas LMS REST API Documentation).  In the document you'll see that the enrollment object contains a number of key-value pairs pertaining to final grades, such as:

computed_current_score, computed_final_score, computed_current_grade, computed_final_grade, current_period_computed_current_score, current_period_computed_final_score, current_period_computed_current_grade, and current_period_computed_final_grade.  Like this:

  "grades": null,
  // optional: The student's score in the course, ignoring ungraded assignments.
  // (applies only to student enrollments, and only available in course endpoints)
  "computed_current_score": 90.25,
  // optional: The student's score in the course including ungraded assignments with
  // a score of 0. (applies only to student enrollments, and only available in course
  // endpoints)
  "computed_final_score": 80.67,
  // optional: The letter grade equivalent of computed_current_score, if available.
  // (applies only to student enrollments, and only available in course endpoints)
  "computed_current_grade": "A-",
  // optional: The letter grade equivalent of computed_final_score, if available.
  // (applies only to student enrollments, and only available in course endpoints)
  "computed_final_grade": "B-",
  // optional: Indicates whether the course the enrollment belongs to has grading
  // periods set up. (applies only to student enrollments, and only available in
  // course endpoints)
  "has_grading_periods": true,
  // optional: Indicates whether the course the enrollment belongs to has the Display
  // Totals for 'All Grading Periods' feature enabled. (applies only to student
  // enrollments, and only available in course endpoints)
  "totals_for_all_grading_periods_option": true,
  // optional: The name of the currently active grading period, if one exists. If the
  // course the enrollment belongs to does not have grading periods, or if no
  // currently active grading period exists, the value will be null. (applies only to
  // student enrollments, and only available in course endpoints)
  "current_grading_period_title": "Fall Grading Period",
  // optional: The id of the currently active grading period, if one exists. If the
  // course the enrollment belongs to does not have grading periods, or if no
  // currently active grading period exists, the value will be null. (applies only to
  // student enrollments, and only available in course endpoints)
  "current_grading_period_id": 5,
  // optional: The student's score in the course for the current grading period,
  // ignoring ungraded assignments. If the course the enrollment belongs to does not
  // have grading periods, or if no currently active grading period exists, the value
  // will be null. (applies only to student enrollments, and only available in course
  // endpoints)
  "current_period_computed_current_score": 95.8,
  // optional: The student's score in the course for the current grading period,
  // including ungraded assignments with a score of 0. If the course the enrollment
  // belongs to does not have grading periods, or if no currently active grading
  // period exists, the value will be null. (applies only to student enrollments, and
  // only available in course endpoints)
  "current_period_computed_final_score": 85.25,
  // optional: The letter grade equivalent of current_period_computed_current_score,
  // if available. If the course the enrollment belongs to does not have grading
  // periods, or if no currently active grading period exists, the value will be
  // null. (applies only to student enrollments, and only available in course
  // endpoints)
  "current_period_computed_current_grade": "A",
  // optional: The letter grade equivalent of current_period_computed_final_score, if
  // available. If the course the enrollment belongs to does not have grading
  // periods, or if no currently active grading period exists, the value will be
  // null. (applies only to student enrollments, and only available in course
  // endpoints)
  "current_period_computed_final_grade": "B"

In order to query this for every student in every course, you'll probably need to do a couple of GETs and iterate over the returend data like:

Get /courses

then for each course in the returned object,

GET  /[:courseID]/enrollments

(filtered by enrollment_type=student), and grab the grade data you want for each student in each course.

Highlighted
Community Member

hi, Danny Wahl
i will try the api, thanks.

Highlighted
Navigator

Hello there, lidzhu@gmail.com‌...

While I don't have an answer for you myself, I wanted to check in with you because I noticed there hasn't been any new activity in this particular discussion topic since early May.  You indicated that you would try the API based on feedback from dwahl+sales@instructure.com‌.  Have you had a chance to try this out?  Did you get the information you were looking for?  Do you have any other questions as it relates to your initial posting above?  If you could please come back to this thread to post an update, that would be great.  Also, if you feel that Danny's posting did help to answer your question, please mark it as "Correct".  But, if you still have question, please post those below.  For now, I am going to mark your question as "Assumed Answered", but that won't prevent you or others from posting additional replies below.  I hope that's okay with you.  Looking forward to hearing from you soon.

Labels