diff options
Diffstat (limited to 'testImports.js')
| -rw-r--r-- | testImports.js | 42 |
1 files changed, 40 insertions, 2 deletions
diff --git a/testImports.js b/testImports.js index 7ce9e1c..90ed230 100644 --- a/testImports.js +++ b/testImports.js @@ -30,7 +30,45 @@ var questions_array = ["this is q1", "this is q2"]; // dbFile.add_course("CSC148", "Intro to Programming"); //test adding solution -//dbFile.add_solution(["578a44ff71ed097fc3079d6e", 2, "this is a solution to q2"]); +/*dbFile.add_solution(["578a44ff71ed097fc3079d6e", 2, "this is a solution to q2", "some_user name"], function (bool, mssg) { + + console.log(mssg); + + if (bool == true) { + // do stuff + } + +});*/ + +dbFile.retrieve_userSolutions_history("some_user name", function (bool, result) { + if (bool == false) { + console.log(result); + } + else { + console.log(result); + } +}); + +dbFile.retrieve_userSolutions_count("some_user name", function (bool, result) { + if (!bool) console.log(result); + else { // bool is true i.e no error occured. result contains an integer + console.log(result); + } +}); + +/*dbFile.retrieve_userComments_history("some_user name", function (bool, results) { + if (!bool) console.log(results); + else { + console.log(results); + } +});*/ + +/*dbFile.retrieve_userComments_count("sad@saddy.com", function (bool, result) { + if (!bool) console.log(result); + else { // bool is true i.e no error occured. result contains an integer + console.log(result); + } +});*/ // the following just prints the exam to console @@ -41,7 +79,7 @@ var questions_array = ["this is q1", "this is q2"]; //test adding of comments given a solution_id, and the comment information as an array -//dbFile.add_comment("578f08e43bba452ee98da444", ["this is asdfasdf", "this is the author"]); +// dbFile.add_comment("5792d8a970040378d4e4b389", ["this is asdfasdasdfasdff", "some_user name"]); /* |
