function get_returns($sid, $hash, $pass) { if (!authorize_WS($pass)) { return false; } $session = TestSession::from_property(array("id" => $sid, "hash" => $hash), false); if ($session == null) { return false; } $return = TestSessionReturn::from_property(array("TestSession_id" => $sid)); $result = array(); foreach ($return as $ret) { $result[$ret->name] = $ret->value; } return json_encode($result); }
function get_returns($sid, $hash, $pass, $wid) { if (!authorize_WS($pass)) { return -1; } $workspace = UserWorkspace::from_mysql_id($wid); if ($workspace != null) { mysql_select_db($workspace->db_name); } $session = TestSession::from_property(array("id" => $sid, "hash" => $hash), false); if ($session == null) { return false; } $return = TestSessionReturn::from_property(array("TestSession_id" => $sid)); $result = array(); foreach ($return as $ret) { $result[$ret->name] = $ret->value; } return json_encode($result); }
public function remove_returns() { $sql = sprintf("DELETE FROM `%s` WHERE `TestSession_id`=%d", TestSessionReturn::get_mysql_table(), $this->id); mysql_query($sql); }
public static function reset_db() { CustomSection::create_db(true); CustomSectionVariable::create_db(true); DS_Module::create_db(true); DS_Right::create_db(true); DS_Sharing::create_db(true); DS_TestSectionType::create_db(true); DS_UserInstitutionType::create_db(true); Setting::create_db(true); Table::create_db(true); TableColumn::create_db(true); Template::create_db(true); Test::create_db(true); TestSection::create_db(true); TestSectionValue::create_db(true); TestSession::create_db(true); TestSessionReturn::create_db(true); TestTemplate::create_db(true); TestVariable::create_db(true); User::create_db(true); UserGroup::create_db(true); UserType::create_db(true); UserTypeRight::create_db(true); }