105         switch (strtolower($a_name)) {
   109                 switch ($this->table) {
   111                         if (!$this->user_criteria_checked) {
   112                             $this->user_criteria_checked = 
true;
   113                             if (isset($a_attribs[
'user_criteria'])
   114                                 && $this->db->tableColumnExists(
'usr_data', $a_attribs[
'user_criteria'])) {
   116                                 $info = $analyzer->getFieldInformation(
'usr_data');
   117                                 $this->user_criteria_field = $a_attribs[
'user_criteria'];
   118                                 $this->user_criteria_type = $info[$a_attribs[
'user_criteria']][
'type'];
   122                         if ($this->user_criteria_field !== 
'') {
   123                             $result = $this->db->queryF(
   124                                 'SELECT usr_id FROM usr_data WHERE '   125                                     . $this->user_criteria_field . 
' =  %s',
   126                                 [$this->user_criteria_type],
   127                                 [$a_attribs[$this->user_criteria_field]]
   129                             if ($result->numRows()) {
   130                                 $row = $this->db->fetchAssoc($result);
   131                                 $usr_id = $row[
'usr_id'];
   134                         $next_id = $this->db->nextId(
'tst_active');
   136                         $this->db->insert(
'tst_active', [
   137                             'active_id' => [
'integer', $next_id],
   138                             'user_fi' => [
'integer', $usr_id],
   139                             'anonymous_id' => [
'text', strlen($a_attribs[
'anonymous_id']) ? $a_attribs[
'anonymous_id'] : null],
   140                             'test_fi' => [
'integer', $this->test_obj->getTestId()],
   141                             'lastindex' => [
'integer', $a_attribs[
'lastindex']],
   142                             'tries' => [
'integer', $a_attribs[
'tries']],
   143                             'submitted' => [
'integer', $a_attribs[
'submitted']],
   144                             'submittimestamp' => [
'timestamp', strlen($a_attribs[
'submittimestamp']) ? $a_attribs[
'submittimestamp'] : null],
   145                             'tstamp' => [
'integer', $a_attribs[
'tstamp']],
   146                             'importname' => [
'text', $a_attribs[
'fullname']],
   149                             'answerstatusfilter' => [
'integer', $this->
fetchAttribute($a_attribs, 
'answer_status_filter')],
   150                             'objective_container' => [
'integer', $this->
fetchAttribute($a_attribs, 
'objective_container')]
   152                         $this->active_id_mapping[$a_attribs[
'active_id']] = $next_id;
   154                     case 'tst_test_rnd_qst':
   155                         $nextId = $this->db->nextId(
'tst_test_rnd_qst');
   156                         $newActiveId = $this->active_id_mapping[$a_attribs[
'active_fi']];
   157                         $newQuestionId = $this->question_id_mapping[$a_attribs[
'question_fi']];
   158                         $newSrcPoolDefId = $this->src_pool_def_id_mapping[$a_attribs[
'src_pool_def_fi']];
   159                         $this->db->insert(
'tst_test_rnd_qst', [
   160                             'test_random_question_id' => [
'integer', $nextId],
   161                             'active_fi' => [
'integer', $newActiveId],
   162                             'question_fi' => [
'integer', $newQuestionId],
   163                             'sequence' => [
'integer', $a_attribs[
'sequence']],
   164                             'pass' => [
'integer', $a_attribs[
'pass']],
   165                             'tstamp' => [
'integer', $a_attribs[
'tstamp']],
   166                             'src_pool_def_fi' => [
'integer', $newSrcPoolDefId]
   169                     case 'tst_pass_result':
   170                         $affectedRows = $this->db->manipulateF(
   171                             "INSERT INTO tst_pass_result (active_fi, pass, points, maxpoints, questioncount, answeredquestions, workingtime, tstamp) VALUES (%s,%s,%s,%s,%s,%s,%s,%s)",
   183                                 $this->active_id_mapping[$a_attribs[
'active_fi']],
   184                                 strlen($a_attribs[
'pass']) ? $a_attribs[
'pass'] : 0,
   185                                 ($a_attribs[
"points"]) ? $a_attribs[
"points"] : 0,
   186                                 ($a_attribs[
"maxpoints"]) ? $a_attribs[
"maxpoints"] : 0,
   187                                 $a_attribs[
"questioncount"],
   188                                 $a_attribs[
"answeredquestions"],
   189                                 ($a_attribs[
"workingtime"]) ? $a_attribs[
"workingtime"] : 0,
   194                     case 'tst_result_cache':
   195                         $affectedRows = $this->db->manipulateF(
   196                             "INSERT INTO tst_result_cache (active_fi, pass, max_points, reached_points, mark_short, mark_official, passed, failed, tstamp) VALUES (%s,%s,%s,%s,%s,%s,%s,%s,%s)",
   209                                 $this->active_id_mapping[$a_attribs[
'active_fi']],
   210                                 strlen($a_attribs[
'pass']) ? $a_attribs[
'pass'] : 0,
   211                                 ($a_attribs[
"max_points"]) ? $a_attribs[
"max_points"] : 0,
   212                                 ($a_attribs[
"reached_points"]) ? $a_attribs[
"reached_points"] : 0,
   213                                 strlen($a_attribs[
"mark_short"]) ? $a_attribs[
"mark_short"] : 
" ",
   214                                 strlen($a_attribs[
"mark_official"]) ? $a_attribs[
"mark_official"] : 
" ",
   215                                 ($a_attribs[
"passed"]) ? 1 : 0,
   216                                 ($a_attribs[
"failed"]) ? 1 : 0,
   222                         $affectedRows = $this->db->insert(
"tst_sequence", [
   223                             "active_fi" => [
"integer", $this->active_id_mapping[$a_attribs[
'active_fi']]],
   224                             "pass" => [
"integer", $a_attribs[
'pass']],
   225                             "sequence" => [
"clob", $a_attribs[
'sequence']],
   226                             "postponed" => [
"text", (strlen($a_attribs[
'postponed'])) ? $a_attribs[
'postponed'] : null],
   227                             "hidden" => [
"text", (strlen($a_attribs[
'hidden'])) ? $a_attribs[
'hidden'] : null],
   228                             "tstamp" => [
"integer", $a_attribs[
'tstamp']]
   231                     case 'tst_solutions':
   232                         $next_id = $this->db->nextId(
'tst_solutions');
   233                         $affectedRows = $this->db->insert(
"tst_solutions", [
   234                             "solution_id" => [
"integer", $next_id],
   235                             "active_fi" => [
"integer", $this->active_id_mapping[$a_attribs[
'active_fi']]],
   236                             "question_fi" => [
"integer", $this->question_id_mapping[$a_attribs[
'question_fi']]],
   238                             "value2" => [
"clob", (strlen($a_attribs[
'value2'])) ? $a_attribs[
'value2'] : null],
   239                             "pass" => [
"integer", $a_attribs[
'pass']],
   240                             "tstamp" => [
"integer", $a_attribs[
'tstamp']]
   243                     case 'tst_test_result':
   244                         $next_id = $this->db->nextId(
'tst_test_result');
   245                         $affectedRows = $this->db->manipulateF(
   246                             "INSERT INTO tst_test_result (test_result_id, active_fi, question_fi, points, pass, manual, tstamp) VALUES (%s, %s, %s, %s, %s, %s, %s)",
   247                             [
'integer', 
'integer',
'integer', 
'float', 
'integer', 
'integer',
'integer'],
   248                             [$next_id, $this->active_id_mapping[$a_attribs[
'active_fi']], $this->question_id_mapping[$a_attribs[
'question_fi']], $a_attribs[
'points'], $a_attribs[
'pass'], (strlen($a_attribs[
'manual'])) ? $a_attribs[
'manual'] : 0, $a_attribs[
'tstamp']]
   252                         $next_id = $this->db->nextId(
'tst_times');
   253                         $affectedRows = $this->db->manipulateF(
   254                             "INSERT INTO tst_times (times_id, active_fi, started, finished, pass, tstamp) VALUES (%s, %s, %s, %s, %s, %s)",
   255                             [
'integer', 
'integer', 
'timestamp', 
'timestamp', 
'integer', 
'integer'],
   256                             [$next_id, $this->active_id_mapping[$a_attribs[
'active_fi']], $a_attribs[
'started'], $a_attribs[
'finished'], $a_attribs[
'pass'], $a_attribs[
'tstamp']]
   262                 $this->table = $a_name;
 
importParticipantsUploadedFiles(array $a_attribs)
 
fetchLastFinishedPass($attribs)
 
fetchLastStartedPass($attribs)
 
fetchAttribute($attributes, $name)
 
This class gives all kind of DB information using the database manager and reverse module...