Skip to content

Instantly share code, notes, and snippets.

@bajajcodes
Last active December 7, 2023 10:03
Show Gist options
  • Save bajajcodes/d872f3d269a652b12ed8aac87a08091f to your computer and use it in GitHub Desktop.
Save bajajcodes/d872f3d269a652b12ed8aac87a08091f to your computer and use it in GitHub Desktop.
Quizes JSON Structure
type QuestionOption = "Yes" | "No" | "YES" | "NO";
interface Question {
answer: QuestionOption;
question: string;
options: QuestionOption[];
}
interface Quiz {
imageURL: string;
description: string;
rules: string[];
title: string;
peopleAttended: number;
questions: Question[];
}
interface Exercise {
imageURL: string;
title: string;
description: string;
quizes: Quiz[];
}
const exampleData: Exercise[] = [
{
imageURL: "https://firebasestorage.googleapis.com/v0/b/quizmaster-app-f4692.appspot.com/o/Quiz_Images%2FswiftUI-banner.jpg?alt=media&token=a01d6290-f270-4f8a-80a9-889557b7da08",
title: "Exercise For SwiftUI",
description: "This quiz contains all exercise questions related to SwiftUI",
quizes: [
{
imageURL: "https://firebasestorage.googleapis.com/v0/b/quizmaster-app-f4692.appspot.com/o/Quiz_Images%2FswiftUI-banner.jpg?alt=media&token=a01d6290-f270-4f8a-80a9-889557b7da08",
description: "This quiz contains all exercise questions related to SwiftUI",
rules: [
"Answer each question promptly to stay within the allotted time, ensuring a fair and challenging quiz experience.",
"Avoid seeking help from external sources or collaborators to uphold the integrity of the quiz and demonstrate individual knowledge.",
"Make your best attempt at each question, as quizzes are designed for a single submission to accurately reflect your understanding.",
"Maintain a quiet environment during the quiz to respect fellow participants, fostering a conducive atmosphere for concentration and fair competition.",
],
title: "Exercise For SwiftUI",
peopleAttended: 4,
questions: [
{
answer: "No",
question: "This Swift code generates a random integer between 1 and 100 and then prints a message indicating the generated number?",
options: ["Yes", "No"],
},
{
answer: "Yes",
question: "This Swift code generates a random integer between 1 and 100 and then prints a message indicating the generated number?",
options: ["Yes", "No"],
},
],
},
],
},
// ... (similar structure for other exercises)
];
[
{
"imageURL":"https://firebasestorage.googleapis.com/v0/b/quizmaster-app-f4692.appspot.com/o/Quiz_Images%2FswiftUI-banner.jpg?alt=media&token=a01d6290-f270-4f8a-80a9-889557b7da08",
"title":"Exercise For SwiftUI",
"description":"This quiz contains all exercise questions related to SwiftUI",
"quizes":[
{
"imageURL":"https://firebasestorage.googleapis.com/v0/b/quizmaster-app-f4692.appspot.com/o/Quiz_Images%2FswiftUI-banner.jpg?alt=media&token=a01d6290-f270-4f8a-80a9-889557b7da08",
"description":"This quiz contains all exercise questions related to SwiftUI",
"rules":[
"Answer each question promptly to stay within the allotted time, ensuring a fair and challenging quiz experience.",
"Avoid seeking help from external sources or collaborators to uphold the integrity of the quiz and demonstrate individual knowledge.",
"Make your best attempt at each question, as quizzes are designed for a single submission to accurately reflect your understanding.",
"Maintain a quiet environment during the quiz to respect fellow participants, fostering a conducive atmosphere for concentration and fair competition."
],
"title":"Exercise For SwiftUI",
"peopleAttended":4,
"questions":[
{
"answer":"No",
"question":"This Swift code generates a random integer between 1 and 100 and then prints a message indicating the generated number?",
"options":[
"Yes",
"No"
]
},
{
"answer":"Yes",
"question":"This Swift code generates a random integer between 1 and 100 and then prints a message indicating the generated number?",
"options":[
"Yes",
"No"
]
}
]
}
]
},
{
"imageURL":"https://firebasestorage.googleapis.com/v0/b/quizmaster-app-f4692.appspot.com/o/Quiz_Images%2FMicrosoft-to-switch-C-to-Language-Server-Protocol-in-Visual-Studio-Code.png?alt=media&token=a85d7a69-634c-45c9-b0a0-c7bda5f088bd",
"title":"Exercise For C#",
"description":"This quiz contains all exercise questions related to c#",
"quizes":[
{
"imageURL":"https://firebasestorage.googleapis.com/v0/b/quizmaster-app-f4692.appspot.com/o/Quiz_Images%2FMicrosoft-to-switch-C-to-Language-Server-Protocol-in-Visual-Studio-Code.png?alt=media&token=a85d7a69-634c-45c9-b0a0-c7bda5f088bd",
"description":"This quiz contains all exercise questions related to c#",
"rules":[
"Answer each question promptly to stay within the allotted time, ensuring a fair and challenging quiz experience.",
"Avoid seeking help from external sources or collaborators to uphold the integrity of the quiz and demonstrate individual knowledge.",
"Make your best attempt at each question, as quizzes are designed for a single submission to accurately reflect your understanding.",
"Maintain a quiet environment during the quiz to respect fellow participants, fostering a conducive atmosphere for concentration and fair competition"
],
"title":"Exercise For C#",
"peopleAttended":1,
"questions":[
{
"answer":"No",
"question":"This Swift code generates a random integer between 1 and 100 and then prints a message indicating the generated number?",
"options":[
"Yes",
"No"
]
},
{
"answer":"Yes",
"question":"This Swift code generates a random integer between 1 and 100 and then prints a message indicating the generated number?",
"options":[
"Yes",
"No"
]
}
]
}
]
},
{
"imageURL":"https://firebasestorage.googleapis.com/v0/b/quizmaster-app-f4692.appspot.com/o/Quiz_Images%2FMicrosoft-to-switch-C-to-Language-Server-Protocol-in-Visual-Studio-Code.png?alt=media&token=a85d7a69-634c-45c9-b0a0-c7bda5f088bd",
"title":"Exercise For C#",
"description":"This quiz contains all exercise questions related to c#",
"quizes":[
{
"imageURL":"https://firebasestorage.googleapis.com/v0/b/quizmaster-app-f4692.appspot.com/o/Quiz_Images%2FMicrosoft-to-switch-C-to-Language-Server-Protocol-in-Visual-Studio-Code.png?alt=media&token=a85d7a69-634c-45c9-b0a0-c7bda5f088bd",
"description":"This quiz contains all exercise questions related to c#",
"rules":[
"Answer each question promptly to stay within the allotted time, ensuring a fair and challenging quiz experience.",
"Avoid seeking help from external sources or collaborators to uphold the integrity of the quiz and demonstrate individual knowledge.",
"Make your best attempt at each question, as quizzes are designed for a single submission to accurately reflect your understanding.",
"Maintain a quiet environment during the quiz to respect fellow participants, fostering a conducive atmosphere for concentration and fair competition"
],
"title":"Exercise For C#",
"peopleAttended":7,
"questions":[
{
"answer":"No",
"question":"This Swift code generates a random integer between 1 and 100 and then prints a message indicating the generated number?",
"options":[
"Yes",
"No"
]
},
{
"answer":"Yes",
"question":"This Swift code generates a random integer between 1 and 100 and then prints a message indicating the generated number?",
"options":[
"Yes",
"No"
]
},
{
"answer":"YES",
"question":"Speak Truth only?",
"options":[
"YES",
"NO"
]
}
]
}
]
},
{
"imageURL":"https://firebasestorage.googleapis.com/v0/b/quizmaster-app-f4692.appspot.com/o/Quiz_Images%2FswiftUI-banner.jpg?alt=media&token=a01d6290-f270-4f8a-80a9-889557b7da08",
"title":"Exercise For SwiftUI",
"description":"This quiz contains all exercise questions related to SwiftUI",
"quizes":[
{
"imageURL":"https://firebasestorage.googleapis.com/v0/b/quizmaster-app-f4692.appspot.com/o/Quiz_Images%2FswiftUI-banner.jpg?alt=media&token=a01d6290-f270-4f8a-80a9-889557b7da08",
"description":"This quiz contains all exercise questions related to SwiftUI",
"rules":[
"Answer each question promptly to stay within the allotted time, ensuring a fair and challenging quiz experience.",
"Avoid seeking help from external sources or collaborators to uphold the integrity of the quiz and demonstrate individual knowledge.",
"Make your best attempt at each question, as quizzes are designed for a single submission to accurately reflect your understanding.",
"Maintain a quiet environment during the quiz to respect fellow participants, fostering a conducive atmosphere for concentration and fair competition."
],
"title":"Exercise For SwiftUI",
"peopleAttended":2,
"questions":[
{
"answer":"No",
"question":"This Swift code generates a random integer between 1 and 100 and then prints a message indicating the generated number?",
"options":[
"Yes",
"No"
]
},
{
"answer":"Yes",
"question":"This Swift code generates a random integer between 1 and 100 and then prints a message indicating the generated number?",
"options":[
"Yes",
"No"
]
}
]
}
]
}
]
@bajajcodes
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment