The create assignment API
seems to create two duplicate assignments (instead of one) every time I call it. Has anyone else experienced this or can anyone help with this?
Thanks for the quick response! We have figured it out. It turns out we had implemented a retry system on any response that wasn't a 200. Creating an assignment actually returns a 201 so that triggered a retry in our system. We just amended it to accept any 2xx response as working.
@ @walter_yuan I have not seen this happen. The basic code I use for this (in python) is:
access_token=configuration["canvas"]["access_token"]baseUrl="https://"+configuration["canvas"]["host"]+"/api/v1/courses/"header = {'Authorization' : 'Bearer ' + access_token}payload = {}----------------------------------------------------------------------def create_assignment(course_id, name, max_points, grading_type, description): # Use the Canvas API to create an assignment # POST /api/v1/courses/:course_id/assignments url = baseUrl + '%s/assignments' % (course_id) if Verbose_Flag: print("url: " + url) payload={'assignment[name]': name, 'assignment[submission_types][]': ["none"], 'assignment[peer_reviews]': False, 'assignment[notify_of_update]': False, 'assignment[grade_group_students_individually]': True, 'assignment[points_possible]': max_points, 'assignment[grading_type]': grading_type, 'assignment[description]': description, 'assignment[published]': True # if not published it will not be in the gradebook } r = requests.post(url, headers = header, data=payload) if r.status_code == requests.codes.ok: if r.status_code == requests.codes.ok: page_response=r.json() print("inserted assignment") return True return False
I have not created a large number of assignments this way, but will do so over the next few days.
Hello, I was thinking of this a while ago and have been trying to message Canvas support about this but they suggested here but not which category. I apologize if this is the wrong spot. When messaging students right now we need to message one by one. I would like to know if there is a way we can change that to streamline…
I'm building a tool for my institution that imports grades from another LTI tool into Canvas so instructors can automate late assignment policies not otherwise supported by Canvas. I'm trying to use the LTIv1.3 ID which is readily available on the LTI-side as a link to the student record on Canvas, but I can't find the ID…
How can one track Canvas Media use without having the reports available from Canvas Studio? Checking API endpoints and the Data 2 schema, there do not seem to be dedicated Canvas Media endpoints. Am I missing some? A method I've considered is using the body field of the wiki_pages table, as this contains the html code of…
Hello, I'm trying to utilize an API call to pull completed certificates and was hoping to download and store the certs as a backup. I can successfully run the API call but it will not allow me to view the certificate unless I access the URL while signed into an account where it's "my" cert. Is there a permissions setting…
UI for weekly progression idea that rest in the Schedule tab of the **K-12 UI** of Canvas it's incomplete and I really would not take it and push it into instance but I am going to post it here because in the past people like @James && @robotcars || @Steve_25 have had terrific input in the past... maybe w/their eyes and…