1) { $arel[$data[0]] = $data[1]; } } //print_r($arel); $al = array(); for ($k=0; $k<$o;$k++) { $al []= array('id'=>$k, 'xp'=>$arel['xp'.$k],'x'=>$arel['x'.$k],'y'=>$arel['y'.$k],'value'=>0); } include_once('../../includes/config.php'); include_once('../../includes/api.php'); include_once('../../includes/BaseAnswer.php'); include_once('TimelineAnswer.php'); include_once('../../includes/Base.php'); include_once('../../includes/Assignments.php'); include_once('../../includes/BaseResource.php'); //include_once('Timeline.php'); include_once('../../includes/db.php'); include_once('../../includes/user.php'); $objs = $kdb->getResourcesByType('timeline', array('resourceID' => $rid)); $obj = $objs[0]; $direction_location = ""; if (isset($pl['aid'])) { if (is_numeric($pl['aid'])) { $a = new TimelineAnswer(); $a->setResourceID($obj->getResourceId()); $a->setAssignmentID($pl['aid']); $a->setUserID($name); $a->setGrade(0); $a->setComment(""); $a->setExponate(0); $a->setTime($time); $a->setData($al); $a->save(); $direction_location = "../../index.php?rid=".$rid."&mode=answer"; } } header("Location: ".$direction_location); ?>