To Education Campus - To CATS Translation
CATS Software Developer Documentation
This page is intended for developers who want to extend (or understand) the CATS software which ist used for the AssurerChallenge and other tests. As usual it is incomplete and maybe not up-to-date. If you find something worth correcting, feel free...
Table of Contents
Database tables
The database can be accessed on the development system by
mysql --user=cats_user --password=PASSWORD cats_db
See also the documentation included the CATS
Questions
You guessed it, it's the table containing the questions.
Field |
Type |
Null |
Key |
Default |
Extra |
Comment |
q_id |
int(11) |
NO |
PRI |
NULL |
auto_increment |
|
qt_id |
int(11) |
NO |
|
0 |
|
|
t_id |
int(11) |
NO |
|
0 |
|
refers to the corresponding record in the topics table |
question |
text |
NO |
|
NULL |
|
|
active |
enum('1','0') |
NO |
|
0 |
|
Flag, 1 for "Question may be used in tests" |
description |
enum('1','0') |
NO |
|
0 |
|
Flag, 1 for "has a detailed comment in table (which one?)" |
ref_q_id |
int(11) |
YES |
|
NULL |
|
Refers to the "Master Question" in case of a translated question |
translationstatus |
int(11) |
YES |
|
NULL |
|
To support translation. NULL is for not initialized, 1 is for completed, 2 is for "in work", 3 is for "Master Question modified", 4 is for "new question". Questions with status 4 may later be modified/overwritten automatically in case the master question is modified. |
Currently 'ref_q_id' and 'translationstatus' are not supported in the sourcecode, so they are set manually by SQL statement and are not really reliable.
Topics
This table contains one record per available (language dependent) test.
Field |
Type |
Null |
Key |
Default |
Extra |
Comment |
t_id |
int(11) |
NO |
PRI |
NULL |
auto_increment |
|
topic |
varchar(50) |
NO |
UNI |
|
|
|
active |
tinyint(1) |
NO |
|
0 |
|
|
numOfQu |
tinyint(4) |
NO |
|
0 |
|
|
percentage |
tinyint(4) |
NO |
|
0 |
|
|
lang |
varchar(42) |
YES |
|
NULL |
|
|
type_id |
int(11) |
YES |
|
NULL |
|
|
Sourcecode
Adding a new user interface language
Once the translation process itself, which is outlined in CATS Translation, is completed a new UI language have to be supported in the PHP code.
Install the new <language>.php in the lang directory
Add support for the new language in the file functions/translation.php
Add the new language in file index.php.template, for the future
These steps may be prepared in advance, even while the translation is still not finished. Installing the modified PHP files with SVN will not make the new (probably incomplete) translation available.
Once everything is finished you have to add the new language in file index.php, add an additional option to the <select> control with name 'language'. This will make the new language available.
Test languages
The english test should be the master test. Every question should exist at least in the english test, so everyone can judge the correctness of the question and the answers. The english question should then be translated into the other languages, so during translation there should be no discussion about content, just about correct translation.
Currently translation is not well supported by the CATS admin interface, so some conventions and SQL statements are necessary during the translation process.
First of all the ID of the english question is used as "content id", all translations refer to the english question concerning the content. The content id is used as a prefix to the question text in sqare brackets ("[73]How often may you try this test?", "[73]Wie oft kannst du diesen Test durchführen?"), so it's possible for the end user to identify the content id in case of unclear, wrong or outdated questions.
When creating a test for a new language the questions table is filled by an SQL statement with copies of the english questions and ref_q_id set to the corresponding master question.
Test System
The machine is managed by AndreasBäß and MichaelTänzer (and potentialy all SA's)
Production System
See SystemAdministration/Systems/CATS
- CategotySoftwareCATS