Skip to content

Commit

Permalink
m
Browse files Browse the repository at this point in the history
  • Loading branch information
sumitkumar1503 committed Feb 13, 2021
0 parents commit ddce8c4
Show file tree
Hide file tree
Showing 79 changed files with 4,807 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Django #
*.log
*.pot
*.pyc
__pycache__
db.sqlite3
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 sumit kumar

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
79 changes: 79 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Online Quiz
![developer](https://img.shields.io/badge/Developed%20By%20%3A-Sumit%20Kumar-red)
---
## screenshots
### Homepage
![homepage snap](https://github.com/sumitkumar1503/onlinequiz/blob/master/static/screenshots/homepage.png?raw=true)
### Admin Dashboard
![dashboard snap](https://github.com/sumitkumar1503/onlinequiz/blob/master/static/screenshots/adminhomepage.png?raw=true)
### Exam Rules
![invoice snap](https://github.com/sumitkumar1503/onlinequiz/blob/master/static/screenshots/rules.png?raw=true)
### Exam
![doctor snap](https://github.com/sumitkumar1503/onlinequiz/blob/master/static/screenshots/exam.png?raw=true)
### Teacher
![doctor snap](https://github.com/sumitkumar1503/onlinequiz/blob/master/static/screenshots/teacher.png?raw=true)
---
## Functions
### Admin
- Create Admin account using command
```
py manage.py createsuperuser
```
- After Login, can see Total Number Of Student, Teacher, Course, Questions are there in system on Dashboard.
- Can View, Update, Delete, Approve Teacher.
- Can View, Update, Delete Student.
- Can Also See Student Marks.
- Can Add, View, Delete Course/Exams.
- Can Add Questions To Respective Courses With Options, Correct Answer, And Marks.
- Can View And Delete Questions Too.

### Teacher
- Apply for job in System. Then Login (Approval required by system admin, Then only teacher can login).
- After Login, can see Total Number Of Student, Course, Questions are there in system on Dashboard.
- Can Add, View, Delete Course/Exams.
- Can Add Questions To Respective Courses With Options, Correct Answer, And Marks.
- Can View And Delete Questions Too.
> **_NOTE:_** Basically Admin Will Hire Teachers To Manage Courses and Questions.
### Student
- Create account (No Approval Required By Admin, Can Login After Signup)
- After Login, Can See How Many Courses/Exam And Questions Are There In System On Dashboard.
- Can Give Exam Any Time, There Is No Limit On Number Of Attempt.
- Can View Marks Of Each Attempt Of Each Exam.
- Question Pattern Is MCQ With 4 Options And 1 Correct Answer.
---

## HOW TO RUN THIS PROJECT
- Install Python(3.7.6) (Dont Forget to Tick Add to Path while installing Python)
- Open Terminal and Execute Following Commands :
```
python -m pip install -r requirements. txt
```
- Download This Project Zip Folder and Extract it
- Move to project folder in Terminal. Then run following Commands :
```
py manage.py makemigrations
py manage.py migrate
py manage.py runserver
```
- Now enter following URL in Your Browser Installed On Your Pc
```
http://127.0.0.1:8000/
```

## CHANGES REQUIRED FOR CONTACT US PAGE
- In settins.py file, You have to give your email and password
```
EMAIL_HOST_USER = '[email protected]'
EMAIL_HOST_PASSWORD = 'your email password'
EMAIL_RECEIVING_USER = '[email protected]'
```

## Drawbacks/LoopHoles
- Admin/Teacher can add any number of questions to any course, But while adding course, admin provide question number.


## Feedback
Any suggestion and feedback is welcome. You can message me on facebook
- [Contact on Facebook](https://fb.com/sumit.luv)
- [Subscribe my Channel LazyCoder On Youtube](https://youtube.com/lazycoders)
Empty file added blood/__init__.py
Empty file.
3 changes: 3 additions & 0 deletions blood/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.contrib import admin

# Register your models here.
5 changes: 5 additions & 0 deletions blood/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from django.apps import AppConfig


class BloodConfig(AppConfig):
name = 'blood'
14 changes: 14 additions & 0 deletions blood/forms.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from django import forms

from . import models


class BloodForm(forms.ModelForm):
class Meta:
model=models.Stock
fields=['bloodgroup','unit']

class RequestForm(forms.ModelForm):
class Meta:
model=models.BloodRequest
fields=['patient_name','patient_age','reason','bloodgroup','unit']
22 changes: 22 additions & 0 deletions blood/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Generated by Django 3.0.5 on 2021-01-17 13:08

from django.db import migrations, models


class Migration(migrations.Migration):

initial = True

dependencies = [
]

operations = [
migrations.CreateModel(
name='Stock',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('bloodgroup', models.CharField(max_length=10)),
('unit', models.PositiveIntegerField(default=0)),
],
),
]
27 changes: 27 additions & 0 deletions blood/migrations/0002_bloodrequest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Generated by Django 3.0.5 on 2021-01-18 16:17

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('blood', '0001_initial'),
]

operations = [
migrations.CreateModel(
name='BloodRequest',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=30)),
('age', models.PositiveIntegerField()),
('mobile', models.CharField(max_length=20)),
('disease', models.CharField(max_length=100)),
('reason', models.CharField(max_length=500)),
('bloodgroup', models.CharField(max_length=10)),
('unit', models.PositiveIntegerField(default=0)),
('status', models.CharField(default='Pending', max_length=20)),
],
),
]
44 changes: 44 additions & 0 deletions blood/migrations/0003_auto_20210213_1053.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Generated by Django 3.0.5 on 2021-02-13 05:23

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
('patient', '0001_initial'),
('donor', '0001_initial'),
('blood', '0002_bloodrequest'),
]

operations = [
migrations.RenameField(
model_name='bloodrequest',
old_name='age',
new_name='patient_age',
),
migrations.RenameField(
model_name='bloodrequest',
old_name='name',
new_name='patient_name',
),
migrations.RemoveField(
model_name='bloodrequest',
name='disease',
),
migrations.RemoveField(
model_name='bloodrequest',
name='mobile',
),
migrations.AddField(
model_name='bloodrequest',
name='request_by_donor',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='donor.Donor'),
),
migrations.AddField(
model_name='bloodrequest',
name='request_by_patient',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='patient.Patient'),
),
]
18 changes: 18 additions & 0 deletions blood/migrations/0004_bloodrequest_date.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 3.0.5 on 2021-02-13 06:24

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('blood', '0003_auto_20210213_1053'),
]

operations = [
migrations.AddField(
model_name='bloodrequest',
name='date',
field=models.DateField(auto_now=True),
),
]
Empty file added blood/migrations/__init__.py
Empty file.
23 changes: 23 additions & 0 deletions blood/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from django.db import models
from patient import models as pmodels
from donor import models as dmodels
class Stock(models.Model):
bloodgroup=models.CharField(max_length=10)
unit=models.PositiveIntegerField(default=0)
def __str__(self):
return self.bloodgroup

class BloodRequest(models.Model):
request_by_patient=models.ForeignKey(pmodels.Patient,null=True,on_delete=models.CASCADE)
request_by_donor=models.ForeignKey(dmodels.Donor,null=True,on_delete=models.CASCADE)
patient_name=models.CharField(max_length=30)
patient_age=models.PositiveIntegerField()
reason=models.CharField(max_length=500)
bloodgroup=models.CharField(max_length=10)
unit=models.PositiveIntegerField(default=0)
status=models.CharField(max_length=20,default="Pending")
date=models.DateField(auto_now=True)
def __str__(self):
return self.bloodgroup


3 changes: 3 additions & 0 deletions blood/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.test import TestCase

# Create your tests here.
Loading

0 comments on commit ddce8c4

Please sign in to comment.