Hi Dominik
we are back at this question (sorry I cannot find the original question on this any more).
We want to send responses (data) from a RT task to a server which computes sth and we wan to use the output in the very survey on the next page.
We compile the responses from the assignment questions S101 and S102 :
$xml = '<?xml version="1.0" encoding="UTF-8"?'.'>';
$xml.= '<myData attr="ID">'.htmlspecialchars(caseNumber()).'<saveEnv save="false"/>';
for ($n = 0; $n < 80; $n++) {
$xml.= '<data attr="'.id('S101', $n+1).'">'.htmlspecialchars(value(id('S101', $n+1))).'</data>\n';
};
for ($n = 0; $n < 80; $n++) {
$xml.= '<data attr="'.id('S102', $n+1).'">'.htmlspecialchars(value(id('S102', $n+1))).'</data>\n';
};
$xml.= '</myData>';
We send the responses from the assignment question S101 :
$answer = sendXML('http://dd.virtualpsyclab.net/ddgem/ddgem', $xml);
debug($answer);
and we receive the attached debug response:
Debug Information for $answer:
name html, attr[Array], value , children [Array]
We then use
list($yes) = explode('\t', $answer);
and get the error:
explode() expects parameter 2 to be string, array given
The other server send back in mine type text/plain the following content (presumably that's what $answer contains):
Content-type:text/plain\r\n\r\n <html>\n<head>\n<title>Hello</title>\n</head>\n<body>\nOK 77.4805609906267 79.1893024286756 1.7087414380489 87.3463465801849 9.86578558955824 120.361186224957 42.8806252343308 43.6180475963458</body>\n</html>\n
How can we access that answer in soscisurvey?
And do you have any tips to be able to debug as we cannot see the contents of $answer?
Thank you for your help.