Info Sessions

  • Take this next step and get all your questions answered.
  • Course Lookup

Looking for a course description? Use our easy course lookup tool to find it.
Sorry, but no record found.
***
\n\n" + $("#" + id).html() + "\n \n"; var print = window.open("", "Print CD"); print.document.open(); print.document.write(html); print.document.close(); print.print(); } return false; } //--------Knockout stuff ------// //--- datacontext----// window.courseDescriptions = window.courseDescriptions || {}; window.courseDescriptions.datacontext = (function (ko) { var datacontext = { allCourseDescription: getCourseDescription }; return datacontext; function getCourseDescription(courseObservable, errorObservable, contentLoadingObservable, courseId, courseName) { return ajaxRequest("get", courseDescriptionUrl(courseId, courseName), null, "courseWrapper") .done(getSucceeded) .fail(getFailed); function getSucceeded(data) { var mappedCourses = $.map(data, function (list) { return new createCourseDescList(list); }); courseObservable(mappedCourses); //set contentLoading to true since the request successfully completed. contentLoadingObservable(true); errorObservable(""); } function getFailed() { errorObservable("Error loading courses"); } function createCourseDescList(data) { return new datacontext.CourseDescription(data); // is injected by model.js } } function courseDescriptionUrl(courseId, courseName) { return "http://secure.peikekhabari.com/RegisWebApi/api/Course?courseId=" + (courseId || "") + "&courseName=" + (courseName || ""); } function ajaxRequest(type, url, data, callbackWrapper) { // Ajax helper var options = { dataType: "jsonp", crossDomain: true, type: type, jsonp: "callback", jsonpCallback: callbackWrapper, data: ko.toJSON(data) }; return $.ajax(url, options); } })(ko); //--- Model ---// (function (ko, datacontext) { datacontext.CourseDescription = CourseDescription; function CourseDescription(data) { var self = this; data = data || {}; // Persisted properties self.xCourseId = data.xCourse_id; self.CourseName = data.course_name; self.CourseNumber = data.course_no; self.CourseTitle = data.course_title; self.Credit = data.credit; self.Description = data.course_desc; self.Comment = data.comment; self.PreReqz = data.pre_requisite; self.CoReqz = data.co_requisite; self.Crosslist = data.crosslist; // Non-persisted properties self.ErrorMessage = ko.observable(); self.formattedCourseDesc = ko.computed(function () { var courseInfo = ''; courseInfo = courseInfo + "
" + self.CourseName + ' ' + self.CourseNumber + ' - ' + self.CourseTitle + "
"; courseInfo = courseInfo + "
" + self.Description + "
"; if (self.PreReqz != '') courseInfo = courseInfo + "
Pre-requisite: " + self.PreReqz + "
"; if (self.CoReqz != '') courseInfo = courseInfo + "
Co-requisite: " + self.CoReqz + "
"; if (self.Crosslist != '') courseInfo = courseInfo + "
Cross Listing: " + self.Crosslist + "
"; return courseInfo; }); } })(ko, courseDescriptions.datacontext); //--- View Model ---// window.courseDescriptions.courseDescriptionsViewModel = (function (ko, datacontext) { //Data var self = this; self.error = ko.observable(); self.courseDescList = ko.observableArray(); self.loadCourseDescClick = ko.observable(false); self.contentLoading = ko.observable(false); self.loadCourseDesc = function () { //Clear out previous results var courseId = $("#course_id").val(); var courseName = $("#course").val(); if ((courseId == '') && (courseName == '')) return; datacontext.allCourseDescription(courseDescList, error, contentLoading, courseId, courseName); self.loadCourseDescClick(true); ////Reset form fields $("#course").val(''); $("#course_id").val(''); $('#course_full_name').html(''); } return { error: self.error, contentLoading: self.contentLoading, loadCourseDescClick: self.loadCourseDescClick }; })(ko, courseDescriptions.datacontext); // Initiate Knockout bindings ko.applyBindings(window.courseDescriptions.courseDescriptionsViewModel);