Interested in React & Blocks Language Front End

46 views
Skip to first unread message

Prakhar Srivastav

unread,
Mar 18, 2015, 2:06:35 PM3/18/15
to plasma-u...@googlegroups.com
Hi All,

I'm Prakhar, a 25 year old full-stack developer from Kuwait who'll be joining Columbia for MS CS (Fall 2015). I've been doing open-source work for a long time and I'm especially interested in building user interfaces. I have a thorough experience in building web UIs in Angular and have been recently spending weekends learning React.

Having read the SurveyMan paper (which I found to be extremely readable), I find the concept of building a visual interface to a DSL extremely interesting (reminds me of Scratch). I'll get started on the starter task and hopefully send in a PR soon. As asked in another thread, I wanted to know if for the drag-and-drop part of the task a standalone webpage (in React) would suffice.

I'd like to apologize for jumping in this late - I became eligible to participate in GSOC 2015 only after I received the admit from Columbia (i.e. yesterday). Looking forward to an exciting summer with PLASMA!



Emma Tosch

unread,
Mar 18, 2015, 5:25:02 PM3/18/15
to plasma-u...@googlegroups.com
No problem on the late start, and congratulations on the MS acceptance!

We are indeed looking for something Scratch-like. Here is a drawing of roughly what we're looking for .

I look forward to reading your application!

Best,
Emma

Prakhar Srivastav

unread,
Mar 19, 2015, 8:14:36 AM3/19/15
to plasma-u...@googlegroups.com
Hi Emma,

Thanks for the welcome. Quick question for the first task - what kind of validations are you looking at? Since the JSON is generated via the Java program, I'm assuming the json schema validation would not be a part of surveyman.js. Please correct me if I'm wrong.

Do you want tests for validating whether the Question, Block and Option objects have the JSON data correctly loaded? Some pointers (or examples) on what parts to test would be helpful.

Thanks,

Emma Tosch

unread,
Mar 19, 2015, 10:08:45 AM3/19/15
to plasma-u...@googlegroups.com


Thanks for the welcome. Quick question for the first task - what kind of validations are you looking at? Since the JSON is generated via the Java program, I'm assuming the json schema validation would not be a part of surveyman.js. Please correct me if I'm wrong.

So validation is currently done in SurveyMan (Java) and SMPy (Python) before dumping the json. It is not currently done in surveyman.js, since this would essentially be a runtime check and would thus be very costly (especially if we were using a crowdsourcing backend like Amazon's Mechanical Turk) if it failed. Right now surveyman.js only does validation in tests.

If you are interested in learning more about json schema validation, check out http://json-schema.org/. However, the kinds of tests I'm looking for for now in the surveyman.js code are things like: create a block, call randomize, assert that (a) we still have the same number and set of questions and (b) the questions actually get shuffled. For (b) you'll want to do something like pick a position in the list of questions and save the question at that position, then call randomize 5 times or so, and assert that there is a different question at that position at least once. You can pick an appropriate number using Chernoff bounds, but for now stick to a reasonable constant.
 
 
Do you want tests for validating whether the Question, Block and Option objects have the JSON data correctly loaded? Some pointers (or examples) on what parts to test would be helpful.

If the data gets loaded incorrectly, we usually find out pretty quickly (and is very unlikely, since the JSON is generated). I'm attaching an example HTML output of a survey. Just run an HTTP server (e.g., `python -m SimpleHTTPServer`) to click through. It's the randomization, branching logic, and button display logic that's more likely to fail.
pick_randomly_survey170035_1425603507253.html

Prakhar Srivastav

unread,
Mar 20, 2015, 2:24:53 PM3/20/15
to plasma-u...@googlegroups.com
call randomize, assert that (a) we still have the same number and set of questions and (b) the questions actually get shuffled.

I've added tests for part (a) but for part (b) since you're using the Fisher-Yates shuffle to randomize the questions, is there a need to explicitly test this? Wouldn't we be just testing the algorithm (or underscore's implementation of it)?

On Wednesday, 18 March 2015 21:06:35 UTC+3, Prakhar Srivastav wrote:

Prakhar Srivastav

unread,
Mar 24, 2015, 8:52:35 AM3/24/15
to plasma-u...@googlegroups.com
Hi Emma,

Hope you're doing well. I'd been working on the second starter task and finally have something to show. 

You can view the react app and the code here. As of now the app does the following - 

1. Takes a starting data json and renders the block, questions and options in the hierarchical (treelike) view.
2. The dropzone can be used to add more components to the survey. Simply drag the block, question or the option component over to the dropzone.
3. At this stage, all additions are linear, i.e. when you add a question it gets added to the last block. Similarly, when you add an option, it gets added to the last question. This is just for simplicity in the demo. Later on, drop zones will be configured in each component (will elaborate on this in the proposal).
4. Lastly, as per the requirement whenever a new block is dropped, a new ID is assigned. When Question and Option are dropped you get (albeit ugly) prompt asking for question text or option text and accordingly the component gets added.

I will be using this as the building block for the rest of the project and it would be great if you can share some feedback on it. If you have any questions regarding my approach etc, do let me know so that I can address those clearly in the proposal.

Hope this was useful.

Cheers,


On Wednesday, 18 March 2015 21:06:35 UTC+3, Prakhar Srivastav wrote:

Prakhar Srivastav

unread,
Mar 26, 2015, 3:21:06 AM3/26/15
to plasma-u...@googlegroups.com
Hi Emma,

I've posted an initial draft of the proposal on the Melange website. It would be great if you could have a quick look and suggest any changes if required before the deadline.

PS: Did you get a chance to see the react app mentioned above. Would love to get some initial feedback on the same.


On Wednesday, 18 March 2015 21:06:35 UTC+3, Prakhar Srivastav wrote:
Reply all
Reply to author
Forward
0 new messages