@@ -5,7 +5,9 @@ The plugin uses the ASYST grading [script](https://transfer.hft-stuttgart.de/git
...
@@ -5,7 +5,9 @@ The plugin uses the ASYST grading [script](https://transfer.hft-stuttgart.de/git
The plugin requires the ASYST ML Backend to be isolated in a standalone Docker container accessible via the local network or the Internet.
The plugin requires the ASYST ML Backend to be isolated in a standalone Docker container accessible via the local network or the Internet.
ASYSTGRADE Moodle Plugin runs each time the teacher reaches some manual grading page (a part of [Essay auto-grade plugin](https://moodle.org/plugins/qtype_essayautograde) maintained by Gordon Bateson)!
ASYSTGRADE Moodle Plugin runs each time the teacher reaches some manual grading page (a part of [Essay auto-grade plugin](https://moodle.org/plugins/qtype_essayautograde) maintained by Gordon Bateson)!
This solution is part of the Master’s Thesis titled “Integration of a Machine Learning Backend into Assessment Processes in a PHP-based Educational Environment” at the University of Applied Sciences Stuttgart, within the Software Technology course, by Artem Baranovskyi.
The first time the plugin makes a request to the ASYST ML backend, there is a delay due to the loading of the BERT model in the Flask container.
This solution is part of the Master’s Thesis titled “Integration of a Machine Learning Backend into Assessment Processes in a PHP-based Educational Environment” at the University of Applied Sciences Stuttgart, within the Software Technology course, 2024, by Artem Baranovskyi.
## Plugin and ASYST ML Backend Interaction Concept
## Plugin and ASYST ML Backend Interaction Concept
```mermaid
```mermaid
...
@@ -155,13 +157,57 @@ To build only the Flask ASYST microservice, run:
...
@@ -155,13 +157,57 @@ To build only the Flask ASYST microservice, run:
docker-compose up flask -d
docker-compose up flask -d
~~~
~~~
If a standalone Flask image is ready, it can be run with (-p 5000:5000 can be omitted):
If a standalone Flask image is ready, it can be run with:
~~~bash
~~~bash
docker run -p 5000:5000 asyst-flask
docker run -p 5000:5000 asyst-flask
~~~
~~~
If ASYST ML Backend is being used alone, ASYSTGRADE plugin should be copied from /asystgrade with the folder to ../moodle/local/ folder for local plugins.
If ASYST ML Backend is being used alone, ASYSTGRADE plugin should be copied from /asystgrade with the folder to ../moodle/local/ folder for local plugins.
The stucture of request to ASYST ML Backend:
~~~JSON
{
"referenceAnswer": "The reference answer",
"studentAnswers": [
"First Student's Answer",
"Second Student's Answer",
...
]
}
~~~
**Explanation:**
**referenceAnswer**: This is the model answer provided by the teacher. It includes detailed explanations and grading criteria.
**studentAnswers**: This array contains the answers submitted by students. Each answer is evaluated against the reference answer.
The stucture of responce from ASYST ML Backend:
~~~JSON
[
{
"predicted_grade": "incorrect"
},
{
"predicted_grade": "correct"
},
...
]
~~~
**Explanation:**
**predicted_grade**: The response includes a predicted grade for each student answer, indicating whether it is “correct” or “incorrect”.
Similarity of any text now could be checked with a curl request:
```curl
curl -X POST http://127.0.0.1:5000/api/autograde -H "Content-Type: application/json" -d '{
"referenceAnswer": "Multithreading improves the performance of a program because the processor can switch between different tasks, utilizing waiting times in one thread to process other threads. This allows for more efficient use of CPU resources.",
"studentAnswers": [
"Multithreading enhances a program’s performance by allowing the CPU to handle multiple tasks simultaneously. This means that while one thread is waiting for data, the CPU can process other threads, leading to more efficient use of processing power.",
"Multithreading slows down the performance of a program because the processor gets overloaded with too many tasks at once."
]
}'
```
## Development tips
## Development tips
To facilitate DB monitoring in your IDE, set the following database connection URL:
To facilitate DB monitoring in your IDE, set the following database connection URL: