edx-modulestore
Advanced tools
Comparing version 0.0.6 to 0.0.7
@@ -56,6 +56,2 @@ var Q = require('q'); | ||
Course.prototype.__defineGetter__('id', function () { | ||
return this.get('_id.course'); | ||
}); | ||
Course.prototype.__defineGetter__('longId', function () { | ||
var _id = this.get('_id'); | ||
@@ -70,11 +66,4 @@ | ||
Course.prototype.__defineGetter__('fullId', function () { | ||
var _id = this.get('_id'); | ||
return _id.tag + '://' + [ | ||
_id.org, | ||
_id.course, | ||
_id.category, | ||
_id.name | ||
].join('/'); | ||
Course.prototype.__defineGetter__('shortId', function () { | ||
return this.get('_id.course'); | ||
}); | ||
@@ -194,4 +183,3 @@ | ||
id: this.id, | ||
longId: this.longId, | ||
fullId: this.fullId, | ||
shortId: this.shortId, | ||
state: this.state, | ||
@@ -198,0 +186,0 @@ name: this.name, |
@@ -122,17 +122,24 @@ var Q = require('q'); | ||
Module(this.connection).findOne({ | ||
'_id.category': 'course', | ||
'_id.course': id | ||
}, function (err, course) { | ||
if (err) { | ||
deferred.reject(new Error(err)); | ||
} | ||
else { | ||
var c = new Course(self, course); | ||
var elements = id.split('/'); | ||
if (elements.length !== 3) { | ||
deferred.reject(new Error('Invalid course ID')); | ||
} | ||
else { | ||
Module(this.connection).findOne({ | ||
'_id.org': elements[0], | ||
'_id.course': elements[1], | ||
'_id.name': elements[2] | ||
}, function (err, course) { | ||
if (err) { | ||
deferred.reject(new Error(err)); | ||
} | ||
else { | ||
var c = new Course(self, course); | ||
c.fetchAboutData().then(function () { | ||
deferred.resolve(c); | ||
}); | ||
} | ||
}); | ||
c.fetchAboutData().then(function () { | ||
deferred.resolve(c); | ||
}); | ||
} | ||
}); | ||
} | ||
return deferred.promise; | ||
@@ -139,0 +146,0 @@ }; |
{ | ||
"name": "edx-modulestore", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"description": "Easy browsing of Open edX modulestores", | ||
@@ -5,0 +5,0 @@ "author": "Bertrand Marron", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13326
406