i know how to switch screens but main concern is user selecting the difficulty, they have to select one and if they want to change they can and after that clicks on start new game to start the game.
eg : player selects medium mode at first. but he/she wants to change it back to easy mode to clicks easy (after clicking easy the medium one gets deselected.) after selecting easy mode he/she clicks to start new game and ques and options arises acc to easy level difficulty
There should be a separate screen in which trivia questions are displayed one by one. When this trivia screen opens, it should load questions of the selected difficulty, following the following logic:
o If the device is currently connected to the network, questions should be loaded from
the Open Trivia Database API, as described in the API section of this document.
o If the device is not connected to the network, questions should be loaded from the
provided text files, which contain static question data retrieved from the Open Trivia
Database API.
The application should contain several screens to fulfill the requirements described below. You are
free to design the interfaces of your app as you like, but your solution should also meet the
requirements in a logical way. Include storyboards or sketches in your report.
Specifically, the logic requirements that must be supported in the app are as follows:
• When the application is first opened, there should be a screen that provides users with a way
to select the game difficulty (“easy”, “medium”, or “hard”); start a new game; and view high
scores.
• There should be a separate screen in which trivia questions are displayed one by one. When
this trivia screen opens, it should load questions of the selected difficulty, following the following logic:
o If the device is currently connected to the network, questions should be loaded from
the Open Trivia Database API, as described in the API section of this document.
o If the device is not connected to the network, questions should be loaded from the
provided text files, which contain static question data retrieved from the Open Trivia
Database API.
• A single question should be displayed at a time, including its category, question text, and four
possible answers (including the correct answer and three incorrect answers in a random
order). The user should be able to select one of these answers, at which point the following
should occur:
o If the selected answer is the correct answer, the user’s score is incremented by 1
point (the current score should also be visible on the trivia screen). A new question is
displayed and the process repeats.
o If the selected answer is incorrect, the user should be made aware that they selected
the wrong answer, and the correct answer should be shown.
o Once the user has answered incorrectly three times, The app should then navigate to
another screen where the user can save their score to a database, passing the
achieved score with it.
• The save score screen should have a mechanism for the user to enter their name, which
along with their score and a current date and timestamp, should be saved to a database.
Once the value is saved, the app should navigate back to the main screen.
• There should be a separate screen on which users can view the high scores by loading them
from the database and displaying in an appropriate UI component. Scores should be
presented in order from highest to lowest.
It is recommended that you visit the Open Trivia DB API link in a browser and view the JSON in a web browser to get a feel for its structure. You will see that the JSON data contains an array (results) of questions, with each question containing a range of information that describes the question, its category, correct_answer, and incorrect_answers. Your app should extract this data and load into an appropriate data structure to achieve the required functionality for this assignment.
General Requirements for Coding :
While your app should meet the functionality described above, you need to ensure that you
demonstrate the concepts we have covered in ITECH2000 so far. To achieve full marks, you will need to ensure that you have correctly made use of each of the following components, constructs or concepts somewhere in your app:
• Dictionary
• WebViewer and/or Web component
• ListView or ListPicker
• TinyDB and File
• Local and global variables
• Procedures
It is the wrongest of all the wrong possibilities.
The TinyDB component dies when you cross screens (though the database file is still there if the new screen were to contain its own TinyDB component with the same NameSpace.)
To fix it, add a TinyDB1 to screen ScoreDB, decide on a tag in TinyDB like 'scores' for your scores, and store the scores there in the first screen for the second screen to look them up when the second screen needs them.
Don't bother passing anything as start value, just use common TinyDB tags.
It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.
To get an image of your blocks, right click in the Blocks Editor and select "Download Blocks as Image". You might want to use an image editor to crop etc. if required. Then post it here in the community.