Skip to content

Commit

Permalink
update README and minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
tmvfb committed Jul 11, 2023
1 parent c05be13 commit a239eab
Show file tree
Hide file tree
Showing 5 changed files with 139 additions and 16 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/pyci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: Python CI

on:
- push
- pull_request

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
# we want to test our package on several versions of Python
python-version: [3.8, 3.9]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
# make depends on poetry
- name: Install dependencies
run: |
pip install poetry
make install
- name: Run linter and check dependencies
run: |
make check-ci
44 changes: 43 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,43 @@
# english-exercises-app
# english-exercises-app

[![Website https://english-exercises-app-production.up.railway.app/](https://img.shields.io/website-up-down-green-red/https/english-exercises-app-production.up.railway.app.svg)](https://english-exercises-app-production.up.railway.app/)
[![Github Actions Status](https://github.com/tmvfb/english-exercises-app/workflows/Python%20CI/badge.svg)](https://github.com/tmvfb/english-exercises-app/actions)

## Description
Python package to generate English practice exercises from an uploaded text. Web backend (module **english_exercises_app**) is written in Django. Module **text_processing** is responsible for data processing and exercise generation using *gensim* and *spacy* libraries. Web app includes authentication system to remember user and exercise generation parameters, as well as to store user stats.

**Key features:**
* User registration and authentication, user answer stats
* 4 types of exercises (type text, select correct answer, complete sentence, drag and drop)
* Light/dark mode implementation with Bootstrap 5.3.0
* 2 languages support (English, Russian)

## Prerequisites (for local deploy)
* Python >=3.8.1
* pip >=22.0
* poetry >=1.4.0
* GNU make
* Configured PostgreSQL database


## Local installation (WSL/Linux)
```
$ git clone https://github.com/tmvfb/english-exercises-app.git
$ cd english-exercises-app.git
$ make install
```
Then configure environment variables below.
Apply migrations via `python3 manage.py migrate`.
Run `make dev` to start dev server.

## Environment variables
```
SECRET_KEY=
DATABASE_URL=
```

## Todo list
* Full CRUD for users
* New exercise types and adding more variability to old ones
* Better design for drag and drop exercises
* Write some tests?
23 changes: 11 additions & 12 deletions locale/ru/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-07-11 21:48+0300\n"
"POT-Creation-Date: 2023-07-11 22:37+0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
Expand Down Expand Up @@ -100,39 +100,39 @@ msgstr "Упражнение"
msgid "Exercises"
msgstr "Упражнения"

#: english_exercises_app/exercises/views.py:41
#: english_exercises_app/exercises/views.py:44
msgid "File uploaded successfully!"
msgstr "Файл успешно загружен!"

#: english_exercises_app/exercises/views.py:47
#: english_exercises_app/exercises/views.py:50
msgid "Something went wrong. Please check file format"
msgstr "Что-то пошло не так. Пожалуйста, проверьте формат файла"

#: english_exercises_app/exercises/views.py:74
#: english_exercises_app/exercises/views.py:79
msgid "Please select valid parameters"
msgstr "Пожалуйста, укажите допустимые параметры"

#: english_exercises_app/exercises/views.py:90
#: english_exercises_app/exercises/views.py:97
msgid "Please upload a file."
msgstr "Пожалуйста, загрузите файл"

#: english_exercises_app/exercises/views.py:111
#: english_exercises_app/exercises/views.py:118
#, python-brace-format
msgid ""
"You have completed all the exercises! Your score: {score} / {params.count}"
msgstr ""
"Отличная работа, вы выполнили все упражнения! Ваш результат: {score} / "
"{params.count}"

#: english_exercises_app/exercises/views.py:175
#: english_exercises_app/exercises/views.py:182
msgid "Correct!"
msgstr "Правильно!"

#: english_exercises_app/exercises/views.py:180
#: english_exercises_app/exercises/views.py:187
msgid "Sorry, your answer is incorrect"
msgstr "К сожалению, вы где-то ошиблись"

#: english_exercises_app/exercises/views.py:195
#: english_exercises_app/exercises/views.py:202
msgid "Please provide a valid answer."
msgstr "Пожалуйста, укажите допустимый ответ"

Expand All @@ -150,7 +150,7 @@ msgstr "Русский"

#: english_exercises_app/templates/base.html:16
msgid "Practice English with your favourite texts"
msgstr "Занимайся английским по мотивам любимых текстов"
msgstr "Занимайтесь английским по любимым текстам"

#: english_exercises_app/templates/base.html:31
#: english_exercises_app/templates/base.html:48
Expand Down Expand Up @@ -197,8 +197,7 @@ msgid ""
"Practice English with your favourite texts. Exercises are created "
"dynamically in accordance with the text you provide."
msgstr ""
"Занимайся английским по мотивам любимых текстов. Упражнения создаются в "
"реальном времени по загруженному тексту."
"Занимайтесь английским по любимым текстам. Упражнения создаются в реальном времени в соответствии с загруженным текстом."

#: english_exercises_app/templates/base.html:136
msgid "Please log in and upload text to get started."
Expand Down
57 changes: 55 additions & 2 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ packages = [
]

[tool.poetry.dependencies]
python = "^3.8"
python = "^3.8.1"
django = "^4.2.2"
python-dotenv = "^1.0.0"
gunicorn = "^20.1.0"
Expand All @@ -23,6 +23,7 @@ gensim = "^4.3.1"
spacy = "^3.5.3"
sentence-splitter = "^1.4"
lemminflect = "^0.2.3"
flake8 = "^6.0.0"


[build-system]
Expand Down

0 comments on commit a239eab

Please sign in to comment.