7.7. Advanced properties

Almost everything in OLAT can have its properties. They are saved in the table o_property, a very generic table. As you see below only three of thirteen rows can not be NULL. The fields are used dependent on the businesscase and this are not in every case all of them.

mysql> desc o_property;
+------------------+----------------+------+-----+---------------------+-------+
| Field            | Type           | Null | Key | Default             | Extra |
+------------------+----------------+------+-----+---------------------+-------+
| id               | bigint(20)     |      | PRI | 0                   |       |
| lastmodified     | datetime       |      |     | 0000-00-00 00:00:00 |       |
| creationdate     | datetime       | YES  |     | NULL                |       |
| identity         | bigint(20)     | YES  | MUL | NULL                |       |
| grp              | bigint(20)     | YES  | MUL | NULL                |       |
| resourcetypename | varchar(50)    | YES  | MUL | NULL                |       |
| resourcetypeid   | bigint(20)     | YES  | MUL | NULL                |       |
| category         | varchar(33)    | YES  | MUL | NULL                |       |
| name             | varchar(255)   |      | MUL |                     |       |
| floatvalue       | decimal(78,30) | YES  |     | NULL                |       |
| longvalue        | bigint(20)     | YES  |     | NULL                |       |
| stringvalue      | varchar(255)   | YES  |     | NULL                |       |
| textvalue        | text           | YES  |     | NULL                |       |
+------------------+----------------+------+-----+---------------------+-------+
13 rows in set (0.03 sec)

Example Info Message

The info message on the login-screen is saved as a property. This property only use three fields except id, lastmodified and creationdate, namely: category, name and textvalue, the text of the message.

mysql> select * from o_property where name="InfoMsg";
+--------+---------------------+---------------------+----------+------+------------------+----------------+
| id     | lastmodified        | creationdate        | identity | grp  | resourcetypename | resourcetypeid |
+--------+---------------------+---------------------+----------+------+------------------+----------------+
| 393217 | 2005-04-12 17:09:06 | 2005-04-12 17:09:06 |     NULL | NULL | NULL             |           NULL |
+--------+---------------------+---------------------+----------+------+------------------+----------------+

   ----------+---------+------------+-----------+-------------+--------------+
    category | name    | floatvalue | longvalue | stringvalue | textvalue    |
   ----------+---------+------------+-----------+-------------+--------------+
    _o3_     | InfoMsg |       NULL |      NULL | NULL        | only as demo |
   ----------+---------+------------+-----------+-------------+--------------+
1 row in set (0.01 sec)

Example PASSED true for a certain test

The information about passing tests is also saved in the o_property table. Below you see that the users with the identities 163847 and 163849 have passed the test NID:iqte::71256453203971.

mysql> select * from o_property where category="NID:iqte::71256453203971" and name="PASSED" and stringvalue="true";
+--------+---------------------+---------------------+----------+------+------------------+----------------+
| id     | lastmodified        | creationdate        | identity | grp  | resourcetypename | resourcetypeid |
+--------+---------------------+---------------------+----------+------+------------------+----------------+
| 655376 | 2005-04-13 13:01:49 | 2005-04-13 13:01:49 |   163847 | NULL | CourseModule     | 71256453203963 |
| 655384 | 2005-04-13 13:17:51 | 2005-04-13 13:17:51 |   163849 | NULL | CourseModule     | 71256453203963 |
+--------+---------------------+---------------------+----------+------+------------------+----------------+

   --------------------------+--------+------------+-----------+-------------+-----------+
    category                 | name   | floatvalue | longvalue | stringvalue | textvalue |
   --------------------------+--------+------------+-----------+-------------+-----------+
    NID:iqte::71256453203971 | PASSED |       NULL |      NULL | true        | NULL      |
    NID:iqte::71256453203971 | PASSED |       NULL |      NULL | true        | NULL      |
   --------------------------+--------+------------+-----------+-------------+-----------+
2 rows in set (0.01 sec)