I am trying to add a Google Form to a Google Classroom assignment, but it seems that it is not possible.
First, it tells me here (https://developers.google.com/classroom/reference/rest/v1/Material) that "When creating attachments, setting the form field is not supported.", but then right under this it give a "form" object option. Then, when I run the code below it gives me this error: "materials: Unsupported material type: FORM".
Take note: you CAN add the form by "link": BUT if you do this you CANNOT use the "Enable grade importing" button on the assignment, which is what I need.
Is there any way to add a Google Form to a Google Classroom assignment?
function createAssignment () {
var ClassSource = {
title: "Test File",
state: "DRAFT",
scheduledTime: "2017-12-28T11:00:00Z",
dueDate: {
year: 2017,
month: 12,
day: 30,
},
dueTime: {
hours: 11,
minutes: 0,
seconds: 0,
},
maxPoints: 10,
materials: [{
form:{
formUrl: "URL",
title: "exam",
},
}],
workType: "ASSIGNMENT"
};
Classroom.Courses.CourseWork.create(ClassSource, "ID");
}
driveFile
– Kos