Install TCExam in CentOS 6.x
The training department of the company has recently had online examination requirements, but the online examination system currently used does not have the automatic scoring function. All the questions need to be reviewed manually, which is very inefficient. To solve this problem, I found a lot of software online for testing, but the results were not very satisfactory until I met TCExam, an open-source software.
TCExam is an online examination system developed based on PHP. The installation environment is LAMP. Its installation is very simple and not very complicated.
1. Install the LAMP Environment
Although tcexam requires a lamp environment, it must be installed through yum in the official documentation. After manually compiling and installing the lamp environment, I encountered many problems during tcexam installation. So here I am using yum to install lamp and other related software.
1. Install the epel-release source
yum install -y epel-release;
2. Install lamp
yum install -y gd curl ImageMagick texlive zbar mysql-server php httpd php-mysql libdbi-dbd-mysql php-gd php-curl memcached
3. Modify the apache configuration file
vim /etc/httpd/conf/httpd.conf
Modify ServerName
ServerName localhost:80
4. Set the php Time Zone
vim /etc/php.ini
Modify date. timezone
date.timezone = "Asia/Shanghai"
5. Start Related Services
# Set mysql service chkconfig mysqld onservice mysqld start # Set apache service chkconfig httpd onservice httpd start # Set memcached service chkconfig memcached onservice memcached start
2. Download TCExam1 and go to the website root directory:
cd /var/www/html
2. Download the installation package from the official website.
wget https://github.com/tecnickcom/tcexam/archive/master.zip
3. Unzip the installation package
uzip master.zip
4. The decompressed folder is "tcexam-master". Move all files in the tcexam-master Directory to/var/www/html and delete the tcexam-master Directory.
mv ./tcexam-master/* .rm -rf tcexam-master
3. Set mysql
According to the official tcexam installation page, you can automatically create a tcexam database and import the initial data. However, according to the actual operation results, this function basically cannot complete this task. Therefore, we need to manually create a database and import the initial data.
1. Set the mysql root Password
Tcexams requires that the mysql root Password cannot be blank. Therefore, set the mysql root Password first.
mysqladmin -u root password "newpassword";
"Newpassword" is the root password of your specified mysql.
2. Create a database in mysql
Mysql-uroot-p; # enter your password # create database tcexam; # exit mysqlquit
3. Import initialization data 1). Go to the tcexam installation page Directory.
cd /var/www/html/install
2) Import initial data
mysql -uroot -p tcexam < mysql_db_structure.sqlmysql -uroot -p tcexam < db_data.sql
Run each statement separately and press enter to enter the password as prompted.
4. Disable selinux of the host, clear iptabels1, and modify the selinux configuration file.
Vim/etc/selinux/config # modify SELINUX = enforcingSELINUX = disabled
Save and exit
2. temporarily disable selander
setenforce 0
3. Clear iptables and save
iptables -Fservice iptables save
5. Visit the tcexam installation page
Enter the following address in the browser. The IP address is the IP address of your server.
http:\\IP\install\install.php
If the database is on the local machine, you only need to modify the following items on the page:
Enter the mysql root password in the db password
Remove the check boxes after "Drop Existing Database" and "Create New Database.
Click "INSTALL" to complete the installation.
Vi. Security Settings
Follow the official documentation to perform the following operations to enhance program security after installation.
1. Delete the installation directory and TXT files under the root directory.
cd /var/www/htmlrm -rf installrm -rf *.TXT
2. Set the owner and permissions of related directories
find . -exec chown -R apache:apache {} \;find . -type f -exec chmod 544 {} \;find cache/ -type f -exec chmod 644 {} \;find cache/backup -type f -exec chmod 644 {} \;find cache/lang -type f -exec chmod 544 {} \;find admin/log/ -type f -exec chmod 644 {} \;find public/log/ -type f -exec chmod 644 {} \;find . -type d -exec chmod 755 {} \;
VII. tcexam configuration 1. Set email Verification
Shared/config/tce_email_config.php needs to be modified
# Administrator's email address $ emailcfg ['adminmail'] = 'lzl001 @ 163.com '; # smtp server $ emailcfg ['host'] = 'smtp .163.com '; # smtp Service Port $ emailcfg ['Port'] = 25; (the default Port is 25) # email user name $ emailcfg ['username'] = 'lzl001 @ 163.com '; # email Password $ emailcfg ['Password'] = '000000'; # Whether to enable height mode $ emailcfg ['smtpdebug'] = false;
2. Set the default logon language to simplified Chinese
Shared/config/tce_config.php needs to be modified
/** * 2-letters code for default language. */define ('K_LANGUAGE', 'cn');
3. Modify exported PDF settings and set Chinese Fonts
The exported PDF file is garbled by default. Therefore, you need to modify shared/config/tce_pdf.php.
First download the Drod Sans Fallback-PHP font file online
Decompress the three files droidsansfallback. php, droidsansfallback. z, and droidsansfallback. ctg. z in the compressed package to the fonts directory.
# Modify the title define ('pdf _ HEADER_TITLE ', "Main title") of a PDF file; # modify the subtitle of a PDF file (three Subtitles can be set) define ('pdf _ HEADER_STRING ', "Subtitle 1 \ n subtitle 2 \ n subtitle 3"); # Set the PDF log. The default icon file is placed in the images directory define ('pdf _ HEADER_LOGO ', 'logo.png '); # Set the default font define ('pdf _ FONT_NAME_MAIN', 'stsonstmdlight '); define ('pdf _ FONT_NAME_DATA', 'stsonstmdlight ');
4. Modify the website log
The default icon file is stored in the./imagesdirectory. The file name is logo_tcexam_118x25.png.
The image size is 118*25, in png format.
5. User Registration settings
Modify the./shared/config/tce_user_registration.php File
# Whether to allow users to register define ('K _ USRREG_ENABLED ', true); # whether to use mailbox authentication define ('K _ USRREG_EMAIL_CONFIRM', false ); # Default User Group ID # Check the IDdefine ('K _ USRREG_GROUP ', 3) of the user group in the database; # define ('K _ USRREG_AGREEMENT ', ''); # define ('K _ USRREG_ADMIN_EMAIL ',''); # The items to be displayed on the registration page, 0 disabled, and 1 Optional, 2 required/*** Additional fields to display on registration form. * Legal values: * 0 = disabled field; * 1 = enabled field; * 2 = required field; */$ regfields = array ('user _ email '=> 0, 'User _ regnumber' => 0, 'user _ firstname' => 2, 'user _ lastname' => 2, 'user _ birthdate' => 0, 'User _ birthplace '=> 0, 'user _ ssn' => 0, 'user _ groups' => 0, 'user _ agreement '=> 0 );
6. tcexam configuration file description 1). The main tcexam configuration files are all placed in the./shared/config directory, starting with tce _ and ending with. php.
File Name |
Description |
Tce_cas.php |
CAS authentication center Configuration |
Tce_config |
General system settings |
Tce_db_config.php |
Database Configuration |
Tce_email_config.php |
Email Configuration |
Tce_general_constants.php |
General System constant Configuration |
Tce_latex.php |
LaTeX formula Configuration |
Tce_ldap.php |
LDAP Configuration |
Tce_mime.php |
MIME file extension Association |
Tce_paths.php |
Configure files and folders in the system |
Tce_pdf.php |
PDF File Export settings |
Tce_radius.php |
RADIUS Configuration |
Tce_user_registration.php |
User Registration Configuration |
2) System Management Configuration File
The configuration files are stored in the./admin/config directory.
File Name |
Description |
Tce_auth.php |
Access Level configuration of the Management Module |
Tce_config.php |
Common Management panel configuration |
3) Public region configuration file
File Name |
Description |
Tce_auth.php |
Access Level configuration of Public modules |
Tce_config.php |
General configurations of Public Area drive |
VIII. Use of tcexam 1. log on
Http: // IP
By default, the admin password is 1234.
2. Use
Tcexam is divided into the front-end and back-end: the front-end is to register users and take tests; the back-end is to manage users, question bank management, test exams, text question grading, and result summary query.
You don't need to talk about it at the front-end. Just log on to the front-end and take the test;
The main part of the background is question and exam generation. Since it is not very difficult to implement, users with a slight computer base can master 80% after testing twice. So here I just want to explain the general process.
1) generate a module
It can be understood as a subject, mathematics, Chinese, or English!
2) generate a topic
It can be understood as a question bank.
3) add a question
It can be understood as the questions in the question Library
4) add answers
Add standard answers to questions in the question Library (no answers are required for text questions)
5) after completing the above operations, you can create a test in the test management and take the test randomly from the question bank.