Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added Lone_Developers/Lone_Developers.pptx
Binary file not shown.
22 changes: 22 additions & 0 deletions Lone_Developers/Lone_Developers.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Description of your project
---------------------------

As schools around the world respond to the “new normal”, the need for remote learning tools has never been more urgent. We present a solution that can help schools, educators, students, and their families to make the transition to distance learning easier.
We Developed pseudo distance learning applications or online educational tools for remote learning that allow users to interact and a “classroom-like” environment.

Some Features:

1) Users can register as students, Teachers, or Parents.
2) Virtual study group — Students can meet up on a common forum and prepare for their exams along with other students that are studying for the same subject matter.
3) Provide users with study material, tools, discussion helps guides, etc.
4)Parents can check the notice board for any announcement (like snow/rainy day holidays, reports cards, fee due dates, attendance as well as upcoming school events) rather than communicating via email.
5)Parents/Teachers can upload photos, videos and other files that they may feel are important for children’s education.

Contents of project directory
-----------------------------

The project directory contains modular and structured code for the hosted web application. It is written in Python language using Django Framework.

To Host locally
---------------
Please follow Readme inside the project directory to see the installation process.
2 changes: 2 additions & 0 deletions Lone_Developers/Lone_Developers/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
final/
venv/
3 changes: 3 additions & 0 deletions Lone_Developers/Lone_Developers/Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
release: python manage.py migrate
web: daphne hack72.asgi:application --port $PORT --bind 0.0.0.0 -v2
worker: python manage.py runworker --settings=hack72.settings -v2
84 changes: 84 additions & 0 deletions Lone_Developers/Lone_Developers/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# Code-Innovation-Series-IITG

An Online education platform
Live at https://learn-live.herokuapp.com/

## Test User Credentials

Login -> http://learn-live.herokuapp.com/accounts/login/

### Student Login
Username : student01
Password : common101

### Teacher Login
Username : teacher01
Password : common101

### Parent Login
Username : parent01
Password : common101

### Django SuperUser
login -> http://learn-live.herokuapp.com/admin
Username : kunal
Password : 1234

## Installation

* `git clone <url>`
* Install Dependencies via `pip install -r 'requirements.txt'`
* `python manage.py makemigrations`
* `python manage.py migrate`
* `python manage.py runserver`


Note 01: Once user register on portal, admin should login <here>[https://learn-live.herokuapp.com/admin/accounts/user/] and approve the account of that user. Only approved users can view our course content and participate in discussion forum.

Note 02: All the Test Credentials are approved Users. So you can use them freely!

## Features

### Students

- login and register
- enroll to available courses
- see all courses
- navigation to course where they can see different modules, contents of modules, announcements regarding the course.
- Chat with other students enrolled in that course through course chat room
- Participate in discussion forum with other teachers/parents/students


### Teachers
- Login and register
- Create multiple courses
- Edit/create new modules in each course
- Reorder modules whenever you feel necessary!
- Post course content in any way. It can be text/image/video/audio/ppt/pdf/etc...
- Participate in discussion forum with other teachers/parents/students
- Create Announcements in each course separately (Course Specific)


### Parents
- Login and register
- See announcements regarding their children's courses that are made by teachers
- Get list of all Events
- Get list of all Holidays
- Check progress of each student in every course (grades,attendance)
- Participate in discussion forum with other teachers/parents/students

Note : Attendance and grades need to be registered by the admin once finalized.


## Technology Used
- Django
- Django Rest Framework
- Django Channels
- Tailblocks
- Javascript
- JQuery
- Html
- CSS

We tried to follow the best coding principles while participating in this Code-Innovation-Series!

2 changes: 2 additions & 0 deletions Lone_Developers/Lone_Developers/accounts/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
__pycache__/
migrations/
Empty file.
18 changes: 18 additions & 0 deletions Lone_Developers/Lone_Developers/accounts/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from django.contrib import admin
from .models import *
from django.contrib.auth.admin import UserAdmin
class CustomUserAdmin(UserAdmin):

fieldsets = UserAdmin.fieldsets + (
('Roles', {'fields': ('role','is_approved')}),
)
add_fieldsets = UserAdmin.add_fieldsets + (
('Roles', {'fields': ('role',)}),
)

admin.site.register(User,CustomUserAdmin)
admin.site.register(Student)
admin.site.register(StudentToCourses)
admin.site.register(Parent)
admin.site.register(Teacher)
# Register your models here.
5 changes: 5 additions & 0 deletions Lone_Developers/Lone_Developers/accounts/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from django.apps import AppConfig


class AccountsConfig(AppConfig):
name = 'accounts'
94 changes: 94 additions & 0 deletions Lone_Developers/Lone_Developers/accounts/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
from django.db import models
from django.utils import timezone
from django.utils.translation import gettext_lazy as _
from django.contrib.auth.models import AbstractUser
from django.dispatch import receiver
#from django.http import HttpResponseBadRequest
from django.db.models.signals import post_save


# Create your models here.
from django.conf import settings
FEES = [1000*i for i in range(1,13)]

class User(AbstractUser) :
class Role(models.TextChoices) :
STUDENT = "S" ,_("Student")
PARENT = "P" ,_("Parent")
TEACHER = "T",_("Teacher")
role = models.CharField(max_length = 255,choices=Role.choices)
is_approved= models.BooleanField(default=False)

class Teacher(models.Model) :
user = models.OneToOneField(settings.AUTH_USER_MODEL,null=True,on_delete=models.CASCADE, related_name="teacher")
position = models.CharField(max_length=255,blank=True)
department = models.CharField(max_length=255,blank=True)
date_of_joining = models.DateField(default=timezone.now)

def __str__(self):
return self.user.username

class Parent(models.Model) :
user = models.OneToOneField(settings.AUTH_USER_MODEL,null=True,on_delete=models.CASCADE)
@property
def total_fees_to_be_paid(self) :
for child in self.children.all():
fees+= child.fess
return fees

def __str__(self):
return self.user.username



class Student(models.Model) :
user = models.OneToOneField(settings.AUTH_USER_MODEL,null=True,on_delete=models.CASCADE, related_name="student")
roll_no = models.IntegerField(null=True)
parent = models.ForeignKey(Parent,related_name="children",null=True,on_delete=models.CASCADE)
standard = models.IntegerField(default =1)
is_fees_paid = models.BooleanField(default = False)
date_of_joining = models.DateField(default =timezone.now)
courses = models.ManyToManyField('courses.Course',related_name="student_courses",through="StudentToCourses", null=True)

@property
def fees(self) :
return 0 if self.fess_is_paid else Fess[self.standard]

def __str__(self):
return self.user.username



class StudentToCourses(models.Model) :
class Grade(models.TextChoices) :
A = "A" ,_("A")
B = "B" ,_("B")
C = "C",_("C")
D = "D",_("D")
E = "E",_("E")
grade = models.CharField(max_length = 255,choices=Grade.choices, null=True, blank=True)
attendance = models.IntegerField(null=True)
student = models.ForeignKey(Student,related_name="reports",null=True,on_delete=models.CASCADE)
course = models.ForeignKey('courses.Course',related_name="report_cards",null=True,on_delete=models.CASCADE)





@receiver(post_save,sender= User)
def generate_profile(sender,instance,created,**kwargs) :
role = instance.role
print(role)

if created :
if role=="S" :
Student.objects.create(user=instance)
elif role=="T" :
Teacher.objects.create(user=instance)
elif role=="P" :
Parent.objects.create(user=instance)





Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{% extends "base.html" %}
{% load course %}
{% block title %}

Login
{% endblock %}

{% block content %}
<section class="text-gray-700 body-font">
<div class="container px-5 py-24 mx-auto">
<div class="flex flex-col text-center w-full mb-20">
<h2 class="text-2xl font-medium text-gray-900 title-font mb-2">Hi there, your username is "{{user.username}}"</h2>
<p class="leading-relaxed">Your registration is under process now .Once the verification is done
you can try logging in again . </p>



</div>
</section>
{% endblock %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{% extends "base.html" %}
{% load course %}
{% block title %}

Login
{% endblock %}


{% block content %}
<style>body{
background-color : #c8d9c594 !important ;
}

</style>
<section class="text-gray-700 body-font">

<div class="container px-5 py-24 mx-auto flex flex-wrap items-center ">
<div class="lg:w-3/5 md:w-1/2 md:pr-16 lg:pr-0 pr-0">
<img src="https://images.unsplash.com/photo-1517430816045-df4b7de11d1d?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1051&q=80">
{% comment %} <h1 class="title-font font-medium text-3xl text-gray-900">Slow-carb next level shoindcgoitch ethical authentic, poko scenester</h1> {% endcomment %}
</div>

<div class="lg:w-2/6 md:w-1/2 bg-gray-200 rounded-lg p-8 flex flex-col md:ml-auto w-full mt-10 md:mt-0">
<form method="post" action="{% url 'accounts:login' %}" class="flex flex-col">
{% csrf_token %}
<h2 class="text-gray-900 text-lg font-medium title-font mb-5">Sign In</h2>
<input class="bg-white rounded border border-gray-400 focus:outline-none focus:border-green-500 text-base px-4 py-2 mb-4" placeholder="User Name" type="text" name="username">
<input class="bg-white rounded border border-gray-400 focus:outline-none focus:border-green-500 text-base px-4 py-2 mb-4" placeholder="Password" type="password" name="password"><br/>
<button class="text-white bg-green-500 border-0 py-2 px-8 focus:outline-none hover:bg-green-600 rounded text-lg" type="submit">Submit</button>
<p class="text-xs text-gray-500 mt-3"></p>
</form>
</div>

</div>
</section>

{% endblock %}

Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{% extends "base.html" %}
{% load course %}
{% block title %}
Register
{% endblock %}
{% block content %}
<section class="text-gray-700 body-font">
<div class="container px-5 py-24 mx-auto">
<div class="flex flex-col text-center w-full mb-20">
<h2 class="text-xs text-indigo-500 tracking-widest font-medium title-font mb-1">Sign Up</h2>
<h1 class="sm:text-3xl text-2xl font-medium title-font text-gray-900">How would you like to register?</h1>
</div>
<div class="flex flex-wrap -m-4">

<div class="p-4 md:w-1/3">
<a href ="{% url 'accounts:register_teacher'%}">
<div class="flex rounded-lg h-full bg-gray-100 p-8 flex-col">
<div class="flex items-center mb-3">
<div class="w-8 h-8 mr-3 inline-flex items-center justify-center rounded-full bg-indigo-500 text-white flex-shrink-0">
<svg fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" class="w-5 h-5" viewBox="0 0 24 24">
<path d="M22 12h-4l-3 9L9 3l-3 9H2"></path>
</svg>
</div>
<h2 class="text-gray-900 text-lg title-font font-medium">Teacher</h2>
</div>
</div>
</a>
</div>
<div class="p-4 md:w-1/3">
<a href ="{% url 'accounts:register_student'%}">
<div class="flex rounded-lg h-full bg-gray-100 p-8 flex-col">
<div class="flex items-center mb-3">
<div class="w-8 h-8 mr-3 inline-flex items-center justify-center rounded-full bg-indigo-500 text-white flex-shrink-0">
<svg fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" class="w-5 h-5" viewBox="0 0 24 24">
<path d="M20 21v-2a4 4 0 00-4-4H8a4 4 0 00-4 4v2"></path>
<circle cx="12" cy="7" r="4"></circle>
</svg>
</div>
<h2 class="text-gray-900 text-lg title-font font-medium">Student</h2>
</div>

</div>
</a>
</div>
<div class="p-4 md:w-1/3">
<a href ="{% url 'accounts:register_parent'%}">
<div class="flex rounded-lg h-full bg-gray-100 p-8 flex-col">
<div class="flex items-center mb-3">
<div class="w-8 h-8 mr-3 inline-flex items-center justify-center rounded-full bg-indigo-500 text-white flex-shrink-0">
<svg fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" class="w-5 h-5" viewBox="0 0 24 24">
<circle cx="6" cy="6" r="3"></circle>
<circle cx="6" cy="18" r="3"></circle>
<path d="M20 4L8.12 15.88M14.47 14.48L20 20M8.12 8.12L12 12"></path>
</svg>
</div>
<h2 class="text-gray-900 text-lg title-font font-medium">Parent</h2>
</div>
</div>
</a>
</div>
</div>
</div>
</section>


{% endblock %}
Loading