$tp->setValue('questionid', $questionid[$i]);
            $tp->setValue('answer', $answer[$i]);
            if (isset($evaluationanswerid[$i])) {
                $tp->setValue('evaluationanswerid', $evaluationanswerid[$i]);
            } else {
                $tp->setValue('evaluationanswerid', '');
            }
            $tp->saveAnswer();
            $i++;
        }
    }
} else {
    if (isset($_GET['ui'])) {
        if (isset($_GET['tpid'])) {
            $tp->setValue('planid', $_GET['tpid']);
        }
        $tp->showAnswerUI();
    }
    if (isset($_GET['view'])) {
        $tp->ShowGeneralInformation();
    }
    if (isset($_GET['qlist'])) {
        $tp->setValue('planid', $_GET['ptid']);
        $tp->showAddedQuestions();
    }
    if (isset($_GET['evalui'])) {
        $tp->setValue('plantraineeid', $_GET['ptid']);
        $tp->setValue('planid', $_GET['pid']);
        $tp->getEvaluaterUI();
    }
}