edx-modulestore
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -117,2 +117,35 @@ var Q = require('q'); | ||
modulestore.findCourse = function (id) { | ||
var self = this; | ||
var deferred = Q.defer(); | ||
if (organization) { | ||
filter = { | ||
'$or': [ | ||
{ '_id.org': organization.name }, | ||
{ 'metadata.display_organization': organization.name } | ||
] | ||
}; | ||
} | ||
Module(this.connection).findOne({ | ||
'_id.category': 'course', | ||
'_id.course': id | ||
}, function (err, course) { | ||
if (err) { | ||
deferred.reject(new Error(err)); | ||
} | ||
else { | ||
var course = new Course(self, model); | ||
course.fetchAboutData().then(function () { | ||
deferred.resolve(course); | ||
}); | ||
} | ||
}); | ||
return deferred.promise; | ||
}; | ||
modulestore.findOrganizations = function (filter) { | ||
@@ -119,0 +152,0 @@ var self = this; |
{ | ||
"name": "edx-modulestore", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "Easy browsing of Open edX modulestores", | ||
@@ -5,0 +5,0 @@ "author": "Bertrand Marron", |
@@ -9,4 +9,18 @@ # edx-modulestore | ||
## Documentation | ||
### Courses | ||
#### States | ||
State | Description | Can enroll? | Can access? | ||
--- | --- | --- | --- | ||
`hidden` | Course is not open for enrollment | No | No | ||
`upcoming` | Course is open for enrollment but not running | Yes | No | ||
`open` | Course is open for enrollment and running | Yes | Yes | ||
`finishing` | Course is running but enrollement is closed | No | Yes | ||
`finished` | Course is closed | No | No | ||
## License | ||
[MIT License](http://en.wikipedia.org/wiki/MIT_License) |
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
13555
417
26