Skip to content

Commit

Permalink
Merge branch 'main' of github.com:danghoangnhan/QuizzApp
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown authored and unknown committed Aug 31, 2023
2 parents 27808cf + bfdaa32 commit 9774b38
Show file tree
Hide file tree
Showing 5 changed files with 127 additions and 4 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Python application

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

permissions:
contents: read

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ __pycache__/
build/
dist/
*.icns
setup.py
*.mp3
venv
prompt.txt
prompt.txt
component/__pycache__
config/__pycache__

45 changes: 44 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,46 @@
# QuizzApp

pyinstaller --add-data "C:\Users\SF305\Desktop\QuizzApp\static;./static" main.py
QuizzApp is a Python application for conducting quizzes or tests with audio questions.

## Installation

### Prerequisites

- Python 3.8 or higher
- Conda (for creating and managing virtual environments)

### Setup

1. Clone the repository:

```bash
git clone https://github.com/yourusername/QuizzApp.git
cd QuizzApp
2. Create a Conda environment from the env.yml file:

```bash
conda env create -f environment.yml
3. Activate the Conda environment:
```bash
conda activate quizzapp

## Usage

To run the QuizzApp, use the following command:

```bash
python main.py
```

## Build Executable

You can build an executable for QuizzApp using cx_Freeze. Run the following command:

```bash
python setup.py build
```
This will create an executable in the build directory.



2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: psychopy
name: quizzapp
channels:
- conda-forge
- anaconda
Expand Down
39 changes: 39 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import cx_Freeze
import logging

# Configure error logging settings
logging.basicConfig(filename='error.log', level=logging.ERROR)

# Create a file handler for error logging
error_log_handler = logging.FileHandler('error.log')
error_log_handler.setLevel(logging.ERROR)

# Create a formatter for the log messages (customize as needed)
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
error_log_handler.setFormatter(formatter)

# Add the error log handler to the root logger
root_logger = logging.getLogger()
root_logger.addHandler(error_log_handler)

# Define the list of files to include
include_files = [('static', 'static')] # ('source_path', 'destination_path')

# Continue with your cx_Freeze setup script
executables = [cx_Freeze.Executable("main.py", base=None)]

options = {
'build_exe': {
'packages': [], # Add your packages here
'includes': [], # Add your includes here
'include_files': include_files, # Include the static folder
}
}

cx_Freeze.setup(
name="QuizzApp",
version="1.0",
description="Your Application Description",
executables=executables,
options=options
)

0 comments on commit 9774b38

Please sign in to comment.