Skip to content
Snippets Groups Projects
Commit 558c3f2f authored by HARTZ HENRI's avatar HARTZ HENRI
Browse files

feat: remove brut quiz

parent 3dca0cbb
Branches
2 merge requests!134Feature/122 answer with image,!132V4.0
......@@ -30,85 +30,21 @@ export default function PlayingQuiz({route, navigation}:Props) {
const [score, setScore] = useState(0);
const fetchQuizInformations = async () => {
// const quizInformationsFetched = await getQuizInformations(quizId);
// if (HttpError.isHttpError(quizInformationsFetched)) {
// return;
// }
const quizInformationsFetched: QuizInformations = {
id: 1,
name: "Quiz de Test",
description: "Ceci est un quiz de test pour vérifier l'interface.",
isCommunity: true,
questionCount: 10,
categoryId: 2,
difficultyId: 3,
authorId: {
id: 42,
username: "TestAuthor",
email: "testauthor@example.com"
},
createdAt: "2025-01-10T10:00:00Z",
updatedAt: "2025-01-11T12:00:00Z",
category: {
id: 2,
name: "Science"
},
difficulty: {
id: 3,
name: "Moyenne"
}
};
const quizInformationsFetched = await getQuizInformations(quizId);
if (HttpError.isHttpError(quizInformationsFetched)) {
return;
}
setQuizInformations(quizInformationsFetched);
}
const fetchActualQuestion = async () => {
// const actualQuestionFetched = await getActualQuestionOfAQuiz(runId);
// if (HttpError.isHttpError(actualQuestionFetched)) {
// return;
// }
// const actualQuestionFetchedShuffle = shuffleAnswersOfQuiz(actualQuestionFetched);
// setActualQuestion(actualQuestionFetchedShuffle);
const actualQuestionFetched: Question = {
id: 1,
text: "Quelle image correspond à une étoile ?",
type: "imae",
categoryId: 2,
quizId: "quiz123",
order: 1,
answers: [
{
id: 1,
text: "https://st3.depositphotos.com/4164031/15614/i/450/depositphotos_156147646-stock-photo-star-field-in-deep-space.jpg",
isCorrect: true,
questionId: 1
},
{
id: 2,
text: "https://st3.depositphotos.com/4164031/15614/i/450/depositphotos_156147646-stock-photo-star-field-in-deep-space.jpg",
isCorrect: false,
questionId: 1
},
{
id: 3,
text: "https://st3.depositphotos.com/4164031/15614/i/450/depositphotos_156147646-stock-photo-star-field-in-deep-space.jpg",
isCorrect: false,
questionId: 1
},
{
id: 4,
text: "https://st3.depositphotos.com/4164031/15614/i/450/depositphotos_156147646-stock-photo-star-field-in-deep-space.jpg",
isCorrect: false,
questionId: 1
}
],
category: {
id: 2,
name: "Astronomie"
}
};
setActualQuestion(actualQuestionFetched);
const actualQuestionFetched = await getActualQuestionOfAQuiz(runId);
if (HttpError.isHttpError(actualQuestionFetched)) {
return;
}
const actualQuestionFetchedShuffle = shuffleAnswersOfQuiz(actualQuestionFetched);
setActualQuestion(actualQuestionFetchedShuffle);
}
useEffect(() => {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment