Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added very simple alternative jspsych-survey-html-form plugin #602

Merged
merged 5 commits into from
Jul 4, 2019

Conversation

jansim
Copy link
Contributor

@jansim jansim commented Mar 14, 2019

Hello,
for a study I'm currently working on, I created this super simple version of a form plugin. I saw, that there's already a planned form plugin in the works #135 , but maybe this is still useful as a starting point or so. This plugin simply renders an HTML string containing the input elements for the form and parses them using a vanilla JS version of jQuery's serializeArray().

@jodeleeuw
Copy link
Member

Thanks! This can be a great intermediate option until the other version is ready. Are you willing to write the documentation and tests for the plugin?

@jodeleeuw jodeleeuw added this to the 6.1 milestone Mar 18, 2019
@jansim
Copy link
Contributor Author

jansim commented Mar 20, 2019

I added a a test & basic documentation for the plugin 👍

Also, is there a particular reason why data in the jspsych-survey-text plugin is passed as JSON-text and not as a JS object? Currently this plugin mirrors the behavior since I based it off of the survey-test plugin, but I could easily remove this.

@jodeleeuw jodeleeuw merged commit 7d01510 into jspsych:master Jul 4, 2019
@jodeleeuw
Copy link
Member

Thanks again. This is a really versatile plugin!

I made one small functional change in the merged version: I encoded the data as a JSON string instead of an object. While objects are more useful, the current design is that anything encoded in the data is a primitive type. This might be worth revisiting in the future, but I wanted to maintain consistency across plugins for now.

@jodeleeuw jodeleeuw mentioned this pull request Jul 4, 2019
@jansim
Copy link
Contributor Author

jansim commented Jul 4, 2019

Ah ok, that makes sense! Thanks for merging the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants