API Documentation
Table of Contents
Classes
Constants
- HEAD_MAGNIFICATION = 1.1
- magnification factor for titles
- K_ADMIN_LINK = 5
- Required user's level to display a link for administration area
- K_ADMIN_THEME = 'default'
- Theme for the admin area
- K_ALLOWED_ERROR_TAGS = '<a><b><br><em><p><ol><ul><li><small><table><tr><th><td>'
- HTML tags that are allowed in an error message.
- K_ALLOWED_TCPDF_TAGS = ''
- List of TCPDF methods that are allowed to be called using HTML syntax.
- K_ALLOWED_UPLOAD_EXTENSIONS = \serialize(array('csv', 'tsv', 'xml', 'txt', 'png', 'gif', 'jpg', 'jpeg', 'svg', 'mp3', 'mid', 'oga', 'ogg', 'wav', 'wma', 'avi', 'flv', 'm2v', 'mpeg', 'mpeg4', 'mpg', 'mpg2', 'mpv', 'ogm', 'ogv', 'vid', 'pfx', 'pem', 'crt'))
- List of allowed file types for upload (remove all extensions to disable upload).
- K_ANSWER_TEXTAREA_COLS = 70
- Number of columns for answer textarea.
- K_ANSWER_TEXTAREA_ROWS = 15
- Number of rows for answer textarea.
- K_AUTH_ADMIN_ANSWERS = \K_AUTH_OPERATOR
- Required user's level to access "answer editor".
- K_AUTH_ADMIN_DIRS = \K_AUTH_OPERATOR
- Required user's level to create and delete directories.
- K_AUTH_ADMIN_FILEMANAGER = \K_AUTH_OPERATOR
- Required user's level to access file manager for multimedia files.
- K_AUTH_ADMIN_GROUPS = \K_AUTH_ADMINISTRATOR
- Required user's level to access "group editor".
- K_AUTH_ADMIN_IMPORT = \K_AUTH_ADMINISTRATOR
- Required user's level to import questions.
- K_AUTH_ADMIN_INFO = 0
- Required user's level to access "TCExam information".
- K_AUTH_ADMIN_MODULES = \K_AUTH_OPERATOR
- Required user's level to access "module editor".
- K_AUTH_ADMIN_OMR_IMPORT = \K_AUTH_OPERATOR
- Required user's level to import OMR answers.
- K_AUTH_ADMIN_ONLINE_USERS = \K_AUTH_OPERATOR
- Required user's level to display online users.
- K_AUTH_ADMIN_QUESTIONS = \K_AUTH_OPERATOR
- Required user's level to access "question editor".
- K_AUTH_ADMIN_RATING = \K_AUTH_OPERATOR
- Required user's level to manually rate free text answers.
- K_AUTH_ADMIN_RESULTS = \K_AUTH_OPERATOR
- Required user's level to display results.
- K_AUTH_ADMIN_SSLCERT = \K_AUTH_OPERATOR
- Required user's level to edit SSL certificates.
- K_AUTH_ADMIN_SUBJECTS = \K_AUTH_OPERATOR
- Required user's level to access "subject editor".
- K_AUTH_ADMIN_TCECODE = \K_AUTH_OPERATOR
- Required user's level to access "tcecode editor".
- K_AUTH_ADMIN_TESTS = \K_AUTH_OPERATOR
- Required user's level to access "test editor".
- K_AUTH_ADMIN_UPLOAD_IMAGES = \K_AUTH_OPERATOR
- Required user's level to upload images.
- K_AUTH_ADMIN_USERS = \K_AUTH_ADMINISTRATOR
- Required user's level to access "user editor".
- K_AUTH_ADMINISTRATOR = 10
- Administrator level.
- K_AUTH_BACKUP = \K_AUTH_ADMINISTRATOR
- Required user's level to import questions.
- K_AUTH_DELETE_GROUPS = \K_AUTH_ADMINISTRATOR
- Required user's level to delete user groups.
- K_AUTH_DELETE_MEDIAFILE = \K_AUTH_OPERATOR
- Required user's level to delete multimedia files.
- K_AUTH_DELETE_USERS = \K_AUTH_ADMINISTRATOR
- Required user's level to delete users.
- K_AUTH_EXPORT_USERS = \K_AUTH_ADMINISTRATOR
- Required user's level to export users.
- K_AUTH_IMPORT_USERS = \K_AUTH_ADMINISTRATOR
- Required user's level to import users.
- K_AUTH_INDEX = \K_AUTH_OPERATOR
- Required user's level to access index page.
- K_AUTH_MOVE_GROUPS = \K_AUTH_ADMINISTRATOR
- Required user's level to move users from one group to another.
- K_AUTH_OPERATOR = 5
- Operator level.
- K_AUTH_PAGE_USER = 1
- Required user's level to access user page submenu
- K_AUTH_PUBLIC_INDEX = 1
- Required user's level to access index page.
- K_AUTH_PUBLIC_TEST_EXECUTE = 1
- Required user's level to execute a test
- K_AUTH_PUBLIC_TEST_INFO = 1
- Required user's level to view test general information
- K_AUTH_PUBLIC_TEST_RESULTS = 1
- Required user's level to view test results
- K_AUTH_RENAME_MEDIAFILE = \K_AUTH_OPERATOR
- Required user's level to rename multimedia files.
- K_AUTH_SSL_LEVEL = \false
- Minimum page level for which a valid client SSL certificate is required.
- K_AUTH_SSL_LEVEL = \false
- Minimum page level for which a valid client SSL certificate is required.
- K_AUTH_SSLIDS = ''
- Comma separated lit of SSL certificates IDs required to access pages with K_AUTH_SSL_LEVEL level or more.
- K_AUTH_SSLIDS = ''
- Comma separated lit of SSL certificates IDs required to access pages with K_AUTH_SSL_LEVEL level or more.
- K_AUTH_USER_CHANGE_EMAIL = 1
- Required user's level to change email
- K_AUTH_USER_CHANGE_PASSWORD = 1
- Required user's level to change password
- K_AVAILABLE_FONTS = \serialize(array('courier' => 'courier', 'helvetica' => 'helvetica', 'times' => 'times', 'symbol' => 'symbol', 'zapfdingbats' => 'zapfdingbats', 'DejaVuSans' => 'dejavusans,sans', 'DejaVuSansCondensed' => 'dejavusanscondensed,sans', 'DejaVuSansMono' => 'dejavusansmono,monospace', 'DejaVuSerif' => 'dejavuserif,serif', 'DejaVuSerifCondensed' => 'dejavuserifcondensed,serif', 'FreeMono' => 'freemono,monospace', 'FreeSans' => 'freesans,sans', 'FreeSerif' => 'freeserif,serif'))
- Defines a serialized array of available fonts for PDF.
- K_AVAILABLE_LANGUAGES = \serialize(array('ar' => 'Arabian', 'az' => 'Azerbaijani', 'bg' => 'Bulgarian', 'br' => 'Brazilian Portuguese', 'cn' => 'Chinese', 'de' => 'German', 'el' => 'Greek', 'en' => 'English', 'es' => 'Spanish', 'fa' => 'Farsi', 'fr' => 'French', 'he' => 'Hebrew', 'hi' => 'Hindi', 'hu' => 'Hungarian', 'id' => 'Indonesian', 'it' => 'Italian', 'jp' => 'Japanese', 'mr' => 'Marathi', 'ms' => 'Malay (Bahasa Melayu)', 'nl' => 'Dutch', 'pl' => 'Polish', 'ro' => 'Romanian', 'ru' => 'Russian', 'tr' => 'Turkish', 'ur' => 'Urdu', 'vn' => 'Vietnamese'))
- Defines a serialized array of available languages.
- K_BLANK_IMAGE = \K_PATH_IMAGES . '_blank.png'
- Full path to a blank image.
- K_BRUTE_FORCE_DELAY_RATIO = 2
- Ratio at which the delay will be increased after every failed login attempt.
- K_CAS_ENABLED = \false
- If true enable CAS
- K_CAS_HOST = ''
- CAS server hostname.
- K_CAS_PATH = '/cas'
- The location on the webserver where the CAS application is hosted.
- K_CAS_PORT = 443
- The port to connect to.
- K_CAS_USER_GROUP_ID = 1
- Default user group ID This is the TCExam group ID to which the CAS accounts belongs.
- K_CAS_USER_LEVEL = 1
- Default user level
- K_CAS_VERSION = '2.0'
- Version of CAS protocol to use.
- K_CELL_HEIGHT_RATIO = 1.25
- height of cell repect font height
- K_CHECK_SESSION_FINGERPRINT = \true
- If true, check for possible session hijacking (set to false if you have login problems).
- K_CLOCK_IN_UTC = \false
- If true display admin clock in UTC (GMT).
- K_COOKIE_DOMAIN = ''
- Cookie domain.
- K_COOKIE_EXPIRE = \K_SECONDS_IN_DAY
- Expiration time for cookies.
- K_COOKIE_HTTPONLY = \true
- When true the cookie will be made accessible only through the HTTP protocol.
- K_COOKIE_PATH = '/'
- Cookie path.
- K_COOKIE_SAMESITE = 'Strict'
- The SameSite attribute lets servers specify whether/when cookies are sent with cross-site requests.
- K_COOKIE_SECURE = \true
- If true use secure cookies.
- K_CUSTOM_AUTH_BASIC_PASSWORD_HASH = ''
- Custom user's Password hash generated with https://www.php.net/manual/en/function.crypt.php
- K_CUSTOM_AUTH_BASIC_USER_GROUP_ID = 1
- Custom user group ID.
- K_CUSTOM_AUTH_BASIC_USER_LEVEL = 1
- Custom user level.
- K_CUSTOM_AUTH_BASIC_USERNAME = ''
- Custom user name.
- K_CUSTOM_AUTH_METHODS = \serialize(array())
- Lisf of enabled custom authentication methods.
- K_DATABASE_HOST = ''
- database Host name (eg: localhost)
- K_DATABASE_NAME = ''
- database name (TCExam)
- K_DATABASE_PORT = ''
- database port (eg: 3306, 5432, 1521)
- K_DATABASE_TYPE = ''
- database type (MYSQL, POSTGRESQL, ORACLE)
- K_DATABASE_USER_NAME = ''
- database user name
- K_DATABASE_USER_PASSWORD = ''
- database user password
- K_DIGSIG_CERT_TYPE = '1'
- The access permissions granted for this document.
- K_DIGSIG_CERTIFICATE = 'file://../../shared/config/tcpdf.crt'
- Signing certificate (string or filename prefixed with 'file://').
- K_DIGSIG_CONTACT = 'you@example.com'
- Information provided by the signer to enable a recipient to contact the signer to verify the signature; for example, a phone number or email address.
- K_DIGSIG_ENABLE = \false
- If true digitally sign PDF documents.
- K_DIGSIG_EXTRA_CERTS = ''
- Name of a file containing a bunch of extra certificates to include in the signature which can for example be used to help the recipient to verify the certificate that you used.
- K_DIGSIG_LOCATION = 'Office'
- The CPU host name or physical location of the signing.
- K_DIGSIG_NAME = 'TCEXAM'
- The name of the person or authority signing the document.
- K_DIGSIG_PASSWORD = 'tcpdfdemo'
- Password for private key.
- K_DIGSIG_PRIVATE_KEY = 'file://../../shared/config/tcpdf.crt'
- Private key (string or filename prefixed with 'file://').
- K_DIGSIG_REASON = 'Certification'
- The reason for the signing, such as ( I agree ...).
- K_DISPLAY_PDFTEXT_BUTTON = \false
- If true display an additional button to print only the TEXT answers on all users' results.
- K_DISPLAY_TEST_DESCRIPTION = \true
- If true display test description before executing the test.
- K_DOWNLOAD_BACKUPS = \true
- If true enable the backup download.
- K_EMAIL_RE_PATTERN = '^([a-zA-Z0-9_\\.\\-\\+\\%]+)@([a-zA-Z0-9\\.\\-]+)$'
- K_ENABLE_ANSWER_EXPLANATION = \true
- If true enable explanation field for answers.
- K_ENABLE_CUSTOM_EXPORT = ''
- Name of the button to export results in custom format (file: admin/code/tce_export_custom.php).
- K_ENABLE_CUSTOM_IMPORT = ''
- Name of the option to import questions using a custom format (file: admin/code/tce_import_custom.php).
- K_ENABLE_JSERRORS = \false
- If true display messages and errors on Javascript popup window.
- K_ENABLE_PUBLIC_PDF = \true
- Enable PDF results on public area.
- K_ENABLE_QUESTION_EXPLANATION = \true
- If true enable explanation field for questions.
- K_ENABLE_VIRTUAL_KEYBOARD = \true
- If true enable virtual keyboard on some textarea fields.
- K_ERROR_TYPES = \E_ALL | \E_STRICT
- Define error reporting types for debug.
- K_EXTEND_TIME_MINUTES = 5
- Default minutes used to extend test duration.
- K_HIDE_EXPIRED_TESTS = \false
- If true hide the expired tests from index table.
- K_HTTPBASIC_ENABLED = \false
- If true trust HTTP Basic Auth
- K_HTTPBASIC_USER_GROUP_ID = 1
- Default user group ID This is the TCExam group id to which the accounts belong.
- K_HTTPBASIC_USER_LEVEL = 1
- Default user level
- K_KEY_SECURITY = 'VENFeGFtIChjKSAyMDA0LTIwMjAgTmljb2xhIEFzdW5pIC0gVGVjbmljay5jb20gLSB0Y2V4YW0uY29t'
- String used for security feature, do not alter.
- K_LANGUAGE = 'en'
- 2-letters code for default language.
- K_LANGUAGE_SELECTOR = \true
- If true, display a language selector.
- K_LATEX_CLASS = 'article'
- LaTeX class (article).
- K_LATEX_FONT_SIZE = 10
- Font size (10).
- K_LATEX_FORMULA_DENSITY = 120
- Formula density used by ImageMagick (120).
- K_LATEX_IMG_FORMAT = 'png'
- Image format (png).
- K_LATEX_IMG_PREFIX = 'latex_'
- Filename prefix for chached images (latex_).
- K_LATEX_MAX_HEIGHT = 800
- Image height limit in pixels (500).
- K_LATEX_MAX_LENGHT = 500
- Size limit for input string (500).
- K_LATEX_MAX_WIDTH = 800
- Image width limit in pixels (500).
- K_LATEX_PATH_CONVERT = '/usr/bin/convert'
- Path to ImageMagick convert (/usr/bin/convert).
- K_LATEX_PATH_PICTURE = \K_PATH_CACHE
- Absolute path to images directory.
- K_LATEX_PATH_PICTURE_HTTPD = \K_PATH_URL_CACHE
- relative path to images directory.
- K_LATEX_PDFLATEX = '/usr/bin/pdflatex'
- Path to PDFLATEX (/usr/bin/pdflatex).
- K_LDAP_BASE_DN = 'ou=users,dc=mydom,dc=example,dc=org'
- The base DN for the directory.
- K_LDAP_ENABLED = \false
- If true enable LDAP.
- K_LDAP_FILTER = 'uid=#USERNAME#'
- The search filter can be simple or advanced, using boolean operators in the format described in the LDAP documentation. Use "#USERNAME#" as a placeholder for the username passed by login form. For W2K3 use: "(sAMAccountName=#USERNAME#)"
- K_LDAP_HOST = 'localhost'
- LDAP hostname. If you are using OpenLDAP 2.x.x you can specify a URL instead of the hostname. To use LDAP with SSL, compile OpenLDAP 2.x.x with SSL support, configure PHP with SSL, and set this parameter as ldaps://hostname/.
- K_LDAP_PORT = 389
- The port to connect to. Not used when using URLs.
- K_LDAP_PROTOCOL_VERSION = 3
- LDAP protocol version.
- K_LDAP_ROOT_DN = \null
- The DN for the ROOT Account Set to null for anonymous LDAP binding
- K_LDAP_ROOT_PASS = \null
- The password for the ROOT Account Set to null for anonymous LDAP binding
- K_LDAP_USER_GROUP_ID = 1
- Default user group ID.
- K_LDAP_USER_LEVEL = 1
- Default user level
- K_LDAP_UTF8 = \true
- Set to true if LDAP uses UTF-8 encoding.
- K_LOGOUT_URL = ''
- URL to be redirected at logout (leave empty for default).
- K_MAIN_PAGE = 'index.php'
- Main page (homepage).
- K_MAX_MEMORY_LIMIT = '512M'
- Max memory limit.
- K_MAX_MEMORY_LIMIT = '32M'
- Max memory limit for a PHP script.
- K_MAX_ROWS_PER_PAGE = 50
- Max number of rows to display in tables.
- K_MAX_ROWS_PER_PAGE = 50
- Max number of rows to display in tables.
- K_MAX_TESTS_DAY = \false
- Maximum number of tests per day (last 24 hours).
- K_MAX_TESTS_MONTH = \false
- Maximum number of tests per month (last 30 days).
- K_MAX_TESTS_YEAR = \false
- Maximum number of tests per year (last 365 days).
- K_MAX_UPLOAD_SIZE = 25000000
- Max size to be uploaded in bytes.
- K_MAX_UPLOAD_SIZE = 1000000
- Max file size to be uploaded [bytes].
- K_MYSQL_QA_BIN_UNIQUITY = \true
- If true check the unicity of question and answer descriptions using utf8_bin collation when using MySQL.
- K_NEWLINE = "\n"
- New line character.
- K_OMR_PATH_ZBARIMG = '/usr/bin/zbarimg'
- Path to zbarimg executable (/usr/bin/zbarimg).
- K_OTP_LOGIN = \false
- If true enable One-Time-Password authentication on login.
- K_PASSWORD_RESET = \true
- If true enable password reset feature.
- K_PATH_BACKUP = \K_PATH_MAIN . 'admin/backup/'
- Full path to backup directory.
- K_PATH_CACHE = \K_PATH_MAIN . 'cache/'
- Full path to cache directory.
- K_PATH_FONTS = \K_PATH_MAIN . 'fonts/'
- Full path to fonts directory.
- K_PATH_HOST = ''
- Host URL (e.g.: "http://www.yoursite.com").
- K_PATH_IMAGES = '../../images/'
- Relative path to images directory.
- K_PATH_JSCRIPTS = '../jscripts/'
- Relative path to javascript directory.
- K_PATH_LANG_CACHE = \K_PATH_CACHE . 'lang/'
- Full path to cache directory used for language files.
- K_PATH_MAIN = ''
- Real full path where this program is installed (e.g: "/var/www/html/TCExam/").
- K_PATH_PUBLIC_CODE = \K_PATH_HOST . \K_PATH_TCEXAM . 'public/code/'
- Path to public code.
- K_PATH_PUBLIC_CODE_REAL = \K_PATH_MAIN . 'public/code/'
- Server path to public code.
- K_PATH_SHARED_JSCRIPTS = '../../shared/jscripts/'
- Relative path to shared javascript directory.
- K_PATH_STYLE_SHEETS = '../styles/'
- Relative path to stylesheets directory.
- K_PATH_TCEXAM = ''
- Relative URL where this program is installed (e.g.: "/").
- K_PATH_TMX_FILE = \K_PATH_MAIN . 'shared/config/lang/language_tmx.xml'
- Full path to TMX language file.
- K_PATH_URL = \K_PATH_HOST . \K_PATH_TCEXAM
- Constant used on TCPDF library.
- K_PATH_URL_CACHE = \K_PATH_TCEXAM . 'cache/'
- URL path to to cache directory.
- K_PUBLIC_THEME = 'default'
- Theme for the public area
- K_QUESTION_DIFFICULTY_LEVELS = 10
- Number of difficulty levels for questions.
- K_QUESTION_LINE_MAX_LENGTH = 70
- Define max line length in chars for question navigator on test execution interface.
- K_RADIUS_ACCOUNTING_PORT = 1813
- Radius accounting port (e.g.: 1813).
- K_RADIUS_AUTHENTICATION_PORT = 1812
- Radius authentication port (e.g.: 1812).
- K_RADIUS_ENABLED = \false
- If true enable RADIUS.
- K_RADIUS_SERVER_IP = 'localhost'
- IP address of the radius server (e.g.: "127.0.0.1").
- K_RADIUS_SHARED_SECRET = 'WinRadius'
- Shared secret with the radius server.
- K_RADIUS_SUFFIX = ''
- Radius domain name suffix (e.g.: "@mydomain.com").
- K_RADIUS_UDP_TIMEOUT = 5
- Radius UDP timeout (e.g.: 5).
- K_RADIUS_USER_GROUP_ID = 1
- Default user group ID.
- K_RADIUS_USER_LEVEL = 1
- Default user level.
- K_RADIUS_UTF8 = \true
- Set to true if RADIUS uses UTF-8 encoding.
- K_RANDOM_SECURITY = 'mkTzxf8WwUxwvj6w'
- String used as a seed for some security code generation please change this value and keep it secret.
- K_REDIRECT_LOGIN_MODE = 4
- Various pages redirection modes after login (valid values are 1, 2, 3 and 4).
- K_REMAINING_TESTS = \false
- Set to false to disable test counting.
- K_SECONDS_IN_DAY = 24 * \K_SECONDS_IN_HOUR
- Number of seconds in one day.
- K_SECONDS_IN_HOUR = 60 * \K_SECONDS_IN_MINUTE
- Number of seconds in one hour.
- K_SECONDS_IN_MINUTE = 60
- Number of seconds in one minute.
- K_SECONDS_IN_MONTH = 30 * \K_SECONDS_IN_DAY
- Number of seconds in one month.
- K_SECONDS_IN_WEEK = 7 * \K_SECONDS_IN_DAY
- Number of seconds in one week.
- K_SECONDS_IN_YEAR = 365 * \K_SECONDS_IN_DAY
- Number of seconds in one year.
- K_SELECT_SUBSTRING = 40
- Max number of chars to display on a selection box.
- K_SESSION_LIFE = \K_SECONDS_IN_HOUR
- User's session life time in seconds.
- K_SHIBBOLETH_ENABLED = \false
- If true trust Shibboleth Auth
- K_SHIBBOLETH_LOGIN = ''
- URL of the Shibboleth login page
- K_SHIBBOLETH_USER_GROUP_ID = 1
- Default user group ID This is the TCExam group id to which the accounts belong.
- K_SHIBBOLETH_USER_LEVEL = 1
- Default user level
- K_SHORT_ANSWERS_BINARY = \false
- If true compare short answers in binary mode.
- K_SITE_AUTHOR = 'Nicola Asuni - Tecnick.com LTD'
- Default site author.
- K_SITE_DESCRIPTION = 'TCExam by Tecnick.com'
- Default site description.
- K_SITE_ICON = '../../favicon.ico'
- Path to default html icon.
- K_SITE_KEYWORDS = 'TCExam, eExam, e-exam, web, exam'
- Default keywords.
- K_SITE_REPLY = ''
- Default html reply-to meta tag.
- K_SITE_STYLE = \K_PATH_STYLE_SHEETS . \K_PUBLIC_THEME . '.css'
- Path to public CSS stylesheet for LTR languages.
- K_SITE_STYLE_RTL = \K_PATH_STYLE_SHEETS . \K_PUBLIC_THEME . '_rtl.css'
- Path to CSS stylesheet for RTL languages.
- K_SITE_TITLE = 'TCExam'
- Default site name.
- K_SMALL_RATIO = 2 / 3
- reduction factor for small font
- K_SSL_ENABLED = \false
- If true trust SSL Auth
- K_SSL_USER_GROUP_ID = 1
- Default user group ID This is the TCExam group id to which the accounts belong.
- K_SSL_USER_LEVEL = 1
- Default user level
- K_STANDARD_PORT = 80
- Standard port for http (80) or https (443).
- K_TAB = "\t"
- Tabulation character.
- K_TABLE_ANSWERS = \K_TABLE_PREFIX . 'answers'
- This table contains all answers relative to a specific questions.
- K_TABLE_GROUPS = \K_TABLE_PREFIX . 'user_groups'
- This table contains users' groups. Each user belongs to one of the groups defined in this table.
- K_TABLE_LOG_ANSWER = \K_TABLE_PREFIX . 'tests_logs_answers'
- This table contains the list of the selected alternative answers for each multiple-choice question.
- K_TABLE_MODULES = \K_TABLE_PREFIX . 'modules'
- Table for modules. A module is a container for subjects.
- K_TABLE_PREFIX = 'tce_'
- prefix for database tables names
- K_TABLE_QUESTIONS = \K_TABLE_PREFIX . 'questions'
- This table contains all questions relative to specific subjects.
- K_TABLE_SESSIONS = \K_TABLE_PREFIX . 'sessions'
- This table stores information about users' Web sessions.
- K_TABLE_SSLCERTS = \K_TABLE_PREFIX . 'sslcerts'
- This table contains the SSL certificates.
- K_TABLE_SUBJECT_SET = \K_TABLE_PREFIX . 'test_subjects'
- This table contains all tests subjects (topics, branch of studies).
- K_TABLE_SUBJECTS = \K_TABLE_PREFIX . 'subjects'
- This table contains all tests subjects (topics, branch of studies).
- K_TABLE_TEST_GROUPS = \K_TABLE_PREFIX . 'testgroups'
- This table contains the list of groups enabled for a selected test.
- K_TABLE_TEST_SSLCERTS = \K_TABLE_PREFIX . 'testsslcerts'
- This table contains the list of SSL certificates enabled for a selected test.
- K_TABLE_TEST_SUBJSET = \K_TABLE_PREFIX . 'test_subject_set'
- This table lists the type and quantity of the questions associated to each set of subjects selected for a particular test.
- K_TABLE_TEST_USER = \K_TABLE_PREFIX . 'tests_users'
- This table contains the list of tests generated for each user.
- K_TABLE_TESTS = \K_TABLE_PREFIX . 'tests'
- This table contains all tests data.
- K_TABLE_TESTS_LOGS = \K_TABLE_PREFIX . 'tests_logs'
- This table contains all questions and user answers relative to a specific test for a specific user.
- K_TABLE_TESTUSER_STAT = \K_TABLE_PREFIX . 'testuser_stat'
- This table counts the number of generated tests.
- K_TABLE_USERGROUP = \K_TABLE_PREFIX . 'usrgroups'
- This table contains the list of groups to whom each user belongs.
- K_TABLE_USERS = \K_TABLE_PREFIX . 'users'
- This table contains all registered users' data, including system administrators and a special 'anonymous' user.
- K_TCEXAM_AUTHOR = 'Nicola Asuni - Tecnick.com LTD'
- TCExam Author.
- K_TCEXAM_DESCRIPTION = 'TCExam by Tecnick.com'
- TCExam description.
- K_TCEXAM_ICON = '../../favicon.ico'
- Relative path to html icon.
- K_TCEXAM_KEYWORDS = 'TCExam, eExam, e-exam, web, exam'
- Default html meta keywords.
- K_TCEXAM_REPLY_TO = ''
- Reply-to meta tag.
- K_TCEXAM_STYLE = \K_PATH_STYLE_SHEETS . \K_ADMIN_THEME . '.css'
- Path to public CSS stylesheet for LTR languages.
- K_TCEXAM_STYLE_RTL = \K_PATH_STYLE_SHEETS . \K_ADMIN_THEME . '_rtl.css'
- Full path to CSS stylesheet for RTL languages.
- K_TCEXAM_TITLE = 'TCExam'
- TCExam title.
- K_TCEXAM_VERSION = \file_get_contents('../../VERSION')
- TCExam version (do not change).
- K_TCPDF_CALLS_IN_HTML = \false
- if true allows to call TCPDF methods using HTML syntax IMPORTANT: For security reason, disable this feature if you are printing user HTML content.
- K_TCPDF_EXTERNAL_CONFIG = \true
- Do not change the value of this define.
- K_TCPDF_THROW_EXCEPTION_ERROR = \false
- if true adn PHP version is greater than 5, then the Error() method throw new exception instead of terminating the execution.
- K_TEST_INFO_HEIGHT = 400
- Popup window height in pixels for test info.
- K_TEST_INFO_WIDTH = 700
- Popup window width in pixels for test info.
- K_THAI_TOPCHARS = \false
- set to true to enable the special procedure used to avoid the overlappind of symbols on Thai language
- K_TIMESTAMP_FORMAT = 'Y-m-d H:i:s'
- Define timestamp format using PHP notation (do not change).
- K_TIMEZONE = 'UTC'
- Set your own timezone here.
- K_TITLE_MAGNIFICATION = 1.3
- title magnification respect main font size
- K_UPDATE_PASSKEY = '0'
- UPDATES PASSKEY
- K_UPDATE_SERVER = 'http://updates.tcexam.com'
- Updating server
- K_USE_ERROR_LOG = \false
- Enable error logs (../log/tce_errors.log).
- K_USER_GROUP_RSYNC = \false
- When an alternate authentication method is used, if this constant is true the default user groups for the selected authentication method are always added to the user.
- K_USRREG_ADMIN_EMAIL = ''
- The following email will receive copies of verification messages.
- K_USRREG_AGREEMENT = ''
- URL of an HTML page containing the registration agreement (i.e.: "http://www.example.com/agreement.html").
- K_USRREG_EMAIL_CONFIRM = \true
- If true requires email confirmation.
- K_USRREG_ENABLED = \true
- If true enable USER REGISTRATION.
- K_USRREG_GROUP = 1
- Default user group ID for registered user.
- K_USRREG_PASSWORD_RE = '^(.{8,})$'
- Regular expression defining the allowed characters for a password
- K_UTF8_NORMALIZATION_MODE = 'NONE'
- Set the UTF-8 Normalization mode for question and answer descriptions: 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'.
- PDF_AUTHOR = 'TCExam 12'
- Document author.
- PDF_CREATOR = 'TCExam 12'
- Document creator.
- PDF_FONT_MONOSPACED = 'courier'
- default monospaced font name
- PDF_FONT_NAME_DATA = 'helvetica'
- Data font name.
- PDF_FONT_NAME_MAIN = 'helvetica'
- Main font name.
- PDF_FONT_SIZE_DATA = 7
- Data font size.
- PDF_FONT_SIZE_MAIN = 9
- Main font size.
- PDF_HEADER_LOGO = 'logo_example.png'
- Image logo.
- PDF_HEADER_LOGO_WIDTH = 20
- Header logo image width [mm].
- PDF_HEADER_STRING = "first row\nsecond row\nthird row"
- Header description string.
- PDF_HEADER_TITLE = "School name"
- Header title.
- PDF_IMAGE_SCALE_RATIO = 1.25
- ratio used to adjust the conversion of pixels to user units
- PDF_MARGIN_BOTTOM = 30
- Bottom margin.
- PDF_MARGIN_FOOTER = 10
- Footer margin.
- PDF_MARGIN_HEADER = 5
- Header margin.
- PDF_MARGIN_LEFT = 15
- Left margin.
- PDF_MARGIN_RIGHT = 15
- Right margin.
- PDF_MARGIN_TOP = 27
- Top margin.
- PDF_PAGE_FORMAT = 'A4'
- Page format.
- PDF_PAGE_ORIENTATION = 'P'
- Page orientation (P=portrait, L=landscape).
- PDF_TEXTANSWER_HEIGHT = 40
- Height of area for offline user answer.
- PDF_UNIT = 'mm'
- Document unit of measure [pt=point, mm=millimeter, cm=centimeter, in=inch].
- PHP_VERSION_ID = $version[0] * 10000 + $version[2] * 100 + $version[4]
Functions
- F_html_color_picker() : mixed
- Display Color Picker
- F_isValidbackupFile() : mixed
- F_send_report_emails() : mixed
- Sends email test reports to users.
- F_deleteMediaFile() : true
- Delete the selected media file
- F_renameMediaFile() : true
- Rename the selected media file
- F_createMediaDir() : true
- Create a new media directory inside the cache
- F_deleteMediaDir() : true
- Delete the specified media directory
- F_getFileInfo() : associative
- Get file information
- F_formatFileSize() : string
- Return a formatted file size
- F_getMediaDirPathLink() : an
- Get an html string containing active path of the specified directory with links to subdirectories.
- F_getDirFiles() : an
- Get an associative array of directories and folder inside the specified dir.
- F_isUsedMediaFile() : true
- Return true if the file is used on question or answer descriptions
- F_getDirTable() : html
- Get an html table containing files and subdirs
- F_getDirVisualTable() : html
- Get an html visual list of files and subdirs
- F_getAuthorizedDirs() : a
- Returns a regular expression to match authorised directories.
- F_isAuthorizedDir() : true
- Returns true if the user is authorized to use the specified directory, false otherwise.
- 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_question_set_enabled() : mixed
- Enable/Disable selected question
- F_question_get_position() : int
- Get question position
- F_question_get_data() : array<string|int, mixed>
- Get question data
- F_question_delete() : mixed
- Delete selected question (or disable it if used)
- F_question_copy() : mixed
- Copy selected question to another topic
- tcecodeEditorTagButtons() : XHTML
- Display TCExam Code EDITOR Tag Buttons
- getImageButton() : XHTML
- Display one tag button
- F_select_test() : true
- Display test selection for using F_show_select_test function.
- F_show_select_test() : false
- Display test selection XHTML table.
- F_show_select_test_popup() : false
- Display user selection XHTML table (popup mode).
- F_isTestOnSSLCerts() : bool
- Return true if the selected test is active for the selected SSL Certificate
- F_is_allowed_upload() : true
- Check if the uploaded file extension is allowed.
- F_upload_file() : mixed
- Uploads image file to the server.
- F_read_file_size() : mixed
- returns the file size in bytes
- F_select_user() : true
- Display user selection for using F_show_select_user function.
- F_show_select_user() : false
- Display user selection XHTML table.
- F_show_select_user_popup() : false
- Display user selection XHTML table (popup mode).
- F_isTestOnGroup() : bool
- Return true if the selected test is active for the selected group
- F_isUserOnGroup() : bool
- Return true if the selected user belongs to the selected group
- F_isAuthorizedEditorForGroup() : bool
- Return true if the current user is an administrator or belongs to the group, false otherwise
- F_isAuthorizedEditorForUser() : bool
- Return true if the current user is authorized to edit the specified user
- F_user_group_select_sql() : sql
- Return the SQL selection query for user groups
- F_user_group_select() : table
- Display select box for user groups
- F_get_user_groups() : array<string|int, mixed>
- Returns an array containing groups IDs to which the specified user belongs
- F_getUIDfromRegnum() : int
- Return the user ID from registration number.
- F_show_online_users() : false
- Display online users form using F_list_online_users function.
- F_list_online_users() : false
- Display online users.
- F_TSVQuestionImporter() : bool
- Import questions from TSV file (tab delimited text).
- F_import_tsv_users() : bool
- Import users from TSV file (tab delimited text).
- F_show_select_questions() : false
- Display a list of selected questions.
- F_tsv_export_questions() : TSV
- Export all questions of the selected subject to TSV.
- F_tsv_export_users() : TSV
- Export all users to TSV grouped by users' groups.
- F_xml_export_question_stats() : XML
- Export all question statistics of the selected test to XML.
- F_xml_export_questions() : XML
- Export all questions of the selected subject to XML.
- F_xml_export_results() : XML
- Export results in XML format.
- F_xml_export_user_results() : XML
- Export user results in XML format.
- F_xml_export_users() : XML
- Export all users to XML grouped by users' groups.
- 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.<br>
- 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.<br>
- 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.<br> 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.<br> 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_select_modules_sql() : string
- Returns a SQL string to select modules accounting for user authorizations.
- F_select_subjects_sql() : string
- Returns a SQL string to select subjects accounting for user authorizations.
- F_select_module_subjects_sql() : string
- Returns a SQL string to select modules and subjects accounting for user authorizations.
- F_select_tests_sql() : string
- Returns a SQL string to select tests accounting for user authorizations.
- F_select_executed_tests_sql() : string
- Returns a SQL string to select executed tests accounting for user authorizations.
- F_loginForm() : XHTML
- Returns XHTML / CSS formatted string for login form.<br> The CSS classes used are: <ul> <li>div.login_form : container for login box</li> <li>div.login_form div.login_row : container for label + input field or button</li> <li>div.login_form div.login_row span.label : container for input label</li> <li>div.login_form div.login_row span.formw : container for input form</li> </ul>
- 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.<br> Returns a string containing a list of missing fields (comma separated).
- F_check_fields_format() : array<string|int, mixed>
- Check fields format using regular expression comparisons.<br> Returns a string containing a list of wrong fields (comma separated).
- F_check_form_fields() : false
- Check Form Fields.
- F_stripslashes_formfields() : mixed
- Strip slashes from posted 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.
- 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.<br> Returns the quoted string if not empty, NULL otherwise.
- F_zero_to_null() : string
- Prepare field value for SQL query.<br> Returns the num if different from zero, NULL otherwise.
- F_getBoolean() : bool
- Returns boolean value from string or integer.<br> 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: <ul> <li>"\t" (ASCII 9 (0x09)), a tab.</li> <li>"\n" (ASCII 10 (0x0A)), a new line (line feed)</li> <li>"\r" (ASCII 13 (0x0D)), a carriage return</li> <li>"\0" (ASCII 0 (0x00)), the NUL-byte</li> <li>"\x0B" (ASCII 11 (0x0B)), a vertical tab</li> </ul>
- 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 acronym 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
- Convert all IP addresses to IPv6 expanded notation.
- getIpAsInt() : int
- Converts a string containing an IP address into its integer value.
- getIpAsString() : int
- Converts a string containing an IP address into its integer value and return string representation.
- 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_open() : bool
- Open session.
- F_session_close() : bool
- Close session.<br> Call garbage collector function to remove expired sessions.
- F_session_read() : string
- Get session data.
- F_session_write() : resource
- Insert or Update session.
- F_session_destroy() : resource
- Deletes the specific session.
- F_session_gc() : int
- Garbage collector.<br> Deletes expired sessions.<br> NOTE: while time() function returns a 32 bit integer, it works fine until year 2038.
- 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
- getPlainCSRFToken() : string
- Generate unencoded CSRF token string
- checkCSRFToken() : bool
- Check the CSRF token
- F_getCSRFToken() : string
- Generate CSRF token
- F_getArrayStatistics() : array<string|int, mixed>
- Return an array containing descriptive statistics for the bidimensional input array.
- F_getSVGGraphCode() : converted
- Replace angular parenthesis with html equivalents (html entities).
- F_getSVGGraph() : converted
- Replace angular parenthesis with html equivalents (html entities).
- F_decode_tcecode() : string
- Returns XHTML code from text marked-up with TCExam Code 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() : true
- 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<br>
- F_countUserTest() : retried
- Count the number times of retries.<br>
- F_checkTestStatus() : array<string|int, mixed>
- Check and returns specific test status for the specified user.<br>
- 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.<br> See CSS classes:<ul> <li>div.row span.label</li> <li>div.row span.formw</li> </ul>
- F_executeTest() : true
- Returns true if the current user is authorized to execute the selected test.<br> Generates the test if it's not already generated.
- F_isRightTestlogUser() : bool
- Checks if the current user is the right testlog_id owner.<br> This function is used for security reasons.
- F_selectAnswers() : array<string|int, mixed>
- Return an array containing answer_id field of selected answers.<br>
- 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.<br> Form fields names are: answer_text, answer_id<br> CSS classes:<ul> <li>div.tcecontentbox</li> <li>div.rowl</li> <li>textarea.answertext</li> </ul>
- 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.<br>
- F_updateTestComment() : string
- Updates user's test comment.<br>
- F_testLoginForm() : XHTML
- Returns XHTML / CSS formatted page string to insert the test password.<br> The CSS classes used are: <ul> <li>div.login_form : container for login box</li> <li>div.login_form div.login_row : container for label + input field or button</li> <li>div.login_form div.login_row span.label : container for input label</li> <li>div.login_form div.login_row span.formw : container for input form</li> </ul>
- 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_lockUserTest() : mixed
- Lock the user's test.<br>
- 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.
- addSlashesArray() : array<string|int, mixed>|string
- Escape strings with backslashes before characters that need to be escaped.
Constants
HEAD_MAGNIFICATION
magnification factor for titles
public mixed HEAD_MAGNIFICATION =
1.1
K_ADMIN_LINK
Required user's level to display a link for administration area
public mixed K_ADMIN_LINK = 5
K_ADMIN_THEME
Theme for the admin area
public mixed K_ADMIN_THEME = 'default'
K_ALLOWED_ERROR_TAGS
HTML tags that are allowed in an error message.
public mixed K_ALLOWED_ERROR_TAGS =
'<a><b><br><em><p><ol><ul><li><small><table><tr><th><td>'
K_ALLOWED_TCPDF_TAGS
List of TCPDF methods that are allowed to be called using HTML syntax.
public mixed K_ALLOWED_TCPDF_TAGS =
''
Note: each method name must end with surrounded with | (pipe) character. The constant K_TCPDF_CALLS_IN_HTML must be set to true. IMPORTANT: For security reason, disable this feature if you are allowing user HTML content.
K_ALLOWED_UPLOAD_EXTENSIONS
List of allowed file types for upload (remove all extensions to disable upload).
public mixed K_ALLOWED_UPLOAD_EXTENSIONS
= \serialize(array('csv',
'tsv', 'xml', 'txt', 'png', 'gif', 'jpg', 'jpeg', 'svg', 'mp3',
'mid', 'oga', 'ogg', 'wav', 'wma', 'avi', 'flv', 'm2v', 'mpeg',
'mpeg4', 'mpg', 'mpg2', 'mpv', 'ogm', 'ogv', 'vid', 'pfx', 'pem',
'crt'))
FOR SERVER SECURITY DO NOT ADD EXECUTABLE FILE TYPES HERE
K_ANSWER_TEXTAREA_COLS
Number of columns for answer textarea.
public mixed K_ANSWER_TEXTAREA_COLS =
70
K_ANSWER_TEXTAREA_ROWS
Number of rows for answer textarea.
public mixed K_ANSWER_TEXTAREA_ROWS =
15
K_AUTH_ADMIN_ANSWERS
Required user's level to access "answer editor".
public mixed K_AUTH_ADMIN_ANSWERS =
\K_AUTH_OPERATOR
K_AUTH_ADMIN_DIRS
Required user's level to create and delete directories.
public mixed K_AUTH_ADMIN_DIRS =
\K_AUTH_OPERATOR
K_AUTH_ADMIN_FILEMANAGER
Required user's level to access file manager for multimedia files.
public mixed K_AUTH_ADMIN_FILEMANAGER =
\K_AUTH_OPERATOR
K_AUTH_ADMIN_GROUPS
Required user's level to access "group editor".
public mixed K_AUTH_ADMIN_GROUPS =
\K_AUTH_ADMINISTRATOR
K_AUTH_ADMIN_IMPORT
Required user's level to import questions.
public mixed K_AUTH_ADMIN_IMPORT =
\K_AUTH_ADMINISTRATOR
K_AUTH_ADMIN_INFO
Required user's level to access "TCExam information".
public mixed K_AUTH_ADMIN_INFO =
0
K_AUTH_ADMIN_MODULES
Required user's level to access "module editor".
public mixed K_AUTH_ADMIN_MODULES =
\K_AUTH_OPERATOR
K_AUTH_ADMIN_OMR_IMPORT
Required user's level to import OMR answers.
public mixed K_AUTH_ADMIN_OMR_IMPORT =
\K_AUTH_OPERATOR
K_AUTH_ADMIN_ONLINE_USERS
Required user's level to display online users.
public mixed K_AUTH_ADMIN_ONLINE_USERS =
\K_AUTH_OPERATOR
K_AUTH_ADMIN_QUESTIONS
Required user's level to access "question editor".
public mixed K_AUTH_ADMIN_QUESTIONS =
\K_AUTH_OPERATOR
K_AUTH_ADMIN_RATING
Required user's level to manually rate free text answers.
public mixed K_AUTH_ADMIN_RATING =
\K_AUTH_OPERATOR
K_AUTH_ADMIN_RESULTS
Required user's level to display results.
public mixed K_AUTH_ADMIN_RESULTS =
\K_AUTH_OPERATOR
K_AUTH_ADMIN_SSLCERT
Required user's level to edit SSL certificates.
public mixed K_AUTH_ADMIN_SSLCERT =
\K_AUTH_OPERATOR
K_AUTH_ADMIN_SUBJECTS
Required user's level to access "subject editor".
public mixed K_AUTH_ADMIN_SUBJECTS =
\K_AUTH_OPERATOR
K_AUTH_ADMIN_TCECODE
Required user's level to access "tcecode editor".
public mixed K_AUTH_ADMIN_TCECODE =
\K_AUTH_OPERATOR
K_AUTH_ADMIN_TESTS
Required user's level to access "test editor".
public mixed K_AUTH_ADMIN_TESTS =
\K_AUTH_OPERATOR
K_AUTH_ADMIN_UPLOAD_IMAGES
Required user's level to upload images.
public mixed K_AUTH_ADMIN_UPLOAD_IMAGES =
\K_AUTH_OPERATOR
K_AUTH_ADMIN_USERS
Required user's level to access "user editor".
public mixed K_AUTH_ADMIN_USERS =
\K_AUTH_ADMINISTRATOR
K_AUTH_ADMINISTRATOR
Administrator level.
public mixed K_AUTH_ADMINISTRATOR =
10
K_AUTH_BACKUP
Required user's level to import questions.
public mixed K_AUTH_BACKUP = \K_AUTH_ADMINISTRATOR
K_AUTH_DELETE_GROUPS
Required user's level to delete user groups.
public mixed K_AUTH_DELETE_GROUPS =
\K_AUTH_ADMINISTRATOR
K_AUTH_DELETE_MEDIAFILE
Required user's level to delete multimedia files.
public mixed K_AUTH_DELETE_MEDIAFILE =
\K_AUTH_OPERATOR
K_AUTH_DELETE_USERS
Required user's level to delete users.
public mixed K_AUTH_DELETE_USERS =
\K_AUTH_ADMINISTRATOR
K_AUTH_EXPORT_USERS
Required user's level to export users.
public mixed K_AUTH_EXPORT_USERS =
\K_AUTH_ADMINISTRATOR
K_AUTH_IMPORT_USERS
Required user's level to import users.
public mixed K_AUTH_IMPORT_USERS =
\K_AUTH_ADMINISTRATOR
K_AUTH_INDEX
Required user's level to access index page.
public mixed K_AUTH_INDEX = \K_AUTH_OPERATOR
K_AUTH_MOVE_GROUPS
Required user's level to move users from one group to another.
public mixed K_AUTH_MOVE_GROUPS =
\K_AUTH_ADMINISTRATOR
K_AUTH_OPERATOR
Operator level.
public mixed K_AUTH_OPERATOR =
5
K_AUTH_PAGE_USER
Required user's level to access user page submenu
public mixed K_AUTH_PAGE_USER =
1
K_AUTH_PUBLIC_INDEX
Required user's level to access index page.
public mixed K_AUTH_PUBLIC_INDEX =
1
K_AUTH_PUBLIC_TEST_EXECUTE
Required user's level to execute a test
public mixed K_AUTH_PUBLIC_TEST_EXECUTE =
1
K_AUTH_PUBLIC_TEST_INFO
Required user's level to view test general information
public mixed K_AUTH_PUBLIC_TEST_INFO =
1
K_AUTH_PUBLIC_TEST_RESULTS
Required user's level to view test results
public mixed K_AUTH_PUBLIC_TEST_RESULTS =
1
K_AUTH_RENAME_MEDIAFILE
Required user's level to rename multimedia files.
public mixed K_AUTH_RENAME_MEDIAFILE =
\K_AUTH_OPERATOR
K_AUTH_SSL_LEVEL
Minimum page level for which a valid client SSL certificate is required.
public mixed K_AUTH_SSL_LEVEL =
\false
Use false or a level above 10 to disable the control. Use 0 to enable for all area. Use 10 to enable just for the ADMIN pages.
K_AUTH_SSL_LEVEL
Minimum page level for which a valid client SSL certificate is required.
public mixed K_AUTH_SSL_LEVEL =
\false
Use false or a level above 10 to disable the control. Use 0 to enable for all area. Use 10 to enable just for the ADMIN pages.
K_AUTH_SSLIDS
Comma separated lit of SSL certificates IDs required to access pages with K_AUTH_SSL_LEVEL level or more.
public mixed K_AUTH_SSLIDS = ''
K_AUTH_SSLIDS
Comma separated lit of SSL certificates IDs required to access pages with K_AUTH_SSL_LEVEL level or more.
public mixed K_AUTH_SSLIDS = ''
K_AUTH_USER_CHANGE_EMAIL
Required user's level to change email
public mixed K_AUTH_USER_CHANGE_EMAIL =
1
K_AUTH_USER_CHANGE_PASSWORD
Required user's level to change password
public mixed K_AUTH_USER_CHANGE_PASSWORD
= 1
K_AVAILABLE_FONTS
Defines a serialized array of available fonts for PDF.
public mixed K_AVAILABLE_FONTS =
\serialize(array('courier'
=> 'courier', 'helvetica' => 'helvetica', 'times' =>
'times', 'symbol' => 'symbol', 'zapfdingbats' =>
'zapfdingbats', 'DejaVuSans' => 'dejavusans,sans',
'DejaVuSansCondensed' => 'dejavusanscondensed,sans',
'DejaVuSansMono' => 'dejavusansmono,monospace', 'DejaVuSerif'
=> 'dejavuserif,serif', 'DejaVuSerifCondensed' =>
'dejavuserifcondensed,serif', 'FreeMono' =>
'freemono,monospace', 'FreeSans' => 'freesans,sans', 'FreeSerif'
=> 'freeserif,serif'))
K_AVAILABLE_LANGUAGES
Defines a serialized array of available languages.
public mixed K_AVAILABLE_LANGUAGES =
\serialize(array('ar'
=> 'Arabian', 'az' => 'Azerbaijani', 'bg' => 'Bulgarian',
'br' => 'Brazilian Portuguese', 'cn' => 'Chinese', 'de' =>
'German', 'el' => 'Greek', 'en' => 'English', 'es' =>
'Spanish', 'fa' => 'Farsi', 'fr' => 'French', 'he' =>
'Hebrew', 'hi' => 'Hindi', 'hu' => 'Hungarian', 'id' =>
'Indonesian', 'it' => 'Italian', 'jp' => 'Japanese', 'mr'
=> 'Marathi', 'ms' => 'Malay (Bahasa Melayu)', 'nl' =>
'Dutch', 'pl' => 'Polish', 'ro' => 'Romanian', 'ru' =>
'Russian', 'tr' => 'Turkish', 'ur' => 'Urdu', 'vn' =>
'Vietnamese'))
Each language is indexed using a 2-letters code (ISO 639).
K_BLANK_IMAGE
Full path to a blank image.
public mixed K_BLANK_IMAGE = \K_PATH_IMAGES .
'_blank.png'
K_BRUTE_FORCE_DELAY_RATIO
Ratio at which the delay will be increased after every failed login attempt.
public mixed K_BRUTE_FORCE_DELAY_RATIO =
2
K_CAS_ENABLED
If true enable CAS
public mixed K_CAS_ENABLED = \false
K_CAS_HOST
CAS server hostname.
public mixed K_CAS_HOST = ''
K_CAS_PATH
The location on the webserver where the CAS application is hosted.
public mixed K_CAS_PATH = '/cas'
Some setups don't place the CAS application in the webserver's root directory and we can specify where to find the CAS application. Default is ''.
K_CAS_PORT
The port to connect to.
public mixed K_CAS_PORT = 443
Defaults to 443
K_CAS_USER_GROUP_ID
Default user group ID This is the TCExam group ID to which the CAS accounts belongs.
public mixed K_CAS_USER_GROUP_ID =
1
You can also set 0 for all available groups or a string containing a comma-separated list of group IDs.
K_CAS_USER_LEVEL
Default user level
public mixed K_CAS_USER_LEVEL =
1
K_CAS_VERSION
Version of CAS protocol to use.
public mixed K_CAS_VERSION = '2.0'
Defaults to CAS_VERSION_2_0
K_CELL_HEIGHT_RATIO
height of cell repect font height
public mixed K_CELL_HEIGHT_RATIO =
1.25
K_CHECK_SESSION_FINGERPRINT
If true, check for possible session hijacking (set to false if you have login problems).
public mixed K_CHECK_SESSION_FINGERPRINT
= \true
K_CLOCK_IN_UTC
If true display admin clock in UTC (GMT).
public mixed K_CLOCK_IN_UTC =
\false
K_COOKIE_DOMAIN
Cookie domain.
public mixed K_COOKIE_DOMAIN =
''
K_COOKIE_EXPIRE
Expiration time for cookies.
public mixed K_COOKIE_EXPIRE =
\K_SECONDS_IN_DAY
K_COOKIE_HTTPONLY
When true the cookie will be made accessible only through the HTTP protocol.
public mixed K_COOKIE_HTTPONLY =
\true
K_COOKIE_PATH
Cookie path.
public mixed K_COOKIE_PATH = '/'
K_COOKIE_SAMESITE
The SameSite attribute lets servers specify whether/when cookies are sent with cross-site requests.
public mixed K_COOKIE_SAMESITE =
'Strict'
K_COOKIE_SECURE
If true use secure cookies.
public mixed K_COOKIE_SECURE =
\true
K_CUSTOM_AUTH_BASIC_PASSWORD_HASH
Custom user's Password hash generated with https://www.php.net/manual/en/function.crypt.php
public mixed K_CUSTOM_AUTH_BASIC_PASSWORD_HASH
= ''
K_CUSTOM_AUTH_BASIC_USER_GROUP_ID
Custom user group ID.
public mixed K_CUSTOM_AUTH_BASIC_USER_GROUP_ID
= 1
K_CUSTOM_AUTH_BASIC_USER_LEVEL
Custom user level.
public mixed K_CUSTOM_AUTH_BASIC_USER_LEVEL
= 1
K_CUSTOM_AUTH_BASIC_USERNAME
Custom user name.
public mixed K_CUSTOM_AUTH_BASIC_USERNAME
= ''
K_CUSTOM_AUTH_METHODS
Lisf of enabled custom authentication methods.
public mixed K_CUSTOM_AUTH_METHODS =
\serialize(array())
Add your custom authentication methods here.
K_DATABASE_HOST
database Host name (eg: localhost)
public mixed K_DATABASE_HOST =
''
K_DATABASE_NAME
database name (TCExam)
public mixed K_DATABASE_NAME =
''
K_DATABASE_PORT
database port (eg: 3306, 5432, 1521)
public mixed K_DATABASE_PORT =
''
NOTE: For MYSQL database type, set this constant to NULL to be able to use the MySQL socket path defined by the mysqli.default_socket PHP value. For example, in Apache: php_value mysqli.default_socket "/path/to/mysql.sock"
K_DATABASE_TYPE
database type (MYSQL, POSTGRESQL, ORACLE)
public mixed K_DATABASE_TYPE =
''
K_DATABASE_USER_NAME
database user name
public mixed K_DATABASE_USER_NAME =
''
K_DATABASE_USER_PASSWORD
database user password
public mixed K_DATABASE_USER_PASSWORD =
''
K_DIGSIG_CERT_TYPE
The access permissions granted for this document.
public mixed K_DIGSIG_CERT_TYPE =
'1'
Valid values shall be: 1 = No changes to the document shall be permitted; any change to the document shall invalidate the signature; 2 = Permitted changes shall be filling in forms, instantiating page templates, and signing; other changes shall invalidate the signature; 3 = Permitted changes shall be the same as for 2, as well as annotation creation, deletion, and modification; other changes shall invalidate the signature.
K_DIGSIG_CERTIFICATE
Signing certificate (string or filename prefixed with 'file://').
public mixed K_DIGSIG_CERTIFICATE =
'file://../../shared/config/tcpdf.crt'
K_DIGSIG_CONTACT
Information provided by the signer to enable a recipient to contact the signer to verify the signature; for example, a phone number or email address.
public mixed K_DIGSIG_CONTACT =
'you@example.com'
K_DIGSIG_ENABLE
If true digitally sign PDF documents.
public mixed K_DIGSIG_ENABLE =
\false
K_DIGSIG_EXTRA_CERTS
Name of a file containing a bunch of extra certificates to include in the signature which can for example be used to help the recipient to verify the certificate that you used.
public mixed K_DIGSIG_EXTRA_CERTS =
''
K_DIGSIG_LOCATION
The CPU host name or physical location of the signing.
public mixed K_DIGSIG_LOCATION =
'Office'
K_DIGSIG_NAME
The name of the person or authority signing the document.
public mixed K_DIGSIG_NAME = 'TCEXAM'
K_DIGSIG_PASSWORD
Password for private key.
public mixed K_DIGSIG_PASSWORD =
'tcpdfdemo'
K_DIGSIG_PRIVATE_KEY
Private key (string or filename prefixed with 'file://').
public mixed K_DIGSIG_PRIVATE_KEY =
'file://../../shared/config/tcpdf.crt'
K_DIGSIG_REASON
The reason for the signing, such as ( I agree ...).
public mixed K_DIGSIG_REASON =
'Certification'
K_DISPLAY_PDFTEXT_BUTTON
If true display an additional button to print only the TEXT answers on all users' results.
public mixed K_DISPLAY_PDFTEXT_BUTTON =
\false
K_DISPLAY_TEST_DESCRIPTION
If true display test description before executing the test.
public mixed K_DISPLAY_TEST_DESCRIPTION =
\true
K_DOWNLOAD_BACKUPS
If true enable the backup download.
public mixed K_DOWNLOAD_BACKUPS =
\true
K_EMAIL_RE_PATTERN
public mixed K_EMAIL_RE_PATTERN =
'^([a-zA-Z0-9_\\.\\-\\+\\%]+)@([a-zA-Z0-9\\.\\-]+)$'
K_ENABLE_ANSWER_EXPLANATION
If true enable explanation field for answers.
public mixed K_ENABLE_ANSWER_EXPLANATION
= \true
K_ENABLE_CUSTOM_EXPORT
Name of the button to export results in custom format (file: admin/code/tce_export_custom.php).
public mixed K_ENABLE_CUSTOM_EXPORT =
''
Set this constant to empty to disable this feature (or if you haven't set tce_import_custom.php)
K_ENABLE_CUSTOM_IMPORT
Name of the option to import questions using a custom format (file: admin/code/tce_import_custom.php).
public mixed K_ENABLE_CUSTOM_IMPORT =
''
Set this constant to empty to disable this feature (or if you haven't set tce_import_custom.php)
K_ENABLE_JSERRORS
If true display messages and errors on Javascript popup window.
public mixed K_ENABLE_JSERRORS =
\false
K_ENABLE_PUBLIC_PDF
Enable PDF results on public area.
public mixed K_ENABLE_PUBLIC_PDF =
\true
K_ENABLE_QUESTION_EXPLANATION
If true enable explanation field for questions.
public mixed K_ENABLE_QUESTION_EXPLANATION
= \true
K_ENABLE_VIRTUAL_KEYBOARD
If true enable virtual keyboard on some textarea fields.
public mixed K_ENABLE_VIRTUAL_KEYBOARD =
\true
K_ERROR_TYPES
Define error reporting types for debug.
public mixed K_ERROR_TYPES = \E_ALL |
\E_STRICT
K_EXTEND_TIME_MINUTES
Default minutes used to extend test duration.
public mixed K_EXTEND_TIME_MINUTES =
5
K_HIDE_EXPIRED_TESTS
If true hide the expired tests from index table.
public mixed K_HIDE_EXPIRED_TESTS =
\false
K_HTTPBASIC_ENABLED
If true trust HTTP Basic Auth
public mixed K_HTTPBASIC_ENABLED =
\false
K_HTTPBASIC_USER_GROUP_ID
Default user group ID This is the TCExam group id to which the accounts belong.
public mixed K_HTTPBASIC_USER_GROUP_ID =
1
You can also set 0 for all available groups or a string containing a comma-separated list of group IDs.
K_HTTPBASIC_USER_LEVEL
Default user level
public mixed K_HTTPBASIC_USER_LEVEL =
1
K_KEY_SECURITY
String used for security feature, do not alter.
public mixed K_KEY_SECURITY =
'VENFeGFtIChjKSAyMDA0LTIwMjAgTmljb2xhIEFzdW5pIC0gVGVjbmljay5jb20gLSB0Y2V4YW0uY29t'
K_LANGUAGE
2-letters code for default language.
public mixed K_LANGUAGE = 'en'
K_LANGUAGE_SELECTOR
If true, display a language selector.
public mixed K_LANGUAGE_SELECTOR =
\true
K_LATEX_CLASS
LaTeX class (article).
public mixed K_LATEX_CLASS = 'article'
K_LATEX_FONT_SIZE
Font size (10).
public mixed K_LATEX_FONT_SIZE =
10
K_LATEX_FORMULA_DENSITY
Formula density used by ImageMagick (120).
public mixed K_LATEX_FORMULA_DENSITY =
120
K_LATEX_IMG_FORMAT
Image format (png).
public mixed K_LATEX_IMG_FORMAT =
'png'
K_LATEX_IMG_PREFIX
Filename prefix for chached images (latex_).
public mixed K_LATEX_IMG_PREFIX =
'latex_'
K_LATEX_MAX_HEIGHT
Image height limit in pixels (500).
public mixed K_LATEX_MAX_HEIGHT =
800
K_LATEX_MAX_LENGHT
Size limit for input string (500).
public mixed K_LATEX_MAX_LENGHT =
500
K_LATEX_MAX_WIDTH
Image width limit in pixels (500).
public mixed K_LATEX_MAX_WIDTH =
800
K_LATEX_PATH_CONVERT
Path to ImageMagick convert (/usr/bin/convert).
public mixed K_LATEX_PATH_CONVERT =
'/usr/bin/convert'
K_LATEX_PATH_PICTURE
Absolute path to images directory.
public mixed K_LATEX_PATH_PICTURE =
\K_PATH_CACHE
K_LATEX_PATH_PICTURE_HTTPD
relative path to images directory.
public mixed K_LATEX_PATH_PICTURE_HTTPD =
\K_PATH_URL_CACHE
K_LATEX_PDFLATEX
Path to PDFLATEX (/usr/bin/pdflatex).
public mixed K_LATEX_PDFLATEX =
'/usr/bin/pdflatex'
K_LDAP_BASE_DN
The base DN for the directory.
public mixed K_LDAP_BASE_DN =
'ou=users,dc=mydom,dc=example,dc=org'
K_LDAP_ENABLED
If true enable LDAP.
public mixed K_LDAP_ENABLED =
\false
K_LDAP_FILTER
The search filter can be simple or advanced, using boolean operators in the format described in the LDAP documentation. Use "#USERNAME#" as a placeholder for the username passed by login form. For W2K3 use: "(sAMAccountName=#USERNAME#)"
public mixed K_LDAP_FILTER = 'uid=#USERNAME#'
K_LDAP_HOST
LDAP hostname. If you are using OpenLDAP 2.x.x you can specify a URL instead of the hostname. To use LDAP with SSL, compile OpenLDAP 2.x.x with SSL support, configure PHP with SSL, and set this parameter as ldaps://hostname/.
public mixed K_LDAP_HOST = 'localhost'
K_LDAP_PORT
The port to connect to. Not used when using URLs.
public mixed K_LDAP_PORT = 389
K_LDAP_PROTOCOL_VERSION
LDAP protocol version.
public mixed K_LDAP_PROTOCOL_VERSION =
3
K_LDAP_ROOT_DN
The DN for the ROOT Account Set to null for anonymous LDAP binding
public mixed K_LDAP_ROOT_DN =
\null
K_LDAP_ROOT_PASS
The password for the ROOT Account Set to null for anonymous LDAP binding
public mixed K_LDAP_ROOT_PASS =
\null
K_LDAP_USER_GROUP_ID
Default user group ID.
public mixed K_LDAP_USER_GROUP_ID =
1
This is the TCExam group id to which the LDAP accounts belongs. You can also set 0 for all available groups or a string containing a comma-separated list of group IDs.
K_LDAP_USER_LEVEL
Default user level
public mixed K_LDAP_USER_LEVEL =
1
K_LDAP_UTF8
Set to true if LDAP uses UTF-8 encoding.
public mixed K_LDAP_UTF8 = \true
K_LOGOUT_URL
URL to be redirected at logout (leave empty for default).
public mixed K_LOGOUT_URL = ''
K_MAIN_PAGE
Main page (homepage).
public mixed K_MAIN_PAGE = 'index.php'
K_MAX_MEMORY_LIMIT
Max memory limit.
public mixed K_MAX_MEMORY_LIMIT =
'512M'
K_MAX_MEMORY_LIMIT
Max memory limit for a PHP script.
public mixed K_MAX_MEMORY_LIMIT =
'32M'
K_MAX_ROWS_PER_PAGE
Max number of rows to display in tables.
public mixed K_MAX_ROWS_PER_PAGE =
50
K_MAX_ROWS_PER_PAGE
Max number of rows to display in tables.
public mixed K_MAX_ROWS_PER_PAGE =
50
K_MAX_TESTS_DAY
Maximum number of tests per day (last 24 hours).
public mixed K_MAX_TESTS_DAY =
\false
false = unlimited
K_MAX_TESTS_MONTH
Maximum number of tests per month (last 30 days).
public mixed K_MAX_TESTS_MONTH =
\false
false = unlimited
K_MAX_TESTS_YEAR
Maximum number of tests per year (last 365 days).
public mixed K_MAX_TESTS_YEAR =
\false
false = unlimited
K_MAX_UPLOAD_SIZE
Max size to be uploaded in bytes.
public mixed K_MAX_UPLOAD_SIZE =
25000000
K_MAX_UPLOAD_SIZE
Max file size to be uploaded [bytes].
public mixed K_MAX_UPLOAD_SIZE =
1000000
K_MYSQL_QA_BIN_UNIQUITY
If true check the unicity of question and answer descriptions using utf8_bin collation when using MySQL.
public mixed K_MYSQL_QA_BIN_UNIQUITY =
\true
K_NEWLINE
New line character.
public mixed K_NEWLINE = "\n"
K_OMR_PATH_ZBARIMG
Path to zbarimg executable (/usr/bin/zbarimg).
public mixed K_OMR_PATH_ZBARIMG =
'/usr/bin/zbarimg'
This application is required to decode barcodes on scanned offline test pages. For installation instructions: http://zbar.sourceforge.net/ On Debian/Ubuntu you can easily install zbarimg using the following command: "sudo apt-get install zbar-tools"
K_OTP_LOGIN
If true enable One-Time-Password authentication on login.
public mixed K_OTP_LOGIN = \false
K_PASSWORD_RESET
If true enable password reset feature.
public mixed K_PASSWORD_RESET =
\true
K_PATH_BACKUP
Full path to backup directory.
public mixed K_PATH_BACKUP = \K_PATH_MAIN .
'admin/backup/'
Please protect this directory with extra authentication to restrict access.
K_PATH_CACHE
Full path to cache directory.
public mixed K_PATH_CACHE = \K_PATH_MAIN .
'cache/'
K_PATH_FONTS
Full path to fonts directory.
public mixed K_PATH_FONTS = \K_PATH_MAIN .
'fonts/'
K_PATH_HOST
Host URL (e.g.: "http://www.yoursite.com").
public mixed K_PATH_HOST = ''
K_PATH_IMAGES
Relative path to images directory.
public mixed K_PATH_IMAGES = '../../images/'
K_PATH_JSCRIPTS
Relative path to javascript directory.
public mixed K_PATH_JSCRIPTS =
'../jscripts/'
K_PATH_LANG_CACHE
Full path to cache directory used for language files.
public mixed K_PATH_LANG_CACHE =
\K_PATH_CACHE
. 'lang/'
K_PATH_MAIN
Real full path where this program is installed (e.g: "/var/www/html/TCExam/").
public mixed K_PATH_MAIN = ''
K_PATH_PUBLIC_CODE
Path to public code.
public mixed K_PATH_PUBLIC_CODE =
\K_PATH_HOST .
\K_PATH_TCEXAM . 'public/code/'
K_PATH_PUBLIC_CODE_REAL
Server path to public code.
public mixed K_PATH_PUBLIC_CODE_REAL =
\K_PATH_MAIN .
'public/code/'
K_PATH_SHARED_JSCRIPTS
Relative path to shared javascript directory.
public mixed K_PATH_SHARED_JSCRIPTS =
'../../shared/jscripts/'
K_PATH_STYLE_SHEETS
Relative path to stylesheets directory.
public mixed K_PATH_STYLE_SHEETS =
'../styles/'
K_PATH_TCEXAM
Relative URL where this program is installed (e.g.: "/").
public mixed K_PATH_TCEXAM = ''
K_PATH_TMX_FILE
Full path to TMX language file.
public mixed K_PATH_TMX_FILE =
\K_PATH_MAIN .
'shared/config/lang/language_tmx.xml'
K_PATH_URL
Constant used on TCPDF library.
public mixed K_PATH_URL = \K_PATH_HOST .
\K_PATH_TCEXAM
K_PATH_URL_CACHE
URL path to to cache directory.
public mixed K_PATH_URL_CACHE =
\K_PATH_TCEXAM
. 'cache/'
K_PUBLIC_THEME
Theme for the public area
public mixed K_PUBLIC_THEME =
'default'
K_QUESTION_DIFFICULTY_LEVELS
Number of difficulty levels for questions.
public mixed K_QUESTION_DIFFICULTY_LEVELS
= 10
K_QUESTION_LINE_MAX_LENGTH
Define max line length in chars for question navigator on test execution interface.
public mixed K_QUESTION_LINE_MAX_LENGTH =
70
K_RADIUS_ACCOUNTING_PORT
Radius accounting port (e.g.: 1813).
public mixed K_RADIUS_ACCOUNTING_PORT =
1813
K_RADIUS_AUTHENTICATION_PORT
Radius authentication port (e.g.: 1812).
public mixed K_RADIUS_AUTHENTICATION_PORT
= 1812
K_RADIUS_ENABLED
If true enable RADIUS.
public mixed K_RADIUS_ENABLED =
\false
K_RADIUS_SERVER_IP
IP address of the radius server (e.g.: "127.0.0.1").
public mixed K_RADIUS_SERVER_IP =
'localhost'
K_RADIUS_SHARED_SECRET
Shared secret with the radius server.
public mixed K_RADIUS_SHARED_SECRET =
'WinRadius'
K_RADIUS_SUFFIX
Radius domain name suffix (e.g.: "@mydomain.com").
public mixed K_RADIUS_SUFFIX =
''
K_RADIUS_UDP_TIMEOUT
Radius UDP timeout (e.g.: 5).
public mixed K_RADIUS_UDP_TIMEOUT =
5
K_RADIUS_USER_GROUP_ID
Default user group ID.
public mixed K_RADIUS_USER_GROUP_ID =
1
This is the TCExam group id to which the radius accounts belongs. You can also set 0 for all available groups or a string containing a comma-separated list of group IDs.
K_RADIUS_USER_LEVEL
Default user level.
public mixed K_RADIUS_USER_LEVEL =
1
K_RADIUS_UTF8
Set to true if RADIUS uses UTF-8 encoding.
public mixed K_RADIUS_UTF8 = \true
K_RANDOM_SECURITY
String used as a seed for some security code generation please change this value and keep it secret.
public mixed K_RANDOM_SECURITY =
'mkTzxf8WwUxwvj6w'
K_REDIRECT_LOGIN_MODE
Various pages redirection modes after login (valid values are 1, 2, 3 and 4).
public mixed K_REDIRECT_LOGIN_MODE =
4
1 = relative redirect. 2 = absolute redirect. 3 = html redirect. 4 = full redirect.
K_REMAINING_TESTS
Set to false to disable test counting.
public mixed K_REMAINING_TESTS =
\false
K_SECONDS_IN_DAY
Number of seconds in one day.
public mixed K_SECONDS_IN_DAY =
24 *
\K_SECONDS_IN_HOUR
K_SECONDS_IN_HOUR
Number of seconds in one hour.
public mixed K_SECONDS_IN_HOUR =
60 *
\K_SECONDS_IN_MINUTE
K_SECONDS_IN_MINUTE
Number of seconds in one minute.
public mixed K_SECONDS_IN_MINUTE =
60
K_SECONDS_IN_MONTH
Number of seconds in one month.
public mixed K_SECONDS_IN_MONTH =
30 *
\K_SECONDS_IN_DAY
K_SECONDS_IN_WEEK
Number of seconds in one week.
public mixed K_SECONDS_IN_WEEK =
7 *
\K_SECONDS_IN_DAY
K_SECONDS_IN_YEAR
Number of seconds in one year.
public mixed K_SECONDS_IN_YEAR =
365 *
\K_SECONDS_IN_DAY
K_SELECT_SUBSTRING
Max number of chars to display on a selection box.
public mixed K_SELECT_SUBSTRING =
40
K_SESSION_LIFE
User's session life time in seconds.
public mixed K_SESSION_LIFE =
\K_SECONDS_IN_HOUR
K_SHIBBOLETH_ENABLED
If true trust Shibboleth Auth
public mixed K_SHIBBOLETH_ENABLED =
\false
K_SHIBBOLETH_LOGIN
URL of the Shibboleth login page
public mixed K_SHIBBOLETH_LOGIN =
''
K_SHIBBOLETH_USER_GROUP_ID
Default user group ID This is the TCExam group id to which the accounts belong.
public mixed K_SHIBBOLETH_USER_GROUP_ID =
1
You can also set 0 for all available groups or a string containing a comma-separated list of group IDs.
K_SHIBBOLETH_USER_LEVEL
Default user level
public mixed K_SHIBBOLETH_USER_LEVEL =
1
K_SHORT_ANSWERS_BINARY
If true compare short answers in binary mode.
public mixed K_SHORT_ANSWERS_BINARY =
\false
K_SITE_AUTHOR
Default site author.
public mixed K_SITE_AUTHOR = 'Nicola Asuni -
Tecnick.com LTD'
K_SITE_DESCRIPTION
Default site description.
public mixed K_SITE_DESCRIPTION =
'TCExam by
Tecnick.com'
K_SITE_ICON
Path to default html icon.
public mixed K_SITE_ICON = '../../favicon.ico'
K_SITE_KEYWORDS
Default keywords.
public mixed K_SITE_KEYWORDS =
'TCExam,
eExam, e-exam, web, exam'
K_SITE_REPLY
Default html reply-to meta tag.
public mixed K_SITE_REPLY = ''
K_SITE_STYLE
Path to public CSS stylesheet for LTR languages.
public mixed K_SITE_STYLE = \K_PATH_STYLE_SHEETS .
\K_PUBLIC_THEME . '.css'
K_SITE_STYLE_RTL
Path to CSS stylesheet for RTL languages.
public mixed K_SITE_STYLE_RTL =
\K_PATH_STYLE_SHEETS .
\K_PUBLIC_THEME . '_rtl.css'
K_SITE_TITLE
Default site name.
public mixed K_SITE_TITLE = 'TCExam'
K_SMALL_RATIO
reduction factor for small font
public mixed K_SMALL_RATIO = 2 /
3
K_SSL_ENABLED
If true trust SSL Auth
public mixed K_SSL_ENABLED = \false
K_SSL_USER_GROUP_ID
Default user group ID This is the TCExam group id to which the accounts belong.
public mixed K_SSL_USER_GROUP_ID =
1
You can also set 0 for all available groups or a string containing a comma-separated list of group IDs.
K_SSL_USER_LEVEL
Default user level
public mixed K_SSL_USER_LEVEL =
1
K_STANDARD_PORT
Standard port for http (80) or https (443).
public mixed K_STANDARD_PORT =
80
K_TAB
Tabulation character.
public mixed K_TAB = "\t"
K_TABLE_ANSWERS
This table contains all answers relative to a specific questions.
public mixed K_TABLE_ANSWERS =
\K_TABLE_PREFIX .
'answers'
K_TABLE_GROUPS
This table contains users' groups. Each user belongs to one of the groups defined in this table.
public mixed K_TABLE_GROUPS =
\K_TABLE_PREFIX
. 'user_groups'
K_TABLE_LOG_ANSWER
This table contains the list of the selected alternative answers for each multiple-choice question.
public mixed K_TABLE_LOG_ANSWER =
\K_TABLE_PREFIX .
'tests_logs_answers'
K_TABLE_MODULES
Table for modules. A module is a container for subjects.
public mixed K_TABLE_MODULES =
\K_TABLE_PREFIX .
'modules'
K_TABLE_PREFIX
prefix for database tables names
public mixed K_TABLE_PREFIX =
'tce_'
K_TABLE_QUESTIONS
This table contains all questions relative to specific subjects.
public mixed K_TABLE_QUESTIONS =
\K_TABLE_PREFIX .
'questions'
K_TABLE_SESSIONS
This table stores information about users' Web sessions.
public mixed K_TABLE_SESSIONS =
\K_TABLE_PREFIX .
'sessions'
K_TABLE_SSLCERTS
This table contains the SSL certificates.
public mixed K_TABLE_SSLCERTS =
\K_TABLE_PREFIX .
'sslcerts'
K_TABLE_SUBJECT_SET
This table contains all tests subjects (topics, branch of studies).
public mixed K_TABLE_SUBJECT_SET =
\K_TABLE_PREFIX .
'test_subjects'
K_TABLE_SUBJECTS
This table contains all tests subjects (topics, branch of studies).
public mixed K_TABLE_SUBJECTS =
\K_TABLE_PREFIX .
'subjects'
K_TABLE_TEST_GROUPS
This table contains the list of groups enabled for a selected test.
public mixed K_TABLE_TEST_GROUPS =
\K_TABLE_PREFIX .
'testgroups'
K_TABLE_TEST_SSLCERTS
This table contains the list of SSL certificates enabled for a selected test.
public mixed K_TABLE_TEST_SSLCERTS =
\K_TABLE_PREFIX .
'testsslcerts'
K_TABLE_TEST_SUBJSET
This table lists the type and quantity of the questions associated to each set of subjects selected for a particular test.
public mixed K_TABLE_TEST_SUBJSET =
\K_TABLE_PREFIX .
'test_subject_set'
K_TABLE_TEST_USER
This table contains the list of tests generated for each user.
public mixed K_TABLE_TEST_USER =
\K_TABLE_PREFIX .
'tests_users'
K_TABLE_TESTS
This table contains all tests data.
public mixed K_TABLE_TESTS = \K_TABLE_PREFIX .
'tests'
K_TABLE_TESTS_LOGS
This table contains all questions and user answers relative to a specific test for a specific user.
public mixed K_TABLE_TESTS_LOGS =
\K_TABLE_PREFIX .
'tests_logs'
K_TABLE_TESTUSER_STAT
This table counts the number of generated tests.
public mixed K_TABLE_TESTUSER_STAT =
\K_TABLE_PREFIX .
'testuser_stat'
K_TABLE_USERGROUP
This table contains the list of groups to whom each user belongs.
public mixed K_TABLE_USERGROUP =
\K_TABLE_PREFIX .
'usrgroups'
K_TABLE_USERS
This table contains all registered users' data, including system administrators and a special 'anonymous' user.
public mixed K_TABLE_USERS = \K_TABLE_PREFIX .
'users'
K_TCEXAM_AUTHOR
TCExam Author.
public mixed K_TCEXAM_AUTHOR =
'Nicola Asuni
- Tecnick.com LTD'
K_TCEXAM_DESCRIPTION
TCExam description.
public mixed K_TCEXAM_DESCRIPTION =
'TCExam by
Tecnick.com'
K_TCEXAM_ICON
Relative path to html icon.
public mixed K_TCEXAM_ICON = '../../favicon.ico'
K_TCEXAM_KEYWORDS
Default html meta keywords.
public mixed K_TCEXAM_KEYWORDS =
'TCExam,
eExam, e-exam, web, exam'
K_TCEXAM_REPLY_TO
Reply-to meta tag.
public mixed K_TCEXAM_REPLY_TO =
''
K_TCEXAM_STYLE
Path to public CSS stylesheet for LTR languages.
public mixed K_TCEXAM_STYLE =
\K_PATH_STYLE_SHEETS
. \K_ADMIN_THEME . '.css'
K_TCEXAM_STYLE_RTL
Full path to CSS stylesheet for RTL languages.
public mixed K_TCEXAM_STYLE_RTL =
\K_PATH_STYLE_SHEETS .
\K_ADMIN_THEME . '_rtl.css'
K_TCEXAM_TITLE
TCExam title.
public mixed K_TCEXAM_TITLE =
'TCExam'
K_TCEXAM_VERSION
TCExam version (do not change).
public mixed K_TCEXAM_VERSION =
\file_get_contents('../../VERSION')
K_TCPDF_CALLS_IN_HTML
if true allows to call TCPDF methods using HTML syntax IMPORTANT: For security reason, disable this feature if you are printing user HTML content.
public mixed K_TCPDF_CALLS_IN_HTML =
\false
K_TCPDF_EXTERNAL_CONFIG
Do not change the value of this define.
public mixed K_TCPDF_EXTERNAL_CONFIG =
\true
K_TCPDF_THROW_EXCEPTION_ERROR
if true adn PHP version is greater than 5, then the Error() method throw new exception instead of terminating the execution.
public mixed K_TCPDF_THROW_EXCEPTION_ERROR
= \false
K_TEST_INFO_HEIGHT
Popup window height in pixels for test info.
public mixed K_TEST_INFO_HEIGHT =
400
K_TEST_INFO_WIDTH
Popup window width in pixels for test info.
public mixed K_TEST_INFO_WIDTH =
700
K_THAI_TOPCHARS
set to true to enable the special procedure used to avoid the overlappind of symbols on Thai language
public mixed K_THAI_TOPCHARS =
\false
K_TIMESTAMP_FORMAT
Define timestamp format using PHP notation (do not change).
public mixed K_TIMESTAMP_FORMAT =
'Y-m-d
H:i:s'
K_TIMEZONE
Set your own timezone here.
public mixed K_TIMEZONE = 'UTC'
Possible values are listed on: http://php.net/manual/en/timezones.php
K_TITLE_MAGNIFICATION
title magnification respect main font size
public mixed K_TITLE_MAGNIFICATION =
1.3
K_UPDATE_PASSKEY
UPDATES PASSKEY
public mixed K_UPDATE_PASSKEY =
'0'
K_UPDATE_SERVER
Updating server
public mixed K_UPDATE_SERVER =
'http://updates.tcexam.com'
K_USE_ERROR_LOG
Enable error logs (../log/tce_errors.log).
public mixed K_USE_ERROR_LOG =
\false
K_USER_GROUP_RSYNC
When an alternate authentication method is used, if this constant is true the default user groups for the selected authentication method are always added to the user.
public mixed K_USER_GROUP_RSYNC =
\false
K_USRREG_ADMIN_EMAIL
The following email will receive copies of verification messages.
public mixed K_USRREG_ADMIN_EMAIL =
''
K_USRREG_AGREEMENT
URL of an HTML page containing the registration agreement (i.e.: "http://www.example.com/agreement.html").
public mixed K_USRREG_AGREEMENT =
''
K_USRREG_EMAIL_CONFIRM
If true requires email confirmation.
public mixed K_USRREG_EMAIL_CONFIRM =
\true
K_USRREG_ENABLED
If true enable USER REGISTRATION.
public mixed K_USRREG_ENABLED =
\true
K_USRREG_GROUP
Default user group ID for registered user.
public mixed K_USRREG_GROUP =
1
K_USRREG_PASSWORD_RE
Regular expression defining the allowed characters for a password
public mixed K_USRREG_PASSWORD_RE =
'^(.{8,})$'
K_UTF8_NORMALIZATION_MODE
Set the UTF-8 Normalization mode for question and answer descriptions: 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'.
public mixed K_UTF8_NORMALIZATION_MODE =
'NONE'
PDF_AUTHOR
Document author.
public mixed PDF_AUTHOR = 'TCExam
12'
PDF_CREATOR
Document creator.
public mixed PDF_CREATOR = 'TCExam
12'
PDF_FONT_MONOSPACED
default monospaced font name
public mixed PDF_FONT_MONOSPACED =
'courier'
PDF_FONT_NAME_DATA
Data font name.
public mixed PDF_FONT_NAME_DATA =
'helvetica'
PDF_FONT_NAME_MAIN
Main font name.
public mixed PDF_FONT_NAME_MAIN =
'helvetica'
PDF_FONT_SIZE_DATA
Data font size.
public mixed PDF_FONT_SIZE_DATA =
7
PDF_FONT_SIZE_MAIN
Main font size.
public mixed PDF_FONT_SIZE_MAIN =
9
PDF_HEADER_LOGO
Image logo.
public mixed PDF_HEADER_LOGO =
'logo_example.png'
PDF_HEADER_LOGO_WIDTH
Header logo image width [mm].
public mixed PDF_HEADER_LOGO_WIDTH =
20
PDF_HEADER_STRING
Header description string.
public mixed PDF_HEADER_STRING =
"first
row\nsecond row\nthird row"
PDF_HEADER_TITLE
Header title.
public mixed PDF_HEADER_TITLE =
"School
name"
PDF_IMAGE_SCALE_RATIO
ratio used to adjust the conversion of pixels to user units
public mixed PDF_IMAGE_SCALE_RATIO =
1.25
PDF_MARGIN_BOTTOM
Bottom margin.
public mixed PDF_MARGIN_BOTTOM =
30
PDF_MARGIN_FOOTER
Footer margin.
public mixed PDF_MARGIN_FOOTER =
10
PDF_MARGIN_HEADER
Header margin.
public mixed PDF_MARGIN_HEADER =
5
PDF_MARGIN_LEFT
Left margin.
public mixed PDF_MARGIN_LEFT =
15
PDF_MARGIN_RIGHT
Right margin.
public mixed PDF_MARGIN_RIGHT =
15
PDF_MARGIN_TOP
Top margin.
public mixed PDF_MARGIN_TOP =
27
PDF_PAGE_FORMAT
Page format.
public mixed PDF_PAGE_FORMAT =
'A4'
PDF_PAGE_ORIENTATION
Page orientation (P=portrait, L=landscape).
public mixed PDF_PAGE_ORIENTATION =
'P'
PDF_TEXTANSWER_HEIGHT
Height of area for offline user answer.
public mixed PDF_TEXTANSWER_HEIGHT =
40
PDF_UNIT
Document unit of measure [pt=point, mm=millimeter, cm=centimeter, in=inch].
public mixed PDF_UNIT = 'mm'
PHP_VERSION_ID
public mixed PHP_VERSION_ID =
$version[0] *
10000 + $version[2] * 100 + $version[4]
Functions
F_html_color_picker()
Display Color Picker
F_html_color_picker(mixed $callingform,
mixed $callingfield,
mixed $tag)
: mixed
Parameters
- $callingform : mixed
- $callingfield : mixed
- $tag : mixed
Tags
F_isValidbackupFile()
F_isValidbackupFile(mixed $file)
: mixed
Parameters
- $file : mixed
F_send_report_emails()
Sends email test reports to users.
F_send_report_emails( $test_id[,
$user_id
= 0
][,
$testuser_id
= 0
][,
$group_id
= 0
][,
$startdate
= 0
][,
$enddate
= 0
][,
$mode
= 0
][,
$display_mode
= 1
][,
$show_graph
= false
]) : mixed
Parameters
- $test_id :
-
(int) TEST ID
- $user_id : = 0
-
(int) USER ID (0 means all users)
- $testuser_id : = 0
-
(int) test-user ID - if greater than zero, filter stats for the specified test-user.
- $group_id : = 0
-
(int) GROUP ID (0 means all groups)
- $startdate : = 0
-
(int) start date ID - if greater than zero, filter stats for the specified starting date
- $enddate : = 0
-
(int) end date ID - if greater than zero, filter stats for the specified ending date
- $mode : = 0
-
(int) type of report to send: 0=detailed report; 1=summary report (without questions)
- $display_mode : = 1
-
display (int) mode: 0 = disabled; 1 = minimum; 2 = module; 3 = subject; 4 = question; 5 = answer.
- $show_graph : = false
-
(boolean) If true display the score graph.
Tags
F_deleteMediaFile()
Delete the selected media file
F_deleteMediaFile( $filename)
: true
Parameters
Tags
Return values
true —in case of success, false otherwise
F_renameMediaFile()
Rename the selected media file
F_renameMediaFile( $filename,
$newname)
: true
Parameters
Tags
Return values
true —in case of success, false otherwise
F_createMediaDir()
Create a new media directory inside the cache
F_createMediaDir( $dirname)
: true
Parameters
Tags
Return values
true —in case of success, false otherwise
F_deleteMediaDir()
Delete the specified media directory
F_deleteMediaDir( $dirname)
: true
Parameters
Tags
Return values
true —in case of success, false otherwise
F_getFileInfo()
Get file information
F_getFileInfo( $file)
: associative
Parameters
Tags
Return values
associative —array containing file info or false in case of error
F_formatFileSize()
Return a formatted file size
F_formatFileSize( $size)
: string
Parameters
Tags
Return values
string —formatted size
F_getMediaDirPathLink()
Get an html string containing active path of the specified directory with links to subdirectories.
F_getMediaDirPathLink( $dirpath[,
$viewmode
= true
]) : an
Parameters
Tags
Return values
an —html string
F_getDirFiles()
Get an associative array of directories and folder inside the specified dir.
F_getDirFiles( $dir[,
$rootdir
= K_PATH_CACHE
][,
$authdirs
= ''
]) : an
Parameters
- $dir :
-
(string) the starting directory path
- $rootdir : = K_PATH_CACHE
-
(string) the user root dir.
- $authdirs : = ''
-
(string) regular expression containing the authorized dirs.
Tags
Return values
an —associative array containing sorted 'dirs' and 'files'
F_isUsedMediaFile()
Return true if the file is used on question or answer descriptions
F_isUsedMediaFile( $file)
: true
Parameters
Tags
Return values
true —if the file is used, false otherwise
F_getDirTable()
Get an html table containing files and subdirs
F_getDirTable( $dir[,
$selected
= ''
][,
$params
= ''
][,
$rootdir
= K_PATH_CACHE
][,
$authdirs
= ''
]) : html
Parameters
- $dir :
-
(string) the starting directory path
- $selected : = ''
-
(string) the selected file
- $params : = ''
-
(string) additional parameters to add on links
- $rootdir : = K_PATH_CACHE
-
(string) the user root dir.
- $authdirs : = ''
-
(string) regular expression containing the authorized dirs.
Tags
Return values
html —table
F_getDirVisualTable()
Get an html visual list of files and subdirs
F_getDirVisualTable( $dir[,
$selected
= ''
][,
$params
= ''
][,
$rootdir
= K_PATH_CACHE
][,
$authdirs
= ''
]) : html
Parameters
- $dir :
-
(string) the starting directory path
- $selected : = ''
-
(string) the selected file
- $params : = ''
-
(string) additional parameters to add on links
- $rootdir : = K_PATH_CACHE
-
(string) the user root dir.
- $authdirs : = ''
-
(string) regular expression containing the authorized dirs.
Tags
Return values
html —table
F_getAuthorizedDirs()
Returns a regular expression to match authorised directories.
F_getAuthorizedDirs()
: a
Return values
a —regular expression to match authorised directories.
F_isAuthorizedDir()
Returns true if the user is authorized to use the specified directory, false otherwise.
F_isAuthorizedDir( $dir,
$rootdir[,
$authdirs
= ''
]) : true
Parameters
- $dir :
-
(string) the directory to check.
- $rootdir :
-
(string) the user root dir.
- $authdirs : = ''
-
(string) regular expression containing the authorized dirs.
Return values
true —if the user is authorized to use the specified directory, false otherwise.
F_encodeOMRTestData()
Encode OMR test data array as a string to be printed on QR-Code.
F_encodeOMRTestData( $data)
: encoded
Parameters
Return values
encoded —string.
F_decodeOMRTestData()
Decode OMR test data string (read from QR-Code) as array.
F_decodeOMRTestData( $str)
: array<string|int,
mixed>
Parameters
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()
Read QR-Code from OMR page and return Test data.
F_decodeOMRTestDataQRCode( $image)
: array<string|int,
mixed>
This function uses the external application zbarimg (http://zbar.sourceforge.net/).
Parameters
Return values
array<string|int, mixed> —with test data or false in case o error
F_decodeOMRPage()
Decode a single OMR Page and return data array.
F_decodeOMRPage( $image)
: array<string|int,
mixed>
This function requires ImageMagick library and zbarimg (http://zbar.sourceforge.net/).
Parameters
Return values
array<string|int, mixed> —of answers data or false in case of error.
F_importOMRTestData()
Import user's test data from OMR.
F_importOMRTestData( $user_id,
$date,
$omr_testdata,
$omr_answers[,
$overwrite
= false
]) : bool
Parameters
- $user_id :
-
(int) user ID.
- $date :
-
(string) date-time field.
- $omr_testdata :
-
(array) Array containing test data.
- $omr_answers :
-
(array) Array containing test answers (from OMR).
- $overwrite : = false
-
(boolean) If true overwrites the previous answers on non-repeatable tests.
Return values
bool —TRUE in case of success, FALSE otherwise.
F_question_set_enabled()
Enable/Disable selected question
F_question_set_enabled( $question_id[,
$enabled
= true
]) : mixed
Parameters
- $question_id :
-
(int) question ID
- $enabled : = true
-
(boolean) if true enables question, false otherwise
Tags
F_question_get_position()
Get question position
F_question_get_position( $question_id)
: int
Parameters
Tags
Return values
int —question position
F_question_get_data()
Get question data
F_question_get_data( $question_id)
: array<string|int,
mixed>
Parameters
Tags
Return values
array<string|int, mixed> —containing selected question data, false in case of error
F_question_delete()
Delete selected question (or disable it if used)
F_question_delete( $question_id,
$subject_id)
: mixed
Parameters
Tags
F_question_copy()
Copy selected question to another topic
F_question_copy( $question_id,
$new_subject_id)
: mixed
Parameters
Tags
tcecodeEditorTagButtons()
Display TCExam Code EDITOR Tag Buttons
tcecodeEditorTagButtons( $callingform,
$callingfield)
: XHTML
Parameters
- $callingform :
-
(string) name of calling xhtml form
- $callingfield :
-
(string) name of calling form field (textarea where output code will be sent)
Tags
Return values
XHTML —string
getImageButton()
Display one tag button
getImageButton( $name,
$tag,
$image[,
$onclick
= ''
][,
$accesskey
= ''
]) : XHTML
Parameters
- $name :
-
(string) name of the button
- $tag :
-
(string) tag value
- $image :
-
(string) image file of button
- $onclick : = ''
-
(string) default onclick action
- $accesskey : = ''
-
(string) accesskey: character for keyboard shortcut
Tags
Return values
XHTML —string
F_select_test()
Display test selection for using F_show_select_test function.
F_select_test( $order_field,
$orderdir,
$firstrow,
$rowsperpage[,
$andwhere
= ''
][,
$searchterms
= ''
]) : true
Parameters
- $order_field :
-
(string) order by column name
- $orderdir :
-
(string) oreder direction
- $firstrow :
-
(string) number of first row to display
- $rowsperpage :
-
(string) number of rows per page
- $andwhere : = ''
-
(string) additional SQL WHERE query conditions
- $searchterms : = ''
-
(string) search terms
Tags
Return values
trueF_show_select_test()
Display test selection XHTML table.
F_show_select_test( $order_field,
$orderdir,
$firstrow,
$rowsperpage[,
$andwhere
= ''
][,
$searchterms
= ''
]) : false
Parameters
- $order_field :
-
(string) Order by column name.
- $orderdir :
-
(int) Order direction.
- $firstrow :
-
(int) Number of first row to display.
- $rowsperpage :
-
(int) Number of rows per page.
- $andwhere : = ''
-
(string) Additional SQL WHERE query conditions.
- $searchterms : = ''
-
(string) Search terms.
Tags
Return values
false —in case of empty database, true otherwise
F_show_select_test_popup()
Display user selection XHTML table (popup mode).
F_show_select_test_popup( $order_field,
$orderdir,
$firstrow,
$rowsperpage[,
$andwhere
= ''
][,
$searchterms
= ''
][,
string $cid
= 0
]) : false
Parameters
- $order_field :
-
(string) Order by column name.
- $orderdir :
-
(int) Order direction.
- $firstrow :
-
(int) Number of first row to display.
- $rowsperpage :
-
(int) Number of rows per page.
- $andwhere : = ''
-
(string) Additional SQL WHERE query conditions.
- $searchterms : = ''
-
(string) Search terms.
- $cid : string = 0
-
ID of the calling form field.
Tags
Return values
false —in case of empty database, true otherwise
F_isTestOnSSLCerts()
Return true if the selected test is active for the selected SSL Certificate
F_isTestOnSSLCerts( $test_id,
$ssl_id)
: bool
Parameters
Tags
Return values
bool —true/false
F_is_allowed_upload()
Check if the uploaded file extension is allowed.
F_is_allowed_upload( $filename)
: true
Parameters
Tags
Return values
true —in case of allowed file type, false otherwise
F_upload_file()
Uploads image file to the server.
F_upload_file( $fieldname,
$uploaddir)
: mixed
Parameters
- $fieldname :
-
(string) form field name containing the source file path
- $uploaddir :
-
(string) upload directory
Tags
Return values
mixed —file name or false in case of error
F_read_file_size()
returns the file size in bytes
F_read_file_size( $filetocheck)
: mixed
Parameters
Tags
Return values
mixed —file size in bytes or false in case of error
F_select_user()
Display user selection for using F_show_select_user function.
F_select_user( $order_field,
$orderdir,
$firstrow,
$rowsperpage[,
$group_id
= 0
][,
$andwhere
= ''
][,
$searchterms
= ''
]) : true
Parameters
- $order_field :
-
(string) order by column name
- $orderdir :
-
(string) oreder direction
- $firstrow :
-
(string) number of first row to display
- $rowsperpage :
-
(string) number of rows per page
- $group_id : = 0
-
(int) id of the group (default = 0 = no specific group selected)
- $andwhere : = ''
-
(string) additional SQL WHERE query conditions
- $searchterms : = ''
-
(string) search terms
Tags
Return values
trueF_show_select_user()
Display user selection XHTML table.
F_show_select_user( $order_field,
$orderdir,
$firstrow,
$rowsperpage[,
$group_id
= 0
][,
$andwhere
= ''
][,
$searchterms
= ''
]) : false
Parameters
- $order_field :
-
(string) Order by column name.
- $orderdir :
-
(int) Order direction.
- $firstrow :
-
(int) Number of first row to display.
- $rowsperpage :
-
(int) Number of rows per page.
- $group_id : = 0
-
(int) ID of the group (default = 0 = no specific group selected).
- $andwhere : = ''
-
(string) Additional SQL WHERE query conditions.
- $searchterms : = ''
-
(string) Search terms.
Tags
Return values
false —in case of empty database, true otherwise
F_show_select_user_popup()
Display user selection XHTML table (popup mode).
F_show_select_user_popup( $order_field,
$orderdir,
$firstrow,
$rowsperpage[,
$group_id
= 0
][,
$andwhere
= ''
][,
$searchterms
= ''
][,
string $cid
= 0
]) : false
Parameters
- $order_field :
-
(string) Order by column name.
- $orderdir :
-
(int) Order direction.
- $firstrow :
-
(int) Number of first row to display.
- $rowsperpage :
-
(int) Number of rows per page.
- $group_id : = 0
-
(int) ID of the group (default = 0 = no specific group selected).
- $andwhere : = ''
-
(string) Additional SQL WHERE query conditions.
- $searchterms : = ''
-
(string) Search terms.
- $cid : string = 0
-
ID of the calling form field.
Tags
Return values
false —in case of empty database, true otherwise
F_isTestOnGroup()
Return true if the selected test is active for the selected group
F_isTestOnGroup( $test_id,
$group_id)
: bool
Parameters
Tags
Return values
bool —true/false
F_isUserOnGroup()
Return true if the selected user belongs to the selected group
F_isUserOnGroup( $user_id,
$group_id)
: bool
Parameters
Tags
Return values
bool —true/false
F_isAuthorizedEditorForGroup()
Return true if the current user is an administrator or belongs to the group, false otherwise
F_isAuthorizedEditorForGroup( $group_id)
: bool
Parameters
Tags
Return values
bool —true/false
F_isAuthorizedEditorForUser()
Return true if the current user is authorized to edit the specified user
F_isAuthorizedEditorForUser( $user_id)
: bool
Parameters
Tags
Return values
bool —true/false
F_user_group_select_sql()
Return the SQL selection query for user groups
F_user_group_select_sql([ $where
= ''
]) : sql
Parameters
Tags
Return values
sql —selection string
F_user_group_select()
Display select box for user groups
F_user_group_select([ $name
= 'group_id'
]) : table
Parameters
Return values
table —header element string
F_get_user_groups()
Returns an array containing groups IDs to which the specified user belongs
F_get_user_groups( $user_id)
: array<string|int,
mixed>
Parameters
Return values
array<string|int, mixed> —containing user's groups IDs
F_getUIDfromRegnum()
Return the user ID from registration number.
F_getUIDfromRegnum(mixed $regnum)
: int
Parameters
- $regnum : mixed
Tags
Return values
int —User ID or 0 in case of error.
F_show_online_users()
Display online users form using F_list_online_users function.
F_show_online_users( $wherequery,
$order_field,
$orderdir,
$firstrow,
$rowsperpage)
: false
Parameters
- $wherequery :
-
(string) users selection query
- $order_field :
-
(string) order by column name
- $orderdir :
-
(string) oreder direction
- $firstrow :
-
(string) number of first row to display
- $rowsperpage :
-
(string) number of rows per page
Tags
Return values
false —in case of empty database, true otherwise
F_list_online_users()
Display online users.
F_list_online_users( $wherequery,
$order_field,
$orderdir,
$firstrow,
$rowsperpage)
: false
Parameters
- $wherequery :
-
(string) users selection query
- $order_field :
-
(string) order by column name
- $orderdir :
-
(int) oreder direction
- $firstrow :
-
(int) number of first row to display
- $rowsperpage :
-
(int) number of rows per page
Tags
Return values
false —in case of empty database, true otherwise
F_TSVQuestionImporter()
Import questions from TSV file (tab delimited text).
F_TSVQuestionImporter( $tsvfile)
: bool
The format of TSV is the same obtained by exporting data from TCExam interface.
Parameters
Return values
bool —TRUE in case of success, FALSE otherwise
F_import_tsv_users()
Import users from TSV file (tab delimited text).
F_import_tsv_users( $tsvfile)
: bool
The format of TSV is the same obtained by exporting data from Users Selection Form.
Parameters
Return values
bool —TRUE in case of success, FALSE otherwise
F_show_select_questions()
Display a list of selected questions.
F_show_select_questions( $wherequery,
$subject_module_id,
$subject_id,
$order_field,
$orderdir,
$firstrow,
$rowsperpage[,
$hide_answers
= false
]) : false
Parameters
- $wherequery :
-
(string) question selection query
- $subject_module_id :
-
(string) module ID
- $subject_id :
-
(string) topic ID
- $order_field :
-
(string) order by column name
- $orderdir :
-
(int) oreder direction
- $firstrow :
-
(int) number of first row to display
- $rowsperpage :
-
(int) number of rows per page
- $hide_answers : = false
-
(boolean) if true hide answers
Tags
Return values
false —in case of empty database, true otherwise
F_tsv_export_questions()
Export all questions of the selected subject to TSV.
F_tsv_export_questions( $module_id,
$subject_id,
$expmode)
: TSV
Parameters
- $module_id :
-
(int) module ID
- $subject_id :
-
(int) topic ID
- $expmode :
-
(int) export mode: 1 = selected topic; 2 = selected module; 3 = all modules.
Return values
TSV —data
F_tsv_export_users()
Export all users to TSV grouped by users' groups.
F_tsv_export_users()
: TSV
Tags
Return values
TSV —data
F_xml_export_question_stats()
Export all question statistics of the selected test to XML.
F_xml_export_question_stats( $test_id)
: XML
Parameters
Tags
Return values
XML —data
F_xml_export_questions()
Export all questions of the selected subject to XML.
F_xml_export_questions( $module_id,
$subject_id,
$expmode)
: XML
Parameters
- $module_id :
-
(int) module ID
- $subject_id :
-
(int) topic ID
- $expmode :
-
(int) export mode: 1 = selected topic; 2 = selected module; 3 = all modules.
Tags
Return values
XML —data
F_xml_export_results()
Export results in XML format.
F_xml_export_results( $test_id[,
$group_id
= 0
][,
$user_id
= 0
][,
$startdate
= 0
][,
$enddate
= 0
][,
$display_mode
= 1
]) : XML
Parameters
- $test_id :
-
(int) test ID.
- $group_id : = 0
-
(int) group ID - if greater than zero, filter stats for the specified user group.
- $user_id : = 0
-
(int) user ID - if greater than zero, filter stats for the specified user.
- $startdate : = 0
-
(int) start date ID - if greater than zero, filter stats for the specified starting date
- $enddate : = 0
-
(int) end date ID - if greater than zero, filter stats for the specified ending date
- $display_mode : = 1
-
(int) display mode: 0 = disabled; 1 = minimum; 2 = module; 3 = subject; 4 = question; 5 = answer.
Tags
Return values
XML —data
F_xml_export_user_results()
Export user results in XML format.
F_xml_export_user_results( $user_id,
$startdate,
$enddate,
$order_field)
: XML
Parameters
- $user_id :
-
(int) user ID - if greater than zero, filter stats for the specified user.
- $startdate :
-
(string) start date ID - if greater than zero, filter stats for the specified starting date
- $enddate :
-
(string) end date ID - if greater than zero, filter stats for the specified ending date
- $order_field :
-
(string) Ordering fields for SQL query.
Tags
Return values
XML —data
F_xml_export_users()
Export all users to XML grouped by users' groups.
F_xml_export_users()
: XML
Tags
Return values
XML —data
F_altLogin()
Try various external Login Systems.
F_altLogin()
: array<string|int,
mixed>
(SSL, HTTP-BASIC, CAS, SHIBBOLETH, RADIUS, LDAP, CUSTOM)
Tags
Return values
array<string|int, mixed> —of user's data for successful login, false otherwise
F_db_connect()
Open a connection to a MySQL Server and select a database.
F_db_connect([ $host
= 'localhost'
][,
$port
= '3306'
][,
$username
= 'root'
][,
$password
= ''
][,
$database
= ''
]) : MySQL
Parameters
- $host : = 'localhost'
-
(string) database server host name.
- $port : = '3306'
-
(string) database connection port
- $username : = 'root'
-
(string) Name of the user that owns the server process.
- $password : = ''
-
(string) Password of the user that owns the server process.
- $database : = ''
-
(string) Database name.
Return values
MySQL —link identifier on success, or FALSE on failure.
F_db_close()
Closes the non-persistent connection to a database associated with the given connection resource.
F_db_close( $link_identifier)
: bool
Parameters
Return values
bool —TRUE on success or FALSE on failure
F_db_error()
Returns the text of the error message from previous database operation
F_db_error([mixed $link_identifier
= null
]) : string
Parameters
- $link_identifier : mixed = null
Return values
string —error message.
F_db_query()
Sends a query to the currently active database on the server that's associated with the specified link identifier.<br>
F_db_query( $query,
$link_identifier)
: false
Parameters
- $query :
-
(string) The query tosend. The query string should not end with a semicolon.
- $link_identifier :
-
(resource) database link identifier.
Return values
false —in case of error, TRUE or resource-identifier in case of success.
F_db_fetch_array()
Fetch a result row as an associative and numeric array.
F_db_fetch_array( $result)
: Returns
Note: This function sets NULL fields to PHP NULL value.
Parameters
Return values
Returns —an array that corresponds to the fetched row, or FALSE if there are no more rows.
F_db_fetch_assoc()
Fetch a result row as an associative array.
F_db_fetch_assoc( $result)
: Returns
Note: This function sets NULL fields to PHP NULL value.
Parameters
Return values
Returns —an array that corresponds to the fetched row, or FALSE if there are no more rows.
F_db_affected_rows()
Returns number of rows (tuples) affected by the last INSERT, UPDATE or DELETE query associated with link_identifier.
F_db_affected_rows( $link_identifier,
$result)
: Number
Parameters
- $link_identifier :
-
(resource) database link identifier.
- $result :
-
(resource) result resource to the query result [UNUSED].
Return values
Number —of rows.
F_db_num_rows()
Get number of rows in result.
F_db_num_rows( $result)
: Number
Parameters
Return values
Number —of affected rows.
F_db_insert_id()
Get the ID generated from the previous INSERT operation
F_db_insert_id( $link_identifier[,
$tablename
= ''
][,
$fieldname
= ''
]) : int
Parameters
- $link_identifier :
-
(resource) database link identifier.
- $tablename : = ''
-
(string) Table name.
- $fieldname : = ''
-
(string) Field name (column name).
Return values
int —ID generated from the last INSERT operation.
F_db_datetime_diff_seconds()
Returns the SQL string to calculate the difference in seconds between to datetime fields.
F_db_datetime_diff_seconds(mixed $start_date_field,
mixed $end_date_field)
: SQL
Parameters
- $start_date_field : mixed
- $end_date_field : mixed
Return values
SQL —query string
F_escape_sql()
Escape a string for insertion into a SQL text field (avoiding SQL injection).
F_escape_sql( $link_identifier,
$str[,
$stripslashes
= true
]) : string
Parameters
- $link_identifier :
-
(resource) database link identifier.
- $str :
-
(string) The string that is to be escaped.
- $stripslashes : = true
-
(boolean) if true strip slashes from string
Tags
Return values
string —Returns the escaped string, or FALSE on error.
F_db_connect()
Open a connection to a MySQL Server and select a database.
F_db_connect([ $host
= 'localhost'
][,
$port
= '3306'
][,
$username
= 'root'
][,
$password
= ''
][,
$database
= ''
]) : MySQL
Parameters
- $host : = 'localhost'
-
(string) database server host name.
- $port : = '3306'
-
(string) database connection port
- $username : = 'root'
-
(string) Name of the user that owns the server process.
- $password : = ''
-
(string) Password of the user that owns the server process.
- $database : = ''
-
(string) Database name.
Return values
MySQL —link identifier on success, or FALSE on failure.
F_db_close()
Closes the non-persistent connection to a database associated with the given connection resource.
F_db_close( $link_identifier)
: bool
Parameters
Return values
bool —TRUE on success or FALSE on failure
F_db_error()
Returns the text of the error message from previous database operation
F_db_error([mixed $link_identifier
= null
]) : string
Parameters
- $link_identifier : mixed = null
Return values
string —error message.
F_db_query()
Sends a query to the currently active database on the server that's associated with the specified link identifier.<br>
F_db_query( $query,
$link_identifier)
: false
Parameters
- $query :
-
(string) The query tosend. The query string should not end with a semicolon.
- $link_identifier :
-
(resource) database link identifier.
Return values
false —in case of error, TRUE or resource-identifier in case of success.
F_db_fetch_array()
Fetch a result row as an associative and numeric array.
F_db_fetch_array( $result)
: Returns
Note: This function sets NULL fields to PHP NULL value.
Parameters
Return values
Returns —an array that corresponds to the fetched row, or FALSE if there are no more rows.
F_db_fetch_assoc()
Fetch a result row as an associative array.
F_db_fetch_assoc( $result)
: Returns
Note: This function sets NULL fields to PHP NULL value.
Parameters
Return values
Returns —an array that corresponds to the fetched row, or FALSE if there are no more rows.
F_db_affected_rows()
Returns number of rows (tuples) affected by the last INSERT, UPDATE or DELETE query associated with link_identifier.
F_db_affected_rows( $link_identifier,
$result)
: Number
Parameters
- $link_identifier :
-
(resource) database link identifier.
- $result :
-
(resource) result resource to the query result [UNUSED].
Return values
Number —of rows.
F_db_num_rows()
Get number of rows in result.
F_db_num_rows( $result)
: Number
Parameters
Return values
Number —of affected rows.
F_db_insert_id()
Returns the auto generated id used in the last query.
F_db_insert_id( $link_identifier[,
$tablename
= ''
][,
$fieldname
= ''
]) : int
Parameters
- $link_identifier :
-
(resource) database link identifier.
- $tablename : = ''
-
(string) Table name. (unused here but required for other DAL).
- $fieldname : = ''
-
(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()
Returns the SQL string to calculate the difference in seconds between to datetime fields.
F_db_datetime_diff_seconds(mixed $start_date_field,
mixed $end_date_field)
: SQL
Parameters
- $start_date_field : mixed
- $end_date_field : mixed
Return values
SQL —query string
F_escape_sql()
Escape a string for insertion into a SQL text field (avoiding SQL injection).
F_escape_sql( $link_identifier,
$str[,
$stripslashes
= true
]) : string
Parameters
- $link_identifier :
-
(resource) database link identifier.
- $str :
-
(string) The string that is to be escaped.
- $stripslashes : = true
-
(boolean) if true strip slashes from string
Tags
Return values
string —Returns the escaped string, or FALSE on error.
F_db_connect()
Open a connection to a Oracle Server and select a database.
F_db_connect([ $host
= 'localhost'
][,
$port
= '1521'
][,
$username
= 'root'
][,
$password
= ''
][,
$database
= ''
]) : Oracle
If 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 : = 'localhost'
-
(string) database server host name.
- $port : = '1521'
-
(string) database connection port
- $username : = 'root'
-
(string) Name of the user that owns the server process.
- $password : = ''
-
(string) Password of the user that owns the server process.
- $database : = ''
-
(string) Database name.
Return values
Oracle —link identifier on success, or FALSE on failure.
F_db_close()
Closes the non-persistent connection to a database associated with the given connection resource.
F_db_close( $link_identifier)
: bool
Parameters
Return values
bool —TRUE on success or FALSE on failure
F_db_error()
Returns the text of the error message from previous database operation
F_db_error([mixed $link_identifier
= null
]) : string
Parameters
- $link_identifier : mixed = null
Return values
string —error message.
F_db_query()
Sends a query to the currently active database on the server that's associated with the specified link identifier.<br> NOTE: Convert MySQL RAND() function to Oracle RANDOM() on ORDER BY clause of selection queries.
F_db_query( $query,
$link_identifier)
: false
Parameters
- $query :
-
(string) The query tosend. The query string should not end with a semicolon.
- $link_identifier :
-
(resource) database link identifier.
Return values
false —in case of error, TRUE or resource-identifier in case of success.
F_db_fetch_array()
Fetch a result row as an associative and numeric array.
F_db_fetch_array( $result)
: Returns
Note: This function sets NULL fields to PHP NULL value.
Parameters
Return values
Returns —an array that corresponds to the fetched row, or FALSE if there are no more rows.
F_db_fetch_assoc()
Fetch a result row as an associative array.
F_db_fetch_assoc( $result)
: Returns
Note: This function sets NULL fields to PHP NULL value.
Parameters
Return values
Returns —an array that corresponds to the fetched row, or FALSE if there are no more rows.
F_db_affected_rows()
Returns number of rows (tuples) affected by the last INSERT, UPDATE or DELETE query associated with link_identifier.
F_db_affected_rows( $link_identifier,
$result)
: Number
Parameters
- $link_identifier :
-
(resource) database link identifier [UNUSED].
- $result :
-
(resource) result resource to the query result.
Return values
Number —of rows.
F_db_num_rows()
Get number of rows in result.
F_db_num_rows( $result)
: Number
Parameters
Return values
Number —of affected rows.
F_db_insert_id()
Get the ID generated from the previous INSERT operation
F_db_insert_id( $link_identifier[,
$tablename
= ''
][,
$fieldname
= ''
]) : int
Parameters
- $link_identifier :
-
(resource) database link identifier.
- $tablename : = ''
-
(string) Table name.
- $fieldname : = ''
-
(string) Field name (column name).
Return values
int —ID generated from the last INSERT operation.
F_db_datetime_diff_seconds()
Returns the SQL string to calculate the difference in seconds between to datetime fields.
F_db_datetime_diff_seconds(mixed $start_date_field,
mixed $end_date_field)
: SQL
Parameters
- $start_date_field : mixed
- $end_date_field : mixed
Return values
SQL —query string
F_escape_sql()
Escape a string for insertion into a SQL text field (avoiding SQL injection).
F_escape_sql( $link_identifier,
$str[,
$stripslashes
= true
]) : string
Parameters
- $link_identifier :
-
(resource) database link identifier.
- $str :
-
(string) The string that is to be escaped.
- $stripslashes : = true
-
(boolean) if true strip slashes from string
Tags
Return values
string —Returns the escaped string, or FALSE on error.
F_db_connect()
Open a connection to a PostgreSQL Server and select a database.
F_db_connect([ $host
= 'localhost'
][,
$port
= '5432'
][,
$username
= 'postgres'
][,
$password
= ''
][,
$database
= 'template1'
]) : PostgreSQL
If 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 : = 'localhost'
-
(string) database server host name.
- $port : = '5432'
-
(string) database connection port
- $username : = 'postgres'
-
(string) Name of the user that owns the server process.
- $password : = ''
-
(string) Password of the user that owns the server process.
- $database : = 'template1'
-
(string) Database name.
Return values
PostgreSQL —link identifier on success, or FALSE on failure.
F_db_close()
Closes the non-persistent connection to a database associated with the given connection resource.
F_db_close( $link_identifier)
: bool
Parameters
Return values
bool —TRUE on success or FALSE on failure
F_db_error()
Returns the text of the error message from previous database operation
F_db_error([mixed $link_identifier
= null
]) : string
Parameters
- $link_identifier : mixed = null
Return values
string —error message.
F_db_query()
Sends a query to the currently active database on the server that's associated with the specified link identifier.<br> NOTE: Convert MySQL RAND() function to PostgreSQL RANDOM() on ORDER BY clause of selection queries.
F_db_query( $query,
$link_identifier)
: false
Parameters
- $query :
-
(string) The query tosend. The query string should not end with a semicolon.
- $link_identifier :
-
(resource) database link identifier.
Return values
false —in case of error, TRUE or resource-identifier in case of success.
F_db_fetch_array()
Fetch a result row as an associative and numeric array.
F_db_fetch_array( $result)
: Returns
Note: This function sets NULL fields to PHP NULL value.
Parameters
Return values
Returns —an array that corresponds to the fetched row, or FALSE if there are no more rows.
F_db_fetch_assoc()
Fetch a result row as an associative array.
F_db_fetch_assoc( $result)
: Returns
Note: This function sets NULL fields to PHP NULL value.
Parameters
Return values
Returns —an array that corresponds to the fetched row, or FALSE if there are no more rows.
F_db_affected_rows()
Returns number of rows (tuples) affected by the last INSERT, UPDATE or DELETE query associated with link_identifier.
F_db_affected_rows( $link_identifier,
$result)
: Number
Parameters
- $link_identifier :
-
(resource) database link identifier [UNUSED].
- $result :
-
(resource) result resource to the query result.
Return values
Number —of rows.
F_db_num_rows()
Get number of rows in result.
F_db_num_rows( $result)
: Number
Parameters
Return values
Number —of affected rows.
F_db_insert_id()
Get the ID generated from the previous INSERT operation
F_db_insert_id( $link_identifier[,
$tablename
= ''
][,
$fieldname
= ''
]) : int
Parameters
- $link_identifier :
-
(resource) database link identifier.
- $tablename : = ''
-
(string) Table name.
- $fieldname : = ''
-
(string) Field name (column name).
Return values
int —ID generated from the last INSERT operation.
F_db_datetime_diff_seconds()
Returns the SQL string to calculate the difference in seconds between to datetime fields.
F_db_datetime_diff_seconds(mixed $start_date_field,
mixed $end_date_field)
: SQL
Parameters
- $start_date_field : mixed
- $end_date_field : mixed
Return values
SQL —query string
F_escape_sql()
Escape a string for insertion into a SQL text field (avoiding SQL injection).
F_escape_sql( $link_identifier,
$str[,
$stripslashes
= true
]) : string
Parameters
- $link_identifier :
-
(resource) database link identifier.
- $str :
-
(string) The string that is to be escaped.
- $stripslashes : = true
-
(boolean) if true strip slashes from string
Tags
Return values
string —Returns the escaped string, or FALSE on error.
F_select_modules_sql()
Returns a SQL string to select modules accounting for user authorizations.
F_select_modules_sql([ $andwhere
= ''
]) : string
Parameters
Tags
Return values
string —sql statement
F_select_subjects_sql()
Returns a SQL string to select subjects accounting for user authorizations.
F_select_subjects_sql([ $andwhere
= ''
]) : string
Parameters
Tags
Return values
string —sql statement
F_select_module_subjects_sql()
Returns a SQL string to select modules and subjects accounting for user authorizations.
F_select_module_subjects_sql([ $andwhere
= ''
]) : string
Parameters
Tags
Return values
string —sql statement
F_select_tests_sql()
Returns a SQL string to select tests accounting for user authorizations.
F_select_tests_sql()
: string
Tags
Return values
string —sql statement
F_select_executed_tests_sql()
Returns a SQL string to select executed tests accounting for user authorizations.
F_select_executed_tests_sql()
: string
Tags
Return values
string —sql statement
F_loginForm()
Returns XHTML / CSS formatted string for login form.<br> The CSS classes used are: <ul> <li>div.login_form : container for login box</li> <li>div.login_form div.login_row : container for label + input field or button</li> <li>div.login_form div.login_row span.label : container for input label</li> <li>div.login_form div.login_row span.formw : container for input form</li> </ul>
F_loginForm(mixed $faction,
mixed $fid,
mixed $fmethod,
mixed $fenctype,
mixed $username)
: XHTML
Parameters
- $faction : mixed
- $fid : mixed
- $fmethod : mixed
- $fenctype : mixed
- $username : mixed
Return values
XHTML —string for login form
F_login_form()
Display login page.
F_login_form()
: mixed
NOTE: This function calls exit() after execution.
F_logout_form()
Display logout form.
F_logout_form()
: XHTML
Return values
XHTML —string for logout form.
F_logout_page()
Display logout page.
F_logout_page()
: mixed
NOTE: This function calls exit() after execution.
F_isAuthorizedUser()
Returns true if the current user is authorized to update and delete the selected database record.
F_isAuthorizedUser( $table,
$field_id_name,
$value_id,
$field_user_id)
: bool
Parameters
- $table :
-
(string) table to be modified
- $field_id_name :
-
(string) name of the main ID field of the table
- $value_id :
-
(int) value of the ID field of the table
- $field_user_id :
-
(string) name of the foreign key to to user_id
Tags
Return values
bool —true if the user is authorized, false otherwise
F_getAuthorizedUsers()
Returns a comma separated string of ID of the users that belong to the same groups.
F_getAuthorizedUsers( $user_id)
: string
Parameters
Tags
Return values
stringF_syncUserGroups()
Sync user groups with the ones specified on the configuration file for alternate authentication.
F_syncUserGroups( $usrid,
$grpids)
: mixed
Parameters
- $usrid :
-
(int) ID of the user to update.
- $grpids :
-
(mixed) Group ID or comma separated list of group IDs (0=all available groups).
Tags
F_isSslCertificateValid()
Check if the client has a valid SSL certificate.
F_isSslCertificateValid()
: true
Tags
Return values
true —if the client has a valid SSL certificate, false otherwise.
F_getSSLCertificateHash()
Get the hash code of the specified SSL certificate
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
Return values
array<string|int, mixed> —containing the hash code and the validity end date in unix epoch.
F_getSSLClientHash()
Get the hash code for the client certificate
F_getSSLClientHash()
: string
Tags
Return values
string —containing the hash code.
F_print_error()
Handle error/warning/system messages.
F_print_error([ $messagetype
= 'MESSAGE'
][,
$messagetoprint
= ''
][,
$exit
= false
]) : mixed
Print a message
Parameters
F_display_db_error()
Print the database error message.
F_display_db_error([ $exit
= true
]) : mixed
Parameters
F_error_handler()
Custom PHP error handler function.
F_error_handler( $errno,
$errstr,
$errfile,
$errline)
: mixed
Parameters
- $errno :
-
(int) The first parameter, errno, contains the level of the error raised, as an integer.
- $errstr :
-
(string) The second parameter, errstr, contains the error message, as a string.
- $errfile :
-
(string) The third parameter is optional, errfile, which contains the filename that the error was raised in, as a string.
- $errline :
-
(int) The fourth parameter is optional, errline, which contains the line number the error was raised at, as an integer.
F_url_exists()
Check if the URL exist.
F_url_exists(mixed $url)
: Returns
Parameters
- $url : mixed
Return values
Returns —TRUE if the URL exists; FALSE otherwise.
F_file_exists()
Wrapper for file_exists.
F_file_exists(mixed $filename)
: Returns
Checks 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()
Returns an array containing form fields.
F_decode_form_fields()
: array<string|int,
mixed>
Return values
array<string|int, mixed> —containing form fields
F_check_required_fields()
Check Required Form Fields.<br> Returns a string containing a list of missing fields (comma separated).
F_check_required_fields( $formfields)
: array<string|int,
mixed>
Parameters
Return values
array<string|int, mixed> —containing a list of missing fields (if any)
F_check_fields_format()
Check fields format using regular expression comparisons.<br> Returns a string containing a list of wrong fields (comma separated).
F_check_fields_format( $formfields)
: array<string|int,
mixed>
NOTE: to check a field create a new hidden field with the same name starting with 'x_'
An example powerful regular expression for email check is: ^([a-zA-Z0-9_.-]+)@(([[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.)|(([a-zA-Z0-9-]+.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(]?)$
Parameters
Return values
array<string|int, mixed> —containing a list of wrongfields (if any)
F_check_form_fields()
Check Form Fields.
F_check_form_fields()
: false
see: F_check_required_fields, F_check_fields_format
Return values
false —in case of error, true otherwise
F_stripslashes_formfields()
Strip slashes from posted form fields.
F_stripslashes_formfields()
: mixed
F_close_button()
Returns XHTML code string to display a window close button
F_close_button([ $onclick
= ''
]) : XHTML
Parameters
Return values
XHTML —code string
F_submit_button()
Returns XHTML code string to display Form Submit Button.
F_submit_button( $name,
$value[,
$title
= ''
][,
$extra
= ''
]) : XHTML
Parameters
- $name :
-
(string) button name
- $value :
-
(string) label for button
- $title : = ''
-
(string) button title, default=''
- $extra : = ''
-
(string) optional extra fields to add to the input tag, default=''
Return values
XHTML —code string
F_getCSRFTokenField()
Returns XHTML code string to display the CSRF token field.
F_getCSRFTokenField()
: XHTML
Return values
XHTML —code string
getFormRowTextInput()
Print input row form.
getFormRowTextInput( $field_name,
$name[,
$description
= ''
][,
$tip
= ''
][,
$value
= ''
][,
$format
= ''
][,
$maxlen
= 255
][,
$date
= false
][,
$datetime
= false
][,
$password
= false
][,
$prefix
= ''
]) : string
Parameters
- $field_name :
-
(string) Name of the form field.
- $name :
-
(string) Label.
- $description : = ''
-
(string) Label description (tooltip).
- $tip : = ''
-
(string) Help to be displayed on the right of the input field.
- $value : = ''
-
(string) Initial value.
- $format : = ''
-
(string) Regular expression to check the format of the field.
- $maxlen : = 255
-
(int) Maximum input lenght.
- $date : = false
-
(boolean) True if the field is a date input.
- $datetime : = false
-
(boolean) True if the field is a date-time input.
- $password : = false
-
(boolean) True if the field is a password.
- $prefix : = ''
-
(string) code to be displayed after label.
Return values
stringgetFormRowTextBox()
Print text box row form.
getFormRowTextBox( $field_name,
$name[,
$description
= ''
][,
$value
= ''
][,
$disabled
= false
][,
$prefix
= ''
]) : string
Parameters
- $field_name :
-
(string) Name of the form field.
- $name :
-
(string) Label.
- $description : = ''
-
(string) Label description (tooltip).
- $value : = ''
-
(string) Initial value.
- $disabled : = false
-
(boolean) If true disable the field.
- $prefix : = ''
-
(string) code to be displayed after label.
Return values
stringgetFormRowSelectBox()
Print select box row form.
getFormRowSelectBox( $field_name,
$name[,
$description
= ''
][,
$tip
= ''
][,
$value
= ''
][,
$items
= []
][,
$prefix
= ''
]) : string
Parameters
- $field_name :
-
(string) Name of the form field.
- $name :
-
(string) Label.
- $description : = ''
-
(string) Label description (tooltip).
- $tip : = ''
-
(string) Help to be displayed on the right of the input field.
- $value : = ''
-
(string) Initial value.
- $items : = []
-
(array) array of items to print key => value.
- $prefix : = ''
-
(string) code to be displayed after label.
Return values
stringgetFormRowCheckBox()
Print check box row form.
getFormRowCheckBox( $field_name,
$name[,
$description
= ''
][,
$tip
= ''
][,
$value
= ''
][,
$selected
= false
][,
$disabled
= false
][,
$prefix
= ''
]) : string
Parameters
- $field_name :
-
(string) Name of the form field.
- $name :
-
(string) Label.
- $description : = ''
-
(string) Label description (tooltip).
- $tip : = ''
-
(string) Help to be displayed on the right of the input field.
- $value : = ''
-
(string) Initial value.
- $selected : = false
-
(boolean) set to true if selected.
- $disabled : = false
-
(boolean) set to true to disable the field
- $prefix : = ''
-
(string) code to be displayed after label.
Return values
stringgetFormRowFixedValue()
Print fixed value row form.
getFormRowFixedValue( $field_name,
$name[,
$description
= ''
][,
$tip
= ''
][,
$value
= ''
][,
$currency
= false
][,
$prefix
= ''
]) : string
Parameters
- $field_name :
-
(string) Name of the form field.
- $name :
-
(string) Label.
- $description : = ''
-
(string) Label description (tooltip).
- $tip : = ''
-
(string) Help to be displayed on the right of the input field.
- $value : = ''
-
(string) Initial value.
- $currency : = false
-
(boolean) if true the value is a curency number.
- $prefix : = ''
-
(string) code to be displayed after label.
Return values
stringgetFormSmallVertSpace()
Print empty form row.
getFormSmallVertSpace()
: string
Return values
stringgetFormSmallDivSpace()
Print empty form row.
getFormSmallDivSpace()
: string
Return values
stringgetFormRowVertSpace()
Print empty form row.
getFormRowVertSpace()
: string
Return values
stringgetFormRowVertDiv()
Print form row with title.
getFormRowVertDiv([ $title
= ''
]) : string
Parameters
Return values
stringgetFormNoscriptSelect()
Print form row with submit button when noscript is active.
getFormNoscriptSelect([ $name
= 'selectrecord'
]) : string
Parameters
Return values
stringgetFormDescriptionLine()
Print form row with label and description
getFormDescriptionLine( $name[,
$description
= ''
][,
$value
= ''
]) : string
Parameters
- $name :
-
(string) Label.
- $description : = ''
-
(string) Label description (tooltip).
- $value : = ''
-
(string) Initial value.
Return values
stringgetFormUploadFile()
Print input row form to upluad a file.
getFormUploadFile( $field_name,
$field_id,
$name[,
$description
= ''
][,
$onchange
= ''
]) : string
Parameters
- $field_name :
-
(string) Name of the form field.
- $field_id :
-
(string) ID of the form field.
- $name :
-
(string) Label.
- $description : = ''
-
(string) Label description (tooltip).
- $onchange : = ''
-
(string) Javascript code to execute at onchange event.
Return values
stringF_count_rows()
Count rows of the given table.
F_count_rows( $dbtable[,
$where
= ''
]) : number
Parameters
- $dbtable :
-
(string) database table name
- $where : = ''
-
(string) optional where SQL clause (including the WHERE keyword).
Return values
number —of rows
F_empty_to_null()
Prepare field value for SQL query.<br> Returns the quoted string if not empty, NULL otherwise.
F_empty_to_null( $str)
: string
Parameters
Return values
string —$str quoted if not empty, NULL otherwise
F_zero_to_null()
Prepare field value for SQL query.<br> Returns the num if different from zero, NULL otherwise.
F_zero_to_null( $num)
: string
Parameters
Return values
string —$num if != 0, NULL otherwise
F_getBoolean()
Returns boolean value from string or integer.<br> This function is needed to get the right boolean value from boolean field returned by PostgreSQL query.
F_getBoolean( $str)
: bool
Parameters
Return values
bool —value.
F_check_unique()
Check if specified fields are unique on table.
F_check_unique( $table,
$where[,
$fieldname
= false
][,
$fieldid
= false
]) : bool
Parameters
- $table :
-
(string) table name
- $where :
-
(string) SQL where clause
- $fieldname : = false
-
(mixed) name of table column to check
- $fieldid : = false
-
(mixed) ID of table row to check
Return values
bool —true if unique, false otherwise
unhtmlentities()
Reverse function for htmlentities.
unhtmlentities( $text_to_convert[,
$preserve_tagsign
= false
]) : converted
Parameters
- $text_to_convert :
-
(string) input string to convert
- $preserve_tagsign : = false
-
(boolean) if true preserve <> symbols, default=FALSE
Return values
converted —string
F_compact_string()
Remove the following characters: <ul> <li>"\t" (ASCII 9 (0x09)), a tab.</li> <li>"\n" (ASCII 10 (0x0A)), a new line (line feed)</li> <li>"\r" (ASCII 13 (0x0D)), a carriage return</li> <li>"\0" (ASCII 0 (0x00)), the NUL-byte</li> <li>"\x0B" (ASCII 11 (0x0B)), a vertical tab</li> </ul>
F_compact_string( $string[,
$dquotes
= false
]) : converted
Parameters
- $string :
-
(string) input string to convert
- $dquotes : = false
-
(boolean) If true add slash in fron of double quotes;
Return values
converted —string
F_replace_angulars()
Replace angular parenthesis with html equivalents (html entities).
F_replace_angulars( $str)
: converted
Parameters
Return values
converted —string
F_substr_utf8()
Performs a multi-byte safe substr() operation based on number of characters.
F_substr_utf8( $str,
$start,
$length)
: substring
Parameters
- $str :
-
(string) input string
- $start :
-
(int) substring start index
- $length :
-
(int) substring max lenght
Return values
substringF_text_to_xml()
Escape some special characters (< > &).
F_text_to_xml( $str)
: converted
Parameters
Return values
converted —string
F_xml_to_text()
Unescape some special characters (< > &).
F_xml_to_text( $str)
: converted
Parameters
Return values
converted —string
F_text_to_tsv()
Escape some special characters for TSV output.
F_text_to_tsv( $str)
: converted
Parameters
Return values
converted —string
F_tsv_to_text()
Unescape some special characters from TSV format.
F_tsv_to_text( $str)
: converted
Parameters
Return values
converted —string
showRequiredField()
Return a string containing an HTML acronym for required/not required fields.
showRequiredField([ $mode
= 1
]) : html
Parameters
Return values
html —string
utrim()
Strip whitespace (or other characters) from the beginning and end of an UTF-8 string and replace the "\xA0" with normal space.
utrim( $txt)
: string
Parameters
Return values
string —The trimmed string.
getNormalizedIP()
Convert all IP addresses to IPv6 expanded notation.
getNormalizedIP( $ip)
: string
Parameters
Tags
Return values
string —IPv6 address in expanded notation or false in case of invalid input.
getIpAsInt()
Converts a string containing an IP address into its integer value.
getIpAsInt( $ip)
: int
Parameters
Tags
Return values
int —IP address as integer number.
getIpAsString()
Converts a string containing an IP address into its integer value and return string representation.
getIpAsString( $ip)
: int
Parameters
Tags
Return values
int —IP address as string.
F_formatFloat()
Format a percentage number.
F_formatFloat( $num)
: formatted
Parameters
Return values
formatted —string
F_formatPercentage()
Format a percentage number.
F_formatPercentage( $num[,
$ratio
= true
]) : formatted
Parameters
- $num :
-
(float) Number to be formatted.
- $ratio : = 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()
format a percentage number
F_formatPdfPercentage( $num[,
$ratio
= true
]) : string
Parameters
- $num :
-
(float) number to be formatted
- $ratio : = 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
stringF_formatXMLPercentage()
format a percentage number for XML
F_formatXMLPercentage( $num[,
$ratio
= true
]) : string
Parameters
- $num :
-
(float) number to be formatted
- $ratio : = 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
stringF_getUTCoffset()
Returns the UTC time offset in seconds
F_getUTCoffset( $timezone)
: int
Parameters
Return values
int —UTC time offset in seconds
F_db_getUTCoffset()
Returns the UTC time offset yo be used with CONVERT_TZ function
F_db_getUTCoffset( $timezone)
: string
Parameters
Return values
string —UTC time offset (+HH:mm)
getDataXML()
Get data array in XML format.
getDataXML( $data[,
$level
= 1
]) : string
Parameters
Return values
string —XML data
getDataTSVHeader()
Get data headers (keys) in TSV header (tab separated text values).
getDataTSVHeader( $data[,
$prefix
= ''
]) : string
Parameters
Return values
string —data
getDataTSV()
Get data in TSV format (tab separated text values).
getDataTSV( $data)
: string
Parameters
Return values
string —XML data
F_html_to_TSV()
Convert HTML code to TSV string.
F_html_to_TSV( $str)
: string
Parameters
Return values
string —TSV
F_select_table_header_element()
Display table header element with order link.
F_select_table_header_element( $order_field,
$orderdir,
$title,
$name[,
$current_order_field
= ''
][,
$filter
= ''
]) : table
Parameters
- $order_field :
-
(string) name of table field
- $orderdir :
-
(string) order direction
- $title :
-
title (string) field of anchor link
- $name :
-
column (string) name
- $current_order_field : = ''
-
(string) current order field name
- $filter : = ''
-
(string) additional parameters to pass on URL
Return values
table —header element string
getContrastColor()
Get a black or white color that maximize contrast.
getContrastColor( $color)
: string
Parameters
Return values
string —Color.
F_isURL()
Returns true if the string is an URL.
F_isURL( $str)
: bool
Parameters
Return values
bool —true or false.
F_utf8_normalizer()
Normalize the UTF-8 input string.
F_utf8_normalizer( $str[,
$mode
= 'NONE'
]) : normalized
Modes greater than 0 requires php5-intl module. Please edit this function to implement your custom normalization method.
Parameters
- $str :
-
(string) UTF-8 string to normalize.
- $mode : = '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()
Convert an long integer number to a Hexadecimal representation
bcdechex(string|int $dec)
: string
Parameters
- $dec : string|int
-
Decimal number to convert.
Tags
Return values
string —containing the HEX representation in uppercase.
F_html_to_text()
Convert HTML code to Text string.
F_html_to_text( $str[,
$preserve_newlines
= false
][,
$display_links
= false
]) : text
Parameters
- $str :
-
(string) HTML code string to convert.
- $preserve_newlines : = false
-
(boolean) If true convert newline characters to HTML line breaks.
- $display_links : = false
-
(boolean) If true gives a textual representation of links and images.
Return values
text —string
F_menu_link()
Returns a menu element link wit subitems.
F_menu_link( $link,
$data[,
$level
= 0
]) : mixed
If the link refers to the current page, only the name will be returned.
Parameters
F_menu_isChildActive()
Returns true if the menu item has an active child, false otherwise.
F_menu_isChildActive( $data)
: mixed
Parameters
F_getRandomOTPkey()
Return a random One Time Password Secret Key (Base32 encoded).
F_getRandomOTPkey()
: Base32
Return values
Base32 —encoded key.
F_decodeBase32()
Decode a Base32 encoded string.
F_decodeBase32( $code)
: Decoded
Parameters
Return values
Decoded —key.
F_getOTP()
Get a One Time Password for the specified secret key.
F_getOTP( $otpkey[,
$mtime
= 0
]) : OTP
Parameters
Return values
OTPF_show_page_navigator()
Display Pages navigation index.
F_show_page_navigator( $script_name,
$sql,
$firstrow,
$rowsperpage,
$param_array)
: mixed
Parameters
- $script_name :
-
(string) url of the calling page
- $sql :
-
(string) sql used to select records
- $firstrow :
-
(int) first row number
- $rowsperpage :
-
(int) number of max rows per page
- $param_array :
-
(string) parameters to pass on url via GET
Return values
mixed —the number of pages in case of success, FALSE otherwise
F_session_open()
Open session.
F_session_open( $save_path,
$session_name)
: bool
Parameters
Return values
bool —always TRUE
F_session_close()
Close session.<br> Call garbage collector function to remove expired sessions.
F_session_close()
: bool
Return values
bool —always TRUE
F_session_read()
Get session data.
F_session_read(