diff options
| author | kumar <kumar.damani@mail.utoronto.ca> | 2016-07-23 04:12:55 +0000 |
|---|---|---|
| committer | kumar <kumar.damani@mail.utoronto.ca> | 2016-07-23 04:12:55 +0000 |
| commit | 9ab4094797e82798eab40b32e7c71b52bb847b8f (patch) | |
| tree | d1fa9e85cd0278f73689e298a72dca2784fd2238 /testImports.js | |
| parent | e4a06d8a5f6af3be38333f5c1bb551fcbd6255cc (diff) | |
added comment and solutions history fetch for a given username -- for profile
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"]); /* |
