I have a global variable named “user response” which creates an empty list for MCQ quiz, when user select any option, it is stored to user response list.
There are 5 mcq Questions.
When user solve 5 questions and see his responses then it is called from that list.
When user solve only 2 questions and when called user response list, then there are only 2 responses in that list and 3 are empty strings.
This create an error of select list item of index 2.
I want to add a text “Skipped” in place of empty string.
How to do this?
In your blocks, you should return a list but not the string "Skipped
you may do it in this way
Ok, if i return a list then, this will replace all items of user response list.
I want to only replace empty strings
is this ok?
That’s actually what you want.
Put this in the join block
Wait i will try it first.
is this ok?
Still getting error
Actually your method works when whole list is empty but not when there are 2 items in the list and i am trying to get 5 items.
Obviously this creates this error thats why i want remaining 3 items as “skipped”
Why don’t you add the item “Skipped” when there is not 5 items in your list?
Btw, are you using
for each item in list or
for each number for your dynamic label?
If so, you may want to do it in this way
I have tried this before calling list but not working.
Here is the problem.
You set if statement to if the list is empty. But very obviously your list isn’t empty, so it won’t be exacute even there isn’t 5 items, only works when there is nothing in the list.
Set the if slot to
if length of the list < 5
Exactly as you explained i got noticed before your reply, and same thing i did myself in blocks and its worked.
Then i saw your reply, Oh my god! Same blocks!
But i really appreciate your help and quick response.
Happy to help
Edit: Thank you for all the likes as well
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.