Skip to content

An interactive traffic rules quiz built with Jekyll, HTML, CSS, and JavaScript to test and improve road safety awareness. 🚦

Notifications You must be signed in to change notification settings

xAffan/traffic-quiz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

13 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🚦 Traffic Safety Hub

A comprehensive traffic safety education website built with Jekyll, featuring interactive quizzes, educational safety tips, and modern responsive design.

🌟 Features

Interactive Quizzes

  • Multiple Choice Questions: Carefully crafted questions covering all aspects of traffic safety
  • Instant Feedback: Immediate results with detailed explanations for each answer
  • Visual Progress: Progress indicators within each quiz session
  • Difficulty Levels: Quizzes ranging from basic to advanced topics
  • Retake Capability: Users can retake quizzes to reinforce learning

Safety Blog

  • Educational Articles: In-depth guides on defensive driving, weather safety, and road signs
  • Practical Tips: Real-world advice that drivers can immediately apply
  • Regular Updates: Fresh content covering the latest in traffic safety
  • Easy Navigation: Well-organized topics and search functionality

Modern Design

  • Responsive Layout: Optimized for desktop, tablet, and mobile devices
  • Professional UI: Clean, modern design with intuitive navigation
  • Accessibility: Built with web accessibility standards in mind
  • Fast Loading: Optimized performance for quick loading times

πŸš€ Getting Started

Prerequisites

  • Ruby 3.0 or higher
  • Bundler gem
  • Git

Installation

  1. Clone the repository

    git clone https://github.com/yourusername/traffic-quiz.git
    cd traffic-quiz
  2. Install dependencies

    bundle install
  3. Run the development server

    bundle exec jekyll serve
  4. Open your browser Visit http://localhost:4000 to see the site

Building for Production

bundle exec jekyll build

The built site will be in the _site directory.

οΏ½ Project Structure

traffic-quiz/
β”œβ”€β”€ _config.yml          # Jekyll configuration
β”œβ”€β”€ _layouts/             # Page layouts
β”‚   β”œβ”€β”€ default.html      # Main site layout
β”‚   β”œβ”€β”€ post.html         # Blog post layout
β”‚   └── quiz.html         # Quiz layout
β”œβ”€β”€ _posts/               # Blog posts
β”œβ”€β”€ _quizzes/             # Quiz content
β”œβ”€β”€ assets/
β”‚   β”œβ”€β”€ css/
β”‚   β”‚   └── main.css      # Main stylesheet
β”‚   └── js/
β”‚       └── main.js       # JavaScript functionality
β”œβ”€β”€ pages/
β”‚   β”œβ”€β”€ about.md          # About page
β”‚   β”œβ”€β”€ blog.md           # Blog listing
β”‚   └── quizzes.md        # Quiz listing
└── index.md              # Homepage

🎯 Creating Content

Adding a New Quiz

  1. Create a new file in _quizzes/ directory
  2. Use the following front matter format:
---
layout: quiz
title: "Your Quiz Title"
description: "Brief description of the quiz"
difficulty: easy # easy, medium, hard
questions:
  - question: "Your question text"
    options:
      - "Option A"
      - "Option B"
      - "Option C"
      - "Option D"
    correct: 0 # Index of correct answer (0-3)
    explanation: "Explanation of why this answer is correct"
---

Adding a Blog Post

  1. Create a new file in _posts/ directory with format: YYYY-MM-DD-title.md
  2. Use the following front matter:
---
layout: post
title: "Your Article Title"
date: YYYY-MM-DD
author: "Author Name"
reading_time: 5
icon: "πŸš—"
tags: ["tag1", "tag2"]
excerpt: "Brief description of the article"
---

πŸ’‘ Contributing

Feel free to fork the repo and submit a PR with improvements, new quizzes, or blog articles!


Made with ❀️ using Jekyll, HTML, CSS, and JavaScript.
Stay safe on the roads! 🚦

About

An interactive traffic rules quiz built with Jekyll, HTML, CSS, and JavaScript to test and improve road safety awareness. 🚦

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published