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.
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”) and start a new game and view high
scores.
CRICOS Provider No. 00103D | RTO Code 4909
CRICOS Provider No. 00103D | RTO Code 4909 Page 2 of 6
• There should be a separate screen in which the trivia questions are displayed, opened from
the first screen. 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). The user should
then be prompted as to whether they wish to continue the game or end it. If they
choose to continue, 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. 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. The following additional
functionality should exist on this screen:
o There should be a way for the user to sort the scores, based on your implementation
of a sorting algorithm. The scores can be sorted by the score value, alphabetical order
of the user’s name, or the date timestamp – you only need to support one of these.
o The user should also be able to delete a score, which will remove it from the display
and the database entirely.
Downloading trivia questions from the Open Trivia Database using the API
The Open Trivia Database API should be used to download the trivia questions used in this app (when
a network connection is available). You can get a random list of questions of a particular difficulty in
JSON format using the following URL – all you need to do is replace <#> with a positive integer, and
<difficulty> with the preferred difficulty (“easy”, “medium”, or “hard”) as required:
[login to view URL]<#>&difficulty=<difficulty>&type=multiple&encode=url3986
For example, [login to view URL]
will give 20 random questions of hard difficulty. Note that the type parameter is set to “multiple”, so that
multiple-choice questions are returned. The encode parameter specifies how special characters are
rendered in text, in this case it is set to URL Encoding (RFC 3986).
more details I will provide over chat