Replies: 4 comments 3 replies
-
|
These are the notes I took while thinking about this: Allowed types for form questions:any (any) [shows a textbox that only allows the matched strings]
integer box (integer) [shows a textbox that only allows integers in the specified range]
decimal box (decimal) [shows a textbox that only allows decimal numbers in the specified range]
slider (slider) [shows a textbox that only allows decimal numbers in the specified range]
yes or no (bool) [shows a checkbox in the form]radio button (radio) [shows a selection list]
phone number (phone_number) []email address (email) []
A possible JSON questions form: |
Beta Was this translation helpful? Give feedback.
-
|
I have some questions but overall looks pretty cool 👍 it's better than what I was imagining in the beginning, i'll have a second look tomorrow, thanks @HuseyinSimsek7904 |
Beta Was this translation helpful? Give feedback.
-
|
@HuseyinSimsek7904 here is my modified suggestion. [ # changing from object map to an array, we do not need to hold questions as key-value pair
{
"title": "Name: "
"description": "This will be publicly shared in the screen", # this part is added to all
"optional": false, # optional should be in every question
"type": "text", # instead of any
"minimum": 3,
"maximum": 32,
},
{
"title": "Email: ",
"optional": false,
"description": "Important to contact you in case you are the winner duck!",
"type": "email",
},
{
"title": "Phone No: ",
"optional": false,
"description": "Will not be shared with any third party source",
"type": "phone",
},
{
"title": "Age group: "
"optional": true,
"description": "Let's us know you better",
"type": "radio",
"options": [
"less than 18",
"between 18-65",
"more than 65",
]
},
{ # this question is added to introduce slider
"title": "How happy are you with the form?"
"optional": true,
"description": "Your opinion matters to us",
"type": "slider",
"minimum": 1,
"maximum": 10,
"step": 1,
},
] |
Beta Was this translation helpful? Give feedback.
-
|
If the question storing type is determined, I can arrange the PR in the frontend accordingly and close the issue, what do you guys say @HuseyinSimsek7904 @Utkub24 ? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Related: #15
We need to decide how to store raffle questions, how to send that data to front-end and display to the participants.
Suggested structure:
Since we do not how many questions any raffle will have, we need to store question information is a JSON object. We can imagine is as an array of questions, and the question interface could be as below.
Question
Then when the participant has entered the ID of raffle and got in, we can request questions array from the database, which would be in a public route, deserialise the JSON object and display the questions accordingly.
Beta Was this translation helpful? Give feedback.
All reactions