DEV Community

Cover image for TwilioHackathon - Manage homeworks in WhatsApp chat easily
Sergey Firsov
Sergey Firsov

Posted on • Updated on

TwilioHackathon - Manage homeworks in WhatsApp chat easily

Hello, Everyone.

As in many other countries, in Russia due to the quarantine schools are closed as well. So, teachers and students (mainly teachers) have to start using WhatsApp for organizing chats for sending, scheduling, and receiving homeworks. That is the pretty common situation for the primary school when a single teacher is responsible for all subjects to have a WhatsApp chat with pupils and their parents.
The similar situation could be applied for the middle school - when several teachers taught different subject. It is just the exacerbated situation either with the single chat or with multiple chats :)
When you have 20 pupils and 20+ parents in a chat pretty often you cannot easily find necessary information quickly. For example: what is my homework for art on Thursday?

So, in order to make the life of teachers, parents and pupils a bit easier, I decided to build a chat bot or virtual assistant that will keep this information and answer to everyone who needs it.

The use-case:

  • A Teacher decides to announce the homework for math on next Tuesday. So, he or she can do it by typing in a chat:

@hw math Tuesday Do calculus!

  • A pupil (or a parent) would like to know what is the homework for a specific subject. So they can do it by typing in chat:

@bot What is my homework? or What should I do?

  • Bot will ask you to clarify the request:

Could you specify the subject your are interested in?
@bot math

Please remind me on what day you would like to get the homework?
@bot Tuesday

  • And finally, a pupil or a parent gets the answer: Do calculus!

Format of commands

  • The initial question is possible in several forms:
    Possible initial question forms

  • A teacher could specify the hometask in the following form:
    @hw[space][subject][space][date]
    So far, several subjects are supported with the their synonyms.
    Supported Subjects
    Date could be specified in different formats:

    • Today, Tomorrow, Yesterday, Last Friday, etc
    • 17 August 2013 - 19 August 2013
    • This Friday from 13:00 - 16.00
    • 5 days ago
    • 2 weeks from now
    • Sat Aug 17 2013 18:40:39 GMT+0900 (JST)
    • 2014-11-30T08:15:30-05:30
  • @bot[space][any text that will be sent to the assistant as your answer]

  • Resetting the dialog
    In case of getting to the dead-end (probably your questions will be to difficult for the assistant), it is possible to reset the dialog with the following commands:
    Start Over the conversation
    or just type "Reset" if you do not want to be so polite, as suggested in the examples 😊

Demo Video

If you would like to test it or the jury would like to verify the functionality,
send a WhatsApp message to+ 1 415 523 8886 with code join owner-chair.

Link to Code

GitHub logo sergeyfsv / twilio-hackathon

Twilio April Hackathon 2020

How I built it (what's the stack? did I run into issues or discover something new along the way?)

Technological Stack

  • Node.JS
  • TypeScript
  • IBM Cloud Services (IBM Watson, IBM Cloud Foundry and so on)

Architecture (extremely high-level)

Homework Bot Architecture Diagram

One of the most difficult part in integrating with Twilio was understanding what should I put in into the field that is labeled as:
WHEN A MESSAGE COMES IN 😊
Twilio guys, that is not 100% obvious that here should be link to the webhook.

To be serious, IBM Watson bot development and deployment to IBM Cloud took significant amount of time, especially if you are doing it the first time. I hope that the code that have been shared will allow you start creating application without bothering how to combine libraries for node.js, typescript, twilio or even using IBM Watson.

Additional Resources/Info

  • Nice Visio Stencils if you decide to draw something cloud related Stencils

Top comments (3)

Collapse
 
jacksmi56358898 profile image
Jack Smith

I recently stumbled upon this amazing website that offers free reviews on various writing services, and I must say, it's a gem for students like me. The ClosersCopy Review aiwritinghub.com on this site provided in-depth insights into the service, its features, and the quality of their work. Thanks to this review, I confidently chose ClosersCopy for my essay, and they didn't disappoint. The site is a valuable resource for anyone seeking reliable and unbiased reviews on writing assistance.

Collapse
 
karandpr profile image
Karan Gandhi

Neat use case Sergey.

Collapse
 
sergeyfsv profile image
Sergey Firsov

Thank you, of course that is the simplest one just to show the idea, the real application should be a bit complex with UI and so, but for demonstrating the idea it should be good enough