plugin->assessments->getAssessmentByUserToken($token); $candidate_id = $TeKe->plugin->assessments->getCandidateByToken($token); //$obj_id = $obj->build(array("assessment"=>$assessment, "candidate"=>$candidate)); $items = $assessment->getItems(); foreach ($items as $item) { $item_obj = $TeKe->plugin->loadType($item->type, $item->id); $chosen = get_input($item->id."_choice"); console_log($chosen); $answer_data = array(); $answer_data ["candidate"]= $candidate_id; $answer_data ["chosen"] = $chosen; $item_obj->answer($answer_data); } $candidate = $TeKe->plugin->loadType("candidate", $candidate_id); //$candidate_assessment = $TeKe->plugin->assessments->getCandidateAssessment($token); $candidate->finishAssessment(); } forward(WWW_ROOT."assessment?token=${token}"); ?>