Table of contents
Package: com\tecnick\tcexam
Classes
- TCExamSessionHandler : Session Handler Class implementing SessionHandlerInterface
Constants
- K_ALLOWED_ERROR_TAGS
= ‘
’: HTML tags that are allowed in an error message. Functions
- F_encodeOMRTestData() : encoded: Encode OMR test data array as a string to be printed on QR-Code.
- F_decodeOMRTestData() : array<string|int, mixed>: Decode OMR test data string (read from QR-Code) as array.
- F_decodeOMRTestDataQRCode() : array<string|int, mixed>: Read QR-Code from OMR page and return Test data.
- F_decodeOMRPage() : array<string|int, mixed>: Decode a single OMR Page and return data array.
- F_importOMRTestData() : bool: Import user’s test data from OMR.
- F_altLogin() : array<string|int, mixed>: Try various external Login Systems.
- F_db_connect() : MySQL: Open a connection to a MySQL Server and select a database.
- F_db_close() : bool: Closes the non-persistent connection to a database associated with the given connection resource.
- F_db_error() : string: Returns the text of the error message from previous database operation
- F_db_query()
: false: Sends a query to the currently active database on the server that’s associated with the specified link identifier.
- F_db_fetch_array() : Returns: Fetch a result row as an associative and numeric array.
- F_db_fetch_assoc() : Returns: Fetch a result row as an associative array.
- F_db_affected_rows() : Number: Returns number of rows (tuples) affected by the last INSERT, UPDATE or DELETE query associated with link_identifier.
- F_db_num_rows() : Number: Get number of rows in result.
- F_db_insert_id() : int: Get the ID generated from the previous INSERT operation
- F_db_datetime_diff_seconds() : SQL: Returns the SQL string to calculate the difference in seconds between to datetime fields.
- F_escape_sql() : string: Escape a string for insertion into a SQL text field (avoiding SQL injection).
- F_db_connect() : MySQL: Open a connection to a MySQL Server and select a database.
- F_db_close() : bool: Closes the non-persistent connection to a database associated with the given connection resource.
- F_db_error() : string: Returns the text of the error message from previous database operation
- F_db_query()
: false: Sends a query to the currently active database on the server that’s associated with the specified link identifier.
- F_db_fetch_array() : Returns: Fetch a result row as an associative and numeric array.
- F_db_fetch_assoc() : Returns: Fetch a result row as an associative array.
- F_db_affected_rows() : Number: Returns number of rows (tuples) affected by the last INSERT, UPDATE or DELETE query associated with link_identifier.
- F_db_num_rows() : Number: Get number of rows in result.
- F_db_insert_id() : int: Returns the auto generated id used in the last query.
- F_db_datetime_diff_seconds() : SQL: Returns the SQL string to calculate the difference in seconds between to datetime fields.
- F_escape_sql() : string: Escape a string for insertion into a SQL text field (avoiding SQL injection).
- F_db_connect() : Oracle: Open a connection to a Oracle Server and select a database.
- F_db_close() : bool: Closes the non-persistent connection to a database associated with the given connection resource.
- F_db_error() : string: Returns the text of the error message from previous database operation
- F_db_query()
: false: Sends a query to the currently active database on the server that’s associated with the specified link identifier.
NOTE: Convert MySQL RAND() function to Oracle RANDOM() on ORDER BY clause of selection queries. - F_db_fetch_array() : Returns: Fetch a result row as an associative and numeric array.
- F_db_fetch_assoc() : Returns: Fetch a result row as an associative array.
- F_db_affected_rows() : Number: Returns number of rows (tuples) affected by the last INSERT, UPDATE or DELETE query associated with link_identifier.
- F_db_num_rows() : Number: Get number of rows in result.
- F_db_insert_id() : int: Get the ID generated from the previous INSERT operation
- F_db_datetime_diff_seconds() : SQL: Returns the SQL string to calculate the difference in seconds between to datetime fields.
- F_escape_sql() : string: Escape a string for insertion into a SQL text field (avoiding SQL injection).
- F_db_connect() : PostgreSQL: Open a connection to a PostgreSQL Server and select a database.
- F_db_close() : bool: Closes the non-persistent connection to a database associated with the given connection resource.
- F_db_error() : string: Returns the text of the error message from previous database operation
- F_db_query()
: false: Sends a query to the currently active database on the server that’s associated with the specified link identifier.
NOTE: Convert MySQL RAND() function to PostgreSQL RANDOM() on ORDER BY clause of selection queries. - F_db_fetch_array() : Returns: Fetch a result row as an associative and numeric array.
- F_db_fetch_assoc() : Returns: Fetch a result row as an associative array.
- F_db_affected_rows() : Number: Returns number of rows (tuples) affected by the last INSERT, UPDATE or DELETE query associated with link_identifier.
- F_db_num_rows() : Number: Get number of rows in result.
- F_db_insert_id() : int: Get the ID generated from the previous INSERT operation
- F_db_datetime_diff_seconds() : SQL: Returns the SQL string to calculate the difference in seconds between to datetime fields.
- F_escape_sql() : string: Escape a string for insertion into a SQL text field (avoiding SQL injection).
- F_loginForm()
: XHTML: Returns XHTML / CSS formatted string for login form.
The CSS classes used are:- div.login_form : container for login box
- div.login_form div.login_row : container for label + input field or button
- div.login_form div.login_row span.label : container for input label
- div.login_form div.login_row span.formw : container for input form
- F_login_form() : mixed: Display login page.
- F_logout_form() : XHTML: Display logout form.
- F_logout_page() : mixed: Display logout page.
- F_isAuthorizedUser() : bool: Returns true if the current user is authorized to update and delete the selected database record.
- F_getAuthorizedUsers() : string: Returns a comma separated string of ID of the users that belong to the same groups.
- F_syncUserGroups() : mixed: Sync user groups with the ones specified on the configuration file for alternate authentication.
- F_isSslCertificateValid() : true: Check if the client has a valid SSL certificate.
- F_getSSLCertificateHash() : array<string|int, mixed>: Get the hash code of the specified SSL certificate
- F_getSSLClientHash() : string: Get the hash code for the client certificate
- F_print_error() : mixed: Handle error/warning/system messages.
- F_display_db_error() : mixed: Print the database error message.
- F_error_handler() : mixed: Custom PHP error handler function.
- F_url_exists() : Returns: Check if the URL exist.
- F_file_exists() : Returns: Wrapper for file_exists.
- F_decode_form_fields() : array<string|int, mixed>: Returns an array containing form fields.
- F_check_required_fields()
: array<string|int, mixed>: Check Required Form Fields.
Returns a string containing a list of missing fields (comma separated). - F_get_field_format_registry() : array<string, string>: Server-side registry of canonical field-format patterns, keyed by form field name.
- F_check_fields_format()
: string: Check fields format against the server-side canonical pattern registry.
Returns a string containing a list of wrong fields (comma separated). - F_check_form_fields() : false: Check Form Fields.
- F_close_button() : XHTML: Returns XHTML code string to display a window close button
- F_submit_button() : XHTML: Returns XHTML code string to display Form Submit Button.
- F_getCSRFTokenField() : XHTML: Returns XHTML code string to display the CSRF token field.
- getRequiredMark() : string: Returns the visual “required field” marker to append to a form label.
- getFormRowTextInput() : string: Print input row form.
- getFormRowTextBox() : string: Print text box row form.
- getFormRowSelectBox() : string: Print select box row form.
- getFormRowCheckBox() : string: Print check box row form.
- getFormRowFixedValue() : string: Print fixed value row form.
- getFormSmallVertSpace() : string: Print empty form row.
- getFormSmallDivSpace() : string: Print empty form row.
- getFormRowVertSpace() : string: Print empty form row.
- getFormRowVertDiv() : string: Print form row with title.
- getFormNoscriptSelect() : string: Print form row with submit button when noscript is active.
- getFormDescriptionLine() : string: Print form row with label and description
- getFormUploadFile() : string: Print input row form to upluad a file.
- F_count_rows() : number: Count rows of the given table.
- F_empty_to_null()
: string: Prepare field value for SQL query.
Returns the quoted string if not empty, NULL otherwise. - F_zero_to_null()
: string: Prepare field value for SQL query.
Returns the num if different from zero, NULL otherwise. - F_getBoolean()
: bool: Returns boolean value from string or integer.
This function is needed to get the right boolean value from boolean field returned by PostgreSQL query. - F_check_unique() : bool: Check if specified fields are unique on table.
- unhtmlentities() : converted: Reverse function for htmlentities.
- F_compact_string()
: converted: Remove the following characters:
- "\t" (ASCII 9 (0x09)), a tab.
- "\n" (ASCII 10 (0x0A)), a new line (line feed)
- "\r" (ASCII 13 (0x0D)), a carriage return
- "\0" (ASCII 0 (0x00)), the NUL-byte
- "\x0B" (ASCII 11 (0x0B)), a vertical tab
- F_replace_angulars() : converted: Replace angular parenthesis with html equivalents (html entities).
- F_substr_utf8() : substring: Performs a multi-byte safe substr() operation based on number of characters.
- F_text_to_xml() : converted: Escape some special characters (< > &).
- F_xml_to_text() : converted: Unescape some special characters (< > &).
- F_text_to_tsv() : converted: Escape some special characters for TSV output.
- F_tsv_to_text() : converted: Unescape some special characters from TSV format.
- showRequiredField() : html: Return a string containing an HTML abbreviation for required/not required fields.
- utrim() : string: Strip whitespace (or other characters) from the beginning and end of an UTF-8 string and replace the “\xA0” with normal space.
- getNormalizedIP() : string|false: Convert all IP addresses to IPv6 expanded notation.
- getIpAsBytes() : string|false: Converts an IP address into its packed 16-byte binary representation (network byte order).
- getIpAsString() : string: Returns a human-readable, compact string representation of an IP address.
- F_formatFloat() : formatted: Format a percentage number.
- F_formatPercentage() : formatted: Format a percentage number.
- F_formatPdfPercentage() : string: format a percentage number
- F_formatXMLPercentage() : string: format a percentage number for XML
- F_getUTCoffset() : int: Returns the UTC time offset in seconds
- F_db_getUTCoffset() : string: Returns the UTC time offset yo be used with CONVERT_TZ function
- getDataXML() : string: Get data array in XML format.
- getDataTSVHeader() : string: Get data headers (keys) in TSV header (tab separated text values).
- getDataTSV() : string: Get data in TSV format (tab separated text values).
- F_html_to_TSV() : string: Convert HTML code to TSV string.
- F_select_table_header_element() : table: Display table header element with order link.
- getContrastColor() : string: Get a black or white color that maximize contrast.
- F_isURL() : bool: Returns true if the string is an URL.
- F_utf8_normalizer() : normalized: Normalize the UTF-8 input string.
- bcdechex() : string: Convert an long integer number to a Hexadecimal representation
- F_html_to_text() : text: Convert HTML code to Text string.
- F_menu_link() : mixed: Returns a menu element link wit subitems.
- F_menu_isChildActive() : mixed: Returns true if the menu item has an active child, false otherwise.
- F_getRandomOTPkey() : Base32: Return a random One Time Password Secret Key (Base32 encoded).
- F_decodeBase32() : Decoded: Decode a Base32 encoded string.
- F_getOTP() : OTP: Get a One Time Password for the specified secret key.
- F_show_page_navigator() : mixed: Display Pages navigation index.
- F_session_string_to_array() : array<string|int, mixed>: Convert encoded session string data to array.
- getClientFingerprint() : string: Generate a client fingerprint (unique ID for the client browser)
- getNewSessionID() : string: Generate and return a new session ID.
- getPasswordHash() : string: Hash password for Database storing.
- checkPassword() : bool: Verifies that a password matches a hash
- F_isRandomSecurityConfigured() : bool: Returns true when K_RANDOM_SECURITY has been set to a unique per-installation secret, i.e. it is not empty and not one of the values shipped in config.default.
- getPlainCSRFToken() : string: Generate unencoded CSRF token string
- checkCSRFToken() : bool: Check the CSRF token
- F_getCSRFToken() : string: Generate CSRF token
- F_decode_tcecode() : string: Returns XHTML code from text marked-up with TCExam Code Tags
- F_bbcode_to_tcecode() : string: Convert some BBCode-style to TCECode.
- F_tcecode_url() : string: Convert [url]…[/url] and [url=…]…[/url] to HTML anchor tags.
- F_tcecode_tag() : string: Convert TCECode simple tags to XHTML tags.
- F_tcecode_tag_arg() : string: Convert TCECode tags with arguments to XHTML tags.
- F_latex_callback() : string: Callback function for preg_replace_callback (LaTeX replacement).
- F_mathml_callback() : string: Callback function for preg_replace_callback (MathML replacement).
- F_objects_callback() : string: Callback function for preg_replace_callback.
- F_objects_replacement() : string: Returns the xhtml code needed to display the object by MIME type.
- F_remove_tcecode() : string: Returns specified string without tcecode mark-up tags
- F_tcecodeToLine() : mixed: Converts tcecode text to a single XHTML string removing some objects.
- F_tcecodeToTitle() : mixed: Converts tcecode text to simple string for XHTML title attribute.
- F_substrHTML() : mixed: Return a substring of XHTML code while making sure no html tags are chopped.
- F_getUserTests() : string: Returns an XHTML table of user’s tests.
- F_repeatTest() : mixed: Mark previous test attempts as repeated.
- F_isValidIP() : bool: Check if user’s IP is valid over test IP range
- F_isValidSSLCert() : true: Check if user’s IP is valid over test IP range
- F_isValidTestUser() : true: Check if user is authorized to execute the specified test
- F_terminateUserTest()
: mixed: Terminate user’s test
- F_countUserTest()
: retried: Count the number times of retries.
- F_checkTestStatus()
: array<string|int, mixed>: Check and returns specific test status for the specified user.
- F_testInfoLink() : mixed: Returns XHTML link to open test info popup.
- F_printTestInfo() : string: Returns an XHTML string containing specified test information.
- F_getTestData() : array<string|int, mixed>: Returns the test data.
- F_getUserData() : array<string|int, mixed>: Returns user data.
- F_getTestPassword() : string: Returns the test password.
- F_getTestName() : string: Returns the test name.
- F_getTestDuration() : int: Returns the test duration time in seconds.
- F_getTestStartTime() : int: Returns the user’s test start time in seconds since UNIX epoch (1970-01-01 00:00:00).
- F_twoColRow()
: string: Return a formatted XHTML row to display 2 columns data.
See CSS classes:- div.row span.label
- div.row span.formw
- F_executeTest()
: true: Returns true if the current user is authorized to execute the selected test.
Generates the test if it’s not already generated. - F_isRightTestlogUser()
: bool: Checks if the current user is the right testlog_id owner.
This function is used for security reasons. - F_selectAnswers()
: array<string|int, mixed>: Return an array containing answer_id field of selected answers.
- F_addLogAnswers() : bool: Add specified answers on tce_tests_logs_answer table.
- F_getFirstTestUser() : int: Returns the ID of the tce_tests_users table corresponding to a complete test of $test_id type.
- F_newTestLog() : int: Creates a new tce_tests_logs table entry and returns inserted ID.
- F_isTestOverLimits() : bool: Returns false if the number of executed tests is under the limits, true otherwise.
- F_count_executed_tests() : int: Returns the number of executed tests on the specified time interval.
- F_updateTestuserStat() : mixed: Track generated tests.
- F_createTest() : bool: Create user’s test and returns TRUE on success.
- F_addQuestionAnswers() : bool: Add answers to selected question.
- F_updateQuestionLog() : bool: Updates question log data (register user’s answers and calculate scores).
- F_getAnswerIdFromPosition() : int: Returns the answer ID from position
- F_questionForm()
: string: 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
- F_questionsMenu() : string: Returns a questions menu and navigator buttons.
- F_getNumOmittedQuestions() : int: Returns the number of omitted questions (unanswered + undisplayed).
- F_testComment()
: string: Display a textarea for user’s comment.
- F_updateTestComment()
: string: Updates user’s test comment.
- F_testLoginForm()
: XHTML: Returns XHTML / CSS formatted page string to insert the test password.
The CSS classes used are:- div.login_form : container for login box
- div.login_form div.login_row : container for label + input field or button
- div.login_form div.login_row span.label : container for input label
- div.login_form div.login_row span.formw : container for input form
- F_getTestGroups() : string: Get a comma separated list of valid group IDs for the selected test.
- F_getTestSSLCerts() : string: Get a comma separated list of valid SSL certificates IDs for the selected test.
- F_getUserTestStat() : mixed: Returns statistic array for the test-user
- F_getUserTestTotals() : mixed: Returns test-user totals
- F_getTestStat() : mixed: Returns statistic array for the selected test.
- F_getRawTestStat() : mixed: Returns raw statistic array for the selected test.
- F_normalizeTestStatAverages() : mixed: Calculate average values from TestStat array
- F_printTestStat() : mixed: Returns test stats as HTML table
- F_printTestResultStat() : mixed: Returns test stats as HTML table
- F_printUserTestStat() : mixed: Returns user test stats as HTML table
- F_getAllUsersTestStat() : mixed: Returns users statistic array for the selected test.
- F_getSafeUsersTestStatOrderBy() : string: Returns a safe ORDER BY clause for user test statistics queries.
- F_lockUserTest()
: mixed: Lock the user’s test.
- F_getTestIDResults() : string: Returns a comma separated string of test IDs with test_results_to_users enabled
- F_getTestIDReports() : string: Returns a comma separated string of test IDs with test_results_to_users enabled
- F_getTestIDs() : string: Returns a comma separated string of test IDs with test_results_to_users enabled
- F_send_user_reg_email() : mixed: Send a registration verification email to user.
Constants
K_ALLOWED_ERROR_TAGS
File: tce_functions_errmsg.php line 32
public mixed K_ALLOWED_ERROR_TAGS = '<a><b><br><em><p><ol><ul><li><small><table><tr><th><td>'K_EMAIL_RE_PATTERN
File: tce_functions_form.php line 53
public mixed K_EMAIL_RE_PATTERN = '^([a-zA-Z0-9_\.\-\+\%]+)@([a-zA-Z0-9\.\-]+)$'Functions
F_encodeOMRTestData()
File: tce_functions_omr.php line 29
F_encodeOMRTestData(mixed $data) : encodedParameters
- $data : mixed: (array) array to be encoded
Return values
encoded —
string.
F_decodeOMRTestData()
File: tce_functions_omr.php line 42
F_decodeOMRTestData(mixed $str) : array<string|int, mixed>Parameters
- $str : mixed: (string) string to be decoded.
Return values
array<string|int, mixed> —
with test data (0 => test_id, n => array(0 => question_n_ID, 1 => array(answers_IDs)), or false in case of error.
F_decodeOMRTestDataQRCode()
File: tce_functions_omr.php line 61
F_decodeOMRTestDataQRCode(mixed $image) : array<string|int, mixed>This function uses the external application zbarimg (http://zbar.sourceforge.net/) .
Parameters
- $image : mixed: (string) image file to be decoded (scanned OMR page).
Return values
array<string|int, mixed> —
with test data or false in case o error
F_decodeOMRPage()
File: tce_functions_omr.php line 79
F_decodeOMRPage(mixed $image) : array<string|int, mixed>This function requires ImageMagick library and zbarimg (http://zbar.sourceforge.net/) .
Parameters
- $image : mixed: (string) image file to be decoded (scanned OMR page at 200 DPI with full color range).
Return values
array<string|int, mixed> —
of answers data or false in case of error.
F_importOMRTestData()
File: tce_functions_omr.php line 214
F_importOMRTestData(mixed $user_id, mixed $date, mixed $omr_testdata, mixed $omr_answers[, mixed $overwrite = false ]) : boolParameters
- $user_id : mixed: (int) user ID.
- $date : mixed: (string) date-time field.
- $omr_testdata : mixed: (array) Array containing test data.
- $omr_answers : mixed: (array) Array containing test answers (from OMR).
- $overwrite : mixed = false: (boolean) If true overwrites the previous answers on non-repeatable tests.
Return values
bool —
TRUE in case of success, FALSE otherwise.
F_altLogin()
File: tce_altauth.php line 30
F_altLogin() : array<string|int, mixed>(SSL, HTTP-BASIC, CAS, SHIBBOLETH, RADIUS, LDAP, CUSTOM)
Tags
- since: 2012-06-05
Return values
array<string|int, mixed> —
of user’s data for successful login, false otherwise
F_db_connect()
File: tce_db_dal_mysql.php line 36
F_db_connect([mixed $host = 'localhost' ][, mixed $port = '3306' ][, mixed $username = 'root' ][, mixed $password = '' ][, mixed $database = '' ]) : MySQLParameters
- $host : mixed = ’localhost’: (string) database server host name.
- $port : mixed = ‘3306’: (string) database connection port
- $username : mixed = ‘root’: (string) Name of the user that owns the server process.
- $password : mixed = ‘’: (string) Password of the user that owns the server process.
- $database : mixed = ‘’: (string) Database name.
Return values
MySQL —
link identifier on success, or FALSE on failure.
F_db_close()
File: tce_db_dal_mysql.php line 63
F_db_close(mixed $link_identifier) : boolParameters
- $link_identifier : mixed: (resource) database link identifier.
Return values
bool —
TRUE on success or FALSE on failure
F_db_error()
File: tce_db_dal_mysql.php line 72
F_db_error([mixed $link_identifier = null ]) : stringParameters
- $link_identifier : mixed = null
Return values
string —
error message.
F_db_query()
File: tce_db_dal_mysql.php line 87
F_db_query(mixed $query, mixed $link_identifier) : falseParameters
- $query : mixed: (string) The query tosend. The query string should not end with a semicolon.
- $link_identifier : mixed: (resource) database link identifier.
Return values
false —
in case of error, TRUE or resource-identifier in case of success.
F_db_fetch_array()
File: tce_db_dal_mysql.php line 100
F_db_fetch_array(mixed $result) : ReturnsNote: This function sets NULL fields to PHP NULL value.
Parameters
- $result : mixed: (resource) result resource to the query result.
Return values
Returns —
an array that corresponds to the fetched row, or FALSE if there are no more rows.
F_db_fetch_assoc()
File: tce_db_dal_mysql.php line 111
F_db_fetch_assoc(mixed $result) : ReturnsNote: This function sets NULL fields to PHP NULL value.
Parameters
- $result : mixed: (resource) result resource to the query result.
Return values
Returns —
an array that corresponds to the fetched row, or FALSE if there are no more rows.
F_db_affected_rows()
File: tce_db_dal_mysql.php line 122
F_db_affected_rows(mixed $link_identifier, mixed $result) : NumberParameters
- $link_identifier : mixed: (resource) database link identifier.
- $result : mixed: (resource) result resource to the query result [UNUSED].
Return values
Number —
of rows.
F_db_num_rows()
File: tce_db_dal_mysql.php line 132
F_db_num_rows(mixed $result) : NumberParameters
- $result : mixed: (resource) result resource to the query result.
Return values
Number —
of affected rows.
F_db_insert_id()
File: tce_db_dal_mysql.php line 144
F_db_insert_id(mixed $link_identifier[, mixed $tablename = '' ][, mixed $fieldname = '' ]) : intParameters
- $link_identifier : mixed: (resource) database link identifier.
- $tablename : mixed = ‘’: (string) Table name.
- $fieldname : mixed = ‘’: (string) Field name (column name).
Return values
int —
ID generated from the last INSERT operation.
F_db_datetime_diff_seconds()
File: tce_db_dal_mysql.php line 168
F_db_datetime_diff_seconds(mixed $start_date_field, mixed $end_date_field) : SQLParameters
- $start_date_field : mixed
- $end_date_field : mixed
Return values
SQL —
query string
F_escape_sql()
File: tce_db_dal_mysql.php line 181
F_escape_sql(mixed $link_identifier, mixed $str[, mixed $stripslashes = true ]) : stringParameters
- $link_identifier : mixed: (resource) database link identifier.
- $str : mixed: (string) The string that is to be escaped.
- $stripslashes : mixed = true: (boolean) if true strip slashes from string
Tags
- since: 5.0.005 2007-12-05
Return values
string —
Returns the escaped string, or FALSE on error.
F_db_connect()
File: tce_db_dal_mysqli.php line 45
F_db_connect([mixed $host = 'localhost' ][, mixed $port = '3306' ][, mixed $username = 'root' ][, mixed $password = '' ][, mixed $database = '' ]) : MySQLParameters
- $host : mixed = ’localhost’: (string) database server host name.
- $port : mixed = ‘3306’: (string) database connection port
- $username : mixed = ‘root’: (string) Name of the user that owns the server process.
- $password : mixed = ‘’: (string) Password of the user that owns the server process.
- $database : mixed = ‘’: (string) Database name.
Return values
MySQL —
link identifier on success, or FALSE on failure.
F_db_close()
File: tce_db_dal_mysqli.php line 68
F_db_close(mixed $link_identifier) : boolParameters
- $link_identifier : mixed: (resource) database link identifier.
Return values
bool —
TRUE on success or FALSE on failure
F_db_error()
File: tce_db_dal_mysqli.php line 77
F_db_error([mixed $link_identifier = null ]) : stringParameters
- $link_identifier : mixed = null
Return values
string —
error message.
F_db_query()
File: tce_db_dal_mysqli.php line 92
F_db_query(mixed $query, mixed $link_identifier) : falseParameters
- $query : mixed: (string) The query tosend. The query string should not end with a semicolon.
- $link_identifier : mixed: (resource) database link identifier.
Return values
false —
in case of error, TRUE or resource-identifier in case of success.
F_db_fetch_array()
File: tce_db_dal_mysqli.php line 105
F_db_fetch_array(mixed $result) : ReturnsNote: This function sets NULL fields to PHP NULL value.
Parameters
- $result : mixed: (resource) result resource to the query result.
Return values
Returns —
an array that corresponds to the fetched row, or FALSE if there are no more rows.
F_db_fetch_assoc()
File: tce_db_dal_mysqli.php line 116
F_db_fetch_assoc(mixed $result) : ReturnsNote: This function sets NULL fields to PHP NULL value.
Parameters
- $result : mixed: (resource) result resource to the query result.
Return values
Returns —
an array that corresponds to the fetched row, or FALSE if there are no more rows.
F_db_affected_rows()
File: tce_db_dal_mysqli.php line 127
F_db_affected_rows(mixed $link_identifier, mixed $result) : NumberParameters
- $link_identifier : mixed: (resource) database link identifier.
- $result : mixed: (resource) result resource to the query result [UNUSED].
Return values
Number —
of rows.
F_db_num_rows()
File: tce_db_dal_mysqli.php line 137
F_db_num_rows(mixed $result) : NumberParameters
- $result : mixed: (resource) result resource to the query result.
Return values
Number —
of affected rows.
F_db_insert_id()
File: tce_db_dal_mysqli.php line 149
F_db_insert_id(mixed $link_identifier[, mixed $tablename = '' ][, mixed $fieldname = '' ]) : intParameters
- $link_identifier : mixed: (resource) database link identifier.
- $tablename : mixed = ‘’: (string) Table name. (unused here but required for other DAL).
- $fieldname : mixed = ‘’: (string) Field name (column name). (unused here but required for other DAL).
Return values
int —
ID generated from the last INSERT operation.
F_db_datetime_diff_seconds()
File: tce_db_dal_mysqli.php line 158
F_db_datetime_diff_seconds(mixed $start_date_field, mixed $end_date_field) : SQLParameters
- $start_date_field : mixed
- $end_date_field : mixed
Return values
SQL —
query string
F_escape_sql()
File: tce_db_dal_mysqli.php line 171
F_escape_sql(mixed $link_identifier, mixed $str[, mixed $stripslashes = true ]) : stringParameters
- $link_identifier : mixed: (resource) database link identifier.
- $str : mixed: (string) The string that is to be escaped.
- $stripslashes : mixed = true: (boolean) if true strip slashes from string
Tags
- since: 5.0.005 2007-12-05
Return values
string —
Returns the escaped string, or FALSE on error.
F_db_connect()
File: tce_db_dal_oracle.php line 37
F_db_connect([mixed $host = 'localhost' ][, mixed $port = '1521' ][, mixed $username = 'root' ][, mixed $password = '' ][, mixed $database = '' ]) : OracleIf a second call is made to this function with the same arguments, no new link will be established, but instead, the link identifier of the already opened link will be returned.
Parameters
- $host : mixed = ’localhost’: (string) database server host name.
- $port : mixed = ‘1521’: (string) database connection port
- $username : mixed = ‘root’: (string) Name of the user that owns the server process.
- $password : mixed = ‘’: (string) Password of the user that owns the server process.
- $database : mixed = ‘’: (string) Database name.
Return values
Oracle —
link identifier on success, or FALSE on failure.
F_db_close()
File: tce_db_dal_oracle.php line 64
F_db_close(mixed $link_identifier) : boolParameters
- $link_identifier : mixed: (resource) database link identifier.
Return values
bool —
TRUE on success or FALSE on failure
F_db_error()
File: tce_db_dal_oracle.php line 73
F_db_error([mixed $link_identifier = null ]) : stringParameters
- $link_identifier : mixed = null
Return values
string —
error message.
F_db_query()
File: tce_db_dal_oracle.php line 86
F_db_query(mixed $query, mixed $link_identifier) : falseParameters
- $query : mixed: (string) The query tosend. The query string should not end with a semicolon.
- $link_identifier : mixed: (resource) database link identifier.
Return values
false —
in case of error, TRUE or resource-identifier in case of success.
F_db_fetch_array()
File: tce_db_dal_oracle.php line 115
F_db_fetch_array(mixed $result) : ReturnsNote: This function sets NULL fields to PHP NULL value.
Parameters
- $result : mixed: (resource) result resource to the query result.
Return values
Returns —
an array that corresponds to the fetched row, or FALSE if there are no more rows.
F_db_fetch_assoc()
File: tce_db_dal_oracle.php line 132
F_db_fetch_assoc(mixed $result) : ReturnsNote: This function sets NULL fields to PHP NULL value.
Parameters
- $result : mixed: (resource) result resource to the query result.
Return values
Returns —
an array that corresponds to the fetched row, or FALSE if there are no more rows.
F_db_affected_rows()
File: tce_db_dal_oracle.php line 149
F_db_affected_rows(mixed $link_identifier, mixed $result) : NumberParameters
- $link_identifier : mixed: (resource) database link identifier [UNUSED].
- $result : mixed: (resource) result resource to the query result.
Return values
Number —
of rows.
F_db_num_rows()
File: tce_db_dal_oracle.php line 159
F_db_num_rows(mixed $result) : NumberParameters
- $result : mixed: (resource) result resource to the query result.
Return values
Number —
of affected rows.
F_db_insert_id()
File: tce_db_dal_oracle.php line 173
F_db_insert_id(mixed $link_identifier[, mixed $tablename = '' ][, mixed $fieldname = '' ]) : intParameters
- $link_identifier : mixed: (resource) database link identifier.
- $tablename : mixed = ‘’: (string) Table name.
- $fieldname : mixed = ‘’: (string) Field name (column name).
Return values
int —
ID generated from the last INSERT operation.
F_db_datetime_diff_seconds()
File: tce_db_dal_oracle.php line 187
F_db_datetime_diff_seconds(mixed $start_date_field, mixed $end_date_field) : SQLParameters
- $start_date_field : mixed
- $end_date_field : mixed
Return values
SQL —
query string
F_escape_sql()
File: tce_db_dal_oracle.php line 200
F_escape_sql(mixed $link_identifier, mixed $str[, mixed $stripslashes = true ]) : stringParameters
- $link_identifier : mixed: (resource) database link identifier.
- $str : mixed: (string) The string that is to be escaped.
- $stripslashes : mixed = true: (boolean) if true strip slashes from string
Tags
- since: 5.0.005 2007-12-05
Return values
string —
Returns the escaped string, or FALSE on error.
F_db_connect()
File: tce_db_dal_postgresql.php line 37
F_db_connect([mixed $host = 'localhost' ][, mixed $port = '5432' ][, mixed $username = 'postgres' ][, mixed $password = '' ][, mixed $database = 'template1' ]) : PostgreSQLIf a second call is made to this function with the same arguments, no new link will be established, but instead, the link identifier of the already opened link will be returned.
Parameters
- $host : mixed = ’localhost’: (string) database server host name.
- $port : mixed = ‘5432’: (string) database connection port
- $username : mixed = ‘postgres’: (string) Name of the user that owns the server process.
- $password : mixed = ‘’: (string) Password of the user that owns the server process.
- $database : mixed = ’template1’: (string) Database name.
Return values
PostgreSQL —
link identifier on success, or FALSE on failure.
F_db_close()
File: tce_db_dal_postgresql.php line 69
F_db_close(mixed $link_identifier) : boolParameters
- $link_identifier : mixed: (resource) database link identifier.
Return values
bool —
TRUE on success or FALSE on failure
F_db_error()
File: tce_db_dal_postgresql.php line 78
F_db_error([mixed $link_identifier = null ]) : stringParameters
- $link_identifier : mixed = null
Return values
string —
error message.
F_db_query()
File: tce_db_dal_postgresql.php line 90
F_db_query(mixed $query, mixed $link_identifier) : falseParameters
- $query : mixed: (string) The query tosend. The query string should not end with a semicolon.
- $link_identifier : mixed: (resource) database link identifier.
Return values
false —
in case of error, TRUE or resource-identifier in case of success.
F_db_fetch_array()
File: tce_db_dal_postgresql.php line 103
F_db_fetch_array(mixed $result) : ReturnsNote: This function sets NULL fields to PHP NULL value.
Parameters
- $result : mixed: (resource) result resource to the query result.
Return values
Returns —
an array that corresponds to the fetched row, or FALSE if there are no more rows.
F_db_fetch_assoc()
File: tce_db_dal_postgresql.php line 114
F_db_fetch_assoc(mixed $result) : ReturnsNote: This function sets NULL fields to PHP NULL value.
Parameters
- $result : mixed: (resource) result resource to the query result.
Return values
Returns —
an array that corresponds to the fetched row, or FALSE if there are no more rows.
F_db_affected_rows()
File: tce_db_dal_postgresql.php line 125
F_db_affected_rows(mixed $link_identifier, mixed $result) : NumberParameters
- $link_identifier : mixed: (resource) database link identifier [UNUSED].
- $result : mixed: (resource) result resource to the query result.
Return values
Number —
of rows.
F_db_num_rows()
File: tce_db_dal_postgresql.php line 135
F_db_num_rows(mixed $result) : NumberParameters
- $result : mixed: (resource) result resource to the query result.
Return values
Number —
of affected rows.
F_db_insert_id()
File: tce_db_dal_postgresql.php line 147
F_db_insert_id(mixed $link_identifier[, mixed $tablename = '' ][, mixed $fieldname = '' ]) : intParameters
- $link_identifier : mixed: (resource) database link identifier.
- $tablename : mixed = ‘’: (string) Table name.
- $fieldname : mixed = ‘’: (string) Field name (column name).
Return values
int —
ID generated from the last INSERT operation.
F_db_datetime_diff_seconds()
File: tce_db_dal_postgresql.php line 165
F_db_datetime_diff_seconds(mixed $start_date_field, mixed $end_date_field) : SQLParameters
- $start_date_field : mixed
- $end_date_field : mixed
Return values
SQL —
query string
F_escape_sql()
File: tce_db_dal_postgresql.php line 178
F_escape_sql(mixed $link_identifier, mixed $str[, mixed $stripslashes = true ]) : stringParameters
- $link_identifier : mixed: (resource) database link identifier.
- $str : mixed: (string) The string that is to be escaped.
- $stripslashes : mixed = true: (boolean) if true strip slashes from string
Tags
- since: 5.0.005 2007-12-05
Return values
string —
Returns the escaped string, or FALSE on error.
F_loginForm()
File: tce_functions_authorization.php line 39
F_loginForm(mixed $faction, mixed $fid, mixed $fmethod, mixed $fenctype, mixed $username) : XHTMLParameters
- $faction : mixed
- $fid : mixed
- $fmethod : mixed
- $fenctype : mixed
- $username : mixed
Return values
XHTML —
string for login form
F_login_form()
File: tce_functions_authorization.php line 156
F_login_form() : mixedNOTE: This function calls exit() after execution.
F_logout_form()
File: tce_functions_authorization.php line 207
F_logout_form() : XHTMLReturn values
XHTML —
string for logout form.
F_logout_page()
File: tce_functions_authorization.php line 242
F_logout_page() : mixedNOTE: This function calls exit() after execution.
F_isAuthorizedUser()
File: tce_functions_authorization.php line 263
F_isAuthorizedUser(mixed $table, mixed $field_id_name, mixed $value_id, mixed $field_user_id) : boolParameters
- $table : mixed: (string) table to be modified
- $field_id_name : mixed: (string) name of the main ID field of the table
- $value_id : mixed: (int) value of the ID field of the table
- $field_user_id : mixed: (string) name of the foreign key to to user_id
Tags
- author: Nicola Asuni
- since: 2006-03-11
Return values
bool —
true if the user is authorized, false otherwise
F_getAuthorizedUsers()
File: tce_functions_authorization.php line 333
F_getAuthorizedUsers(mixed $user_id) : stringParameters
- $user_id : mixed: (int) user ID
Tags
- author: Nicola Asuni
- since: 2006-03-11
Return values
string
F_syncUserGroups()
File: tce_functions_authorization.php line 363
F_syncUserGroups(mixed $usrid, mixed $grpids) : mixedParameters
- $usrid : mixed: (int) ID of the user to update.
- $grpids : mixed: (mixed) Group ID or comma separated list of group IDs (0=all available groups).
Tags
- author: Nicola Asuni
- since: 2012-09-11
F_isSslCertificateValid()
File: tce_functions_authorization.php line 430
F_isSslCertificateValid() : trueTags
- author: Nicola Asuni
- since: 2013-03-26
Return values
true —
if the client has a valid SSL certificate, false otherwise.
F_getSSLCertificateHash()
File: tce_functions_authorization.php line 457
F_getSSLCertificateHash(string $cert[, bool $pkcs12 = false ]) : array<string|int, mixed>Parameters
- $cert : string: String containing the certificate data.
- $pkcs12 : bool = false: Set this variable to true if the certificate is in PKCS12 format.
Tags
- author: Nicola Asuni
- since: 2013-07-01
Return values
array<string|int, mixed> —
containing the hash code and the validity end date in unix epoch.
F_getSSLClientHash()
File: tce_functions_authorization.php line 492
F_getSSLClientHash() : stringTags
- author: Nicola Asuni
- since: 2013-07-01
Return values
string —
containing the hash code.
F_print_error()
File: tce_functions_errmsg.php line 41
F_print_error([mixed $messagetype = 'MESSAGE' ][, mixed $messagetoprint = '' ][, mixed $exit = false ]) : mixedPrint a message
Parameters
- $messagetype : mixed = ‘MESSAGE’: (string) Type of message: 0=no message, message; warning; error.
- $messagetoprint : mixed = ‘’: (string) message to print.
- $exit : mixed = false: (bool) if true output a message and terminate the current script [default = false].
F_display_db_error()
File: tce_functions_errmsg.php line 114
F_display_db_error([mixed $exit = true ]) : mixedParameters
- $exit : mixed = true: (bool) if true output a message and terminate the current script [default = true].
F_error_handler()
File: tce_functions_errmsg.php line 129
F_error_handler(mixed $errno, mixed $errstr, mixed $errfile, mixed $errline) : mixedParameters
- $errno : mixed: (int) The first parameter, errno, contains the level of the error raised, as an integer.
- $errstr : mixed: (string) The second parameter, errstr, contains the error message, as a string.
- $errfile : mixed: (string) The third parameter is optional, errfile, which contains the filename that the error was raised in, as a string.
- $errline : mixed: (int) The fourth parameter is optional, errline, which contains the line number the error was raised at, as an integer.
F_url_exists()
File: tce_functions_errmsg.php line 153
F_url_exists(mixed $url) : ReturnsParameters
- $url : mixed
Return values
Returns —
TRUE if the URL exists; FALSE otherwise.
F_file_exists()
File: tce_functions_errmsg.php line 181
F_file_exists(mixed $filename) : ReturnsChecks whether a file or directory exists. Only allows some protocols and local files.
Parameters
- $filename : mixed
Return values
Returns —
TRUE if the file or directory specified by filename exists; FALSE otherwise.
F_decode_form_fields()
File: tce_functions_form.php line 59
F_decode_form_fields() : array<string|int, mixed>Return values
array<string|int, mixed> —
containing form fields
F_check_required_fields()
File: tce_functions_form.php line 70
F_check_required_fields(mixed $formfields) : array<string|int, mixed>Parameters
- $formfields : mixed: (string) input array containing form fields
Return values
array<string|int, mixed> —
containing a list of missing fields (if any)
F_get_field_format_registry()
File: tce_functions_form.php line 116
F_get_field_format_registry() : array<string, string>This is the single source of truth used by F_check_fields_format() to validate submitted values. The matching pattern is resolved here, on the server, by field name.
Field names are static across the application, so a flat “name => un-delimited regex” map is sufficient. Configurable constants are reused where they already exist.
Return values
array<string, string> —
map of field name to un-delimited regular expression
F_check_fields_format()
File: tce_functions_form.php line 162
F_check_fields_format(mixed $formfields) : stringFor every field present in F_get_field_format_registry() that was submitted with a non-empty value, the value is matched against its canonical (server-authored) pattern. The client-supplied ‘x_’ value is ignored entirely, so a tampered/omitted/malicious pattern can neither bypass validation nor be executed as a regular expression.
Parameters
- $formfields : mixed: (array) input array containing form fields
Return values
string —
comma-separated list of wrong fields (empty when all valid)
F_check_form_fields()
File: tce_functions_form.php line 212
F_check_form_fields() : falsesee: F_check_required_fields, F_check_fields_format
Return values
false —
in case of error, true otherwise
F_close_button()
File: tce_functions_form.php line 239
F_close_button([mixed $onclick = '' ]) : XHTMLParameters
- $onclick : mixed = ‘’: (string) additional javascript code to execute before closing the window.
Return values
XHTML —
code string
F_submit_button()
File: tce_functions_form.php line 270
F_submit_button(mixed $name, mixed $value[, mixed $title = '' ][, mixed $extra = '' ]) : XHTMLParameters
- $name : mixed: (string) button name
- $value : mixed: (string) label for button
- $title : mixed = ‘’: (string) button title, default=’’
- $extra : mixed = ‘’: (string) optional extra fields to add to the input tag, default=’’
Return values
XHTML —
code string
F_getCSRFTokenField()
File: tce_functions_form.php line 291
F_getCSRFTokenField() : XHTMLReturn values
XHTML —
code string
getRequiredMark()
File: tce_functions_form.php line 302
getRequiredMark([mixed $required = false ]) : stringThe control itself should also carry aria-required=“true”.
Parameters
- $required : mixed = false: (boolean) true if the field is required.
Return values
string —
XHTML code (empty string when the field is not required).
getFormRowTextInput()
File: tce_functions_form.php line 334
getFormRowTextInput(mixed $field_name, mixed $name[, mixed $description = '' ][, mixed $tip = '' ][, mixed $value = '' ][, mixed $format = '' ][, mixed $maxlen = 255 ][, mixed $date = false ][, mixed $datetime = false ][, mixed $password = false ][, mixed $prefix = '' ][, mixed $required = false ][, mixed $autocomplete = '' ][, mixed $inputtype = '' ]) : stringParameters
- $field_name : mixed: (string) Name of the form field.
- $name : mixed: (string) Label.
- $description : mixed = ‘’: (string) Label description (tooltip).
- $tip : mixed = ‘’: (string) Help to be displayed on the right of the input field.
- $value : mixed = ‘’: (string) Initial value.
- $format : mixed = ‘’: (string) Regular expression to check the format of the field.
- $maxlen : mixed = 255: (int) Maximum input length.
- $date : mixed = false: (boolean) True if the field is a date input.
- $datetime : mixed = false: (boolean) True if the field is a date-time input.
- $password : mixed = false: (boolean) True if the field is a password.
- $prefix : mixed = ‘’: (string) code to be displayed after label.
- $required : mixed = false: (boolean) If true the field is marked as required.
- $autocomplete : mixed = ‘’: (string) HTML autocomplete token (e.g. ’email’, ‘username’, ‘current-password’, ’new-password’).
- $inputtype : mixed = ‘’: (string) Override for the HTML input type (e.g. ’email’, ’tel’, ’number’); ignored for password/date/datetime fields.
Return values
string
getFormRowTextBox()
File: tce_functions_form.php line 481
getFormRowTextBox(mixed $field_name, mixed $name[, mixed $description = '' ][, mixed $value = '' ][, mixed $disabled = false ][, mixed $prefix = '' ][, mixed $required = false ]) : stringParameters
- $field_name : mixed: (string) Name of the form field.
- $name : mixed: (string) Label.
- $description : mixed = ‘’: (string) Label description (tooltip).
- $value : mixed = ‘’: (string) Initial value.
- $disabled : mixed = false: (boolean) If true disable the field.
- $prefix : mixed = ‘’: (string) code to be displayed after label.
- $required : mixed = false: (boolean) If true the field is marked as required.
Return values
string
getFormRowSelectBox()
File: tce_functions_form.php line 541
getFormRowSelectBox(mixed $field_name, mixed $name[, mixed $description = '' ][, mixed $tip = '' ][, mixed $value = '' ][, mixed $items = [] ][, mixed $prefix = '' ][, mixed $required = false ]) : stringParameters
- $field_name : mixed: (string) Name of the form field.
- $name : mixed: (string) Label.
- $description : mixed = ‘’: (string) Label description (tooltip).
- $tip : mixed = ‘’: (string) Help to be displayed on the right of the input field.
- $value : mixed = ‘’: (string) Initial value.
- $items : mixed = []: (array) array of items to print key => value.
- $prefix : mixed = ‘’: (string) code to be displayed after label.
- $required : mixed = false
Return values
string
getFormRowCheckBox()
File: tce_functions_form.php line 616
getFormRowCheckBox(mixed $field_name, mixed $name[, mixed $description = '' ][, mixed $tip = '' ][, mixed $value = '' ][, mixed $selected = false ][, mixed $disabled = false ][, mixed $prefix = '' ]) : stringParameters
- $field_name : mixed: (string) Name of the form field.
- $name : mixed: (string) Label.
- $description : mixed = ‘’: (string) Label description (tooltip).
- $tip : mixed = ‘’: (string) Help to be displayed on the right of the input field.
- $value : mixed = ‘’: (string) Initial value.
- $selected : mixed = false: (boolean) set to true if selected.
- $disabled : mixed = false: (boolean) set to true to disable the field
- $prefix : mixed = ‘’: (string) code to be displayed after label.
Return values
string
getFormRowFixedValue()
File: tce_functions_form.php line 693
getFormRowFixedValue(mixed $field_name, mixed $name[, mixed $description = '' ][, mixed $tip = '' ][, mixed $value = '' ][, mixed $currency = false ][, mixed $prefix = '' ]) : stringParameters
- $field_name : mixed: (string) Name of the form field.
- $name : mixed: (string) Label.
- $description : mixed = ‘’: (string) Label description (tooltip).
- $tip : mixed = ‘’: (string) Help to be displayed on the right of the input field.
- $value : mixed = ‘’: (string) Initial value.
- $currency : mixed = false: (boolean) if true the value is a curency number.
- $prefix : mixed = ‘’: (string) code to be displayed after label.
Return values
string
getFormSmallVertSpace()
File: tce_functions_form.php line 762
getFormSmallVertSpace() : stringReturn values
string
getFormSmallDivSpace()
File: tce_functions_form.php line 771
getFormSmallDivSpace() : stringReturn values
string
getFormRowVertSpace()
File: tce_functions_form.php line 780
getFormRowVertSpace() : stringReturn values
string
getFormRowVertDiv()
File: tce_functions_form.php line 790
getFormRowVertDiv([mixed $title = '' ]) : stringParameters
- $title : mixed = ‘’: (string) Title to be printed.
Return values
string
getFormNoscriptSelect()
File: tce_functions_form.php line 805
getFormNoscriptSelect([mixed $name = 'selectrecord' ]) : stringParameters
- $name : mixed = ‘selectrecord’: (string) Name of the input form field.
Return values
string
getFormDescriptionLine()
File: tce_functions_form.php line 827
getFormDescriptionLine(mixed $name[, mixed $description = '' ][, mixed $value = '' ]) : stringParameters
- $name : mixed: (string) Label.
- $description : mixed = ‘’: (string) Label description (tooltip).
- $value : mixed = ‘’: (string) Initial value.
Return values
string
getFormUploadFile()
File: tce_functions_form.php line 852
getFormUploadFile(mixed $field_name, mixed $field_id, mixed $name[, mixed $description = '' ][, mixed $onchange = '' ]) : stringParameters
- $field_name : mixed: (string) Name of the form field.
- $field_id : mixed: (string) ID of the form field.
- $name : mixed: (string) Label.
- $description : mixed = ‘’: (string) Label description (tooltip).
- $onchange : mixed = ‘’: (string) Javascript code to execute at onchange event.
Return values
string
F_count_rows()
File: tce_functions_general.php line 29
F_count_rows(mixed $dbtable[, mixed $where = '' ]) : numberParameters
- $dbtable : mixed: (string) database table name
- $where : mixed = ‘’: (string) optional where SQL clause (including the WHERE keyword).
Return values
number —
of rows
F_empty_to_null()
File: tce_functions_general.php line 52
F_empty_to_null(mixed $str) : stringParameters
- $str : mixed: (string) string to check.
Return values
string —
$str quoted if not empty, NULL otherwise
F_zero_to_null()
File: tce_functions_general.php line 69
F_zero_to_null(mixed $num) : stringParameters
- $num : mixed: (string) string to check.
Return values
string —
$num if != 0, NULL otherwise
F_getBoolean()
File: tce_functions_general.php line 86
F_getBoolean(mixed $str) : boolParameters
- $str : mixed: (string) string to check.
Return values
bool —
value.
F_check_unique()
File: tce_functions_general.php line 107
F_check_unique(mixed $table, mixed $where[, mixed $fieldname = false ][, mixed $fieldid = false ]) : boolParameters
- $table : mixed: (string) table name
- $where : mixed: (string) SQL where clause
- $fieldname : mixed = false: (mixed) name of table column to check
- $fieldid : mixed = false: (mixed) ID of table row to check
Return values
bool —
true if unique, false otherwise
unhtmlentities()
File: tce_functions_general.php line 139
unhtmlentities(mixed $text_to_convert[, mixed $preserve_tagsign = false ]) : convertedParameters
- $text_to_convert : mixed: (string) input string to convert
- $preserve_tagsign : mixed = false: (boolean) if true preserve <> symbols, default=FALSE
Return values
converted —
string
F_compact_string()
File: tce_functions_general.php line 161
F_compact_string(mixed $string[, mixed $dquotes = false ]) : convertedParameters
- $string : mixed: (string) input string to convert
- $dquotes : mixed = false: (boolean) If true add slash in fron of double quotes;
Return values
converted —
string
F_replace_angulars()
File: tce_functions_general.php line 182
F_replace_angulars(mixed $str) : convertedParameters
- $str : mixed: (string) input string to convert
Return values
converted —
string
F_substr_utf8()
File: tce_functions_general.php line 198
F_substr_utf8(mixed $str, mixed $start, mixed $length) : substringParameters
- $str : mixed: (string) input string
- $start : mixed: (int) substring start index
- $length : mixed: (int) substring max length
Return values
substring
F_text_to_xml()
File: tce_functions_general.php line 238
F_text_to_xml(mixed $str) : convertedParameters
- $str : mixed: (string) input string to convert
Return values
converted —
string
F_xml_to_text()
File: tce_functions_general.php line 258
F_xml_to_text(mixed $str) : convertedParameters
- $str : mixed: (string) input string to convert
Return values
converted —
string
F_text_to_tsv()
File: tce_functions_general.php line 277
F_text_to_tsv(mixed $str) : convertedParameters
- $str : mixed: (string) input string to convert
Return values
converted —
string
F_tsv_to_text()
File: tce_functions_general.php line 297
F_tsv_to_text(mixed $str) : convertedParameters
- $str : mixed: (string) input string to convert
Return values
converted —
string
showRequiredField()
File: tce_functions_general.php line 316
showRequiredField([mixed $mode = 1 ]) : htmlParameters
- $mode : mixed = 1: (int) field mode: 1=not required; 2=required.
Return values
html —
string
utrim()
File: tce_functions_general.php line 332
utrim(mixed $txt) : stringParameters
- $txt : mixed: (string) The string that will be trimmed.
Return values
string —
The trimmed string.
getNormalizedIP()
File: tce_functions_general.php line 349
getNormalizedIP(mixed $ip) : string|falseParameters
- $ip : mixed: (string) IP address to normalize.
Tags
- since: 7.1.000 (2009-02-13)
Return values
string|false —
IPv6 address in expanded notation or false in case of invalid input.
getIpAsBytes()
File: tce_functions_general.php line 426
getIpAsBytes(mixed $ip) : string|falseThis preserves full 128-bit precision and is case-insensitive, so the returned fixed-width byte strings can be ordered and range-compared losslessly with strcmp() (see F_isValidIP). Input may use any notation accepted by getNormalizedIP() (IPv4, IPv6, or the expanded form already stored in the database).
Parameters
- $ip : mixed: (string) IP address to convert.
Tags
- since: 17.1.0 (2026-06-23)
Return values
string|false —
16-byte packed IPv6 address, or false on invalid input.
getIpAsString()
File: tce_functions_general.php line 445
getIpAsString(mixed $ip) : stringThe stored form is the expanded IPv6 produced by getNormalizedIP(); this compacts it (and unwraps IPv4-mapped IPv6, e.g. ::ffff:127.0.0.1 -> 127.0.0.1) so it reads naturally and fits report/result columns.
Parameters
- $ip : mixed: (string) IP address to convert.
Tags
- since: 9.0.033 (2009-11-03)
Return values
string —
IP address as a readable string.
F_formatFloat()
File: tce_functions_general.php line 475
F_formatFloat(mixed $num) : formattedParameters
- $num : mixed: (float) number to be formatted
Return values
formatted —
string
F_formatPercentage()
File: tce_functions_general.php line 486
F_formatPercentage(mixed $num[, mixed $ratio = true ]) : formattedParameters
- $num : mixed: (float) Number to be formatted.
- $ratio : mixed = true: (boolean) Set to true if the number is a ratio between 0 and 1, false if is a percentage number between 0 an 100.
Return values
formatted —
string
F_formatPdfPercentage()
File: tce_functions_general.php line 501
F_formatPdfPercentage(mixed $num[, mixed $ratio = true ]) : stringParameters
- $num : mixed: (float) number to be formatted
- $ratio : mixed = true: (boolean) Set to true if the number is a ratio between 0 and 1, false if is a percentage number between 0 an 100.
Return values
string
F_formatXMLPercentage()
File: tce_functions_general.php line 516
F_formatXMLPercentage(mixed $num[, mixed $ratio = true ]) : stringParameters
- $num : mixed: (float) number to be formatted
- $ratio : mixed = true: (boolean) Set to true if the number is a ratio between 0 and 1, false if is a percentage number between 0 an 100.
Return values
string
F_getUTCoffset()
File: tce_functions_general.php line 530
F_getUTCoffset(mixed $timezone) : intParameters
- $timezone : mixed: (string) current user timezone
Return values
int —
UTC time offset in seconds
F_db_getUTCoffset()
File: tce_functions_general.php line 542
F_db_getUTCoffset(mixed $timezone) : stringParameters
- $timezone : mixed: (string) current user timezone
Return values
string —
UTC time offset (+HH:mm)
getDataXML()
File: tce_functions_general.php line 555
getDataXML(mixed $data[, mixed $level = 1 ]) : stringParameters
- $data : mixed: (array) Array of data (key => value).
- $level : mixed = 1: (int) Indentation level.
Return values
string —
XML data
getDataTSVHeader()
File: tce_functions_general.php line 585
getDataTSVHeader(mixed $data[, mixed $prefix = '' ]) : stringParameters
- $data : mixed: (array) Array of data (key => value).
- $prefix : mixed = ‘’: (string) Prefix to add to keys.
Return values
string —
data
getDataTSV()
File: tce_functions_general.php line 604
getDataTSV(mixed $data) : stringParameters
- $data : mixed: (array) Array of data.
Return values
string —
XML data
F_html_to_TSV()
File: tce_functions_general.php line 623
F_html_to_TSV(mixed $str) : stringParameters
- $str : mixed: (string) HTML string to convert.
Return values
string —
TSV
F_select_table_header_element()
File: tce_functions_general.php line 678
F_select_table_header_element(mixed $order_field, mixed $orderdir, mixed $title, mixed $name[, mixed $current_order_field = '' ][, mixed $filter = '' ]) : tableParameters
- $order_field : mixed: (string) name of table field
- $orderdir : mixed: (string) order direction
- $title : mixed: title (string) field of anchor link
- $name : mixed: column (string) name
- $current_order_field : mixed = ‘’: (string) current order field name
- $filter : mixed = ‘’: (string) additional parameters to pass on URL
Return values
table —
header element string
getContrastColor()
File: tce_functions_general.php line 716
getContrastColor(mixed $color) : stringParameters
- $color : mixed: (string) color in HEX format.
Return values
string —
Color.
F_isURL()
File: tce_functions_general.php line 737
F_isURL(mixed $str) : boolParameters
- $str : mixed: (string) String to check.
Return values
bool —
true or false.
F_utf8_normalizer()
File: tce_functions_general.php line 750
F_utf8_normalizer(mixed $str[, mixed $mode = 'NONE' ]) : normalizedModes greater than 0 requires php5-intl module. Please edit this function to implement your custom normalization method.
Parameters
- $str : mixed: (string) UTF-8 string to normalize.
- $mode : mixed = ‘NONE’: (int) Normalization type: NONE=None; C=Normalization Form C (NFC) - Canonical Decomposition followed by Canonical Composition; D=Normalization Form D (NFD) - Canonical Decomposition; KC=Normalization Form KC (NFKC) - Compatibility Decomposition, followed by Canonical Composition; KD=Normalization Form KD (NFKD) - Compatibility Decomposition; CUSTOM=Custom normalization using user defined function ‘user_utf8_custom_normalizer’.
Return values
normalized —
string using the specified algorithm.
bcdechex()
File: tce_functions_general.php line 803
bcdechex(string|int $dec) : stringParameters
- $dec : string|int: Decimal number to convert.
Tags
- author: Nicola Asuni
- since: 2013-07-02
Return values
string —
containing the HEX representation in uppercase.
F_html_to_text()
File: tce_functions_html2txt.php line 30
F_html_to_text(mixed $str[, mixed $preserve_newlines = false ][, mixed $display_links = false ]) : textParameters
- $str : mixed: (string) HTML code string to convert.
- $preserve_newlines : mixed = false: (boolean) If true convert newline characters to HTML line breaks.
- $display_links : mixed = false: (boolean) If true gives a textual representation of links and images.
Return values
text —
string
F_menu_link()
File: tce_functions_menu.php line 30
F_menu_link(mixed $link, mixed $data[, mixed $level = 0 ]) : mixedIf the link refers to the current page, only the name will be returned.
Parameters
- $link : mixed: (string) URL
- $data : mixed: (array) link data
- $level : mixed = 0: (int) item level
F_menu_isChildActive()
File: tce_functions_menu.php line 75
F_menu_isChildActive(mixed $data) : mixedParameters
- $data : mixed: (array) link data
F_getRandomOTPkey()
File: tce_functions_otp.php line 27
F_getRandomOTPkey() : Base32Return values
Base32 —
encoded key.
F_decodeBase32()
File: tce_functions_otp.php line 45
F_decodeBase32(mixed $code) : DecodedParameters
- $code : mixed: (string) Base32 code to be decoded.
Return values
Decoded —
key.
F_getOTP()
File: tce_functions_otp.php line 75
F_getOTP(mixed $otpkey[, mixed $mtime = 0 ]) : OTPParameters
- $otpkey : mixed: (string) One Time Password secret key.
- $mtime : mixed = 0: (int) Reference time in microseconds.
Return values
OTP
F_show_page_navigator()
File: tce_functions_page.php line 32
F_show_page_navigator(mixed $script_name, mixed $sql, mixed $firstrow, mixed $rowsperpage, mixed $param_array) : mixedParameters
- $script_name : mixed: (string) url of the calling page
- $sql : mixed: (string) sql used to select records
- $firstrow : mixed: (int) first row number
- $rowsperpage : mixed: (int) number of max rows per page
- $param_array : mixed: (string) parameters to pass on url via GET
Return values
mixed —
the number of pages in case of success, FALSE otherwise
F_session_string_to_array()
File: tce_functions_session.php line 212
F_session_string_to_array(mixed $sd) : array<string|int, mixed>Parameters
- $sd : mixed: (string) input data string
Tags
- author: Nicola Asuni
- since: 2001-10-18
Return values
array<string|int, mixed>
getClientFingerprint()
File: tce_functions_session.php line 232
getClientFingerprint() : stringTags
- author: Nicola Asuni
- since: 2010-10-04
Return values
string —
client ID
getNewSessionID()
File: tce_functions_session.php line 268
getNewSessionID() : stringTags
- author: Nicola Asuni
- since: 2010-10-04
Return values
string —
PHPSESSID
getPasswordHash()
File: tce_functions_session.php line 278
getPasswordHash(mixed $password) : stringParameters
- $password : mixed: (string) Password to hash.
Return values
string —
password hash
checkPassword()
File: tce_functions_session.php line 290
checkPassword(mixed $password, mixed $hash) : boolParameters
- $password : mixed: (string) The password to verify
- $hash : mixed: (string) Password hash
Return values
bool
F_isRandomSecurityConfigured()
File: tce_functions_session.php line 304
F_isRandomSecurityConfigured([mixed $secret = null ]) : boolSecurity-sensitive checks that rely on the secrecy of K_RANDOM_SECURITY (e.g. the result-access token that bypasses the normal authorization check) MUST fail closed when this returns false, otherwise an attacker who knows the public default can forge a valid token. The installer replaces the placeholder with a random value at install time.
Parameters
- $secret : mixed = null
Return values
bool —
true if the seed is configured, false if it is still the shipped default.
getPlainCSRFToken()
File: tce_functions_session.php line 321
getPlainCSRFToken() : stringReturn values
string
checkCSRFToken()
File: tce_functions_session.php line 333
checkCSRFToken(mixed $token) : boolParameters
- $token : mixed: (string) tocken to check
Return values
bool
F_getCSRFToken()
File: tce_functions_session.php line 343
F_getCSRFToken() : stringReturn values
string
F_decode_tcecode()
File: tce_functions_tcecode.php line 31
F_decode_tcecode(mixed $text_to_decode) : stringParameters
- $text_to_decode : mixed: (string) text to convert
Return values
string —
XHTML code
F_bbcode_to_tcecode()
File: tce_functions_tcecode.php line 109
F_bbcode_to_tcecode(mixed $text) : stringParameters
- $text : mixed
Return values
string
F_tcecode_url()
File: tce_functions_tcecode.php line 124
F_tcecode_url(mixed $text) : stringParameters
- $text : mixed
Return values
string
F_tcecode_tag()
File: tce_functions_tcecode.php line 162
F_tcecode_tag(mixed $text) : stringParameters
- $text : mixed
Return values
string
F_tcecode_tag_arg()
File: tce_functions_tcecode.php line 199
F_tcecode_tag_arg(mixed $text) : stringParameters
- $text : mixed
Return values
string
F_latex_callback()
File: tce_functions_tcecode.php line 236
F_latex_callback(mixed $matches) : stringReturns replacement image for LaTeX code.
Parameters
- $matches : mixed: (string) array containing matches: $matches[0] is the complete match, $matches[1] the match for the first subpattern enclosed in ‘(…)’ (the LaTeX code)
Return values
string —
replacement HTML code string to include the equivalent LaTeX image.
F_mathml_callback()
File: tce_functions_tcecode.php line 364
F_mathml_callback(mixed $matches) : stringReturns replacement code for MathML code.
Parameters
- $matches : mixed: (string) array containing matches: $matches[0] is the complete match, $matches[1] the match for the first subpattern enclosed in ‘(…)’ (the MathML code)
Return values
string —
MathML code.
F_objects_callback()
File: tce_functions_tcecode.php line 389
F_objects_callback(mixed $matches) : stringReturns replacement code by MIME type.
Parameters
- $matches : mixed: (string) array containing matches: $matches[0] is the complete match, $matches[1] the match for the first subpattern enclosed in ‘(…)’ and so on
Return values
string —
replacement string by file extension
F_objects_replacement()
File: tce_functions_tcecode.php line 420
F_objects_replacement(mixed $name, mixed $extension[, mixed $width = 0 ][, mixed $height = 0 ][, mixed $alt = '' ][, mixed &$maxwidth = 0 ][, mixed &$maxheight = 0 ]) : stringParameters
- $name : mixed: (string) object path excluded extension
- $extension : mixed: (string) object extension (e.g.: gif, jpg, swf, …)
- $width : mixed = 0: (int) object width
- $height : mixed = 0: (int) object height
- $alt : mixed = ‘’: (string) alternative content
- $maxwidth : mixed = 0: (int) object max or default width
- $maxheight : mixed = 0: (int) object max or default height
Return values
string —
replacement string
F_remove_tcecode()
File: tce_functions_tcecode.php line 545
F_remove_tcecode(mixed $str) : stringParameters
- $str : mixed: (string) text to process
Return values
string —
without tcecode markup tags
F_tcecodeToLine()
File: tce_functions_tcecode.php line 575
F_tcecodeToLine(mixed $str) : mixedParameters
- $str : mixed: (string) text to process return string
F_tcecodeToTitle()
File: tce_functions_tcecode.php line 601
F_tcecodeToTitle(mixed $str) : mixedParameters
- $str : mixed: (string) text to process return string
F_substrHTML()
File: tce_functions_tcecode.php line 618
F_substrHTML(mixed $htmltext[, mixed $min_length = 100 ][, mixed $offset_length = 20 ]) : mixedIt also prevents chopping while a tag is still open. this function is based on a public-domain script posted on www.php.net by fox@conskript.server and mr@bbp.biz
Parameters
- $htmltext : mixed: (string)
- $min_length : mixed = 100: (int) (default=100) the approximate length you want the concatenated text to be
- $offset_length : mixed = 20: (int) (default=20) the max variation in how long the text can be
F_getUserTests()
File: tce_functions_test.php line 28
F_getUserTests() : stringReturn values
string —
containing an XHTML table of user’s tests.
F_repeatTest()
File: tce_functions_test.php line 243
F_repeatTest(mixed $test_id) : mixedParameters
- $test_id : mixed: (int) Test ID
F_isValidIP()
File: tce_functions_test.php line 287
F_isValidIP(mixed $user_ip, mixed $test_ips) : boolParameters
- $user_ip : mixed: (string) user’s IP address (IPv4 or IPv6).
- $test_ips : mixed: (string) comma separated list of valid test IP addresses. The ‘*’ character may be used to indicate any number in IPv4 addresses. Intervals must be specified using the ‘-’ character.
Return values
bool —
true if IP is valid, false otherwise
F_isValidSSLCert()
File: tce_functions_test.php line 368
F_isValidSSLCert(mixed $test_id) : trueParameters
- $test_id : mixed: (int) Test ID
Return values
true —
if the client certifiate is valid, false otherwise
F_isValidTestUser()
File: tce_functions_test.php line 401
F_isValidTestUser(mixed $test_id, mixed $user_ip, mixed $test_ip) : trueParameters
- $test_id : mixed: (int) ID of the selected test
- $user_ip : mixed: (int) user’s IP address.
- $test_ip : mixed: (int) test IP valid addresses. Various IP addresses may be separated using comma character. The asterisk character may be used to indicate “any number”.
Return values
true —
if is user is authorized, false otherwise
F_terminateUserTest()
File: tce_functions_test.php line 435
F_terminateUserTest(mixed $test_id) : mixedParameters
- $test_id : mixed: (int) test ID
Tags
- since: 4.0.000 (2006-09-27)
F_countUserTest()
File: tce_functions_test.php line 464
F_countUserTest(mixed $user_id, mixed $test_id) : retriedParameters
- $user_id : mixed: (int) user ID
- $test_id : mixed: (int) test ID
Return values
retried —
times
F_checkTestStatus()
File: tce_functions_test.php line 479
F_checkTestStatus(mixed $user_id, mixed $test_id, mixed $duration) : array<string|int, mixed>Parameters
- $user_id : mixed: (int) user ID
- $test_id : mixed: (int) test ID
- $duration : mixed: (int) test duration in seconds
Return values
array<string|int, mixed> —
of (test_status_code, testuser_id). test_status_code:
- 0 = the test generation process is started but not completed;
- 1 = the test has been successfully created;
- 2 = all questions have been displayed to the user;
- 3 = all questions have been answered;
- 4 = test locked (for timeout);
- 5 or more = old version of repeated test;
F_testInfoLink()
File: tce_functions_test.php line 596
F_testInfoLink(mixed $test_id[, mixed $link_name = '' ]) : mixedParameters
- $test_id : mixed: (int) test ID
- $link_name : mixed = ‘’: (string) link caption return XHTML code
F_printTestInfo()
File: tce_functions_test.php line 630
F_printTestInfo(mixed $test_id[, mixed $showip = false ]) : stringParameters
- $test_id : mixed: (int) test ID
- $showip : mixed = false: (boolean) if true display enabled users’ IP range
Return values
string —
containing an XHTML code
F_getTestData()
File: tce_functions_test.php line 709
F_getTestData(mixed $test_id) : array<string|int, mixed>Parameters
- $test_id : mixed: (int) test ID.
Return values
array<string|int, mixed> —
containing test data.
F_getUserData()
File: tce_functions_test.php line 733
F_getUserData(mixed $user_id) : array<string|int, mixed>Parameters
- $user_id : mixed: (int) User ID.
Return values
array<string|int, mixed> —
containing test data.
F_getTestPassword()
File: tce_functions_test.php line 757
F_getTestPassword(mixed $test_id) : stringParameters
- $test_id : mixed: (int) test ID.
Return values
string —
test password or empty string in case of error.
F_getTestName()
File: tce_functions_test.php line 769
F_getTestName(mixed $test_id) : stringParameters
- $test_id : mixed: (int) test ID.
Return values
string —
test name or empty string in case of error.
F_getTestDuration()
File: tce_functions_test.php line 781
F_getTestDuration(mixed $test_id) : intParameters
- $test_id : mixed: (int) test ID
Return values
int —
test duration time in seconds
F_getTestStartTime()
File: tce_functions_test.php line 794
F_getTestStartTime(mixed $testuser_id) : intParameters
- $testuser_id : mixed: (int) user’s test ID
Return values
int —
start time in seconds
F_twoColRow()
File: tce_functions_test.php line 826
F_twoColRow([mixed $label = '' ][, mixed $description = '' ][, mixed $value = '' ]) : stringParameters
- $label : mixed = ‘’: (string) string to display on the left column
- $description : mixed = ‘’: (string) string to display on the title attribute of the left column field
- $value : mixed = ‘’: (string) string to display on the right column
Return values
string —
XHTML code
F_executeTest()
File: tce_functions_test.php line 847
F_executeTest(mixed $test_id) : trueParameters
- $test_id : mixed: (int) test ID.
Return values
true —
if user is authorized, false otherwise.
F_isRightTestlogUser()
File: tce_functions_test.php line 927
F_isRightTestlogUser(mixed $test_id, mixed $testlog_id) : boolParameters
- $test_id : mixed: (int) test ID
- $testlog_id : mixed: (int) test log ID
Return values
bool —
TRUE in case of success, FALSE otherwise
F_selectAnswers()
File: tce_functions_test.php line 964
F_selectAnswers(mixed $question_id[, mixed $isright = '' ][, mixed $ordering = false ][, mixed $limit = 0 ][, mixed $startindex = 0 ][, mixed $randorder = true ][, mixed $ordmode = 0 ]) : array<string|int, mixed>Parameters
- $question_id : mixed: (int) Question ID.
- $isright : mixed = ‘’: (int) Value (0 = false, 1 = true), if non-empty checks for answer_isright value on WHERE clause.
- $ordering : mixed = false: (int) Ordering type question (0 = false, 1 = true).
- $limit : mixed = 0: (int) Maximum number of IDs to return.
- $startindex : mixed = 0: (int) Array starting index (default = 0).
- $randorder : mixed = true: (boolean) If true user random order.
- $ordmode : mixed = 0: (int) Ordering mode: 0=position; 1=alphabetical; 2=ID.
Return values
array<string|int, mixed> —
id of selected answers
F_addLogAnswers()
File: tce_functions_test.php line 1055
F_addLogAnswers(mixed $testlog_id, mixed $answers_ids) : boolParameters
- $testlog_id : mixed: (int) testlog ID
- $answers_ids : mixed: (array) array of answer IDs to add
Return values
bool —
true in case of success, false otherwise
F_getFirstTestUser()
File: tce_functions_test.php line 1087
F_getFirstTestUser(mixed $test_id) : intParameters
- $test_id : mixed: (int) test ID
Return values
int —
testuser ID
F_newTestLog()
File: tce_functions_test.php line 1119
F_newTestLog(mixed $testuser_id, mixed $question_id, mixed $score, mixed $order[, mixed $num_answers = 0 ]) : intParameters
- $testuser_id : mixed: (int) ID of tce_tests_users
- $question_id : mixed: (int) question ID
- $score : mixed: (int) score for unanswered questions
- $order : mixed: (int) question display order
- $num_answers : mixed = 0: (int) number of alternative answers
Return values
int —
testlog ID
F_isTestOverLimits()
File: tce_functions_test.php line 1171
F_isTestOverLimits() : boolReturn values
bool —
true/false.
F_count_executed_tests()
File: tce_functions_test.php line 1225
F_count_executed_tests(mixed $startdate, mixed $enddate) : intParameters
- $startdate : mixed: (string) Star date-time interval.
- $enddate : mixed: (string) End date-time interval.
Return values
int —
number of executed tests.
F_updateTestuserStat()
File: tce_functions_test.php line 1249
F_updateTestuserStat(mixed $date) : mixedParameters
- $date : mixed: (string) date-time when the test was generated.
F_createTest()
File: tce_functions_test.php line 1265
F_createTest(mixed $test_id, mixed $user_id) : boolParameters
- $test_id : mixed: (int) test ID.
- $user_id : mixed: (int) user ID.
Return values
bool —
TRUE in case of success, FALSE otherwise.
F_addQuestionAnswers()
File: tce_functions_test.php line 1623
F_addQuestionAnswers(mixed $testlog_id, mixed $question_id, mixed $question_type, mixed $num_answers, mixed $firsttest, mixed $testdata) : boolParameters
- $testlog_id : mixed: (int) testlog ID.
- $question_id : mixed: (int) question ID.
- $question_type : mixed: (int) type of question.
- $num_answers : mixed: (int) number of alternative answers to display.
- $firsttest : mixed: (int) ID of first test testuser_id.
- $testdata : mixed: (array) array of test data.
Return values
bool —
TRUE in case of success, FALSE otherwise.
F_updateQuestionLog()
File: tce_functions_test.php line 1741
F_updateQuestionLog(mixed $test_id, mixed $testlog_id[, mixed $answpos = [] ][, mixed $answer_text = '' ][, mixed $reaction_time = 0 ]) : boolParameters
- $test_id : mixed: (int) test ID
- $testlog_id : mixed: (int) test log ID
- $answpos : mixed = []: (array) Array of answer positions
- $answer_text : mixed = ‘’: (string) answer text
- $reaction_time : mixed = 0: (int) reaction time in milliseconds
Return values
bool —
TRUE in case of success, FALSE otherwise
F_getAnswerIdFromPosition()
File: tce_functions_test.php line 2012
F_getAnswerIdFromPosition(mixed $testlog_id, mixed $answpos) : intParameters
- $testlog_id : mixed: (int) Test Log ID
- $answpos : mixed: (array) Answer positions (order in wich they are displayed)
Return values
int —
answer ID
F_questionForm()
File: tce_functions_test.php line 2051
F_questionForm(mixed $test_id, mixed $testlog_id, mixed $formname) : stringParameters
- $test_id : mixed: (int) test ID
- $testlog_id : mixed: (int) test log ID
- $formname : mixed: (string) form name (form ID)
Return values
string —
XHTML code
F_questionsMenu()
File: tce_functions_test.php line 2501
F_questionsMenu(mixed $testdata, mixed $testuser_id[, mixed $testlog_id = 0 ][, mixed $disable = false ]) : stringParameters
- $testdata : mixed: (array) test data
- $testuser_id : mixed: (int) user’s test ID
- $testlog_id : mixed = 0: (int) test log ID
- $disable : mixed = false: (boolean) if TRUE disable the questions list.
Return values
string —
XHTML code
F_getNumOmittedQuestions()
File: tce_functions_test.php line 2693
F_getNumOmittedQuestions(mixed $test_id) : intParameters
- $test_id : mixed: (int) test ID
Return values
int —
number
F_testComment()
File: tce_functions_test.php line 2717
F_testComment(mixed $test_id) : stringParameters
- $test_id : mixed: (int) test ID
Tags
- since: 4.0.000 (2006-10-01)
Return values
string —
XHTML code
F_updateTestComment()
File: tce_functions_test.php line 2772
F_updateTestComment(mixed $test_id, mixed $testcomment) : stringParameters
- $test_id : mixed: (int) test ID
- $testcomment : mixed: (string) user comment.
Tags
- since: 4.0.000 (2006-10-01)
Return values
string —
XHTML code
F_testLoginForm()
File: tce_functions_test.php line 2814
F_testLoginForm(mixed $faction, mixed $fid, mixed $fmethod, mixed $fenctype, mixed $test_id) : XHTMLParameters
- $faction : mixed
- $fid : mixed
- $fmethod : mixed
- $fenctype : mixed
- $test_id : mixed
Return values
XHTML —
string for login form
F_getTestGroups()
File: tce_functions_test.php line 2872
F_getTestGroups(mixed $test_id) : stringParameters
- $test_id : mixed: (int) ID of the selected test
Return values
string —
containing a comma separated list fo group IDs.
F_getTestSSLCerts()
File: tce_functions_test.php line 2901
F_getTestSSLCerts(mixed $test_id) : stringParameters
- $test_id : mixed: (int) ID of the selected test
Return values
string —
containing a comma separated list SSL certificates IDs.
F_getUserTestStat()
File: tce_functions_test_stats.php line 31
F_getUserTestStat(mixed $test_id[, mixed $user_id = 0 ][, mixed $testuser_id = 0 ][, mixed $pubmode = false ]) : mixedParameters
- $test_id : mixed: (int) test ID.
- $user_id : mixed = 0: (int) user ID - if greater than zero, filter stats for the specified user.
- $testuser_id : mixed = 0: (int) test-user ID - if greater than zero, filter stats for the specified test-user.
- $pubmode : mixed = false: (boolean) If true filter the results for the public interface. return $data array containing test-user statistics.
F_getUserTestTotals()
File: tce_functions_test_stats.php line 52
F_getUserTestTotals(mixed $test_id[, mixed $user_id = 0 ][, mixed $testuser_id = 0 ][, mixed $pubmode = false ]) : mixedParameters
- $test_id : mixed: (int) test ID.
- $user_id : mixed = 0: (int) user ID - if greater than zero, filter stats for the specified user.
- $testuser_id : mixed = 0: (int) test-user ID - if greater than zero, filter stats for the specified test-user.
- $pubmode : mixed = false: (boolean) If true filter the results for the public interface. return $data array containing test-user statistics.
F_getTestStat()
File: tce_functions_test_stats.php line 119
F_getTestStat(mixed $test_id[, mixed $group_id = 0 ][, mixed $user_id = 0 ][, mixed $startdate = 0 ][, mixed $enddate = 0 ][, mixed $testuser_id = 0 ][, mixed $pubmode = false ]) : mixedParameters
- $test_id : mixed: (int) test ID.
- $group_id : mixed = 0: (int) group ID - if greater than zero, filter stats for the specified user group.
- $user_id : mixed = 0: (int) user ID - if greater than zero, filter stats for the specified user.
- $startdate : mixed = 0: (int) start date ID - if greater than zero, filter stats for the specified starting date
- $enddate : mixed = 0: (int) end date ID - if greater than zero, filter stats for the specified ending date
- $testuser_id : mixed = 0: (int) test-user ID - if greater than zero, filter stats for the specified test-user.
- $pubmode : mixed = false: (boolean) If true filter the results for the public interface. return $data array containing test statistics.
F_getRawTestStat()
File: tce_functions_test_stats.php line 148
F_getRawTestStat(mixed $test_id[, mixed $group_id = 0 ][, mixed $user_id = 0 ][, mixed $startdate = 0 ][, mixed $enddate = 0 ][, mixed $testuser_id = 0 ][, mixed $data = [] ][, mixed $pubmode = false ]) : mixedParameters
- $test_id : mixed: (int) test ID.
- $group_id : mixed = 0: (int) group ID - if greater than zero, filter stats for the specified user group.
- $user_id : mixed = 0: (int) user ID - if greater than zero, filter stats for the specified user.
- $startdate : mixed = 0: (int) start date ID - if greater than zero, filter stats for the specified starting date
- $enddate : mixed = 0: (int) end date ID - if greater than zero, filter stats for the specified ending date
- $testuser_id : mixed = 0: (int) test-user ID - if greater than zero, filter stats for the specified test-user.
- $data : mixed = []: (array) Array of existing data to be merged with the current one.
- $pubmode : mixed = false: (boolean) If true filter the results for the public interface. return $data array containing test statistics.
F_normalizeTestStatAverages()
File: tce_functions_test_stats.php line 682
F_normalizeTestStatAverages(mixed $data) : mixedParameters
- $data : mixed: (array) Raw data array. return $data (array) Processed array.
F_printTestStat()
File: tce_functions_test_stats.php line 798
F_printTestStat(mixed $test_id[, mixed $group_id = 0 ][, mixed $user_id = 0 ][, mixed $startdate = 0 ][, mixed $enddate = 0 ][, mixed $testuser_id = 0 ][, mixed $ts = [] ][, mixed $display_mode = 2 ][, mixed $pubmode = false ]) : mixedParameters
- $test_id : mixed: (int) test ID.
- $group_id : mixed = 0: (int) group ID - if greater than zero, filter stats for the specified user group.
- $user_id : mixed = 0: (int) user ID - if greater than zero, filter stats for the specified user.
- $startdate : mixed = 0: (int) start date ID - if greater than zero, filter stats for the specified starting date
- $enddate : mixed = 0: (int) end date ID - if greater than zero, filter stats for the specified ending date
- $testuser_id : mixed = 0: (int) test-user ID - if greater than zero, filter stats for the specified test-user.
- $ts : mixed = []: (array) array of stats to print (leave empty to automatically generate new data).
- $display_mode : mixed = 2: display (int) mode: 0 = disabled; 1 = minimum; 2 = module; 3 = subject; 4 = question; 5 = answer.
- $pubmode : mixed = false: (boolean) If true filter the results for the public interface. return $data string containing HTML table.
F_printTestResultStat()
File: tce_functions_test_stats.php line 1262
F_printTestResultStat(mixed $data, mixed $nextorderdir, mixed $order_field, mixed $filter[, mixed $pubmode = false ][, mixed $stats = 1 ]) : mixedParameters
- $data : mixed: (array) Array containing test statistics.
- $nextorderdir : mixed: (int) next order direction.
- $order_field : mixed: (string) order fields.
- $filter : mixed: (string) filter string for URLs.
- $pubmode : mixed = false: (boolean) If true filter the results for the public interface.
- $stats : mixed = 1: (int) 2 = full stats; 1 = user stats; 0 = disabled stats; return HTML table string.
F_printUserTestStat()
File: tce_functions_test_stats.php line 1624
F_printUserTestStat(mixed $testuser_id) : mixedParameters
- $testuser_id : mixed: (int) test-user ID - if greater than zero, filter stats for the specified test-user. return $data string containing HTML table.
F_getAllUsersTestStat()
File: tce_functions_test_stats.php line 1829
F_getAllUsersTestStat(mixed $test_id[, mixed $group_id = 0 ][, mixed $user_id = 0 ][, mixed $startdate = 0 ][, mixed $enddate = 0 ][, mixed $full_order_field = 'total_score' ][, mixed $pubmode = false ][, mixed $stats = 2 ]) : mixedParameters
- $test_id : mixed: (int) test ID.
- $group_id : mixed = 0: (int) group ID - if greater than zero, filter stats for the specified user group.
- $user_id : mixed = 0: (int) user ID - if greater than zero, filter stats for the specified user.
- $startdate : mixed = 0: (string) start date ID - if greater than zero, filter stats for the specified starting date
- $enddate : mixed = 0: (string) end date ID - if greater than zero, filter stats for the specified ending date
- $full_order_field : mixed = ’total_score’: (string) Ordering fields for SQL query.
- $pubmode : mixed = false: (boolean) If true filter the results for the public interface.
- $stats : mixed = 2: (int) 2 = full stats; 1 = user stats; 0 = disabled stats; return $data array containing test statistics.
F_getSafeUsersTestStatOrderBy()
File: tce_functions_test_stats.php line 2071
F_getSafeUsersTestStatOrderBy(mixed $full_order_field) : stringParameters
- $full_order_field : mixed: Raw ORDER BY input.
Return values
string
F_lockUserTest()
File: tce_functions_test_stats.php line 2116
F_lockUserTest(mixed $test_id, mixed $user_id) : mixedParameters
- $test_id : mixed: (int) test ID
- $user_id : mixed: (int) user ID
F_getTestIDResults()
File: tce_functions_test_stats.php line 2144
F_getTestIDResults(mixed $test_id, mixed $user_id) : stringParameters
- $test_id : mixed: (int) Test ID.
- $user_id : mixed
Return values
string
F_getTestIDReports()
File: tce_functions_test_stats.php line 2154
F_getTestIDReports(mixed $test_id, mixed $user_id) : stringParameters
- $test_id : mixed: (int) Test ID.
- $user_id : mixed
Return values
string
F_getTestIDs()
File: tce_functions_test_stats.php line 2164
F_getTestIDs(mixed $test_id, mixed $user_id[, mixed $filter = 'test_results_to_users' ]) : stringParameters
- $test_id : mixed: (int) Test ID.
- $user_id : mixed
- $filter : mixed = ’test_results_to_users’
Return values
string
F_send_user_reg_email()
File: tce_functions_user_registration.php line 29
F_send_user_reg_email(mixed $user_id, mixed $user_email, mixed $user_verifycode) : mixedParameters
- $user_id : mixed: (int) User ID
- $user_email : mixed: (string) User email
- $user_verifycode : mixed: (string) user verification code