diff options
| author | HumairAK <humair88@hotmail.com> | 2016-07-23 04:15:44 +0000 |
|---|---|---|
| committer | HumairAK <humair88@hotmail.com> | 2016-07-23 04:15:44 +0000 |
| commit | 29e3a33a09be459a16248cbe6eabfccd8f9f4406 (patch) | |
| tree | e0068efb1955e9cd44e9507b75190f49e25a53be /testImports.js | |
| parent | 08553e26f159f725c6a750f7503c1a5e7f89d608 (diff) | |
| parent | f658b2367b9ea33703f3b4174688a96e682d86c8 (diff) | |
Merge branch 'master' of https://github.com/HumairAK/solutions_repo
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"]); /* |
