# Creating a Quiz with Streamlit

**URL:** <https://discuss.streamlit.io/t/creating-a-quiz-with-streamlit/13013>\
**Category:** Using Streamlit\
**Created:** [May 17, 2021, 4:02pm UTC](https://discuss.streamlit.io/t/creating-a-quiz-with-streamlit/13013 "2021-05-17T16:02:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Judsonpp](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/judsonpp/32/7700_2.png) [@Judsonpp](https://discuss.streamlit.io/u/Judsonpp)\
**Post date:** [May 17, 2021, 4:02pm UTC](https://discuss.streamlit.io/t/creating-a-quiz-with-streamlit/13013/1 "2021-05-17T16:02:55Z")

</div>

Hello guys,

Im trying to create a Streamlit app, to a friend of mine, in her company they need that every new candidate answer 55 questions of multiple choice, and them the Intern cheque the answers.

---

<div class="post-metadata">

**Author:** ![Caroline](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/caroline/32/38736_2.png) [@Caroline](https://discuss.streamlit.io/u/Caroline)\
**Post date:** [May 17, 2021, 7:08pm UTC](https://discuss.streamlit.io/t/creating-a-quiz-with-streamlit/13013/2 "2021-05-17T19:08:27Z")

</div>

Hi @Judsonpp,

Thank you for sharing with the Streamlit community! I would recommend checking out [our Cookbook documentation on input widgets](https://docs.streamlit.io/en/stable/advanced_concepts.html?highlight=input#batch-elements-and-input-widgets) and [our documentation on streamlit.radio](https://docs.streamlit.io/en/stable/api.html?highlight=radio#streamlit.radio), which can be used to create radio buttons.

Feel free to let us know if you have any further questions after reviewing those pages and the included code snippets.

Best,

Caroline

---

<div class="post-metadata">

**Author:** ![deepsphere](https://avatars.discourse-cdn.com/v4/letter/d/e68b1a/32.png) [@deepsphere](https://discuss.streamlit.io/u/deepsphere)\
**Post date:** [July 14, 2021, 5:35am UTC](https://discuss.streamlit.io/t/creating-a-quiz-with-streamlit/13013/3 "2021-07-14T05:35:11Z")

</div>

Hi Caroline,

We are trying to generate a quiz application using streamlit. Please find the code attached here:

```auto
fill_in_the_blanks = {'questions': ['question1','question2'], 'answers': ['answer1','answer2']}
ans = []
mark = 0
with st.form(key = id_generator()):
	for i,quest in enumerate(fill_in_the_blanks["questions"]):
		st.write(i+1,quest)
		x = st.text_input("Enter your answer here",key=id_generator())
		ans.append(x)
	submitted = st.form_submit_button(label='Submit')
	if submitted:
		# if answers are correct then
			mark = mark+1
	st.success("Test Score - "+str(mark))

```

Here, i am able to populate questions within the form widget. But, am not able to read text\_input answers which is created with the help of for loop. How to read text\_input value from user in this case. Please do the needful here.

Thanks,  
Prakash  
mail: prakash@deepsphere.ai

---

<div class="post-metadata">

**Author:** ![randyzwitch](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/randyzwitch/32/58772_2.png) [@randyzwitch](https://discuss.streamlit.io/u/randyzwitch)\
**Post date:** [August 15, 2022, 8:42pm UTC](https://discuss.streamlit.io/t/creating-a-quiz-with-streamlit/13013/4 "2022-08-15T20:42:51Z")

</div>


