Skip to content

Commit

Permalink
Merge pull request #206 from Arquisoft/more-question-templates
Browse files Browse the repository at this point in the history
Added More Templates
  • Loading branch information
didierrc authored Apr 28, 2024
2 parents b8e77b3 + ac3c19d commit 3e6f8db
Show file tree
Hide file tree
Showing 5 changed files with 131 additions and 4 deletions.
123 changes: 123 additions & 0 deletions questionservice/src/models/template-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,129 @@ const generateSampleTest = () => {
typeName: 'sports',
},
});

addQuestionTemplate({
questionTemplate: 'Who is this football player?',
question_type: {
name: 'Images_FootballPlayers',
query: `SELECT DISTINCT ?templateLabel ?answerLabel WHERE {
?answer wdt:P106 wd:Q937857;
wdt:P21 wd:Q6581097; # Male gender
wdt:P27 wd:$$$; # Nationality
wdt:P569 ?birthDate.
FILTER (YEAR(?birthDate) > 1980)
?answer wdt:P18 ?template.
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
ORDER BY UUID()
LIMIT 5
`,
entities: [
'Q21', // England
'Q29', // Spain
'Q142', // France
'Q183', // Germany
'Q38' // Italy
],
typeName: 'sports',
},
});

addQuestionTemplate({
questionTemplate: 'Who is this football player?',
question_type: {
name: 'Images_FootballPlayers',
query: `SELECT DISTINCT ?templateLabel ?answerLabel WHERE {
?answer wdt:P106 wd:Q937857;
wdt:P21 wd:Q6581072; # Female gender
wdt:P27 wd:$$$; # Nationality
wdt:P569 ?birthDate.
FILTER (YEAR(?birthDate) > 1980)
?answer wdt:P18 ?template.
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
ORDER BY UUID()
LIMIT 5
`,
entities: [
'Q21', // England
'Q29', // Spain
'Q142', // France
'Q183', // Germany
'Q38' // Italy
],
typeName: 'sports',
},
});

addQuestionTemplate({
questionTemplate: 'What is the size in square kilometers of $$$?',
question_type: {
name: 'CountriesArea',
query: `SELECT DISTINCT ?templateLabel ?answerLabel WHERE {
?template wdt:P31 wd:Q6256; # Instance of country
wdt:P2046 ?answerLabel. # Area of the country
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY UUID()
LIMIT 5
`,
entities: [],
typeName: 'geography',
},
});

addQuestionTemplate({
questionTemplate: 'Which painting is this?',
question_type: {
name: 'Images_Paintings',
query: `SELECT DISTINCT ?templateLabel ?answerLabel WHERE {
?answer wdt:P31 wd:Q3305213; # Instance of painting
wdt:P18 ?template; # Image of the painting
wdt:P135 wd:Q947129. # Genre: Gothic painting
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
ORDER BY UUID()
LIMIT 5
`,
entities: [],
typeName: 'art',
},
});

addQuestionTemplate({
questionTemplate: 'Which painting is this?',
question_type: {
name: 'Images_Paintings',
query: `SELECT DISTINCT ?templateLabel ?answerLabel WHERE {
?answer wdt:P31 wd:Q3305213; # Instance of painting
wdt:P18 ?template; # Image of the painting
wdt:P170 wd:Q104884.
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
ORDER BY UUID()
LIMIT 5
`,
entities: [],
typeName: 'art',
},
});

addQuestionTemplate({
questionTemplate: 'Which sculpture is this?',
question_type: {
name: 'Images_Paintings',
query: `SELECT DISTINCT ?templateLabel ?answerLabel WHERE {
?answer wdt:P31 wd:Q860861; # Instance of sculpture
wdt:P18 ?template. # Image of the sculpture
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
LIMIT 5
`,
entities: [],
typeName: 'art',
},
});
};

export { TemplateModel, generateSampleTest };
3 changes: 2 additions & 1 deletion webapp/public/assets/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@
"geography": "Geography",
"history": "History",
"science": "Science",
"sports": "Sports"
"sports": "Sports",
"art": "Art"
},
"description": "This is the Custom mode. Take control of your quiz experience. Set the number of questions, time per question, and select your preferred question types. Tailor the challenge to your liking and dive into a personalized trivia adventure."
}
Expand Down
3 changes: 2 additions & 1 deletion webapp/public/assets/locales/es/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@
"geography": "Geografía",
"history": "Historia",
"science": "Ciencia",
"sports": "Deportes"
"sports": "Deportes",
"art": "Arte"
},
"description": "Este es el modo Personalizado. Toma el control de tu experiencia de quiz. Establece el número de preguntas, el tiempo por pregunta y selecciona tus tipos de preguntas preferidos. Adapta el desafío a tu gusto y sumérgete en una aventura de trivia personalizada."
}
Expand Down
3 changes: 2 additions & 1 deletion webapp/public/assets/locales/fr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@
"geography": "Géographie",
"history": "Histoire",
"science": "Science",
"sports": "Sports"
"sports": "Sports",
"art": "Art"
},
"description": "Ceci est le mode Personnalisé. Prenez le contrôle de votre expérience de quiz. Définissez le nombre de questions, le temps par question, et sélectionnez vos types de questions préférés. Personnalisez le défi à votre goût et plongez dans une aventure de quiz personnalisée."
}
Expand Down
3 changes: 2 additions & 1 deletion webapp/public/assets/locales/uk/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@
"geography": "Географія",
"history": "Історія",
"science": "Наука",
"sports": "Спорт"
"sports": "Спорт",
"art": "Ст"
},
"description": "Це Режим Користувацького вибору. Візьміть під контроль свій досвід вікторини. Встановіть кількість питань, час на кожне питання та оберіть ваші улюблені типи питань. Налаштуйте виклик на свій смак та поглибіться в персоналізовану пригоду вікторини."
}
Expand Down

0 comments on commit 3e6f8db

Please sign in to comment.