Canvas Lite is now available! If you have course content in Free-for-Teacher, now's the time to export it. Access closes for good at 11:59 p.m. MT on October 6. Learn more.
I need to produce a CSV file that lists which Courses have Quizzes.
# Checkes each course in the array course_ids[] # to see if it has any quizzes # it does not determine if the quizz is published or not # it will return TRUE for both published and unpublished quizzes import requests import csv import os # beta expires April 30th 2024 API_TOKEN = '...' #beta BASE_URL = 'https://...instructure.com/api/v1/' # Array of course IDs to check for quizzes course_ids = [2486,8500,8501,8502,1525] # Set up headers with Authorization token headers = { 'Authorization': 'Bearer ' + API_TOKEN, } # Function to check if a course contains any quizzes def course_has_quiz(course_id): # API endpoint to list quizzes in a specific course url = f"{BASE_URL}courses/{course_id}/quizzes" # Make a GET request to the Canvas API response = requests.get(url, headers=headers) # Check if the request was successful (status code 200) if response.status_code == 200: quizzes = response.json() return len(quizzes) > 0 else: print(f"Failed to retrieve quizzes for course {course_id}. Status code: {response.status_code}") return False # Function to get the next version number for the CSV file def get_next_version_number(): current_version = 0 files = os.listdir('.') for file in files: if file.startswith('course_quizzes_') and file.endswith('.csv'): try: version = int(file.split('_')[2].split('.')[0]) if version >= current_version: current_version = version + 1 except ValueError: pass return current_version # Export course data to CSV file with dynamic version number def export_course_data_to_csv(course_data): next_version = get_next_version_number() csv_filename = f'course_quizzes_{next_version:03d}.csv' with open(csv_filename, 'w', newline='') as csvfile: csv_writer = csv.writer(csvfile) csv_writer.writerow(['Course ID', 'Has Quiz']) for course_id, has_quiz in course_data.items(): csv_writer.writerow([course_id, has_quiz]) return csv_filename # Return the filename # Main function def main(): course_data = {} # Iterate over course IDs and check if each course has a quiz for course_id in course_ids: has_quiz = course_has_quiz(course_id) course_data[course_id] = has_quiz print(f"Checking course {course_id}") # Export course data to CSV file csv_filename = export_course_data_to_csv(course_data) print(f"Course data exported to {csv_filename}") if __name__ == "__main__": main()
As it is now, assignments that are dropped show to the students as a slightly lighter font color. However, if students do not complete an assignment that is then dropped, the font color doesn't change at all and it shows as "missing" in red. Why not just change all dropped assignments to "Dropped" instead of "missing"?…
Our H5P LTI assignment scores are not returning to the gradebook 9 times out of 10. It's been going on since 15 September, and we are not aware of any event or change at that time that might have caused the issue. The H5P reports confirm students have completed the assignments, therefore ruling out user error. Is anyone…
Our institution is setting up 9 institutional outcomes in Canvas. Several of our outcomes have multiple skill sets within the rubric. For example: Critical Reading – Skill Set A Critical Reading – Skill Set B Critical Reading – Skill Set C Our understanding is that Canvas Outcomes data reports can provide the overall/total…
I am just curiousas to why there is not a field to enter a description for an outcome at the account level? Or at least edit the rating when you attach/link an account level outcome to a rubric. When you create a new criterion for a rubric, you enter a decription for a rating, but for an account level outcome.
We use a pre- post- model to measure learning which requires student-question matching from two time periods. This requires exporting quiz data to CSV to do the analysis properly. (I can get into more detail if needed.) The New Quizzes Student Analysis CSV export has repeated blocks of ItemID then columns related to that…