function loadTestSession($test_id, $user_id = "", $anonymous_id = "")
 {
     global $ilDB;
     global $ilUser;
     if (!$user_id) {
         $user_id = $ilUser->getId();
     }
     if ($_SESSION["AccountId"] == ANONYMOUS_USER_ID && strlen($_SESSION["tst_access_code"][$test_id])) {
         $result = $ilDB->queryF("SELECT * FROM tst_active WHERE user_fi = %s AND test_fi = %s AND anonymous_id = %s", array('integer', 'integer', 'text'), array($user_id, $test_id, $_SESSION["tst_access_code"][$test_id]));
     } else {
         if (strlen($anonymous_id)) {
             $result = $ilDB->queryF("SELECT * FROM tst_active WHERE user_fi = %s AND test_fi = %s AND anonymous_id = %s", array('integer', 'integer', 'text'), array($user_id, $test_id, $anonymous_id));
         } else {
             if ($_SESSION["AccountId"] == ANONYMOUS_USER_ID) {
                 return NULL;
             }
             $result = $ilDB->queryF("SELECT * FROM tst_active WHERE user_fi = %s AND test_fi = %s", array('integer', 'integer'), array($user_id, $test_id));
         }
     }
     if ($result->numRows()) {
         $row = $ilDB->fetchAssoc($result);
         $this->active_id = $row["active_id"];
         $this->user_id = $row["user_fi"];
         $this->anonymous_id = $row["anonymous_id"];
         $this->test_id = $row["test_fi"];
         $this->lastsequence = $row["lastindex"];
         $this->pass = $row["tries"];
         $this->submitted = $row["submitted"] ? TRUE : FALSE;
         $this->submittedTimestamp = $row["submittimestamp"];
         $this->tstamp = $row["tstamp"];
         $this->questionSetFilterSelection->setTaxonomySelection(unserialize($row['taxfilter']));
         $this->questionSetFilterSelection->setAnswerStatusSelection($row['answerstatusfilter']);
         $this->questionSetFilterSelection->setAnswerStatusActiveId($row['active_id']);
     }
 }