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 LMX_CourseDash_LoggedIn_ERD.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
102 changes: 73 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,89 @@
# LMX
This is the django development version of LMX Software.
## LMX - EPAi CapStone

Upgraded Replica of Canvas LMS


## Initials

If you don't have the repo, open a shell and run
Group Task

```
git clone https://github.com/TSAI-Labs/LMX.git
cd LMX
The Course Dashboard (logged in) Objectives:
- show list of registered and unregistered courses
- show to-do list (pending assignments and quizzes)
- show coming up schedule
- show student profile
- show a “public” page mode where student can display their work and blog/writeup
- show student settings to change time-zone, notification settings
- And Integrating everything when logged IN
```

If you already have the repo in your home directory. Go inside it and make sure you have the latest.
---

```
cd LMX
git pull origin main
```
#### Group Members:

For required environment run (python3)
- Aditya Jindal (aditya.jindal4@gmail.com)
- Akshat Jaipuria ()
- Ansalam Daniel (ansimatt@gmail.com)

```
python -m venv venv
source venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
```
---

#### Project Setup:

Follow basic Django project setup as usual except SQLite database migrations part.

## Run Django App Locally:
Note: [GIT branch]() is already committed with a dummy SQLite database file for use [DataBase File]()

Please create your .env file or collect it from Admin
Static and Media files are gitignored. Please add it locally.
Use command to run:

```
- cd LMX
- python manage.py makemigrations
- python manage.py migrate
- python manage.py createsuperuser
- python manage.py collectstatic
- python manage.py runserver
python3 manage.py runserver
```

---

### Tasks

- show list of registered and unregistered courses
- Based on Teacher/Student view the dashboard is populated with published/un-published and registered/un-registered respectively.
- The View, Publish, UnPublish, Register buttons on courses are mapped to empty urls as of now.

- show to-do list (pending assignments and quizzes)
- To-Do view is a part of student session.
- Dummy assignments are populated based on due date.
- show coming up schedule
- Coming Up view is a part of teacher session.
- Dummy assignments of courses belonging to the teacher user are populated based on due date.
- show student profile
- Profile URL is attached to the username on the top left corner of the dashboard.
- Sourced from "@Soma Korada" Profile part and upgraded for Role and Time Zone visibility.
- show a “public” page mode where student can display their work and blog/write up
- Blogs feature is independent of user session (public view)
- Using New Post nav bar feature logged in user can create a post.
- Blogs are on pagination.
- show student settings to change time-zone, notification settings
- Timezone can be updated in the profile page from the drop down selection. Default Timezone is UTC. (Note: Database should store UTC timestamp for easier conversions)
- Notification settings are created automatically after user creation and all are set to off by default.

#### Extra feature

- Role objects for user are created automatically after user registration.
- lms_course : Course belonging to a single teacher.
- lms_studentcourse: Students belonging to the course
- lms_assignment: Assignment belonging to the teacher course.
- lms_studentassignment: Student Assignment is a Assignment object belonging to a student based on student course. Can be upgraded to store student marks.

---

### ERD for the project:

<img src="./LMX_CourseDash_LoggedIn_ERD.png" alt="image" style="zoom:0%;" />

---

Credentials:

ADMIN/Teacher: ansi/hellodude

Teacher: user123/Qwerty@123

Student1: test2/Qwerty@123

Student2: test6/Qwerty@123
45 changes: 45 additions & 0 deletions Zoheb_Run_Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# LMX
This is the django development version of LMX Software.



## Initials

If you don't have the repo, open a shell and run

```
git clone https://github.com/TSAI-Labs/LMX.git
cd LMX
```

If you already have the repo in your home directory. Go inside it and make sure you have the latest.

```
cd LMX
git pull origin main
```

For required environment run (python3)

```
python -m venv venv
source venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
```



## Run Django App Locally:

Please create your .env file or collect it from Admin
Static and Media files are gitignored. Please add it locally.

```
- cd LMX
- python manage.py makemigrations
- python manage.py migrate
- python manage.py createsuperuser
- python manage.py collectstatic
- python manage.py runserver
```
Binary file added db.sqlite3
Binary file not shown.
85 changes: 76 additions & 9 deletions lms/admin.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,94 @@
from django.contrib import admin
from django.contrib import messages

# LMS application imports.
from .models.student_model import Profile
from .models.course_model import Course
from .models.profile_model import Profile
from .models.course_model import Course, StudentCourse
from .models.assignment_model import Assignment, StudentAssignment
from .models.user_role_model import Role
from .models.files_model import File
from .models.blog_model import Post
from .models.notification_settings_model import NotificationSetting


class ProfileAdmin(admin.ModelAdmin):
class NotificationSettingAdmin(admin.ModelAdmin):
list_display = ('user',)
list_filter = ('user',)
search_fields = ('user',)
ordering = ['user', ]

# Registers the notification setting model for user at the admin backend.
admin.site.register(NotificationSetting, NotificationSettingAdmin)

class ProfileAdmin(admin.ModelAdmin):
list_filter = ('user', 'email_confirmed')
search_fields = ('user','user_tz')
ordering = ['user', ]

# Registers the student profile model at the admin backend.
admin.site.register(Profile, ProfileAdmin)

class StudentCourseAdmin(admin.ModelAdmin):
list_display = ('user', 'courses', 'registered')
list_filter = ('user',)
search_fields = ('user__username', 'courses')
ordering = ['user__username', ]

# Registers the student courses model at the admin backend.
admin.site.register(StudentCourse, StudentCourseAdmin)

class RoleAdmin(admin.ModelAdmin):
list_display = ('user', 'is_admin', 'is_teacher', 'is_teaching_assistant', 'is_student')
list_filter = ('is_admin', 'is_teacher', 'is_teaching_assistant', 'is_student')
search_fields = ('user__username',)
ordering = ['user__username',]

# Registers the staff profile model at the admin backend.
admin.site.register(Role, RoleAdmin)

class CourseAdmin(admin.ModelAdmin):

list_display = ('title', 'student',)
list_filter = ('student',)
list_display = ('title', 'user', 'published')
list_filter = ('user',)
search_fields = ('title',)
raw_id_fields = ('student',)

def publish_course(modeladmin, request, queryset):
queryset.update(published = 1)
messages.success(request, "Selected courses are published successfully !!")

def unpublish_course(modeladmin, request, queryset):
queryset.update(published = 0)
messages.success(request, "Selected courses are unpublished successfully !!")

admin.site.add_action(publish_course, "Publish Course")
admin.site.add_action(unpublish_course, "Unpublish Course")

# Registers the article model at the admin backend.
admin.site.register(Course, CourseAdmin)

class FileAdmin(admin.ModelAdmin):

list_display = ('name', 'date_created',)
list_filter = ('name',)
search_fields = ('name',)
raw_id_fields = ('course',)

# Registers the article model at the admin backend.
admin.site.register(Course, CourseAdmin)
admin.site.register(File, FileAdmin)

class PostAdmin(admin.ModelAdmin):

list_display = ('author', 'title', 'date_posted')
list_filter = ('author','date_posted')
search_fields = ('author','date_posted')

# Registers the Blog Post model at the admin backend.
admin.site.register(Post, PostAdmin)

@admin.register(Assignment)
class AssignmentAdmin(admin.ModelAdmin):
list_display = ('name', 'for_course', 'created_by')
list_filter = ('for_course', 'created_by')

@admin.register(StudentAssignment)
class StudentAssignmentAdmin(admin.ModelAdmin):
list_display = ('user', 'assignment',)
list_filter = ('user__username', 'assignment__name',)
3 changes: 3 additions & 0 deletions lms/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@

class LmsConfig(AppConfig):
name = 'lms'

def ready(self):
import lms.signals
18 changes: 17 additions & 1 deletion lms/forms/account/register_form.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@ def __init__(self, *args, **kwargs):
),
help_text='Required. Input a valid email address.'
)

role = forms.ChoiceField(choices=[('1', 'Student'),('2', 'Teacher'),('3', 'Teacher Assistant')], required=True,
widget=forms.Select(attrs={
"name": "role", "class": "input100",
"style": "align-items : center"
}
),
help_text='Required. Select a user role'
)

password1 = forms.CharField(widget=
forms.PasswordInput(attrs={
"name": "password1", "class": "input100",
Expand All @@ -40,7 +50,7 @@ def __init__(self, *args, **kwargs):

class Meta:
model = User
fields = ['username', 'email', 'password1', 'password2']
fields = ['username', 'email', 'role', 'password1', 'password2']
widgets = {

"username": forms.TextInput(attrs={
Expand All @@ -51,3 +61,9 @@ class Meta:

}

class UserUpdateForm(forms.ModelForm):
email = forms.EmailField()

class Meta:
model = User
fields = ['username', 'email']
10 changes: 10 additions & 0 deletions lms/forms/dashboard/profile_form.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from django import forms

# LMS application imports.
from lms.models.profile_model import Profile


class ProfileUpdateForm(forms.ModelForm):
class Meta:
model = Profile
fields = ['image', 'user_tz']
10 changes: 10 additions & 0 deletions lms/forms/notification/notification_settings_form.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from django import forms

# LMS application imports.
from lms.models.notification_settings_model import NotificationSetting


class NotificationSettingUpdateForm(forms.ModelForm):
class Meta:
model = NotificationSetting
fields = ['due_date', 'grading_policies', 'course_content', 'files', 'announcement']
Loading