Always Learning

API Group: 

The Course Info content extension leverages the existing course context to provide details about the course like title, ID, dates, etc.

For example, you could use this extension to retrieve the course start date, and in combination with an accompanying JavaScript component to calculate calendar dates, you could then dynamic syllabus information with text such as, "Week 1 Reading Assignment, Due Date - Tuesday, January 9, 2011". You can use this in combination with the User Info content extension to create truly customized content for users.

The only practical way to implement content extensions is with "JSONP" or "JSON-with-Padding" approach. When you invoke the content extension, you'll include the name of a JavaScript function (which you create) that our code will invoke when it loads the data. The data is passed to that function as an object, and you can use it however you wish. The last section below shows how to do this.

Note: JQuery 1.6.2 is available in the Visual Editor, and you'll need to use this. If you aren't familiar with JQuery, you can view their documentation here.

Note: You will need to use the Visual Editor's HTML mode to enter your code. HTML mode is a button at the bottom of the editor, but is not the "Plain Text Editor." Don't use Plain Text Editor, because that strips out important HTML elements.

Data Source URL

In your JavaScript, you'll request the data via this URL (see example below):

Available Data

Payload Format

This is the object that will be passed to your JavaScript function.

    "dispCourseCode":"BUS 101",
    "startDate":"10/13/2010 12:00:00 AM",
    "endDate":"12/13/2010 12:00:00 AM",
    "courseTitle":"Introduction to Business",
    "termName":"Fall 2011",
    "termStartDate":"10/13/2010 12:00:00 AM",
    "termEndDate":"12/13/2010 12:00:00 AM",
    "createDate":"10/13/2010 12:31:02 PM",
    "lastModifiedDate":"10/13/2010 12:31:02 PM",
		{"value": "FA2011BUS101"}
        "clientNodeID": "468990",
        "clientNodeTitle": "eCollege School of Business",
        "clientSortString": "sample.bus.",
        "clientString": "sample"

Property Descriptions

Property Name Description
courseID The LearningStudio numeric Course ID. You could use this if you were building a unique SSO, such as an IFrame to import institution-specific content. If you are SSO-ing to a separate application entirely, you must use a proper LearningStudio Outbound SSO.
courseType The LearningStudio course type. Typically this value is STANDARD.
dispCourseCode The Display Course Code of the course. This is typically a user-friendly identifier or shorthand, for example, "MATH-101".
startDate The course start date. This is in a human readable format and in US/Denver Mountain Time.
endDate The course end date. This is in a human readable format and in US/Denver Mountain Time.
semesterID The LearningStudio numeric Term ID. Every course exists in a single Term.
courseTitle The official title of the course.
instructorTitle Every LearningStudio course can use a different word to describe the role of the professor(s). For example, this can be "Professor" or "Instructor" or "Facilitator," etc.
termName The name of the term. Every course exists in a single Term.
isOpen Designates whether the course is available to students.
dupedCourseID If the course was copied from another (such as in a Master Course model), this is the ID of the course from which it was copied (e.g. the Parent course)
parentNodeID The LearningStudio numeric Node ID of the parent course.
termStartDate The term's start date. This is in a human readable format and in US/Denver Mountain Time
termEndDate The term's end date. This is in a human readable format and in US/Denver Mountain Time
createDate The date the course was created or copied. This is in a human readable format and in US/Denver Mountain Time.
lastModifiedDate The last time the course was modified. This is in a human readable format and in US/Denver Mountain Time.
expiredCallNumbers Any previously used call numbers that are no longer used/acceptable.
unexpiredCallNumbers An array of currently active call numbers. A course can have multiple call numbers (since it may be cross listed between schools/departments at an institution).
clientNodes An array of the nodes the course is available to. Though a course exists in a single term, it may be available to students from multiple nodes. See LearningStudio Data Model.

Using the Content Extension

To use a content extension you will need to:

  • Write a JavaScript function that will accept the data object.
  • Invoke JQuery (built into the visual editor) and use its getJSON method to call the extension.

Here's some sample code:

<script src="/CurrentCourse/jquery-1.6.2.min.js"></script><script type="text/javascript">
<!--//--><![CDATA[// ><!--
<!--//--><![CDATA[// ><!--
<!--//--><![CDATA[// ><!--
<!--//--><![CDATA[// ><!--
function processContentExtension(courseData){ 
	//process the data object with object notation. 
	//for example, to get the course title, reference the property with: 
	document.write("Welcome to "+courseData.courseInfo.courseTitle); 
$(document).ready(function (){
5843 reads
Always Learning