Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

jeevamugunthan's avatar

Fill in the blanks

Hi, everyone Now i'm creating an quiz web application that have two types of questions one is choose type and another one is fill in the blanks.

i want to know how i can add fill in the blanks questions dynamically from admin side, i want to add input box with name and id attributes dynamically .

anyone give some suggestion

0 likes
1 reply
automica's avatar

@jeevamugunthan you'll first need to decide how to add the meta data into the text to describe what type of question type you are using.

eg

Some text with a {question:1,type:'text'} and another bit of text with a {question:2,type:'select',options:['value1':'text for value 1','value2':'text for value 2','value3':'text for value 3']} etc

You'd then need to write a regex to find the various {} and then transform the text to the various html form element you want.

Please or to participate in this conversation.