Methods
addAdmin(user, callback)
Create a student USER, if the USER object is valid
Parameters:
| Name | Type | Description |
|---|---|---|
user |
object | |
callback |
function |
addAdmin(admin, callback)
add a user
Parameters:
| Name | Type | Description |
|---|---|---|
admin |
object | |
callback |
function |
addComment(questionId, userId, comment, callback)
add comment to question by id with user and comment
Parameters:
| Name | Type | Description |
|---|---|---|
questionId |
string | |
userId |
string | |
comment |
string | |
callback |
function |
- Source:
addFeedback(uuid, subject, message, callback)
Adds the user's feedback into the database
Parameters:
| Name | Type | Description |
|---|---|---|
uuid |
string | |
subject |
string | |
message |
string | |
callback |
funciton |
addQuestion(question, callback)
Insert a new question into the database.
The question object passed to the function should have
the text, topic, type, answer, minpoints, maxpoints and hint set.
Parameters:
| Name | Type | Description |
|---|---|---|
question |
object | |
callback |
function |
- Source:
addQuestion(question, callback)
Questions functions
Add QUESTION to questionsCollection in the database
Parameters:
| Name | Type | Description |
|---|---|---|
question |
object | |
callback |
function |
addReply(commentId, userId, reply, callback)
add reply to comment by id with user and reply
Parameters:
| Name | Type | Description |
|---|---|---|
commentId |
string | |
userId |
string | |
reply |
string | |
callback |
function |
- Source:
addStudent(user, callback)
Create a student USER, if the USER object is valid
Parameters:
| Name | Type | Description |
|---|---|---|
user |
object | |
callback |
function |
addStudent(student, callback)
add a student
Parameters:
| Name | Type | Description |
|---|---|---|
student |
object | |
callback |
function |
addStudentAnalyticsWithDate(studentId, date, info, callback)
add student analytics
if there are no records of the student, create a new record
if there are recards of the student, get the last recard and compute the deltas
Parameters:
| Name | Type | Description |
|---|---|---|
studentId |
string | |
date |
string | |
info |
object | |
callback |
function |
addStudentAnalyticsWithDate(studentId, date, info, callback)
add student analytics
if there are no records of the student, create a new record
if there are recards of the student, get the last recard and compute the deltas
Parameters:
| Name | Type | Description |
|---|---|---|
studentId |
string | |
date |
string | |
info |
object | |
callback |
function |
- Source:
addToVirtualFileSystem(callback)
add item to the virtual file system
Parameters:
| Name | Type | Description |
|---|---|---|
callback |
function |
addUser(user, callback)
add a user
Parameters:
| Name | Type | Description |
|---|---|---|
user |
object | |
callback |
function |
changeAllVisibility(changeValue, callback)
Changes visibilty of all questions based on the changeValue
Parameters:
| Name | Type | Description |
|---|---|---|
changeValue |
boolean | |
callback |
funciton |
- Source:
checkLogin(userId, pass, callback)
Check if the account given by user and pass is valid
user type of null
Parameters:
| Name | Type | Description |
|---|---|---|
userId |
string | |
pass |
string | |
callback |
function |
checkLogin(username, pass, callback)
Check if the account given by user and pass is valid.
Return account object if it is or null otherwise.
Parameters:
| Name | Type | Description |
|---|---|---|
username |
string | |
pass |
string | |
callback |
function |
chooseAllAttributeValidator(question) → {object}
choose all attribute validator
Parameters:
| Name | Type | Description |
|---|---|---|
question |
object |
- Source:
Returns:
- Type
- object
deleteQuestion(questionId, callback)
Deactivate the question with ID qid from the database.
Parameters:
| Name | Type | Description |
|---|---|---|
questionId |
string | |
callback |
function |
- Source:
error(text)
print an error message
Parameters:
| Name | Type | Description |
|---|---|---|
text |
string |
existsSync(fileId, callback)
check if a directory exists
Parameters:
| Name | Type | Description |
|---|---|---|
fileId |
string | |
callback |
function |
- Source:
findInVirtualFileSystem(callback)
find in the virtual file system
Parameters:
| Name | Type | Description |
|---|---|---|
callback |
function |
formatString() → {string}
formating a string based on an array of parts of the string
Returns:
- Type
- string
getAccuracyOverTime(query, callback)
get accuracy of user over time
Parameters:
| Name | Type | Description |
|---|---|---|
query |
object | |
callback |
function |
- Source:
getAccuracyPerTopicVsClass(query, callback)
get accuracy per question topic
Parameters:
| Name | Type | Description |
|---|---|---|
query |
object | |
callback |
function |
- Source:
getAccuracyPerTypeVsClass(query, callback)
get accuracy per question type
Parameters:
| Name | Type | Description |
|---|---|---|
query |
object | |
callback |
function |
- Source:
getAccuracyRankOverTime(query, callback)
get accuracy rank over time
Parameters:
| Name | Type | Description |
|---|---|---|
query |
object | |
callback |
function |
- Source:
getAccuracyVsClass(query, callback)
get questions answered vs class
Parameters:
| Name | Type | Description |
|---|---|---|
query |
object | |
callback |
function |
- Source:
getAdminById(adminId, callback)
get the admin object by Id if exists
Parameters:
| Name | Type | Description |
|---|---|---|
adminId |
string | |
callback |
function |
getAdminById(adminId, callback)
get admin by id
Parameters:
| Name | Type | Description |
|---|---|---|
adminId |
string | |
callback |
function |
getAdminsList(callback)
get admin list
Parameters:
| Name | Type | Description |
|---|---|---|
callback |
function |
getAdminsList(callback)
Return an array of users in the database.
Parameters:
| Name | Type | Description |
|---|---|---|
callback |
function |
getAllQuestionsByQuery(findQuery, sortQuery, callback)
get all questions list by Query
Parameters:
| Name | Type | Description |
|---|---|---|
findQuery |
object | |
sortQuery |
object | |
callback |
function |
- Source:
getAllQuestionsList(callback)
get all questions list
Parameters:
| Name | Type | Description |
|---|---|---|
callback |
function |
- Source:
getAllSettings(callback)
get all settings object from database
Parameters:
| Name | Type | Description |
|---|---|---|
callback |
function |
- Source:
getAllSettings(callback)
get all settings objects from the collection
Parameters:
| Name | Type | Description |
|---|---|---|
callback |
function |
getAllSettings(callback)
get all settings object
Parameters:
| Name | Type | Description |
|---|---|---|
callback |
function |
- Source:
getAllSettings(callback)
get all settings objects from the collection
Parameters:
| Name | Type | Description |
|---|---|---|
callback |
function |
getAnalytics(callback)
get analytics for a admins
Parameters:
| Name | Type | Description |
|---|---|---|
callback |
function |
- Source:
getAttemptRankOverTime(query, callback)
get attempt rank over time
Parameters:
| Name | Type | Description |
|---|---|---|
query |
object | |
callback |
function |
- Source:
getAverageRating(ratingsList)
get average rating
Parameters:
| Name | Type | Description |
|---|---|---|
ratingsList |
list |
- Source:
getChart(query, callback)
get the charts based on type
Parameters:
| Name | Type | Description |
|---|---|---|
query |
object | |
callback |
function |
- Source:
getClassAccuracy(query, callback)
get accuracy of the class
Parameters:
| Name | Type | Description |
|---|---|---|
query |
object | |
callback |
function |
- Source:
getClassAccuracyOverTime(query, callback)
get accuracy of the class over time
Parameters:
| Name | Type | Description |
|---|---|---|
query |
object | |
callback |
function |
- Source:
getClassAccuracyPerTopicVsClass(query, callback)
get class accuracy per question topic
Parameters:
| Name | Type | Description |
|---|---|---|
query |
object | |
callback |
function |
- Source:
getClassAccuracyPerTypeVsClass(query, callback)
get class accuracy per question type
Parameters:
| Name | Type | Description |
|---|---|---|
query |
object | |
callback |
function |
- Source:
getClassActive(callback)
check if the class is active
Parameters:
| Name | Type | Description |
|---|---|---|
callback |
funtion |
- Source:
getClassAnswered(query, callback)
get questions answered of the class
Parameters:
| Name | Type | Description |
|---|---|---|
query |
object | |
callback |
function |
- Source:
getClassAnsweredOverTime(query, callback)
get questions answered of the class over time
Parameters:
| Name | Type | Description |
|---|---|---|
query |
object | |
callback |
function |
- Source:
getClassOverall(query, callback)
get overall value of the class
Parameters:
| Name | Type | Description |
|---|---|---|
query |
object | |
callback |
function |
- Source:
getClassOverallOverTime(query, callback)
get overall average of the class over time
Parameters:
| Name | Type | Description |
|---|---|---|
query |
object | |
callback |
function |
- Source:
getClassPoints(query, callback)
get points of the class
Parameters:
| Name | Type | Description |
|---|---|---|
query |
object | |
callback |
function |
- Source:
getClassPointsOverTime(query, callback)
get points of the class over time
Parameters:
| Name | Type | Description |
|---|---|---|
query |
object | |
callback |
function |
- Source:
getClassPointsPerAttempt(query, callback)
get class points per attempt of the class
Parameters:
| Name | Type | Description |
|---|---|---|
query |
object | |
callback |
function |
- Source:
getClassPointsPerAttemptOverTime(query, callback)
get points per attempt average of the class over time
Parameters:
| Name | Type | Description |
|---|---|---|
query |
object | |
callback |
function |
- Source:
getClassPointsPerTopicVsClass(query, callback)
get class points per question topic
Parameters:
| Name | Type | Description |
|---|---|---|
query |
object | |
callback |
function |
- Source:
getClassPointsPerTypeVsClass(query, callback)
get class points per question type
Parameters:
| Name | Type | Description |
|---|---|---|
query |
object | |
callback |
function |
- Source:
getClassRating(query, callback)
get rating of the class
Parameters:
| Name | Type | Description |
|---|---|---|
query |
object | |
callback |
function |
- Source:
getClassRatingPerTopicVsClass(query, callback)
get class rating per topic vs class
Parameters:
| Name | Type | Description |
|---|---|---|
query |
object | |
callback |
function |
- Source:
getClassRatingPerTypeVsClass(query, callback)
get class rating per type vs class
Parameters:
| Name | Type | Description |
|---|---|---|
query |
object | |
callback |
function |
- Source:
getCorrectAttemptRankOverTime(query, callback)
get correct attempt rank over time
Parameters:
| Name | Type | Description |
|---|---|---|
query |
object | |
callback |
function |
- Source:
getCorrectAttemptsOverTime(query, callback)
get number correct attempts of user over time
Parameters:
| Name | Type | Description |
|---|---|---|
query |
object | |
callback |
function |
- Source:
getDate() → {string}
return the current date
Returns:
- Type
- string
getDateByFormat() → {string}
return the current date with format
Returns:
- Type
- string
getDateFormatedMinutesAgo(mins, format) → {string}
return the current date
Parameters:
| Name | Type | Description |
|---|---|---|
mins |
number | |
format |
string |
Returns:
- Type
- string
getDateObject() → {date}
return the current date
Returns:
- Type
- date
getDiscussionboardDislikesEnabled(callback)
get discussionboard dislikes enabled
Parameters:
| Name | Type | Description |
|---|---|---|
callback |
funtion |
- Source:
getDiscussionboardVisibilityEnabled(callback)
get discussionboard visibility enabled
Parameters:
| Name | Type | Description |
|---|---|---|
callback |
funtion |
- Source:
getError(errorCode) → {object}
return an object of error code and message
Parameters:
| Name | Type | Description |
|---|---|---|
errorCode |
number |
Returns:
- Type
- object
getFeedback(callback)
Get all the feedback stored in the collection
Parameters:
| Name | Type | Description |
|---|---|---|
callback |
function |
getFullLeaderboard(callback)
Fetch a list of students to display in the leaderboard.
Parameters:
| Name | Type | Description |
|---|---|---|
callback |
function |
getIdsListFromJSONList() → {array}
given a list of JSON objects that have Id as one of their feilds, return a list of Ids
Returns:
- Type
- array
getLeaderboard(userid, smallBoard, callback)
Fetch a list of students to display in the leaderboard.
If smallBoard is true, return points leaderboard with top 3 entries.
Parameters:
| Name | Type | Description |
|---|---|---|
userid |
string | |
smallBoard |
boolean | |
callback |
function |
getLeaderboardLimit(callback)
get the limit of rows on the leaderboard
Parameters:
| Name | Type | Description |
|---|---|---|
callback |
funtion |
- Source:
getLeaderboardLimited(callback)
get the true of false if the leader board is set to a limit
Parameters:
| Name | Type | Description |
|---|---|---|
callback |
funtion |
- Source:
getNextQuestionNumber(callback)
get next question number
Parameters:
| Name | Type | Description |
|---|---|---|
callback |
function |
getOverallOverTime(query, callback)
get points per attempts of user and class over time
Parameters:
| Name | Type | Description |
|---|---|---|
query |
object | |
callback |
function |
- Source:
getOverallRankOverTime(query, callback)
get overall rank over time
Parameters:
| Name | Type | Description |
|---|---|---|
query |
object | |
callback |
function |
- Source:
getOverallVsClass(query, callback)
get questions answered vs class
Parameters:
| Name | Type | Description |
|---|---|---|
query |
object | |
callback |
function |
- Source:
getPointsOverTime(query, callback)
get points of user over time
Parameters:
| Name | Type | Description |
|---|---|---|
query |
object | |
callback |
function |
- Source:
getPointsPerAttemptsOverTime(query, callback)
get points per attempts of user and class over time
Parameters:
| Name | Type | Description |
|---|---|---|
query |
object | |
callback |
function |
- Source:
getPointsPerAttemptVsClass(query, callback)
get questions answered vs class
Parameters:
| Name | Type | Description |
|---|---|---|
query |
object | |
callback |
function |
- Source:
getPointsPerTopicVsClass(query, callback)
get points per question topic
Parameters:
| Name | Type | Description |
|---|---|---|
query |
object | |
callback |
function |
- Source:
getPointsPerTypeVsClass(query, callback)
get points per question type
Parameters:
| Name | Type | Description |
|---|---|---|
query |
object | |
callback |
function |
- Source:
getPointsRankOverTime(query, callback)
get points rank over time
Parameters:
| Name | Type | Description |
|---|---|---|
query |
object | |
callback |
function |
- Source:
getPointsVsClass(query, callback)
get points vs class
Parameters:
| Name | Type | Description |
|---|---|---|
query |
object | |
callback |
function |
- Source:
getQuestionDefaultMaxPoints(callback)
get question default max points
Parameters:
| Name | Type | Description |
|---|---|---|
callback |
funtion |
- Source:
getQuestionDefaultMinPoints(callback)
get question default min points
Parameters:
| Name | Type | Description |
|---|---|---|
callback |
funtion |
- Source:
getQuestionDefaultTopic(callback)
get question default topic
Parameters:
| Name | Type | Description |
|---|---|---|
callback |
funtion |
- Source:
getQuestionsAnsweredVsClass(query, callback)
get questions answered vs class
Parameters:
| Name | Type | Description |
|---|---|---|
query |
object | |
callback |
function |
- Source:
getQuestionsList(findQuery, sortQuery, callback)
get the list of Active questions sorted
Parameters:
| Name | Type | Description |
|---|---|---|
findQuery |
object | |
sortQuery |
object | |
callback |
function |
getQuestionsListByUser(request, callback)
Fetch the question list of userId
Parameters:
| Name | Type | Description |
|---|---|---|
request |
object | |
callback |
function |
getQuestionsListforAdmin(findQuery, sortQuery, callback)
get the list of questions sorted
Parameters:
| Name | Type | Description |
|---|---|---|
findQuery |
object | |
sortQuery |
object | |
callback |
function |
getQuestionTimeoutEnabled(callback)
get question timeout enabled
Parameters:
| Name | Type | Description |
|---|---|---|
callback |
funtion |
- Source:
getQuestionTimeoutPeriod(callback)
get question timeout period
Parameters:
| Name | Type | Description |
|---|---|---|
callback |
funtion |
- Source:
getRatingVsClass(query, callback)
get rating vs class
Parameters:
| Name | Type | Description |
|---|---|---|
query |
object | |
callback |
function |
- Source:
getStudentById(studentId, callback)
get the admin object by Id if exists
Parameters:
| Name | Type | Description |
|---|---|---|
studentId |
string | |
callback |
function |
getStudentById(studentId, callback)
get student by id
Parameters:
| Name | Type | Description |
|---|---|---|
studentId |
string | |
callback |
function |
getStudentEditEmailEnabled(callback)
check if the student can edit their email
Parameters:
| Name | Type | Description |
|---|---|---|
callback |
funtion |
- Source:
getStudentEditNameEnabled(callback)
check if the student can edit their first and last name
Parameters:
| Name | Type | Description |
|---|---|---|
callback |
funtion |
- Source:
getStudentEditPasswordEnabled(callback)
check if the student can edit their password
Parameters:
| Name | Type | Description |
|---|---|---|
callback |
funtion |
- Source:
getStudentsList(callback)
get student list
Parameters:
| Name | Type | Description |
|---|---|---|
callback |
function |
getStudentsList(callback)
get students list
Parameters:
| Name | Type | Description |
|---|---|---|
callback |
function |
getStudentsListSorted(lim, callback)
Return an array of users in the database, sorted by rank.
Parameters:
| Name | Type | Description |
|---|---|---|
lim |
int | |
callback |
function |
getStudentsListSorted(lim, callback)
get students list sorted
Parameters:
| Name | Type | Description |
|---|---|---|
lim |
int | |
callback |
function |
getStudentsListWithStatus(status, callback)
get students list with status
Parameters:
| Name | Type | Description |
|---|---|---|
status |
string | |
callback |
function |
getStudentsListWithStatus(active, callback)
get students list with status
Parameters:
| Name | Type | Description |
|---|---|---|
active |
boolean | |
callback |
function |
getTime() → {string}
return the time in "<0> days, <0> hours, <0> minutes, <0> seconds" format
Returns:
- Type
- string
getTimeBasedAnalytics(findQuery, callback)
get the list of data on the user by date
Parameters:
| Name | Type | Description |
|---|---|---|
findQuery |
object | |
callback |
function |
- Source:
getUserById(userId, callback)
get user by id
Parameters:
| Name | Type | Description |
|---|---|---|
userId |
string | |
callback |
function |
getUserById(userId, callback)
get user by id
Parameters:
| Name | Type | Description |
|---|---|---|
userId |
string | |
callback |
function |
getUserById(userId, callback)
Fetch the user object with ID iserId in the users database.
Parameters:
| Name | Type | Description |
|---|---|---|
userId |
string | |
callback |
function |
getUserByUsername(adminId, callback)
get the user object by username if exists
Parameters:
| Name | Type | Description |
|---|---|---|
adminId |
string | |
callback |
function |
getUserObject(findQuery, callback)
get user by search query
Parameters:
| Name | Type | Description |
|---|---|---|
findQuery |
object | |
callback |
function |
getUsersList(callback)
get users list
Parameters:
| Name | Type | Description |
|---|---|---|
callback |
function |
getUsersList(findQuery, sortQuery, callback)
Return an array of users in the database, sorted by rank
Parameters:
| Name | Type | Description |
|---|---|---|
findQuery |
object | |
sortQuery |
object | |
callback |
function |
getUsersList(callback)
get users list
Parameters:
| Name | Type | Description |
|---|---|---|
callback |
function |
getUUID() → {string}
get a unique Id
Returns:
- Type
- string
getVariableType(variable)
get variable type
Parameters:
| Name | Type | Description |
|---|---|---|
variable |
* |
init()
initiate the logging with file
initialize()
Initialize allSettings object
- Source:
initialize(callback)
Open a connection to the database
Parameters:
| Name | Type | Description |
|---|---|---|
callback |
function |
initialize(callback)
start the analytics daily process
Parameters:
| Name | Type | Description |
|---|---|---|
callback |
function |
- Source:
isEmptyObject() → {boolean}
check if json obejct is empty
Returns:
- Type
- boolean
isKeyValuePairInJsonList(list, field, value) → {boolean}
Returns a JSON from a list of JSONs given a key, value to search for
Parameters:
| Name | Type | Description |
|---|---|---|
list |
list | |
field |
string | |
value |
string |
Returns:
- Type
- boolean
isUserLocked(userId, question, callback)
check if the user is locked from answering the question
Parameters:
| Name | Type | Description |
|---|---|---|
userId |
string | |
question |
object | |
callback |
function |
- Source:
log(text)
print a normal message
Parameters:
| Name | Type | Description |
|---|---|---|
text |
string |
lookupQuestion(findQuery, callback)
Extract a question object from the database using its ID
Parameters:
| Name | Type | Description |
|---|---|---|
findQuery |
object | |
callback |
function |
lookupQuestionById(questionId, callback)
lookup question in database
Parameters:
| Name | Type | Description |
|---|---|---|
questionId |
string | |
callback |
function |
- Source:
lookupQuestionById(questionId, callback)
Extract a question object from the database using its ID.
Parameters:
| Name | Type | Description |
|---|---|---|
questionId |
string | |
callback |
function |
- Source:
matchingAttributeValidator(question) → {object}
matching attribute validator
Parameters:
| Name | Type | Description |
|---|---|---|
question |
object |
- Source:
Returns:
- Type
- object
mkdir(parentPath, directoryName, directoryPermissions, callback)
make a directory given the path and the name of the new directory
Parameters:
| Name | Type | Description |
|---|---|---|
parentPath |
string | |
directoryName |
string | |
directoryPermissions |
string | |
callback |
function |
- Source:
multipleChoiceAttributeValidator(question) → {object}
multiple choice attribute validator
Parameters:
| Name | Type | Description |
|---|---|---|
question |
object |
- Source:
Returns:
- Type
- object
orderingAttributeValidator(question) → {object}
ordering attribute validator
Parameters:
| Name | Type | Description |
|---|---|---|
question |
object |
- Source:
Returns:
- Type
- object
prepareQuestionData(question, callback)
Prepare question data on first pass to DB
Parameters:
| Name | Type | Description |
|---|---|---|
question |
object | |
callback |
function |
- Source:
qTypeFailMsg(message) → {object}
Send back specific error message by question type
Parameters:
| Name | Type | Description |
|---|---|---|
message |
string |
- Source:
Returns:
- Type
- object
questionCreationValidation(info) → {object}
Validate all question fields on first entry to db
Parameters:
| Name | Type | Description |
|---|---|---|
info |
object |
- Source:
Returns:
- Type
- object
questionUpdateParser(question)
Preparing data on update/edit of a question
Parameters:
| Name | Type | Description |
|---|---|---|
question |
object |
- Source:
randomizeList() → {array}
shuffle the given list and return the result as a new list
Returns:
- Type
- array
regexAttributeValidator(question) → {object}
regex attribute validator
Parameters:
| Name | Type | Description |
|---|---|---|
question |
object |
- Source:
Returns:
- Type
- object
removeAllQuestions(callback)
cleanup the users collection
Parameters:
| Name | Type | Description |
|---|---|---|
callback |
function |
removeAllUsers(callback)
cleanup the users collection
Parameters:
| Name | Type | Description |
|---|---|---|
callback |
function |
removeAnalytics(callback)
remove all previous analytics
Parameters:
| Name | Type | Description |
|---|---|---|
callback |
function |
removeAnalytics(callback)
clean all previous analytics data
Parameters:
| Name | Type | Description |
|---|---|---|
callback |
function |
- Source:
removeVirtualFileSystem(callback)
clean up the virtual file system
Parameters:
| Name | Type | Description |
|---|---|---|
callback |
function |
- Source:
removeVirtualFileSystem(callback)
clean up the virtual file system
Parameters:
| Name | Type | Description |
|---|---|---|
callback |
function |
resetAllSettings(callback)
reset the global settings to their default values
Parameters:
| Name | Type | Description |
|---|---|---|
callback |
function |
- Source:
resetAllSettings(callback)
reset all settings to default
Parameters:
| Name | Type | Description |
|---|---|---|
callback |
function |
resetAllSettings(callback)
reset all settings to default
Parameters:
| Name | Type | Description |
|---|---|---|
callback |
function |
rmdir(parentPath, directoryName, callback)
BE CAREFUL: remove a directory given the path and the name of the new directory
Parameters:
| Name | Type | Description |
|---|---|---|
parentPath |
string | |
directoryName |
string | |
callback |
function |
- Source:
rmrf(parentPath, directoryName, callback)
BE CAREFUL: perform rm -rf on a directory
Parameters:
| Name | Type | Description |
|---|---|---|
parentPath |
string | |
directoryName |
string | |
callback |
function |
- Source:
setClassActive(isActive, callback)
set class activation status
Parameters:
| Name | Type | Description |
|---|---|---|
isActive |
boolean | |
callback |
funtion |
- Source:
setDiscussionboardDislikesEnabled(isActive, callback)
set discussionboard dislikes enabled
Parameters:
| Name | Type | Description |
|---|---|---|
isActive |
boolean | |
callback |
funtion |
- Source:
setDiscussionboardVisibilityEnabled(isActive, callback)
set discussionboard visibility enabled
Parameters:
| Name | Type | Description |
|---|---|---|
isActive |
boolean | |
callback |
funtion |
- Source:
setLeaderboardLimit(limit, callback)
set leaderboard limit
Parameters:
| Name | Type | Description |
|---|---|---|
limit |
number | |
callback |
funtion |
- Source:
setLeaderboardLimited(limit, callback)
set leaderboard limit
Parameters:
| Name | Type | Description |
|---|---|---|
limit |
number | |
callback |
funtion |
- Source:
setQuestionDefaultMinPoints(points, callback)
get question default min points
Parameters:
| Name | Type | Description |
|---|---|---|
points |
number | |
callback |
funtion |
- Source:
setQuestionDefaultMinPoints(points, callback)
get question default max points
Parameters:
| Name | Type | Description |
|---|---|---|
points |
number | |
callback |
funtion |
- Source:
setQuestionDefaultTopic(topic, callback)
set question default topic
Parameters:
| Name | Type | Description |
|---|---|---|
topic |
string | |
callback |
funtion |
- Source:
setQuestionTimeoutEnabled(isActive, callback)
set question timeout enabled
Parameters:
| Name | Type | Description |
|---|---|---|
isActive |
boolean | |
callback |
funtion |
- Source:
setQuestionTimeoutPeriod(timeout, callback)
set question timeout period
Parameters:
| Name | Type | Description |
|---|---|---|
timeout |
number | |
callback |
funtion |
- Source:
setStudentEditEmailEnabled(isActive, callback)
set student edit email enabled
Parameters:
| Name | Type | Description |
|---|---|---|
isActive |
boolean | |
callback |
funtion |
- Source:
setStudentEditNameEnabled(isActive, callback)
set student edit name enabled
Parameters:
| Name | Type | Description |
|---|---|---|
isActive |
boolean | |
callback |
funtion |
- Source:
setStudentEditPasswordEnabled(isActive, callback)
set student edit password enabled
Parameters:
| Name | Type | Description |
|---|---|---|
isActive |
boolean | |
callback |
funtion |
- Source:
setUserStatus(studentId, newStatus, callback)
set the status of the user to active or in-active
Parameters:
| Name | Type | Description |
|---|---|---|
studentId |
string | |
newStatus |
boolean | |
callback |
function |
sortLeaderBoard(list, criteria)
sort leaderboard based on criteria
Parameters:
| Name | Type | Description |
|---|---|---|
list |
list | |
criteria |
string |
- Source:
submitAnswer(userId, questionId, correct, points, answer, callback)
submit user's answer on a question by updating the collections
Parameters:
| Name | Type | Description |
|---|---|---|
userId |
string | |
questionId |
string | |
correct |
boolean | |
points |
int | |
answer |
string | |
callback |
function |
submitAnswer(questionId, userId, correct, points, answer, callback)
submit answer
Parameters:
| Name | Type | Description |
|---|---|---|
questionId |
string | |
userId |
string | |
correct |
boolean | |
points |
number | |
answer |
* | |
callback |
function |
- Source:
submitRating(questionId, userId, rating, callback)
adding rating to question collection
Parameters:
| Name | Type | Description |
|---|---|---|
questionId |
string | |
userId |
string | |
rating |
number | |
callback |
function |
- Source:
submitRating(userId, questionId, rating, callback)
adding rating to question collection
Parameters:
| Name | Type | Description |
|---|---|---|
userId |
string | |
questionId |
string | |
rating |
int | |
callback |
function |
sumListOfNumbers(list)
return a number as the sum of all numbers in a list
Parameters:
| Name | Type | Description |
|---|---|---|
list |
list |
trueAndFalseAttributeValidator(question) → {object}
true and false attribute validator
Parameters:
| Name | Type | Description |
|---|---|---|
question |
object |
- Source:
Returns:
- Type
- object
updateAdminById(userId, info, callback)
update admin by id
Parameters:
| Name | Type | Description |
|---|---|---|
userId |
string | |
info |
object | |
callback |
function |
updateAdminById(userId, info, callback)
update admin by id
Parameters:
| Name | Type | Description |
|---|---|---|
userId |
string | |
info |
object | |
callback |
function |
updateProfile(userId, request, callback)
update user's profile based on the given infomation
Parameters:
| Name | Type | Description |
|---|---|---|
userId |
string | |
request |
object | |
callback |
function |
updateQuestionById(questionId, request, callback)
update a question record based on its id
Parameters:
| Name | Type | Description |
|---|---|---|
questionId |
string | |
request |
object | |
callback |
function |
updateQuestionById(questionId, info, callback)
Replace a question in the database with the provided question object.
Parameters:
| Name | Type | Description |
|---|---|---|
questionId |
string | |
info |
object | |
callback |
function |
- Source:
updateQuestionById(questionId, info, callback)
Replace a question in the database with the provided question object.
Parameters:
| Name | Type | Description |
|---|---|---|
questionId |
string | |
info |
object | |
callback |
function |
- Source:
updateQuestionByQuery(query, update, callback)
update users collection directly by a query
Parameters:
| Name | Type | Description |
|---|---|---|
query |
object | |
update |
object | |
callback |
function |
updateSettings(updateObject, callback)
update multiple settings based on the passed params
Parameters:
| Name | Type | Description |
|---|---|---|
updateObject |
object | |
callback |
function |
- Source:
updateSettings(updateQuery, callback)
update settings object
Parameters:
| Name | Type | Description |
|---|---|---|
updateQuery |
object | |
callback |
function |
- Source:
updateSettings(findQuery, updateQuery, callback)
update settings object
Parameters:
| Name | Type | Description |
|---|---|---|
findQuery |
object | |
updateQuery |
object | |
callback |
function |
updateStudentById(userId, info, callback)
update student by id
Parameters:
| Name | Type | Description |
|---|---|---|
userId |
string | |
info |
object | |
callback |
function |
updateStudentById(userId, info, callback)
update student by id
Parameters:
| Name | Type | Description |
|---|---|---|
userId |
string | |
info |
object | |
callback |
function |
updateUserById(userId, info, callback)
update user by id
Parameters:
| Name | Type | Description |
|---|---|---|
userId |
string | |
info |
object | |
callback |
function |
updateUserById(userId, info, callback)
Update the account with ID userid in the student database.
The user argument holds the complete new object to insert.
Fail if the ID has changed and the new ID already belongs
to a user.
Parameters:
| Name | Type | Description |
|---|---|---|
userId |
string | |
info |
object | |
callback |
function |
updateUserById(userId, info, callback)
update user by id
Parameters:
| Name | Type | Description |
|---|---|---|
userId |
string | |
info |
object | |
callback |
function |
updateUserByQuery(query, update, callback)
update users collection directly by a query
Parameters:
| Name | Type | Description |
|---|---|---|
query |
object | |
update |
object | |
callback |
function |
updateUserPassword(query, update, password, callback)
update user password
Parameters:
| Name | Type | Description |
|---|---|---|
query |
object | |
update |
object | |
password |
string | |
callback |
function |
updateUserPassword(query, update, password, callback)
update user password
Parameters:
| Name | Type | Description |
|---|---|---|
query |
object | |
update |
object | |
password |
string | |
callback |
function |
updateUserSubmissionTime(userId, question, callback)
Updates the Users Submission time for a Question
Parameters:
| Name | Type | Description |
|---|---|---|
userId |
string | |
question |
object | |
callback |
function |
- Source:
validateAllAttributesInGroup(objectToCheck, attributeType) → {boolean}
Validate all attributes in Object being passed and has correct field types
Parameters:
| Name | Type | Description |
|---|---|---|
objectToCheck |
object | |
attributeType |
string |
- Source:
Returns:
- Type
- boolean
validateArrayObject(arrayObject, typeOfvalue) → {boolean}
Validate an Array object to contain specific value types
Parameters:
| Name | Type | Description |
|---|---|---|
arrayObject |
list | |
typeOfvalue |
string |
- Source:
Returns:
- Type
- boolean
validateAttributeFields(question, type) → {object}
Validate all fields that will be modified
Parameters:
| Name | Type | Description |
|---|---|---|
question |
object | |
type |
string |
- Source:
Returns:
- Type
- object
validateAttributeType(valueToCheck, key, attributeType) → {boolean}
Validate specific value to it's attributeType in DB
Parameters:
| Name | Type | Description |
|---|---|---|
valueToCheck |
* | |
key |
string | |
attributeType |
string |
- Source:
Returns:
- Type
- boolean
validateDefaultQuestionValues(questionData) → {object}
validate default question values
Parameters:
| Name | Type | Description |
|---|---|---|
questionData |
number |
- Source:
Returns:
- Type
- object
validatePassword(userobj, pass, callback)
Check the hash of pass against the password stored in userobj
Parameters:
| Name | Type | Description |
|---|---|---|
userobj |
object | |
pass |
string | |
callback |
function |
validateQuestionAttributesByType(question, type) → {object}
validate question attributes by type
Parameters:
| Name | Type | Description |
|---|---|---|
question |
object | |
type |
string |
- Source:
Returns:
- Type
- object
verifyAnswer(question, answer)
verify answer based on type
Parameters:
| Name | Type | Description |
|---|---|---|
question |
object | |
answer |
* |
- Source:
verifyChooseAllQuestionAnswer(question, answer)
verify choose all question answer
Parameters:
| Name | Type | Description |
|---|---|---|
question |
object | |
answer |
* |
- Source:
verifyMatchingQuestionAnswer(question, answer)
verify matching question answer
Parameters:
| Name | Type | Description |
|---|---|---|
question |
object | |
answer |
* |
- Source:
verifyOrderingQuestionAnswer(question, answer)
Check if answer submitted is correct for Ordering question Type
Parameters:
| Name | Type | Description |
|---|---|---|
question |
object | |
answer |
* |
- Source:
voteComment(commentId, vote, userId, callback)
vote on a comment
The way votes work:
if the user already voted up, then if they vote up again the previous vote
will get cancelled. Same for vote down.
if the user already voted up, then vote down the previous vote gets removed
and the new vote gets added.
if they never voted before, just add the vote
Parameters:
| Name | Type | Description |
|---|---|---|
commentId |
string | |
vote |
number | |
userId |
string | |
callback |
function |
- Source:
voteReply(replyId, vote, userId, callback)
vote on a reply
Parameters:
| Name | Type | Description |
|---|---|---|
replyId |
string | |
vote |
number | |
userId |
string | |
callback |
function |
- Source:
writeFile(fileObj, callback)
write data to a fils
Parameters:
| Name | Type | Description |
|---|---|---|
fileObj |
object | |
callback |
function |
- Source: