-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Game Service] Question fetcher component #53
Comments
Update: it seems that mongoose assigns by default a '_id' field to each object of type ObjectId. This is the test I've done: We can take that hash to uniquely identify each Question object in the db, so that the image file linked to that question also has the same name. I suggest this schema:
since both image names and question id can be extracted from _id @Arquisoft/course2425_en2b. |
…repeated cities are created
…tion and the amount of questions. Query yet to be improved.
Thanks to @adrianmfuentes and his previous experience in node, I've discovered that I had an OOOoooold version of Node installed in my Ubuntu. I have already updated it and I will fix the existing errors soon. |
…ated with the rest of the app
…lude invalid item labels
Question fetcher component
The question fetcher is in charge of querying WikiData for questions. Remember that the main function of this component is processing the data returned from Wikidata and storing it into the database. The format of storing the data into the MongoDB database with the following schema (have a look at the user-model):
{
subject: {
type: String,
required: true,
},
image_name: {
type: String,
required: true,
},
answer: {
type: String,
required: true,
}
}
GET /generate
with parameter the number of questions we want to generate, as well as the themeSomething like: /generate?n=100&sub=capital
Note that, in this initial implementation, only questions about capitals should be correctly generated and stored.
The image should be downloaded into a folder images inside the game service.
The text was updated successfully, but these errors were encountered: