I have a student that wants to make an online journal type entry on her app. She wants to be able to allow the user to make an entry and keep the entry so she can come back later and check it off. Is there a way we can do that?
I think there are a few ways this can be done, but I would say create a boolean variable for done/not done and then use that to “
hideElement” or “
showElement”, as the elements fill up the screen, might need to use the “
deleteElement” block and “
setPosition” block to move everything up. This is a great idea and could be very useful to students.
Let me know how it goes!
@bradleywellsashley I am sending you a link of my students app. On the “entries” page, she wants to be able to add an entry and store the data. We are looking at the createRecord and the show/hide with an if statement. We don’t know how to actually make it work. Also, on the tasks page, she wants to create a new task such as “do laundry” and be able to check it off when finished. There again, I don’t know how to help her! Please help!
If the student really wants this app to save information over time, then she will need to use a database to store the information about the entries. That means that the database will need to be set up ahead of time in the “data” portion of App Lab.
There are a few complicated things about this problem, problems that the unit wasn’t really intended to address because this is more about prototyping than about making a functional app.
First, a user should only be able to access his or her own entries, not those of other users, so the database will need to hold information about which user owns each entry. When the app reads this information from the database, it should only read the information from the current user.
Second, there needs to be a way to update the display of entries after something is added to the database. That means that the App will probably need to delete any text displays of entries that are still on the screen, then read the relevant entries and display them all from scratch. Otherwise, the displays will be on top of each other. In order to delete them, we need to keep track of them.
Take a look at this sample app: https://studio.code.org/projects/applab/FitPcvICezmmWKPRjlI6NKs-wQHTEu0-0CVakraOw7o
This is far beyond what we would expect students to do in this course, but it is possible with App Lab.