<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.returnofreckoning.com/index.php?action=history&amp;feed=atom&amp;title=API%3ASendSurveyResponse</id>
	<title>API:SendSurveyResponse - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.returnofreckoning.com/index.php?action=history&amp;feed=atom&amp;title=API%3ASendSurveyResponse"/>
	<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:SendSurveyResponse&amp;action=history"/>
	<updated>2026-10-18T04:53:51Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://wiki.returnofreckoning.com/index.php?title=API:SendSurveyResponse&amp;diff=30706&amp;oldid=prev</id>
		<title>Maintenance script: UI Lua API import (WAR 1.4.8)</title>
		<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:SendSurveyResponse&amp;diff=30706&amp;oldid=prev"/>
		<updated>2026-10-16T19:48:48Z</updated>

		<summary type="html">&lt;p&gt;UI Lua API import (WAR 1.4.8)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{LuaApi|group=Game}}&lt;br /&gt;
Sends the player&amp;#039;s answers to a survey to the server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SendSurveyResponse(surveyId, eventType, objectId, objectName, comment, submitted)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Arguments ==&lt;br /&gt;
;surveyId : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – ID of the survey (&amp;lt;code&amp;gt;Survey.id&amp;lt;/code&amp;gt;).&lt;br /&gt;
;eventType : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – Event type of the survey (&amp;lt;code&amp;gt;Survey.event_type&amp;lt;/code&amp;gt;).&lt;br /&gt;
;objectId : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – Object the survey is about (&amp;lt;code&amp;gt;Survey.object_id&amp;lt;/code&amp;gt;).&lt;br /&gt;
;objectName : &amp;lt;code&amp;gt;wstring&amp;lt;/code&amp;gt; – Name of that object (&amp;lt;code&amp;gt;Survey.object_name&amp;lt;/code&amp;gt;).&lt;br /&gt;
;comment : &amp;lt;code&amp;gt;wstring&amp;lt;/code&amp;gt; – Free-text comment.&lt;br /&gt;
;submitted : &amp;lt;code&amp;gt;boolean&amp;lt;/code&amp;gt; – &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; when the player submitted the survey, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; when it was closed without submitting.&lt;br /&gt;
&lt;br /&gt;
== Returns ==&lt;br /&gt;
Nothing.&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
* Besides the arguments, the answers are read from the global Lua table &amp;lt;code&amp;gt;Survey&amp;lt;/code&amp;gt;: for &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; = 1 to 10, &amp;lt;code&amp;gt;Survey.question[n].label&amp;lt;/code&amp;gt; (wstring) and &amp;lt;code&amp;gt;Survey.question[n].choice&amp;lt;/code&amp;gt; (number). Reading stops at the first question whose label is empty. Each choice is sent as a value from 0 to 255.&lt;br /&gt;
* All six values and the list of choices are sent to the server in one message.&lt;br /&gt;
* The function needs at least six arguments and only reads the last six. &amp;lt;code&amp;gt;submitted&amp;lt;/code&amp;gt; must be a real boolean.&lt;br /&gt;
&lt;br /&gt;
== Errors ==&lt;br /&gt;
None besides the generic &amp;#039;&amp;#039;Invalid Parameters&amp;#039;&amp;#039; message when an argument has the wrong type.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
From &amp;lt;code&amp;gt;default/ea_surveywindow/source/surveywindow.lua&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SendSurveyResponse(Survey.id, Survey.event_type, Survey.object_id, Survey.object_name, EA_Window_SurveyCommentText.Text, true)&lt;br /&gt;
EA_Window_Survey.hasSubmitted = true&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sending the response with &amp;lt;code&amp;gt;submitted = false&amp;lt;/code&amp;gt; when the window is closed without submitting, from the same file:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if( not EA_Window_Survey.hasSubmitted )&lt;br /&gt;
then&lt;br /&gt;
    SendSurveyResponse(Survey.id, Survey.event_type, Survey.object_id, Survey.object_name, EA_Window_SurveyCommentText.Text, false)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[API:SendBugReport|SendBugReport]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>