2014년 12월 10일 수요일

Save a Word for Later Review

I'm just now getting back into AI after a rather long stint away. I'm working on a flashcard app and am stuck (after a few hours of trying numerous things). What I'm stuck on is how to add a feature where I can click a button to store a word in the question list that I got wrong, which I can then come back to later for review. The idea is that when I hit the "Review" button, only the words that were saved will appear in the list to be reviewed. I suppose, then, that another issue that will come up is exiting out of that review list. 

 I have included the .aia file as an attachment below. If someone could help me on these I'd be very grateful. Thank you.




If you are asking for help, I recommend you to make it as easy for others to be able to help you ...
You probably will get more feedback then...

which means in your case post a screenshot of your relevant blocks...

To download the aia file, upload it to  App Inventor, open it, do some bug hunting for you, etc... this takes time, and most people will not do that...



I have attached the .aia file above. Here are the blocks.




you could create a review list and add the words using the add items to list block
Taifun

add items to list


Adds the given items to the end of the list.
The difference between this and append to list is that append to listtakes the items to be appended as a single list
while add items to list takes the items as individual arguments. This block is a mutator.



I'm stumped! 
I thought that's what I was doing. The "savedList" is what I was understanding to be the review list.



sorry, haven't seen the savedList...

you should correct some errors...
1. use text blocks and not variables as tag to store something in TinyDB, in this case e.g. the text "savedList"
2. load the savedList during Screen.Initialize like this
set savedList to  TinyDB.GetValue "savedList"
                         create empty list                          
Note: valueIfTagNotThere should be the create empty list block for lists!  
3. in the ButtonSave.Click event first add the current word to the list using the add items to list block and then save the new list in TinyDB

add items to list get global savedList
                        QuestionLabel.Text

you will have to work on the ButtonReview.Click event to display only the saved questions then...


댓글 없음:

댓글 쓰기