Comments (13)
@etosch - I have cloned and built runner.jar
on my computer. Can you paste some examples on how I can run sample json survey to validate with the jar file.
from react-surveyman.
runner.jar handles communication with backends; @jfoley threw together a
StaticAnalysisServer for running the static analyses (which includes the
validation).
- pull the latest version of the SurveyMan repository
- run
make package
- run
java -cp edu.umass.cs.surveyman.server.StaticAnalysisServer
Send the request as json to /analyser
via POST.
On 7/19/15 12:18 PM, Prakhar Srivastav wrote:
Add support for incrementally validating survey by making a ajax call
to runner.jar.—
Reply to this email directly or view it on GitHub
#35.
from react-surveyman.
Hi @etosch
So I pulled in the Surveyman code and was able to build the package too. However, I'm unable to start the server. Can you tell me what's wrong?
PS: Not quite well-versed with the java stack 😬
java -cp edu.umass.cs.surveyman.server.StaticAnalysisServer
Usage: java [-options] class [args...]
(to execute a class)
or java [-options] -jar jarfile [args...]
(to execute a jar file)
from react-surveyman.
Run command - java -cp surveyman.jar edu.umass.cs.surveyman.server.StaticAnalysisServer
So I was able to run the server and hit the /analyze
route but no matter what JSON
is sent in POST
, the server keeps throwing up an exception.
Here's the curl request that I'm making
curl -X POST -H "Content-Type: application/json" -d '{"survey": [
{
"id": "b_10101",
"randomize": true,
"questions": [],
"subblocks": []
}
]}' 'http://localhost:1234/analyze'
java.lang.NullPointerException
at edu.umass.cs.surveyman.input.json.JSONParser.makeCorrelationMap(JSONParser.java:258)
at edu.umass.cs.surveyman.input.json.JSONParser.populateSurvey(JSONParser.java:363)
at edu.umass.cs.surveyman.input.json.JSONParser.parse(JSONParser.java:382)
at edu.umass.cs.surveyman.server.StaticAnalysisServer.parseJSON(StaticAnalysisServer.java:175)
at edu.umass.cs.surveyman.server.StaticAnalysisServer.analyzeRequest(StaticAnalysisServer.java:118)
at edu.umass.cs.surveyman.server.StaticAnalysisServer$1.handle(StaticAnalysisServer.java:46)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
at org.eclipse.jetty.server.Server.handle(Server.java:363)
at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:483)
at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:931)
at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:992)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:856)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)
at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:628)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
at java.lang.Thread.run(Thread.java:745)
@jjfiv / @etosch: Any pointers?
from react-surveyman.
With the latest build the server is working now. Here's what I get when I run the curl
above -
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
<title>Error 400 SurveyException: A survey must have at least one question.</title>
</head>
<body>
<h2>HTTP ERROR: 400</h2>
<p>Problem accessing /analyze. Reason:
<pre> SurveyException: A survey must have at least one question.</pre></p>
So then I added a single question (as shown below) but now I keep getting a 501 Unimplemented error.
{"survey": [
{
"id": "b_10101",
"randomize": true,
"questions": [
{
"id": "q_5847",
"qtext": "First question",
"options": [
{
"id": "o_97512",
"otext": "first"
},
{
"id": "o_57705",
"otext": "second"
},
{
"id": "o_32878",
"otext": "third"
}
],
"ordering": false,
"freetext": false,
"exclusive": true
}
],
"subblocks": []
}
]}
from react-surveyman.
s/ordering/ordered
from react-surveyman.
Tried. Same error 😢
from react-surveyman.
It's failing when trying to assign breakoff (not finding the permitBreakoff tag). This isn't required, though, and the assignment for that value does check to see if the tag is present in the JSON node. More on this in a minute.
from react-surveyman.
@etosch: I just noticed that the server response is missing access-control headers because of which I'm unable to make requests to it via the react-surveyman app.
from react-surveyman.
@jjfiv merged; try out and confirm.
Emma Tosch
[email protected]
On Fri, Aug 14, 2015, at 02:13 AM, Prakhar Srivastav wrote:
@etosch[1]: I just noticed that the server response is missing access-control headers because of which I'm unable to make requests to it via the react-surveyman app.
—
Reply to this email directly or view it on GitHub[2].
Links:
from react-surveyman.
I downloaded the latest build and tried running the server - but I still can't see the new headers.
curl -i POST -H "Content-Type: application/json" -d '{"survey": [
{
"id": "b_10101",
"randomize": true,
"questions": [
{
"id": "q_5847",
"qtext": "First question",
"options": [
{
"id": "o_97512",
"otext": "first"
},
{
"id": "o_57705",
"otext": "second"
},
{
"id": "o_32878",
"otext": "third"
}
],
"ordered": false,
"freetext": false,
"exclusive": true
}
],
"subblocks": []
}
]}
' 'http://localhost:1234/analyze' | head
> HTTP/1.1 200 OK
Content-Length: 831
Server: Jetty(7.x.y-SNAPSHOT)
Min Path Length: 1
Max Path Length: 1
Average Path Length: 1.000000
Max Possible Entropy: 1.584963
Prob. False Correlation: 1.000000
group,percentBots,entropy,TP,FP,TN,FN
from react-surveyman.
I see the new access control header when running locally; will upload my jar.
from react-surveyman.
See https://github.com/SurveyMan/SurveyMan/releases/download/v1.6.6/surveyman.jar
from react-surveyman.
Related Issues (20)
- Add transitions HOT 2
- Fix id generation HOT 3
- Ability to duplicate blocks and questions
- Validate JSON Schema
- Ability to Save / Load surveys HOT 4
- Allow items to be positioned arbitrarily when being dropped HOT 6
- drop broke in safari HOT 3
- Add support for Subblocks HOT 3
- testing slack integration
- randomization button? HOT 5
- Clicking on x in the select component gives a NaN
- Add linting for ES6
- Move to ES6 classes HOT 2
- Apply fixed positioning to the Toolbox
- Add properties to the Question Schema HOT 5
- Broken package HOT 7
- License type HOT 3
- s/ordering/ordered
- Several module not found errors HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-surveyman.