-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:danghoangnhan/QuizzApp
- Loading branch information
Showing
5 changed files
with
127 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: psychopy | ||
name: quizzapp | ||
channels: | ||
- conda-forge | ||
- anaconda | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
) |