After an outage on September 1, the Instructure Community is now fully available, including guides, release notes, forums, and groups. If some styling still looks unusual, clear your cache and cookies.
Previously I have created TurnItIn assignments on canvas using the canvas API with (python) code like:
import requests
access_token =' .... '
assignment={'assignment': {
'description': 'A really wonderful test assignment',
'due_at': '2020-02-23T12:59:59Z',
'grading_type': 'points',
'name': 'Another test Assignment',
'points_possible': 32.0,
'submission_types': ['external_tool'],
'external_tool_tag_attributes': {'url': 'https://api.turnitin.com/api/lti/1p0/assignment'},
}
}
headers = {'Accept': 'application/json',
'Authorization': 'Bearer ' + access_token,
'Cache-control': 'no-cache',
'Content-Type': 'application/json; charset=UTF-8'}
}
requests.post(url='https://canvas....u/api/v1/courses/./.../assignments',
headers=headers, json=assignment)
This worked fine but this interface is being phased out and I need to start using the plagiarism framework. Specifically, I want the assignments created through the API to have these settings:
Using the code above but with
assignment={'assignment': {
'description': 'A really wonderful test assignment',
'due_at': '2020-02-23T12:59:59Z',
'grading_type': 'points',
'name': 'Another test Assignment',
'points_possible': 32.0,
'submission_types': ['online_upload'],
}
}
I get close to what I want except that when I go into canvas and edit the assignment created this way the "Select to use TurnItIn" menu is set to "None". So I have not enabled TurnItIn, which is not surprising since the json above does not mention it. The canvas documentation seems to suggest that setting
assignment['assignment]['
turnitin_enabled] = true
might solve my problem but this does not help.
I have tried many variations on the code above, combed through the canvas API documentation and searched on the net but I can't find anything does what I want. Previously I was able to troubleshoot assignments by looking at the output from an API call
GET /api/v1/courses/:course_id/assignments/:id
but, surprisingly, there is no change in the returned json for the assignment before and after TurnItIn is manually added to the assignment, so I can't see what to change in my API call to create the assignment.
Is anyone able to suggest what I should do?
@andrew_mathas , greetings! I'm not sure of the answer to this question, but I'm sharing it with the Canvas Developers group in the Community to see if they can help!
Kona
It seems that this is a known issue: https://community.canvaslms.com/ideas/14664-add-api-end-points-for-plagiarism-framework
The problem is that the canvas API is not providing the required endpoints to create assignments using the TurnItIn plagiarism framework.
Hi, any update on this issue? It looks like canvas API has the necessary key "turnitin_settings" in the assignment creation. I also don't have "sufficient privileges" to access the link you provided...
Thank you
As far as I can see this is still broken. The link that I posted abopve used to work but now I cannot access it either. It looks like infrastructure may have blocked access to the page...
Hi @andrew_mathas ...
The link you had provided in your earlier post pointed to the old Canvas Community website. Back in August 2020, Instructure transitioned to a new Community platform. Unfortunately, some links don't re-direct to display the new link. Unfortunately, the link you are referring to is one of those links that didn't re-direct...which is why you and I are seeing that error message. Normally, you'd be able to type in a few words from the old URL (which typically displays the title of the old posting) into the search field at the top of any page here in the Community site, and you'd be able to find the page/current URL for that topic. But, in my own searching, I'm not able to find that page you are inquiring about. I don't think it's necessarily that Instructure (not Infrastructure) blocked access to the page, though. It seems like the link was to a Feature Idea in the Community, but I'm just not sure where it would have gone to...as they typically do not delete content from us as users.
Sorry I don't have better news for you at this time.
I have tested this functionality using the update assignments API
PUT /api/v1/courses/:course_id/assignments/:id
The settings turnitin_enabled and turnitin_enabled have no effect, as previously mentioned.
I have captured the payload used by the Canvas UI, and I found the required parameters - this works in the update assignment request to enable TII plagiarism framework. This is an undocumented functionality, it may change without notice; use at your risk. Sample payload below.
{
"assignment":
{
"submission_types": [
"online_upload"
],
"submission_type": "online",
"similarityDetectionTool": "Lti::MessageHandler_XYZ",
"configuration_tool_type": "Lti::MessageHandler",
"report_visibility": "immediate"
}
}
The above is the minimum required payload for an update request; the same above fields will have to be included in a create (POST) request to enable TII.
Wow, thanks for this. I can confirm that this works. I needed:
'similarityDetectionTool': 'Lti::MessageHandler_3'
Previously, I had tried to reverse engineer the canvas API requests but I could never find the right requests, even though I do this regularly with another app. Motivated by your post I looked again and discovered that I just need to use persistent logs in the developer tools because otherwise the API requests get lost with page reloads.
Thank you again!
To interact with Panda Bot, our automated chatbot, you need to sign up or log in:
Sign inTo interact with Panda Bot, our automated chatbot, you need to sign up or log in:
Sign in
This discussion post is outdated and has been archived. Please use the Community question forums and official documentation for the most current and accurate information.