Skip to content

havatarproject/AndroidQuiz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Quiz Platform (Backend + Android App)

This project is a full-stack quiz platform consisting of a Python backend (with MySQL and Firebase integration) and an Android app for users to take quizzes, submit answers, and receive notifications.


Overview

  • Backend: Python server with RESTful API, MySQL database for quiz data, and Firebase for authentication and notifications.
  • Database: MySQL schema and stored procedures for quizzes, questions, answers, user associations, and tokens.
  • Android App: Simple app for users to sign up, receive quizzes, submit responses, and get push notifications.

Quick Start

1. Set Up the Database

  • Install MySQL and run the provided SQL script to create tables and stored procedures.
  • (Optional) Load sample data using the provided .dump files.

Example:

mysql -u <user> -p < quiz_schema.sql

2. Set Up the Backend

  • Clone the backend repository.
  • Install Python dependencies:
pip install mysql-connector-python firebase-admin schedule
  • Place your Firebase service account JSON in the project folder.
  • Update DB and Firebase config in the script if needed.
  • Start the server:
python <script_name>.py -host_http 0.0.0.0 -port_http 8080

3. Set Up the Android App

  • Clone/open the Android app in Android Studio.
  • Add google-services.json from your Firebase project to the app/ directory.
  • Set your backend server IP in the Retrofit builder.
  • Build and run the app on a device or emulator.

How It Works

  • Users sign up and log in through the Android app (Firebase Authentication).
  • The app fetches quizzes via the backend API, displays questions, and submits answers.
  • The backend stores responses, manages user-quiz associations, and sends notifications using Firebase Cloud Messaging.
  • Admins can manage quizzes, associations, and view logs via the backend CLI.

Key Endpoints (Backend)

  • POST /get_questionnaire — Get quiz for a user
  • PUT /response — Submit user answers
  • POST /token — Register device token for notifications
  • PUT /log — Log user activity

Requirements

  • Backend: Python 3, MySQL, Firebase project
  • Android App: Android Studio, Firebase project

Troubleshooting

  • Ensure backend server is accessible from the Android device (use local IP, not localhost).
  • MySQL and Firebase credentials must be correct.
  • Open necessary ports (e.g., 8080) on your backend server.

Customization

  • Add new quiz types or question formats in the database and backend.
  • Expand app features (history, leaderboards, etc.).
  • Style the Android app to fit your needs.

About

The Android Quiz App

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors