Support #1619
Retrieving data from the console
Status: | New | Start date: | 2016-02-22 | |
---|---|---|---|---|
Priority: | Low | Due date: | ||
Assignee: | - | % Done: | 0% | |
Category: | - | |||
Target version: | - |
Description
save.php did not save the output file and threw an error, so I was left with the console output and tried to parse it
The following almost works to generate a matlab file from the console output of an AB interface
echo "result=[];input=[" | cat - consolelog.txt | grep -v "WARNING\|Stopped\|1651\|have not\|slider" | sed s/\(.*\)//g | sed s/AB\.js.*Selected/result\(end+1\)=[/g | sed s/^core\.js:1652/input\(end+1\,:\)=\[/g | sed "s/$/\];/g" | grep -v core > out.madditionally, you have to manually:
- replace the first occurrence of "input(end+1,:)" to "order"
- check for consecutive lines starting with "input" if you find them this means that the user submitted without selecting. If you find consecutive lines starting with input, leave only the last one (or insert dummy "result=[-1];" in between
History
#1 Updated by Nicholas Jillings almost 9 years ago
Did the page not fallback and present the XML save as a link to you??
#2 Updated by Giulio Moro almost 9 years ago
It probably did but I overlooked it and went straight to the console because of my hidden desire of playing with regexp
#3 Updated by Nicholas Jillings almost 9 years ago
I will look over the PHP tomorrow, I don't have access here, and check the XML it spits back etc.
That is a handy piece of code as there was a thought earlier of converting the console from an error session into an XML. With the new structure, error'd sessions are recoverable and should submit what they have from the console.