AnsweredAssumed Answered

Creating an Assignment using BB's Web Service

Question asked by ivanhan on Jan 27, 2016
Latest reply on Mar 26, 2016 by jkelley_blackboard

Been struggling with trying to create an assignment using the web services, any help is greatly appreciated.

 

Made sure I created a grade column prior to creating the assignment:

 

            ColumnVO newColumn = new ColumnVO();
            newColumn.courseId = courseId;
            newColumn.contentId = "_365439_1"; // This sets the category of the column to "Assignments"?
            newColumn.columnName = "Assignment 1";
            newColumn.columnDisplayName = "Assignment 1";
            newColumn.description = "Assignment 1 grades";
            newColumn.visible = true;
            newColumn.visibleSpecified = true;
            newColumn.visibleInBook = true;
            newColumn.visibleInBookSpecified = true;
            newColumn.possible = 100;
            newColumn.possibleSpecified = true;
            newColumn.scorable = true;
            newColumn.scorableSpecified = true;

 

            string[] savedColumnIds = grd.saveColumns(courseId, new[] { newColumn });

 

Verified that I can see the new column in my course. Proceeded to create an assignment:

    

            ContentVO assignment = new ContentVO();
            assignment.allowGuests = true;
            assignment.allowGuestsSpecified = true;
            assignment.allowObservers = true;
            assignment.allowObserversSpecified = true;
            assignment.available = true;
            assignment.availableSpecified = true;
            assignment.body = "Assignment 1";
            assignment.described = false;
            assignment.describedSpecified = true;
            assignment.contentHandler = "resource/x-bb-assignment";
            assignment.gradebookColumnId = savedColumnIds.FirstOrDefault();
            assignment.endDate = 0;
            assignment.endDateSpecified = true;
            assignment.startDate = 0;
            assignment.startDateSpecified = true;
            assignment.title = "Assignment 1";
            assignment.lesson = false;
            assignment.lessonSpecified = true;

 

            string assignmentId = cnt.saveContent(courseId, assignment);

 

saveContent returns null

 

Thank you

 

Outcomes