Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions db.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,13 @@
"response_code": 0,
"results": [
{
"type": "multiple",
"difficulty": "medium",
"category": "Entertainment: Video Games",
"question": "Which one of the first four titles of the "Grand Theft Auto" franchise started the series of iconic image grid cover arts?",
"correct_answer": "Grand Theft Auto III",
"type": "Ym9vbGVhbg==",
"difficulty": "bWVkaXVt",
"category": "RW50ZXJ0YWlubWVudDogSmFwYW5lc2UgQW5pbWUgJiBNYW5nYQ==",
"question": "VGhlIGFuaW1hdGVkIGZpbG0gIlNwaXJpdGVkIEF3YXkiIHdvbiB0aGUgQWNhZGVteSBBd2FyZCBmb3IgQmVzdCBBbmltYXRlZCBGZWF0dXJlIGF0IHRoZSA3NXRoIEFjYWRlbXkgQXdhcmRzIGluIDIwMDMu",
"correct_answer": "VHJ1ZQ==",
"incorrect_answers": [
"Grand Theft Auto",
"Grand Theft Auto II",
"Grand Theft Auto Vice City"
"RmFsc2U="
]
}
]
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "xpquiz.github.io",
"version": "1.4.0",
"version": "1.4.1",
"scripts": {
"ng": "ng",
"start": "ng serve",
Expand Down
2 changes: 1 addition & 1 deletion src/app/about-window/about-window.component.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="window">
<app-window-title-bar iconPath="about.png" title="About XPQuiz"></app-window-title-bar>
<div class="window-body">
<label><b>XPQuiz</b>&nbsp;- Version 1.4.0</label>
<label><b>XPQuiz</b>&nbsp;- Version 1.4.1</label>
<label class="main">Created by&nbsp;<b><a href="https://isahann.github.io">Isahann Hanacleto</a></b></label>

<label>Source code at&nbsp;<b><a href="https://github.com/xpquiz/xpquiz.github.io">GitHub</a></b></label>
Expand Down
10 changes: 5 additions & 5 deletions src/service/trivia.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,18 @@ export class TriviaService {
}

private async getQuestionsOpenTriviaDB(): Promise<Question[]> {
const url: string = `${environment.openTriviaDBUrl}?amount=${this.questionLimit}`;
const url: string = `${environment.openTriviaDBUrl}?amount=${this.questionLimit}&encode=base64`;

const response: OpenTriviaDBResponse = await firstValueFrom(
this.httpClient.get<OpenTriviaDBResponse>(url)
);

return response.results.map(res => {
return {
question: res.question,
correctAnswer: res.correct_answer,
incorrectAnswers: res.incorrect_answers,
difficulty: res.difficulty as 'easy' | 'medium' | 'hard',
question: atob(res.question),
correctAnswer: atob(res.correct_answer),
incorrectAnswers: res.incorrect_answers.map(r => atob(r)),
difficulty: atob(res.difficulty) as 'easy' | 'medium' | 'hard',
isNiche: false,
}
});
Expand Down