Preface
Hello everyone!π
This is my new Telegram bot and I want to share this project with you. You can get all the available code here.
The idea of the bot is to make the learning process easier. Teachers create subjects and tasks, invite students, grade them, and get statistics. Students receive a list of tasks that are closest to the due date, create solutions, and upload them.
Since this is a pet project, you won't see any grandiose things here. Mostly, I wanted to get acquainted with new technologies, such as Tortoise and AWS.
You can see the most interesting solutions and features of the bot belowβ¬οΈ
Features
Teachers
The main thing that a teacher can do is create subjects, invite students to them, and interact with them.
As you can see, all the functionality here is done not through buttons, but through links. These are deep links. That is, in the chat, you will see something like β/startβ, but in reality, it will be βhttps://t.me/testmezgoodlebot?start=eyJrZXkiOiAic2VlX3Rhc2tzIiwgImlkIjogNH0β. And this code will process it. I made it so that it launches some methods from utils using this method. And accordingly, it was enough for me to create a method, pass the name, and it's done. Very convenient.
So, if we continue, teachers can look at the assignments for the subject like this:
and statistics, for example, how many solutions from students there are in percentage value and the histogram of grades through the subject.
When we open solutions to tasks, we can evaluate them through the buttons, and the message will be updated on the spot. There will also be a link to the work file. All data is stored on AWS S3.
The entire logic of interaction with AWS S3 can be found here. It is the same for both students and teachers.
Students
This is what the start of work looks like for a student (I've already skipped the process of joining the course).
That's how I created a new solution. At first, I wanted to add it to the task, but the deadline had already passed. Since I am both a teacher and a student, I received a notification that the student had uploaded the solution.
On AWS, the bucket looks like this: subfolders for subjects and students, and then the file itself is created here.
Students can also use the feedback function with the teacher (code here). All of this is built on states.
Noteworthy
I may not have shown the most important features, but I will provide a list of what might be of interest:
- Using a filter that, in addition to passing to the handler, also returns the value of the object from the database.
- Using the magic filter F.
- Creating charts with seaborn.
- Using ORM Tortoise.
- Pushing objects to handlers using middlewares.
- Send notifications on a schedule.
Conclusion
I hope you enjoyed my pet project and learned something new. Write your impressions and questions in the comments. By the way, soon in the future, I want to launch my course, where I will go through all the topics of developing Telegram bots, as well as using artificial intelligence.
Top comments (0)