There are many distractions when you are at home taking an online class. Make sure that you are sitting in a room where there is no outside noise, turn off your cell phone and do not connect to social media sites for your own good. You need to concentrate completely on your studies as if you are in a physical rather than a virtual classroom. Dress up in the same manner as if you were going to class.
There are options of attending live lectures as well as a recorded one. Whenever possible, attend live lectures. This will give you a better feel since you know that numerous other people are also listening to the lecture attentively. This will encourage you more.
Sit on a Desk
Place your desktop computer or laptop on a desk. You should not be lying down or sitting on a sofa as you take the class. Sit upright on a chair with the computer in front of you to keep you going and allowing you to concentrate better.
Take notes while the teacher lectures. These will greatly help you in the exams as you can revert back to what you have learned in class. It is far better than accessing the lecture over and over again when the exams are near or when you are looking to make your assignments.
These classes allow you to ask questions to the teacher, make sure that you are not shy and do not feel ashamed to ask questions yourself. This will keep you attentive and help you learn better.