getResourcesByType('hangman', array('resourceID' => $rid)); $obj = $objs[0]; $direction_location = ""; if (isset($pl['aid'])) { if (is_numeric($pl['aid'])) { $a = new HangmanAnswer(); $a->setResourceID($obj->getResourceId()); $a->setAssignmentID($pl['aid']); $a->setUserID($name); $a->setGrade(0); $a->setComment(""); $a->setExponate(0); //$a->setTry($try); //$a->setTime($time); $a->setFeedback($feedback); $a->save(); $direction_location = "../../index.php?rid=".$rid."&mode=answer"; } } header("Location: ".$direction_location); ?>