In this activity, you will gather responses to your survey questions.
The data you collect will be stored as table. As you collect data, the list will fill up with additional rows, but the survey questions will remain as the first row of the survey. For example:
The block takes a survey as input and reports its first row with all the questions.
ask question
. --MF, 12/28/21 and PF
This project also includes an block that takes a question as input, asks the user the question, and reports the user's response.
questions only
block, and discuss how the block works (even when the survey is full of data).
item of
selects one. You learned about item of
in Lab 4 Activity 3.ask
block, and then click it to see how the responses will be entered into Snap! and then reported by the ask
block.
The ask
block takes a question as input, asks the user the question, waits for a response, and then reports the user's response as the output of the function.
questions only
and ask
together to ask the user each question from your survey and store that data in the my survey variable?The missing tool is the block, which performs an action to each item in a list. In this case, the action is to
ask
the user, and the list is the output of questions only
from my survey
.
map
block in Lab 4 Activity 4: Transforming Every Pixel.Click for a hint about building new response
.
Use map
together with ask
and questions only
.
The new response
block reports the user's data, but it doesn't send it anywhere. The block will take data and add it the end of a list.
→
new response
together with add
to create code to collect survey data.reset survey
and then running the survey setup script againdelete
block takes a position number and a list as input and removes the item from the list at the specified position number.)In this activity, you learned about the ask
and add
blocks and used them together with map
to collect data for your survey.