adding comments
This commit is contained in:
parent
21d435d49d
commit
05ee1e7350
6 changed files with 50 additions and 2 deletions
|
|
@ -20,8 +20,11 @@ Other cool stuff
|
|||
- Ability to add multiple fields to each step.
|
||||
- Scales to different types of forms.
|
||||
- You can provide a custom algorithim to process the form data.
|
||||
- Hosted on my website.
|
||||
- In fact, you can even have multiple forms.
|
||||
- Hosted on my website (public folder).
|
||||
|
||||
Bug Tracker
|
||||
- Input range doesn't reset position on next().
|
||||
- You need to move input at least once to set a value.
|
||||
|
||||
Ok I'm tired now...
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ export const psychForm = {
|
|||
prompt: "If you make a mistake on this team, it's held against you.",
|
||||
fields: [{
|
||||
type: "range",
|
||||
value: null,
|
||||
value: null, /* Where we capture the data */
|
||||
}],
|
||||
},
|
||||
{
|
||||
|
|
@ -43,3 +43,9 @@ export const psychAlgo = (form, res) => {
|
|||
|
||||
res.value = Math.floor(vals.reduce((a, b) => a + b) / vals.length);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
You can edit the form data here without touching app logic.
|
||||
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -45,3 +45,13 @@ const Form =
|
|||
}
|
||||
|
||||
export default Form;
|
||||
|
||||
/*
|
||||
|
||||
Each form consists of multiple steps.
|
||||
|
||||
Each step can consist of multiple fields.
|
||||
|
||||
Press the next button to go to next step.
|
||||
|
||||
*/
|
||||
|
|
@ -48,3 +48,18 @@ const Main =
|
|||
}
|
||||
|
||||
export default Main;
|
||||
|
||||
/*
|
||||
|
||||
App is split into three parts:
|
||||
|
||||
1. Choose a form (simplified to a start button for now).
|
||||
|
||||
2. Fill out the form (Form component).
|
||||
|
||||
3. See the results (will be separate component in future).
|
||||
|
||||
The psychForm (or any form) has the double function of being a template as
|
||||
well as storing the form data itself.
|
||||
|
||||
*/
|
||||
|
|
@ -38,3 +38,9 @@ const Range =
|
|||
}
|
||||
|
||||
export default Range
|
||||
|
||||
/*
|
||||
|
||||
Update the results live with the sliding action.
|
||||
|
||||
*/
|
||||
|
|
@ -25,3 +25,11 @@ const Step =
|
|||
}
|
||||
|
||||
export default Step;
|
||||
|
||||
/*
|
||||
|
||||
Show the prompt.
|
||||
|
||||
Render the appropriate fields, obviously only range field for now.
|
||||
|
||||
*/
|
||||
Loading…
Reference in a new issue