This repository contains several tools-helpers to work with data from the Hyperskill and JetBrains Academy platforms:
- core module contains some common functions like pandas utilities or some common models
- templates module contains algorithms for searching code quality issues in the pre-written templates.
- data collection module contains client for Hyperskill. This module use platforms' APIs to extract information about following entities from the educational platforms.
- preprocessing module contains methods to preprocess and prepare data, collected from Hyperskill educational platform, for further analysis.
On the JetBrains Academy platform, the educational process is structured as follows: firstly, the student’s solution is checked for correctness using traditional predefined tests. Then, two scenarios are possible:
(1) if the solution is incorrect (contains compilation errors or does not pass all tests), then these problems are reported to the student, and they continue to solve the task;
(2) if the solution is correct, the Hyperstyle tool is launched to check the quality of the code.
Therefore, the result of the Hyperstyle tool can only be determined for correct solutions, that is, solutions that pass all tests. After successfully passing the solution, the student receives a code quality grade on a four-point scale, and all detected issues (if any) are highlighted in the code editor. An example of the Hyperstyle user interface:
This project uses the Poetry build system. To set up everything you need:
- Install poetry.
- Clone this repository
- Run
poetry install --with <list_of_optional_modules>
, where<list_of_optional_modules>
is a list of modules what you need to install. Only thecore
module is not an optional and is always installed. For example, if you want to install thedata_collection
,jba
andpreprocessing
modules, then you should runpoetry install --with data-collection,jba,preporcessing
.
To run any script in the repository just execute:
poetry run python /path/to/the/script.py [script_arguments]
There are also several aliases for main scripts.
You could find them inside the pyproject.toml file in the [tool.poetry.scripts]
section.
To run any script using its alias just execute:
poetry run <script_alias> [script_arguments]
If you don't want to install poetry, you could use our official Docker image where all necessary environment is installed. To do this:
-
Pull the image:
docker pull registry.jetbrains.team/p/code-quality-for-online-learning-platforms/hyperstyle-analysis-prod/hyperstyle-analysis-prod:<VERSION>
where
<VERSION>
is the project version you would like to use. You could always find the latest version inside the pyproject.toml file. -
Run a container with the command you would like to execute.
docker run hyperstyle-analysis-prod:<VERSION> <command>
For example:
docker run hyperstyle-analysis-prod:<VERSION> poetry run <script_alias> [script_arguments]