source files -> src/ folder

This commit is contained in:
tmshv committed 2016-01-09 17:26:44 +03:00
1 parent f006207112
commit d25f4439fa
144 files changed

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
const COURSES = require("./courses.json");
exports.courses = COURSES;
exports.course = getCourseByID;
exports.name = getCourseNameByID;
function getCourseByID(id){
for(var i=0; i<COURSES.length; i++){
var p = COURSES[i];
if(p.id == id){
return p;
}
}
return null;
}
function getCourseNameByID(id){
var p = getCourseByID(id);
if(p) return p.name;
else return null;
}