getResourcesByType('dialogue', array('resourceID' => $rid));
$obj = $objs[0];
$direction_location = "";
if (isset($pl['aid'])) {
if (is_numeric($pl['aid'])) {
$a = new DialogueAnswer();
$a->setResourceID($obj->getResourceId());
$a->setAssignmentID($pl['aid']);
$a->setUserID($name);
$a->setGrade(0);
$a->setComment("");
$a->setExponate(0);
$a->setFouls($fouls);
$a->setScore($score);
$a->save();
$direction_location = "../../index.php?rid=".$rid."&mode=answer";
}
}
header("Location: ".$direction_location);
?>