Coder Social home page Coder Social logo

projectworst / practice-exam-with-mysql-database Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 19 KB

While studying for my PMP exam, I wanted to create a practice exam with Python. This program is for any practice exam and not just the PMP. Your practice exam would depend on the database/API you use within the program. I made this program to pull data from a MySQL database. With a few changes, you could include any database/API as you wish.

License: MIT License

Python 100.00%
exam mysql mysql-connector mysql-database mysql-server mysql-workbench practice python python-script quiz

practice-exam-with-mysql-database's Introduction

README File:

Practice Exam with MySQL Database

To help me with my studies and continue to practice programming with Python, I created this project to facilitate a PMP (Project Management Professional) practice exam by presenting a series of questions and evaluating the user's answers. The questions are fetched from a MySQL database, and the user interacts with the program through the console.

Prerequisites

Before running this code, ensure that you have the following dependencies installed:

  • Python 3.x
  • mysql-connector-python library

You can install the mysql-connector-python library using the following command:

pip install mysql-connector-python

Setup

To set up the project and prepare it for running, follow these steps:

  1. Clone or download the project files to your local machine.
  2. Create a MySQL database and table to store the PMP questions. The table should contain columns for question ID, question text, choices, correct answer, and explanation.
  3. Open the main.py file and locate the fetch_questions_from_database function.
  4. Within the function, update the database connection details (host, port, user, password, database) to match your MySQL configuration.
  5. Save the changes to the main.py file.

Usage

To start the PMP exam, execute the main.py script by running the following command:

python main.py

The program will connect to the MySQL database, fetch the PMP questions, and present them one by one to the user. The user can provide their answer by entering A, B, C, or D. After each answer, the program provides feedback and explanation. Press Enter to proceed to the next question.

Once all questions are answered, the program displays the exam completion message along with the user's score.

Customization

You can customize the PMP questions by modifying the data stored in the MySQL database table. Update the question text, choices, correct answer, and explanation according to your requirements.

Contribution

Contributions to this project are welcome! If you find any issues or have suggestions for improvements, please submit them through the issue tracker or create a pull request.

License

This project is licensed under the MIT License. Feel free to use, modify, and distribute the code as per the terms of the license.

Note: Make sure to replace "x.x.x.x" with the actual host IP address and "sample" with the appropriate database credentials in the code before running it.

practice-exam-with-mysql-database's People

Contributors

projectworst avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.