diff options
| author | nanalelfe <nargiza.nosirova@mail.utoronto.ca> | 2016-07-18 10:54:08 +0000 |
|---|---|---|
| committer | nanalelfe <nargiza.nosirova@mail.utoronto.ca> | 2016-07-18 10:54:08 +0000 |
| commit | a35da9f9ccc1124d9b6f4461c7216ffbb0285e2f (patch) | |
| tree | d5b4b8548caae36a20e1258a8341dab4b3d522d2 /testImports.js | |
| parent | 16bbc66ebafc6f1a55e47dbda3f3c0f658fe715c (diff) | |
| parent | c1ce89359a7b54ec97b54ce577e5534c180c5c4b (diff) | |
merged
Diffstat (limited to 'testImports.js')
| -rw-r--r-- | testImports.js | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/testImports.js b/testImports.js new file mode 100644 index 0000000..fc128eb --- /dev/null +++ b/testImports.js @@ -0,0 +1,33 @@ +var dbFile = require("./node_simple"); + +var fields = ["CSC240", 2016, "fall", "midterm", ["Faith Ellen", "Tom F."], 20, 2, "some date", "some user name"]; +var questions_array = ["this is q1", "this is q2"]; + + +// ***************************************************************************** +// EXAMPLE USAGE +// ***************************************************************************** + + +// test adding of exams to the database functionality +// dbFile.add_exam(fields, questions_array); + +//test removal of exam from the database functionality +//dbFile.remove_exam([fields[0],fields[1],fields[2],fields[3]]); + + +//test getting all exams database functionality -- USE FOR THE EXAMS PAGES maybe? +dbFile.get_all_exams("CSC240", function (exams) { + if (exams.length == 0){ + console.log("Nothing was found"); + } + else { + console.log(exams); + } +}); + +//test adding course +// dbFile.add_course("CSC148", "Intro to Programming"); + +//test adding solution +//dbFile.add_solution(["578a44ff71ed097fc3079d6e", 1, "this is another solution to q1"]); |
