Skip to content

Commit

Permalink
adding more quizez
Browse files Browse the repository at this point in the history
  • Loading branch information
fahdaguenouz committed Oct 8, 2024
1 parent 317fe3a commit 1d7bf68
Show file tree
Hide file tree
Showing 2 changed files with 129 additions and 8 deletions.
50 changes: 50 additions & 0 deletions database/seeders/AnswerSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,55 @@ public function run()
Answer::create(['question_id' => 10, 'answer_text' => 'Football', 'is_correct' => false]);
Answer::create(['question_id' => 10, 'answer_text' => 'Baseball', 'is_correct' => false]);
Answer::create(['question_id' => 10, 'answer_text' => 'Hockey', 'is_correct' => false]);

Answer::create([ 'question_id' => 11, 'answer_text' => 'Paris', 'is_correct' => true]);
Answer::create(['question_id' => 11, 'answer_text' => 'London', 'is_correct' => false]);
Answer::create(['question_id' => 11, 'answer_text' => 'Berlin', 'is_correct' => false]);
Answer::create([ 'question_id' => 11, 'answer_text' => 'Madrid', 'is_correct' => false]);

Answer::create([ 'question_id' => 12, 'answer_text' => 'Pacific Ocean', 'is_correct' => true]);
Answer::create(['question_id' => 12, 'answer_text' => 'Atlantic Ocean', 'is_correct' => false]);
Answer::create([ 'question_id' => 12, 'answer_text' => 'Indian Ocean', 'is_correct' => false]);
Answer::create([ 'question_id' => 12, 'answer_text' => 'Arctic Ocean', 'is_correct' => false]);

Answer::create([ 'question_id' => 13, 'answer_text' => '100°C', 'is_correct' => true]);
Answer::create(['question_id' => 13, 'answer_text' => '90°C', 'is_correct' => false]);
Answer::create([ 'question_id' => 13, 'answer_text' => '80°C', 'is_correct' => false]);
Answer::create([ 'question_id' => 13, 'answer_text' => '110°C', 'is_correct' => false]);

Answer::create([ 'question_id' => 14, 'answer_text' => 'Harper Lee', 'is_correct' => true]);
Answer::create(['question_id' => 14, 'answer_text' => 'J.K. Rowling', 'is_correct' => false]);
Answer::create([ 'question_id' => 14, 'answer_text' => 'Ernest Hemingway', 'is_correct' => false]);
Answer::create(['question_id' => 14, 'answer_text' => 'F. Scott Fitzgerald', 'is_correct' => false]);

Answer::create(['question_id' => 15, 'answer_text' => 'Au', 'is_correct' => true]);
Answer::create(['question_id' => 15, 'answer_text' => 'Ag', 'is_correct' => false]);
Answer::create([ 'question_id' => 15, 'answer_text' => 'Fe', 'is_correct' => false]);
Answer::create([ 'question_id' => 15, 'answer_text' => 'Pb', 'is_correct' => false]);

Answer::create([ 'question_id' => 16, 'answer_text' => 'Mars', 'is_correct' => true]);
Answer::create(['question_id' => 16, 'answer_text' => 'Venus', 'is_correct' => false]);
Answer::create([ 'question_id' => 16, 'answer_text' => 'Jupiter', 'is_correct' => false]);
Answer::create(['question_id' => 16, 'answer_text' => 'Saturn', 'is_correct' => false]);

Answer::create([ 'question_id' => 17, 'answer_text' => 'Basketball', 'is_correct' => true]);
Answer::create([ 'question_id' => 17, 'answer_text' => 'Football', 'is_correct' => false]);
Answer::create([ 'question_id' => 17, 'answer_text' => 'Baseball', 'is_correct' => false]);
Answer::create(['question_id' => 17, 'answer_text' => 'Hockey', 'is_correct' => false]);

Answer::create(['question_id' => 18, 'answer_text' => 'Diamond', 'is_correct' => true]);
Answer::create([ 'question_id' => 18, 'answer_text' => 'Graphite', 'is_correct' => false]);
Answer::create([ 'question_id' => 18, 'answer_text' => 'Quartz', 'is_correct' => false]);
Answer::create([ 'question_id' => 18, 'answer_text' => 'Emerald', 'is_correct' => false]);

Answer::create(['question_id' => 19, 'answer_text' => 'Mount Everest', 'is_correct' => true]);
Answer::create(['question_id' => 19, 'answer_text' => 'K2', 'is_correct' => false]);
Answer::create([ 'question_id' => 19, 'answer_text' => 'Kangchenjunga', 'is_correct' => false]);
Answer::create([ 'question_id' => 19, 'answer_text' => 'Lhotse', 'is_correct' => false]);

Answer::create([ 'question_id' => 20, 'answer_text' => 'J.K. Rowling', 'is_correct' => true]);
Answer::create([ 'question_id' => 20, 'answer_text' => 'Stephen King', 'is_correct' => false]);
Answer::create([ 'question_id' => 20, 'answer_text' => 'George R.R. Martin', 'is_correct' => false]);
Answer::create(['question_id' => 20, 'answer_text' => 'Agatha Christie', 'is_correct' => false]);
}
}
87 changes: 79 additions & 8 deletions database/seeders/QuestionSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Illuminate\Database\Seeder;
use App\Models\Question;
use Illuminate\Support\Facades\DB;

class QuestionSeeder extends Seeder
{
Expand All @@ -14,64 +15,134 @@ class QuestionSeeder extends Seeder
*/
public function run()
{
DB::table('questions')->truncate();
Question::create([
'category_id' => 1, // Art
'text' => 'Who painted the Mona Lisa?',
'xp_value' => 10,
'xp_value' => 105,
]);

Question::create([
'category_id' => 1,
'text' => 'What art movement is Salvador Dalí associated with?',
'xp_value' => 10,
'xp_value' => 1000,
]);

Question::create([
'category_id' => 2, // History
'text' => 'In which year did the Titanic sink?',
'xp_value' => 10,
'xp_value' => 106,
]);

Question::create([
'category_id' => 2,
'text' => 'Who was the first president of the United States?',
'xp_value' => 10,
'xp_value' => 140,
]);

Question::create([
'category_id' => 3, // Geography
'text' => 'What is the capital of France?',
'xp_value' => 10,
'xp_value' => 11,
]);

Question::create([
'category_id' => 3,
'text' => 'Which river is the longest in the world?',
'xp_value' => 10,
'xp_value' => 15,
]);

Question::create([
'category_id' => 4, // Science
'text' => 'What is the chemical symbol for gold?',
'xp_value' => 10,
'xp_value' => 4,
]);

Question::create([
'category_id' => 4,
'text' => 'What planet is known as the Red Planet?',
'xp_value' => 10,
'xp_value' => 50,
]);

Question::create([
'category_id' => 5, // Sports
'text' => 'Which sport is known as "the beautiful game"?',
'xp_value' => 15,
]);

Question::create([
'category_id' => 5,
'text' => 'In which sport would you perform a slam dunk?',
'xp_value' => 60,
]);
Question::create([
'id' => 11,
'category_id' => 1,
'text' => 'What is the capital of France?',
'xp_value' => 10,
]);

Question::create([
'id' => 12,
'category_id' => 1,
'text' => 'What is the largest ocean on Earth?',
'xp_value' => 10,
]);

Question::create([
'id' => 13,
'category_id' => 2,
'text' => 'What is the boiling point of water?',
'xp_value' => 10,
]);

Question::create([
'id' => 14,
'category_id' => 3,
'text' => 'Who wrote "To Kill a Mockingbird"?',
'xp_value' => 10,
]);

Question::create([
'id' => 15,
'category_id' => 4,
'text' => 'What is the chemical symbol for gold?',
'xp_value' => 50,
]);

Question::create([
'id' => 16,
'category_id' => 4,
'text' => 'Which planet is known as the Red Planet?',
'xp_value' => 215,
]);

Question::create([
'id' => 17,
'category_id' => 5,
'text' => 'In which sport would you perform a slam dunk?',
'xp_value' => 10,
]);

Question::create([
'id' => 18,
'category_id' => 2,
'text' => 'What is the hardest natural substance on Earth?',
'xp_value' => 10,
]);

Question::create([
'id' => 19,
'category_id' => 1,
'text' => 'What is the tallest mountain in the world?',
'xp_value' => 100,
]);

Question::create([
'id' => 20,
'category_id' => 3,
'text' => 'What is the name of the author of the Harry Potter series?',
'xp_value' => 1320,
]);
}
}

0 comments on commit 1d7bf68

Please sign in to comment.