## 4 System Architecture  
Taking into consideration the question generation methodology outlined in Section 3, the resulting architecture consists of the following three main components as depicted in Figure 3: a **data extractor and annotator**; a **web service** and the **gaming system**. The **data extractor and annotator** performs two major tasks. First, this module aims to retrieve museum objects' documentation from their website using web scraping technologies. Second, the extracted data undergoes a semantic annotation procedure and finally, these data are fed into a template-based question generator. This yields batches of questions associated with every museum item. The latter procedure has been carried out according to the question generation methodology portrayed in Section 3.1. The **web service** component stores the information on museum items and their respective generated questions. These are stored as document collections in MongoDB (MongoDB official site: [[https://www.mongodb.com/](https://www.mongodb.com/)]([https://www.mongodb.com/](https://www.mongodb.com/))), the database of choice because it enables to store documents (NoSQL) in JSON format.Additionally, there is another document to add, which consists of user data and game statistics. The implementation of the web server has been carried out considering REST API paradigms, and it grants the gaming system access to the required resources (object data, questions and user statistics). The server has been developed using Python Flask (Flask official site: [[https://www.palletsprojects.com/p/flask/](https://www.palletsprojects.com/p/flask/)]([https://www.palletsprojects.com/p/flask/](https://www.palletsprojects.com/p/flask/))) web application framework, which is fast and straightforward to set up, whilst providing an excellent performance for our purposes (GET requests only return a JSON-formatted text response). In order to be able to perform the majority of API calls to the service, a valid user key must be used within each request. Such key is granted to a user when they register on our application. For the purpose of improving security, this key is updated each time the user logs in. A demo version of the web service has been uploaded to Heroku (Site for demo web service of the proposed system: [[https://museowebapi.herokuapp.com/](https://museowebapi.herokuapp.com/)]([https://museowebapi.herokuapp.com/](https://museowebapi.herokuapp.com/))). This version does not require keys to perform API calls and is at the reader's disposal for illustrative purposes (no user data is collected; only items' documentation and questions). Regarding the **gaming system**, it comprises two main artefacts: QR codes and a smartphone application. These codes contain an URL (A working example to illustrate this is shown in: [[https://museowebapi.herokuapp.com/objects/502504](https://museowebapi.herokuapp.com/objects/502504)]([https://museowebapi.herokuapp.com/objects/502504](https://museowebapi.herokuapp.com/objects/502504))) identifying the museum item of interest. Accessing these URLs yield a JSON response containing information about the object. These data are elegantly formatted and presented in the application, so that it provides advanced visualization of the exhibits as well as access to the Trivia quiz game. Each object will allow users to play three questions. It must also be noted that images associated to the objects are not stored in our designed database. The main reason is to reduce the load and optimise the speed of the transactions. Instead, we have decided to host them on Cloudinary (Cloudinary Site: [[https://cloudinary.com/](https://cloudinary.com/)]([https://cloudinary.com/](https://cloudinary.com/))) servers. The application has been developed with JavaScript using React Native (React Native Official Website: [[http://www.reactnative.com/](http://www.reactnative.com/)]([http://www.reactnative.com/](http://www.reactnative.com/))) framework, granting cross-compatibility with Android and iOS.