F_addLogAnswers (line 538)
Add specified answers on tce_tests_logs_answer table.
boolean
F_addLogAnswers
(int $testlog_id, array $answers_ids)
-
int
$testlog_id: testlog ID
-
array
$answers_ids: array of answer IDs to add
F_checkTestStatus (line 181)
Check and returns specific test status for the specified user.
test
F_checkTestStatus
(int $user_id, int $test_id, int $duration)
-
int
$user_id: user ID
-
int
$test_id: test ID
-
int
$duration: test duration in seconds
F_createTest (line 602)
Create user's test and returns TRUE on success.
boolean
F_createTest
(int $test_id, int $user_id)
-
int
$test_id: test ID.
-
int
$user_id: user ID.
F_executeTest (line 425)
Returns true if the current user is authorized to execute the selected test.
Generates the test if it's not already generated.
true
F_executeTest
(int $test_id)
F_getFirstTestUser (line 558)
Returns the ID of the tce_tests_users table corresponding to a complete test of $test_id type.
int
F_getFirstTestUser
(int $test_id)
F_getTestBasicScore (line 354)
Returns the basic score for right questions.
double
F_getTestBasicScore
(int $test_id)
F_getTestData (line 324)
Returns the test data.
array
F_getTestData
(int $test_id)
F_getTestDuration (line 364)
Returns the test duration time in seconds.
int
F_getTestDuration
(int $test_id)
F_getTestName (line 344)
Returns the test name.
string
F_getTestName
(int $test_id)
F_getTestStartTime (line 375)
Returns the user's test start time in seconds since UNIX epoch (1970-01-01 00:00:00).
int
F_getTestStartTime
(int $testuser_id)
-
int
$testuser_id: user's test ID
F_getUserTests (line 37)
Returns an XHTML unordered list of user's enabled tests.
string
F_getUserTests
()
F_isRightTestlogUser (line 473)
Checks if the current user is the right testlog_id owner.
This function is used for security reasons.
boolean
F_isRightTestlogUser
(int $test_id, int $testlog_id)
-
int
$test_id: test ID
-
int
$testlog_id: test log ID
F_isValidIP (line 107)
Check if user's IP is valid over test IP range
true
F_isValidIP
(int $user_ip, int $test_ip)
-
int
$user_ip: user's IP address.
-
int
$test_ip: test IP valid addresses. Various IP addresses may be separated using comma character. The asterisk character may be used to indicate "any number".
F_isValidTestUser (line 145)
Check if user is authorized to execute the specified test
true
F_isValidTestUser
(int $test_id, int $user_ip, int $test_ip)
-
int
$test_id: ID of the selected test
-
int
$user_ip: user's IP address.
-
int
$test_ip: test IP valid addresses. Various IP addresses may be separated using comma character. The asterisk character may be used to indicate "any number".
F_newTestLog (line 582)
Creates a new tce_tests_logs table entry and returns inserted ID.
int
F_newTestLog
(int $testuser_id, int $question_id, int $score)
-
int
$testuser_id: ID of tce_tests_users
-
int
$question_id: question ID
-
int
$score: score for unanswered questions
F_printTestInfo (line 285)
Returns an XHTML string containing specified test information.
string
F_printTestInfo
(int $test_id, [boolean $showip = false])
-
int
$test_id: test ID
-
boolean
$showip: if true display enabled users' IP range
F_questionForm (line 873)
Returns a formatted XHTML form code to handle the specified question.
Form fields names are: answer_text, answer_id
CSS classes:
- div.tcecontentbox
- div.rowl
- textarea.answertext
string
F_questionForm
(int $test_id, int $testlog_id, string $formname)
-
int
$test_id: test ID
-
int
$testlog_id: test log ID
-
string
$formname: form name (form ID)
F_questionsMenu (line 1026)
Return a formatted XHTML ordered list containing test questions menu.
string
F_questionsMenu
(int $test_id, int $testuser_id, [mixed $testlog_id = 0], string $formname)
-
int
$test_id: test ID
-
int
$testuser_id: user's test ID
-
string
$formname: form name (form ID)
F_selectAnswers (line 503)
Return an array containing answer_id field of selected answers.
array
F_selectAnswers
(int $question_id, boolean $checktype, int $type, int $limit, [int $startindex = 0], [int $exclude_id = 0])
-
int
$question_id: question ID
-
boolean
$checktype: if true checks for answer_isright value on WHERE clause
-
int
$type: answer_isright value (0 = false, 1 = true)
-
int
$limit: maximum number of IDs to return
-
int
$startindex: array starting index (default = 0)
-
int
$exclude_id: ID of the answer to be excluded from selection (default=0)
F_terminateUserTest (line 164)
Terminate user's test
void
F_terminateUserTest
(mixed $testid, int $test_id)
F_testComment (line 1150)
Display a textarea for user's comment.
string
F_testComment
(int $testid)
F_testInfoLink (line 257)
Returns XHTML link to open test info popup.
void
F_testInfoLink
(int $test_id, [string $link_name = ""])
-
int
$test_id: test ID
-
string
$link_name: link caption return XHTML code
F_twoColRow (line 404)
Return a formatted XHTML row to display 2 columns data.
See CSS classes:
- div.row span.label
- div.row span.formw
string
F_twoColRow
([string $label = ""], [string $description = ""], [string $value = ""])
-
string
$label: string to display on the left column
-
string
$description: string to display on the title attribute of the left column field
-
string
$value: string to display on the right column
F_updateQuestionLog (line 762)
Updates question log data (register user's answers).
boolean
F_updateQuestionLog
(int $test_id, int $testlog_id, [int $answer_id = 0], [string $answer_text = ""])
-
int
$test_id: test ID
-
int
$testlog_id: test log ID
-
int
$answer_id: answer ID
-
string
$answer_text: answer text
F_updateTestComment (line 1180)
Updates user's test comment.
string
F_updateTestComment
(int $testid, mixed $testcomment, string $comment)
-
int
$testid: test ID
-
string
$comment: user's comment.