How to submit an assignment with external tool for the teacher to speedgrade

JennyLi
Community Member

I am a new developer, using Canvas.

I am confused that when I add an assignment with external tool Submission Type and link a resource to show. The student can do assignment with external tool ,but how to sumbit his work in external tool , it may have a button called "Submit", and then when the teacher do the speedgrade, canvas can display the external tool to show the student's work. But now when the teacher check student's work ,it is nothing.Just "

This student does not have a submission for this assignment

" show me.

I know it is because the i didn't finish the "Submit" feature to let Canvas know the student has done with it and seed it back to teacher to speedgrade.

I use the form to sumbit to ''

/api/v1/courses/2/assignments/62/submissions

like:

 
<form method="post" action="https://foxitsoftware.instructure.com/api/v1/courses/2/assignments/62/submissions" id="assignment_submit">
<input type="hidden" name="submission_type" value="basic_lti_launch"/>
<input type="hidden" name="url" value="http://localhost:1014/edit_file"/>
<input type="hidden" name="user_id" value="7"/>
<input type="hidden" name="assignment_id" value="62"/>
<input type="hidden" name="course" value="2"/>
</form>

but i got "

{"errors":[{"message":"An error occurred.","error_code":"unprocessable_entity"}]}

"

so when i try to post it like :

axios({
header:{
Authorization: 'Bearer 21645~Rl1chCHcJvfU38SKyeALjcuSf2aGuZnqwRC3ya8L2eJ45fVCyydU5tN13bGusO21'
},
method:'POST',
url:'/cpi/api/v1/courses/2/assignments/62/submissions',
data:{
submission:{
submission_type:'',
url:'http://localhost:1014/edit_file',
user_id:'7',
assignment_id:'62',
course:'2',
}
}
}).then(res=>{
console.log('Success',res);
}).catch(error=>{
console.log('error', error);
})

i still got nothing.

Don't know how to make it pass and let Canvas know the student has sumbit.

Maybe it should be other api call or use other way to make it

I don't know, Please help me to make it right.

Labels (1)
0 Likes