I’m making a learning application, and I want each page of the learning material to not be able to be opened if I haven’t completed the previous learning material, can kodular do that?
Yes it’s Possible .Make some logic & magic will happen .
Yes, it’s possible to create locked pages in Kodular. You can achieve this by implementing a logic that checks if the previous learning material has been completed before allowing access to the next page.
Here’s a simple example of how you can implement this using Kodular’s blocks:
when screen opens
set completed to false
when button "Complete" clicked
set completed to true
when button "Next Page" clicked
if completed then
open screen "Next Page"
else
show alert "Please complete the previous learning material first!"
In this example, the completed variable is used to track whether the previous learning material has been completed. When the “Complete” button is clicked, the completed variable is set to true. When the “Next Page” button is clicked, the app checks the value of completed. If it’s true, the app opens the next page. If it’s false, the app shows an alert message prompting the user to complete the previous learning material first. You can also enhance the logic with TinyDB component to save the completed status across the apps local storage
Maybe this could help you, I don’t have my pc right now, hence I can’t send the blocks but I have provided code snippets which will help you to gain the logic and implement it
Thank you for the information. Can you tell me where I can find the “Completed” component you mean?
Sorry, I’m still quite new to using Kodular.
It is a global variable
A very good way to learn App Inventor or Kodular is to read the free Inventor’s Manual here in the AI2 free online eBook App Inventor 2 Book: Create Your Own Android Apps … the links are at the bottom of the Web page. The book ‘teaches’ users how to program with AI2 blocks.
There is a free programming course here Course In A Box and the aia files for the projects in the book are here: App Inventor 2 Book: Create Your Own Android Apps
How to do a lot of basic things with App Inventor are described here: How do you...? .
Also do the tutorials Our Tutorials! to learn the basics of App Inventor, then try something and follow the Top 5 Tips: How to learn App Inventor
Taifun
Is there any suggestion to improve tinyDB, because I have tried as shown but the value from tinyDB is not saved
try this without a global variable and store the status completed (true or false) in TinyDB
valueIfTagNotThere is the boolean block false
and for easier understanding, what about renaming Button1 to btnComplete and Button2 to btnNextPage?
Taifun
Oh my god, thank you, this method is very helpful
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.