Let me start with a short introduction, I am an Automobile Engineer and I like to learn and create new things whether it be a Machine or a Computer Program .

I work as a Technical Trainer for an Automobile Company. Recently we started A new service training center in Nepal , and before training our Mechanics we had to know there skill Level, So as to Segregate them for different training courses. So we had to do Skill Mapping throughout Nepal.

Conducting Exam For All The Mechanics Throughout A Country Is Tough, What Makes It Even Tougher Is That 70–80% Of Mechanics Don’t Know How Read Or Write Properly In English or In Nepali.

Problem : Conducting Exam

Solution 1: Creating A Multiple Choice Question Set And Distributing It To Every Servicing Center For Examination.

Issues :

Possibility Of Question Paper Leak. (Workaround, Providing Soft Copies At The Time Of Examination) Delay Of 1 or 2 Hour In Conducting Exam Can cause Question Being Leaked(Workaround , Sending Trusted Invigilator To All The Workshops, But It Will Be Very Costly). How Would Mechanics Answer Question If They Don’t Understand English (Workaround, Convert All Different Types Of Question Papers In Nepali, But It Would Take time and many mechanics can’t read Nepali too.) Checking The question Papers Would Take Hours if Not Days.

Solution : Online Exam

So lastly I thought to conduct Online Exam, As almost Every Mechanics had Smart phones with the and were able to use them.

There were many online platform for conducting Online Exams so it was not a new idea , But these online services were not suitable as they had:

Complicated user Registration and Login System Which Were not suitable For Our Participants. They Did not have any facility for pre registration at once for all our users. They did not have Audio Question and Option Facility.

So the type of Online Exam App I wanted Had to be Made By Me.

Creating The App: Using Python And Django

I had Been learning Python for about an year now and Django was the best option to deploy my ideas quickly.

My Django App Had 2 simple models, One For the Participants and other for storing the Questions.

class Questions(models.Model):

"""Model for storing Questions"""

question = models.CharField(max_length=500) //the Question

options = models.CharField(max_length=1000) //all four options

answer = models.CharField(max_length=1) //correct answer

category = models.CharField(max_length=30) //question category

audio = models.CharField(max_length=50) //audio for question def __str__(self):

return self.question class Participant(models.Model):

name = models.CharField(max_length=100) //participants name

mobile = models.CharField(max_length=15, unique=True)

location = models.CharField(max_length=100)//workshop location

experiance = models.IntegerField() //exp to determine question category

marks = models.IntegerField(default=0)

start_time = models.DateTimeField(null=True)

onquestion = models.IntegerField(default=0)

category = models.IntegerField(default=0)

ans_list = models.CharField(max_length=200) def __str__(self):

return self.name

Then I had to design 3 Templates i.e, Login Page, Examination Page and Completion Page.

Login Page:

Login Page

Examination Page:

Examination Page

Completion Page:

Completion Page

All this took me 3 Days to create.

The Main Thing Which Made The Examination Possible Was That I had Added Audio To Every Question Which Would Play Automatically For Every Question And There Option In Nepali , My Colleague Recorded Audio for almost 200 Questions in 2 day.

Adding Participants and Question in Database:

I had all the details of the Participants and Questions in an Excel Sheet, I wrote a small Python script to Import the data from Excel Sheet To Database.

I used a python Library called xlrd to read data from the Excel Sheet.

from .models import Participant, Questuons

import xlrd //Adding Question to database

def addques(request): //Open question Excel Sheet

BASE_DIR = os.path.dirname(os.path.abspath(__file__))

wb = xlrd.open_workbook(os.path.join(BASE_DIR, 'ques.xls')) //Loop through all 4 Question Sets for cat in range(0, 4):

sheet = wb.sheet_by_index(cat)

for x in range(4, sheet.nrows):

ques = Questions()

qna = sheet.cell_value(rowx=x, colx=1).split(sep='

', maxsplit=1) //first line contains Question

ques.question = qna[0]

ques.options = qna[1]

ques.answer = sheet.cell_value(rowx=x, colx=2)

ques.category = cat

audiocat = ['B', 'A', 'E', 'El']

ques.audio = audiocat[cat] + str(x) + '.m4a'

print('Added.. ' + audiocat[cat] + str(x) + 'Question')

ques.save()

return render(request, 'index.html') //Add Participants to database def addmem(request):

BASE_DIR = os.path.dirname(os.path.abspath(__file__))

wb = xlrd.open_workbook(os.path.join(BASE_DIR, 'mem.xls'))

sheet = wb.sheet_by_index(0)

partiadded = ''

for x in range(1, sheet.nrows):

parti = Participant()

parti.name = sheet.cell_value(rowx=x, colx=1)

parti.mobile = sheet.cell_value(rowx=x, colx=4)

parti.location = sheet.cell_value(rowx=x, colx=3)

parti.experiance = sheet.cell_value(rowx=x, colx=7)

parti.category = sheet.cell_value(rowx=x, colx=10)

parti.save()

return HTTPResponse(request, partiadded)

And Lastly I had to Write A View to handle the Answer Submitting and Checking.

And That all , with Django and xlrd Library and stack overflow :) , I was able to create this app in a week.

Next we create a Demo Video and a demo Question set for Mechanics to practice before Appearing For Examination.

I Implemented the App on Digital Ocean $10 Server And in 1 hour we had Completed Online Exam throughout The Country.

This is One Of many Problems I was Able to solve With Little programing Knowledge i have, and i wanted to share the Positive Things which Learning to Program Has Brought To My Life.

This Is My First Article On the Internet Hope You Guys Like It..!