Enrollment/Credits - Web Service Data Structures

Course Records

Course record imports, via the transcript_import endpoint, allow remote services to queue enrollments for user, that are processed upon the user's next login.

Imported Transcript Record (transcript_import)
1 2 3 4 5 6 7 8 9 10 11 var transcript_import = { "imported" : 0, // imported must be 0 upon initial creation to trigger the enrollment. Records set to 1 are not imported. "nid" : 10, // The course nid "attended" : 0, // 1 = attended "complete" : 1, // 0 = incomplete; 1 = complete (Triggers credit awarding) "external_mail" : "webservice_user@dlcdev.com", // External_mail is used to match a user, when uid is not available. "date_completed" : "1463756400", // Date in Epoch format "start" : "1463756400", // Date in Epoch format "credit_type" : "ama", // The credit type machine name to award. May be NULL, or omitted, if not awarding credit "credits" : 10.50, // The number of credits. };

Course Credit

Course credit allows the addition, or updating, of eligible credit on an individual course.

Course Credit (course_credit)
1 2 3 4 5 6 7 8 9 var course_credit = { "nid" : 10, // The course nid "type" : "ama", // The credit type machine name to award. "increments" : ".25", "min" : "1.00", "max" : "10.00", "active" : 1, // 0 = Disabled; 1 = Enabled "enable_variable_credit" : 1, };

Awarded Credit

Credit awarded to an individual user in a course may be accessed via the course_credit_awarded endpoint.

Awarded Credit (course_credit_awarded)
1 2 3 4 5 6 var course_credit_awarded = { "nid" : 10, // Course nid "uid" : 1, // User ID "type" : "ama", // The credit type machine name to award. "credits" : 4, // Number of credits };

Course Enrollment

Enrollment records may be added directly to the system via the course_enrollment endpoint. This does not require the user to login.

Course Enrollment (course_enrollment)
1 2 3 4 5 6 7 var course_enrollment = { "nid" : 10, // Course nid "uid" : 1, // User ID "enrollmenttype" : "external_webservice", // A string detailing what service enrolled the user "type" : "course_enrollment", // The field bundle to use. Can be omitted. "status" : 1, // 0 - Disabled, 1 - Enabled };

Course Report

The course report contains the user's completion status, grade and section. External web services may update this to mark a user as complete or incomplete.

Course report (course_report)
1 2 3 4 5 6 7 8 9 10 11 var course_report = ( "nid" : 10, // Course nid "uid" : 1, // User ID "grade_result" : 0, "date_completed" : NULL, // Date in Epoch format or NULL if Incomplete "updated" : 1592512895, // Date in Epoch format "complete" : 0, // 0 - Incomplete, 1 - Complete "section" : "course_content", // The course object module type "section_name" : "Webservice Object", // The course object module name "coid" : 30 // The course object id. );

Course Object Fulfillment

External web services may set the completion status, and grades, of individual course objects a user is taking, within a course. The record is associated to the individual via their uid, and course object id (coid). The coid is obtainable via the Course Outline. An objects course object id is distinct from the course nid.

Course Object Fulfillment (course_object_fulfillment)
1 2 3 4 5 6 7 8 var course_object_fulfillment = { "coid" : 30, // The course object id. "uid" : 1, // User ID "grade_result" : 100, "date_started" : "1463756400", // Date in Epoch format "date_completed" : "1463756400", // Date in Epoch format "complete" : 1, // 0 - Failed/Incomplete, 1 - Passed };

Additional Data Structures