diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..926229b5e --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +# Ignore virtual environments +.venv/ +venv/ \ No newline at end of file diff --git a/.gradio/certificate.pem b/.gradio/certificate.pem new file mode 100644 index 000000000..b85c8037f --- /dev/null +++ b/.gradio/certificate.pem @@ -0,0 +1,31 @@ +-----BEGIN CERTIFICATE----- +MIIFazCCA1OgAwIBAgIRAIIQz7DSQONZRGPgu2OCiwAwDQYJKoZIhvcNAQELBQAw +TzELMAkGA1UEBhMCVVMxKTAnBgNVBAoTIEludGVybmV0IFNlY3VyaXR5IFJlc2Vh +cmNoIEdyb3VwMRUwEwYDVQQDEwxJU1JHIFJvb3QgWDEwHhcNMTUwNjA0MTEwNDM4 +WhcNMzUwNjA0MTEwNDM4WjBPMQswCQYDVQQGEwJVUzEpMCcGA1UEChMgSW50ZXJu +ZXQgU2VjdXJpdHkgUmVzZWFyY2ggR3JvdXAxFTATBgNVBAMTDElTUkcgUm9vdCBY +MTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAK3oJHP0FDfzm54rVygc +h77ct984kIxuPOZXoHj3dcKi/vVqbvYATyjb3miGbESTtrFj/RQSa78f0uoxmyF+ +0TM8ukj13Xnfs7j/EvEhmkvBioZxaUpmZmyPfjxwv60pIgbz5MDmgK7iS4+3mX6U +A5/TR5d8mUgjU+g4rk8Kb4Mu0UlXjIB0ttov0DiNewNwIRt18jA8+o+u3dpjq+sW +T8KOEUt+zwvo/7V3LvSye0rgTBIlDHCNAymg4VMk7BPZ7hm/ELNKjD+Jo2FR3qyH +B5T0Y3HsLuJvW5iB4YlcNHlsdu87kGJ55tukmi8mxdAQ4Q7e2RCOFvu396j3x+UC +B5iPNgiV5+I3lg02dZ77DnKxHZu8A/lJBdiB3QW0KtZB6awBdpUKD9jf1b0SHzUv +KBds0pjBqAlkd25HN7rOrFleaJ1/ctaJxQZBKT5ZPt0m9STJEadao0xAH0ahmbWn +OlFuhjuefXKnEgV4We0+UXgVCwOPjdAvBbI+e0ocS3MFEvzG6uBQE3xDk3SzynTn +jh8BCNAw1FtxNrQHusEwMFxIt4I7mKZ9YIqioymCzLq9gwQbooMDQaHWBfEbwrbw +qHyGO0aoSCqI3Haadr8faqU9GY/rOPNk3sgrDQoo//fb4hVC1CLQJ13hef4Y53CI +rU7m2Ys6xt0nUW7/vGT1M0NPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNV +HRMBAf8EBTADAQH/MB0GA1UdDgQWBBR5tFnme7bl5AFzgAiIyBpY9umbbjANBgkq +hkiG9w0BAQsFAAOCAgEAVR9YqbyyqFDQDLHYGmkgJykIrGF1XIpu+ILlaS/V9lZL +ubhzEFnTIZd+50xx+7LSYK05qAvqFyFWhfFQDlnrzuBZ6brJFe+GnY+EgPbk6ZGQ +3BebYhtF8GaV0nxvwuo77x/Py9auJ/GpsMiu/X1+mvoiBOv/2X/qkSsisRcOj/KK +NFtY2PwByVS5uCbMiogziUwthDyC3+6WVwW6LLv3xLfHTjuCvjHIInNzktHCgKQ5 +ORAzI4JMPJ+GslWYHb4phowim57iaztXOoJwTdwJx4nLCgdNbOhdjsnvzqvHu7Ur +TkXWStAmzOVyyghqpZXjFaH3pO3JLF+l+/+sKAIuvtd7u+Nxe5AW0wdeRlN8NwdC +jNPElpzVmbUq4JUagEiuTDkHzsxHpFKVK7q4+63SM1N95R1NbdWhscdCb+ZAJzVc +oyi3B43njTOQ5yOf+1CceWxG1bQVs5ZufpsMljq4Ui0/1lvh+wjChP4kqKOJ2qxq +4RgqsahDYVvTH9w7jXbyLeiNdd8XM2w9U/t7y0Ff/9yi0GE44Za4rF2LN9d11TPA +mRGunUHBcnWEvgJBQl9nJEiU0Zsnvgc/ubhPgXRR4Xq37Z0j4r7g1SgEEzwxA57d +emyPxgcYxn/eR44/KJ4EBs+lVDR3veyJm+kXQ99b21/+jh5Xos1AnX5iItreGCc= +-----END CERTIFICATE----- diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 000000000..6f3a2913e --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "liveServer.settings.port": 5501 +} \ No newline at end of file diff --git a/AIPlanner/__init__.py b/AIPlanner/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/AIPlanner/__pycache__/__init__.cpython-311.pyc b/AIPlanner/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 000000000..86e566593 Binary files /dev/null and b/AIPlanner/__pycache__/__init__.cpython-311.pyc differ diff --git a/AIPlanner/__pycache__/__init__.cpython-312.pyc b/AIPlanner/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 000000000..154e45476 Binary files /dev/null and b/AIPlanner/__pycache__/__init__.cpython-312.pyc differ diff --git a/AIPlanner/__pycache__/__init__.cpython-313.pyc b/AIPlanner/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 000000000..bb1ae310a Binary files /dev/null and b/AIPlanner/__pycache__/__init__.cpython-313.pyc differ diff --git a/AIPlanner/__pycache__/__init__.cpython-39.pyc b/AIPlanner/__pycache__/__init__.cpython-39.pyc new file mode 100644 index 000000000..0712305ff Binary files /dev/null and b/AIPlanner/__pycache__/__init__.cpython-39.pyc differ diff --git a/AIPlanner/__pycache__/admin.cpython-311.pyc b/AIPlanner/__pycache__/admin.cpython-311.pyc new file mode 100644 index 000000000..372d00631 Binary files /dev/null and b/AIPlanner/__pycache__/admin.cpython-311.pyc differ diff --git a/AIPlanner/__pycache__/admin.cpython-312.pyc b/AIPlanner/__pycache__/admin.cpython-312.pyc new file mode 100644 index 000000000..f1afaf82d Binary files /dev/null and b/AIPlanner/__pycache__/admin.cpython-312.pyc differ diff --git a/AIPlanner/__pycache__/admin.cpython-313.pyc b/AIPlanner/__pycache__/admin.cpython-313.pyc new file mode 100644 index 000000000..64ffca465 Binary files /dev/null and b/AIPlanner/__pycache__/admin.cpython-313.pyc differ diff --git a/AIPlanner/__pycache__/admin.cpython-39.pyc b/AIPlanner/__pycache__/admin.cpython-39.pyc new file mode 100644 index 000000000..f02ab9f36 Binary files /dev/null and b/AIPlanner/__pycache__/admin.cpython-39.pyc differ diff --git a/AIPlanner/__pycache__/apps.cpython-311.pyc b/AIPlanner/__pycache__/apps.cpython-311.pyc new file mode 100644 index 000000000..d616ad0d2 Binary files /dev/null and b/AIPlanner/__pycache__/apps.cpython-311.pyc differ diff --git a/AIPlanner/__pycache__/apps.cpython-312.pyc b/AIPlanner/__pycache__/apps.cpython-312.pyc new file mode 100644 index 000000000..d465e30b8 Binary files /dev/null and b/AIPlanner/__pycache__/apps.cpython-312.pyc differ diff --git a/AIPlanner/__pycache__/apps.cpython-313.pyc b/AIPlanner/__pycache__/apps.cpython-313.pyc new file mode 100644 index 000000000..bb2c0930f Binary files /dev/null and b/AIPlanner/__pycache__/apps.cpython-313.pyc differ diff --git a/AIPlanner/__pycache__/apps.cpython-39.pyc b/AIPlanner/__pycache__/apps.cpython-39.pyc new file mode 100644 index 000000000..4b1866e38 Binary files /dev/null and b/AIPlanner/__pycache__/apps.cpython-39.pyc differ diff --git a/AIPlanner/__pycache__/forms.cpython-311.pyc b/AIPlanner/__pycache__/forms.cpython-311.pyc new file mode 100644 index 000000000..47c884629 Binary files /dev/null and b/AIPlanner/__pycache__/forms.cpython-311.pyc differ diff --git a/AIPlanner/__pycache__/forms.cpython-312.pyc b/AIPlanner/__pycache__/forms.cpython-312.pyc new file mode 100644 index 000000000..97107f2c9 Binary files /dev/null and b/AIPlanner/__pycache__/forms.cpython-312.pyc differ diff --git a/AIPlanner/__pycache__/forms.cpython-313.pyc b/AIPlanner/__pycache__/forms.cpython-313.pyc new file mode 100644 index 000000000..a83de8386 Binary files /dev/null and b/AIPlanner/__pycache__/forms.cpython-313.pyc differ diff --git a/AIPlanner/__pycache__/forms.cpython-39.pyc b/AIPlanner/__pycache__/forms.cpython-39.pyc new file mode 100644 index 000000000..7b51a160e Binary files /dev/null and b/AIPlanner/__pycache__/forms.cpython-39.pyc differ diff --git a/AIPlanner/__pycache__/models.cpython-311.pyc b/AIPlanner/__pycache__/models.cpython-311.pyc new file mode 100644 index 000000000..b4f6bd137 Binary files /dev/null and b/AIPlanner/__pycache__/models.cpython-311.pyc differ diff --git a/AIPlanner/__pycache__/models.cpython-312.pyc b/AIPlanner/__pycache__/models.cpython-312.pyc new file mode 100644 index 000000000..93f124bba Binary files /dev/null and b/AIPlanner/__pycache__/models.cpython-312.pyc differ diff --git a/AIPlanner/__pycache__/models.cpython-313.pyc b/AIPlanner/__pycache__/models.cpython-313.pyc new file mode 100644 index 000000000..75424e13e Binary files /dev/null and b/AIPlanner/__pycache__/models.cpython-313.pyc differ diff --git a/AIPlanner/__pycache__/models.cpython-39.pyc b/AIPlanner/__pycache__/models.cpython-39.pyc new file mode 100644 index 000000000..0e275445e Binary files /dev/null and b/AIPlanner/__pycache__/models.cpython-39.pyc differ diff --git a/AIPlanner/__pycache__/urls.cpython-311.pyc b/AIPlanner/__pycache__/urls.cpython-311.pyc new file mode 100644 index 000000000..8488c3c12 Binary files /dev/null and b/AIPlanner/__pycache__/urls.cpython-311.pyc differ diff --git a/AIPlanner/__pycache__/urls.cpython-312.pyc b/AIPlanner/__pycache__/urls.cpython-312.pyc new file mode 100644 index 000000000..937c7da86 Binary files /dev/null and b/AIPlanner/__pycache__/urls.cpython-312.pyc differ diff --git a/AIPlanner/__pycache__/urls.cpython-313.pyc b/AIPlanner/__pycache__/urls.cpython-313.pyc new file mode 100644 index 000000000..78548d42f Binary files /dev/null and b/AIPlanner/__pycache__/urls.cpython-313.pyc differ diff --git a/AIPlanner/__pycache__/urls.cpython-39.pyc b/AIPlanner/__pycache__/urls.cpython-39.pyc new file mode 100644 index 000000000..b0569e787 Binary files /dev/null and b/AIPlanner/__pycache__/urls.cpython-39.pyc differ diff --git a/AIPlanner/__pycache__/views.cpython-311.pyc b/AIPlanner/__pycache__/views.cpython-311.pyc new file mode 100644 index 000000000..5468f74b3 Binary files /dev/null and b/AIPlanner/__pycache__/views.cpython-311.pyc differ diff --git a/AIPlanner/__pycache__/views.cpython-312.pyc b/AIPlanner/__pycache__/views.cpython-312.pyc new file mode 100644 index 000000000..9283df7f1 Binary files /dev/null and b/AIPlanner/__pycache__/views.cpython-312.pyc differ diff --git a/AIPlanner/__pycache__/views.cpython-313.pyc b/AIPlanner/__pycache__/views.cpython-313.pyc new file mode 100644 index 000000000..1e282cd7a Binary files /dev/null and b/AIPlanner/__pycache__/views.cpython-313.pyc differ diff --git a/AIPlanner/__pycache__/views.cpython-39.pyc b/AIPlanner/__pycache__/views.cpython-39.pyc new file mode 100644 index 000000000..431e1374f Binary files /dev/null and b/AIPlanner/__pycache__/views.cpython-39.pyc differ diff --git a/AIPlanner/admin.py b/AIPlanner/admin.py new file mode 100644 index 000000000..8c38f3f3d --- /dev/null +++ b/AIPlanner/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/AIPlanner/apps.py b/AIPlanner/apps.py new file mode 100644 index 000000000..8724ad6af --- /dev/null +++ b/AIPlanner/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class AiplannerConfig(AppConfig): + default_auto_field = 'django.db.models.BigAutoField' + name = 'AIPlanner' diff --git a/AIPlanner/forms.py b/AIPlanner/forms.py new file mode 100644 index 000000000..ead2dbab0 --- /dev/null +++ b/AIPlanner/forms.py @@ -0,0 +1,19 @@ +# ai model -> data from -> their interst in learing -> uske baad course and games suggest krega -> uske hisab se vo course kitne month me ho sakta hai and daily plan bana kr dega ki kitna ho sakta hai -> daily plan and practice schedule and suggestions +from django import forms + +class userForm(forms.Form): + pass + +class RequestForm(forms.Form): + skill_level = forms.ChoiceField(choices=[ + ('Beginner', 'Beginner'), + ('Intermediate', 'Intermediate'), + ('Advanced', 'Advanced') + ]) + learning_speed = forms.ChoiceField(choices=[ + ('Slow', 'Slow'), + ('Moderate', 'Moderate'), + ('Fast', 'Fast') + ]) + daily_hours = forms.IntegerField(min_value=1) + preferred_days = forms.CharField() \ No newline at end of file diff --git a/AIPlanner/middleware.py b/AIPlanner/middleware.py new file mode 100644 index 000000000..dc2039807 --- /dev/null +++ b/AIPlanner/middleware.py @@ -0,0 +1,19 @@ +from django.http import HttpResponse + +class SimpleCorsMiddleware: + def __init__(self, get_response): + self.get_response = get_response + + def __call__(self, request): + # Handle OPTIONS method to handle preflight requests + if request.method == 'OPTIONS': + response = HttpResponse(status=200) + else: + response = self.get_response(request) + + # Add CORS headers + response['Access-Control-Allow-Origin'] = '*' # Allows all domains + response['Access-Control-Allow-Methods'] = 'GET, POST, OPTIONS' + response['Access-Control-Allow-Headers'] = 'Content-Type, Authorization' + + return response diff --git a/AIPlanner/migrations/0001_initial.py b/AIPlanner/migrations/0001_initial.py new file mode 100644 index 000000000..d5ca4f99c --- /dev/null +++ b/AIPlanner/migrations/0001_initial.py @@ -0,0 +1,64 @@ +# Generated by Django 4.2.20 on 2025-03-29 18:58 + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ('gamification', '0001_initial'), + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] + + operations = [ + migrations.CreateModel( + name='Course', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=255)), + ('difficulty_level', models.CharField(choices=[('Beginner', 'Beginner'), ('Intermediate', 'Intermediate'), ('Advanced', 'Advanced')], max_length=20)), + ('description', models.TextField()), + ('topics_and_hours', models.JSONField(default=dict)), + ('created_at', models.DateTimeField(auto_now_add=True)), + ], + ), + migrations.CreateModel( + name='StudySchedule', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('skill_level', models.CharField(max_length=20)), + ('learning_speed', models.CharField(max_length=10)), + ('daily_hours', models.IntegerField()), + ('preferred_days', models.JSONField(default=list)), + ('generated_study_plan', models.TextField(blank=True, null=True)), + ('created_at', models.DateTimeField(auto_now_add=True)), + ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), + ], + ), + migrations.CreateModel( + name='ExtendedUserProfile', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('skill_level', models.CharField(choices=[('Beginner', 'Beginner'), ('Intermediate', 'Intermediate'), ('Advanced', 'Advanced')], max_length=20)), + ('learning_speed', models.CharField(choices=[('Slow', 'Slow'), ('Moderate', 'Moderate'), ('Fast', 'Fast')], max_length=10)), + ('daily_hours', models.IntegerField(default=2)), + ('preferred_days', models.JSONField(default=list)), + ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), + ], + ), + migrations.CreateModel( + name='Exercise', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=255)), + ('description', models.TextField()), + ('difficulty_level', models.CharField(choices=[('Beginner', 'Beginner'), ('Intermediate', 'Intermediate'), ('Advanced', 'Advanced')], max_length=20)), + ('exercises_and_hours', models.JSONField()), + ('course', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='exercises', to='gamification.quiz')), + ], + ), + ] diff --git a/AIPlanner/migrations/0002_alter_exercise_course.py b/AIPlanner/migrations/0002_alter_exercise_course.py new file mode 100644 index 000000000..c2d36b05c --- /dev/null +++ b/AIPlanner/migrations/0002_alter_exercise_course.py @@ -0,0 +1,19 @@ +# Generated by Django 4.2.20 on 2025-03-29 21:17 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('AIPlanner', '0001_initial'), + ] + + operations = [ + migrations.AlterField( + model_name='exercise', + name='course', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='exercises', to='AIPlanner.course'), + ), + ] diff --git a/AIPlanner/migrations/__init__.py b/AIPlanner/migrations/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/AIPlanner/migrations/__pycache__/0001_initial.cpython-311.pyc b/AIPlanner/migrations/__pycache__/0001_initial.cpython-311.pyc new file mode 100644 index 000000000..7a1ccd391 Binary files /dev/null and b/AIPlanner/migrations/__pycache__/0001_initial.cpython-311.pyc differ diff --git a/AIPlanner/migrations/__pycache__/0001_initial.cpython-312.pyc b/AIPlanner/migrations/__pycache__/0001_initial.cpython-312.pyc new file mode 100644 index 000000000..603128da8 Binary files /dev/null and b/AIPlanner/migrations/__pycache__/0001_initial.cpython-312.pyc differ diff --git a/AIPlanner/migrations/__pycache__/0001_initial.cpython-313.pyc b/AIPlanner/migrations/__pycache__/0001_initial.cpython-313.pyc new file mode 100644 index 000000000..dba31df06 Binary files /dev/null and b/AIPlanner/migrations/__pycache__/0001_initial.cpython-313.pyc differ diff --git a/AIPlanner/migrations/__pycache__/0001_initial.cpython-39.pyc b/AIPlanner/migrations/__pycache__/0001_initial.cpython-39.pyc new file mode 100644 index 000000000..1a8989419 Binary files /dev/null and b/AIPlanner/migrations/__pycache__/0001_initial.cpython-39.pyc differ diff --git a/AIPlanner/migrations/__pycache__/0002_alter_exercise_course.cpython-311.pyc b/AIPlanner/migrations/__pycache__/0002_alter_exercise_course.cpython-311.pyc new file mode 100644 index 000000000..c8bf4e172 Binary files /dev/null and b/AIPlanner/migrations/__pycache__/0002_alter_exercise_course.cpython-311.pyc differ diff --git a/AIPlanner/migrations/__pycache__/0002_alter_exercise_course.cpython-312.pyc b/AIPlanner/migrations/__pycache__/0002_alter_exercise_course.cpython-312.pyc new file mode 100644 index 000000000..4d21fc513 Binary files /dev/null and b/AIPlanner/migrations/__pycache__/0002_alter_exercise_course.cpython-312.pyc differ diff --git a/AIPlanner/migrations/__pycache__/0002_alter_exercise_course.cpython-313.pyc b/AIPlanner/migrations/__pycache__/0002_alter_exercise_course.cpython-313.pyc new file mode 100644 index 000000000..1a2ea0f93 Binary files /dev/null and b/AIPlanner/migrations/__pycache__/0002_alter_exercise_course.cpython-313.pyc differ diff --git a/AIPlanner/migrations/__pycache__/0002_alter_exercise_course.cpython-39.pyc b/AIPlanner/migrations/__pycache__/0002_alter_exercise_course.cpython-39.pyc new file mode 100644 index 000000000..4420d240a Binary files /dev/null and b/AIPlanner/migrations/__pycache__/0002_alter_exercise_course.cpython-39.pyc differ diff --git a/AIPlanner/migrations/__pycache__/__init__.cpython-311.pyc b/AIPlanner/migrations/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 000000000..37074184f Binary files /dev/null and b/AIPlanner/migrations/__pycache__/__init__.cpython-311.pyc differ diff --git a/AIPlanner/migrations/__pycache__/__init__.cpython-312.pyc b/AIPlanner/migrations/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 000000000..cf7b5dd30 Binary files /dev/null and b/AIPlanner/migrations/__pycache__/__init__.cpython-312.pyc differ diff --git a/AIPlanner/migrations/__pycache__/__init__.cpython-313.pyc b/AIPlanner/migrations/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 000000000..f56303ea7 Binary files /dev/null and b/AIPlanner/migrations/__pycache__/__init__.cpython-313.pyc differ diff --git a/AIPlanner/migrations/__pycache__/__init__.cpython-39.pyc b/AIPlanner/migrations/__pycache__/__init__.cpython-39.pyc new file mode 100644 index 000000000..6d16fb31e Binary files /dev/null and b/AIPlanner/migrations/__pycache__/__init__.cpython-39.pyc differ diff --git a/AIPlanner/models.py b/AIPlanner/models.py new file mode 100644 index 000000000..e4292758f --- /dev/null +++ b/AIPlanner/models.py @@ -0,0 +1,81 @@ +import datetime +from django.db import models +from django.contrib.auth import get_user_model +from gamification.models import Quiz +from Dashboard.models import CustomUser + +User = get_user_model() + +# Extended User Profile Model +class ExtendedUserProfile(models.Model): + user = models.OneToOneField(CustomUser, on_delete=models.CASCADE) + skill_level = models.CharField( + max_length=20, + choices=[('Beginner', 'Beginner'), ('Intermediate', 'Intermediate'), ('Advanced', 'Advanced')] + ) + learning_speed = models.CharField( + max_length=10, + choices=[('Slow', 'Slow'), ('Moderate', 'Moderate'), ('Fast', 'Fast')] + ) + daily_hours = models.IntegerField(default=2) + preferred_days = models.JSONField(default=list) # Example: ['Monday', 'Wednesday', 'Friday'] + + def __str__(self): + return f"{self.user.name}'s Profile" + +class Course(models.Model): + name = models.CharField(max_length=255) + difficulty_level = models.CharField(max_length=20, choices=[('Beginner', 'Beginner'), ('Intermediate', 'Intermediate'), ('Advanced', 'Advanced')]) + description = models.TextField() + topics_and_hours = models.JSONField(default=dict) # Format: { "Topic Name": hours } + created_at = models.DateTimeField(auto_now_add=True) + + def __str__(self): + return self.name + +class Exercise(models.Model): + course = models.ForeignKey(Course, related_name='exercises', on_delete=models.CASCADE) + name = models.CharField(max_length=255) + description = models.TextField() + difficulty_level = models.CharField(max_length=20, choices=[('Beginner', 'Beginner'), ('Intermediate', 'Intermediate'), ('Advanced', 'Advanced')]) + exercises_and_hours = models.JSONField() + + def __str__(self): + return self.name + +# Study Schedule Model +class StudySchedule(models.Model): + user = models.ForeignKey(CustomUser, on_delete=models.CASCADE) + skill_level = models.CharField(max_length=20) + learning_speed = models.CharField(max_length=10) + daily_hours = models.IntegerField() + preferred_days = models.JSONField(default=list) + generated_study_plan = models.TextField(null=True, blank=True) + created_at = models.DateTimeField(auto_now_add=True) + + def __str__(self): + return f"{self.user.username}'s Study Schedule" + + def calculate_completion_date(self): + user_profile = ExtendedUserProfile.objects.get(user=self.user) + total_hours = self.course.estimated_hours + daily_hours = user_profile.daily_hours + days_needed = total_hours / daily_hours + today = datetime.date.today() + + preferred_days = user_profile.preferred_days + delta = datetime.timedelta(days=1) + count = 0 + completion_date = today + + while count < days_needed: + completion_date += delta + if completion_date.strftime('%A') in preferred_days: + count += 1 + + return completion_date + + def save(self, *args, **kwargs): + if not self.completion_date: + self.completion_date = self.calculate_completion_date() + super().save(*args, **kwargs) diff --git a/AIPlanner/templates/study_plan_form.html b/AIPlanner/templates/study_plan_form.html new file mode 100644 index 000000000..b6b580dc9 --- /dev/null +++ b/AIPlanner/templates/study_plan_form.html @@ -0,0 +1,249 @@ + + +
+ + +{{ study_plan }}
+{% else %}
+ No study plan generated yet.
+{% endif %} + +{{ completion_date }}
diff --git a/AIPlanner/tests.py b/AIPlanner/tests.py new file mode 100644 index 000000000..7ce503c2d --- /dev/null +++ b/AIPlanner/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/AIPlanner/urls.py b/AIPlanner/urls.py new file mode 100644 index 000000000..9ac0b29f9 --- /dev/null +++ b/AIPlanner/urls.py @@ -0,0 +1,9 @@ +from django.urls import path +from . import views + +app_name = 'AIPlanner' + +urlpatterns = [ + path('process_user_input/', views.process_user_input, name='process_user_input'), + path('generate-study-plan/', views.generate_study_plan_view, name='generate_study_plan'), +] diff --git a/AIPlanner/views.py b/AIPlanner/views.py new file mode 100644 index 000000000..b595daf70 --- /dev/null +++ b/AIPlanner/views.py @@ -0,0 +1,132 @@ +import requests +import json +import urllib.request +import json +from django.contrib.auth.decorators import login_required +import requests +from django.shortcuts import render +from django.http import JsonResponse +from .models import ExtendedUserProfile, StudySchedule, Course, Exercise +from datetime import timedelta +import logging +from .forms import RequestForm + +# Configure logging +logging.basicConfig(filename='debug.log', level=logging.DEBUG, format='%(asctime)s - %(levelname)s - %(message)s') + +def calculate_total_study_hours(user_profile): + skill_level = user_profile.skill_level + courses = Course.objects.filter(difficulty_level=skill_level) + total_hours = sum( + sum(course.topics_and_hours.values()) + sum(ex.estimated_time for ex in Exercise.objects.filter(course=course)) + for course in courses + ) + return total_hours + +def generate_study_plan(user_profile, courses, exercises): + workflow_url = 'https://quizzical-cohen-angry.lemme.cloud/api/99532368-3fcd-48ea-8aeb-73a42b293026' + + print("I'm here!!") + print(user_profile.skill_level, user_profile.learning_speed, user_profile.daily_hours, user_profile.preferred_days) + + data = { + "daily_hours": user_profile.daily_hours, + "skill_level": user_profile.skill_level, + "learning_speed": user_profile.learning_speed, + "preferred_days": user_profile.preferred_days, + "courses": [course.name for course in courses], + "exercises": ['MCQ'], + # "exercises": [exercise.name for exercise in exercises] + } + + json_data = json.dumps(data).encode("utf-8") + print("YEAAAAAAA", json_data) + req = urllib.request.Request(workflow_url, data=json_data, headers={"Content-Type": "application/json"}, method="POST") + print(req, req.data, req.headers) + + try: + with urllib.request.urlopen(req) as response: + response_data = response.read().decode() + logging.debug("Trigger Block Response: %s", response_data) # Log response + return json.loads(response_data) + except urllib.error.HTTPError as e: + print(e.code, e.reason) + print(e) + error_details = e.read().decode() + logging.error("HTTPError: %s, Details: %s", e.code, error_details) # Log HTTP error + return {'error': f'HTTP error occurred: {e.code}'} + except urllib.error.URLError as e: + logging.error("URLError: %s", e.reason) # Log URL error + return {'error': f'URL error occurred: {e.reason}'} + except Exception as e: + logging.exception("Unexpected Error") # Log generic errors + return {'error': f'An error occurred: {str(e)}'} + + +@login_required(login_url='/login/') +def process_user_input(request): + if request.method == "POST": + user = request.user + user_profile, _ = ExtendedUserProfile.objects.get_or_create(user=user) + + user_profile.skill_level = request.POST.get('skill_level') + user_profile.learning_speed = request.POST.get('learning_speed') + user_profile.daily_hours = int(request.POST.get('daily_hours', 2)) + user_profile.preferred_days = request.POST.getlist('preferred_days') + user_profile.save() + + courses = Course.objects.filter(difficulty_level=user_profile.skill_level) + exercises = Exercise.objects.filter(course__in=courses) + + total_study_hours = calculate_total_study_hours(user_profile) + print("----->", user_profile.skill_level, user_profile.learning_speed, user_profile.daily_hours, user_profile.preferred_days) + study_plan = generate_study_plan(user_profile, courses, exercises) + + study_schedule = StudySchedule.objects.create( + user=user, + skill_level=user_profile.skill_level, + learning_speed=user_profile.learning_speed, + daily_hours=user_profile.daily_hours, + preferred_days=user_profile.preferred_days, + generated_study_plan=study_plan + ) + + completion_date = study_schedule.calculate_completion_date(total_study_hours) + + return render(request, "study_plan_result.html", {"study_plan": study_plan, "completion_date": completion_date}) + + return render(request, "study_plan_form.html") + + +@login_required(login_url='/login/') +def generate_study_plan_view(request): + if request.method == "POST": + print("Session ID:", request.session.session_key) + print("User:", request.user) + print("Is authenticated:", request.user.is_authenticated) + print("Cookies:", request.COOKIES) + user = request.user + print("User:", user) + user_profile, created = ExtendedUserProfile.objects.get_or_create(user=user) + + body_unicode = request.body.decode('utf-8') + body = json.loads(body_unicode) + print(body) + + user_profile.skill_level = body['skill_level'] + user_profile.learning_speed = body['learning_speed'] + user_profile.daily_hours = int(body['daily_hours']) + user_profile.preferred_days = [i.strip() for i in body['preferred_days'].split(',')] + user_profile.save() + + print("User Profile:", user_profile) + + courses = Course.objects.filter(difficulty_level=user_profile.skill_level) + exercises = Exercise.objects.filter(course__in=courses) + + print("---------->", user_profile.skill_level, user_profile.learning_speed, user_profile.daily_hours, user_profile.preferred_days) + study_plan = generate_study_plan(user_profile, courses, exercises) + + return JsonResponse({"study_plan": study_plan}) + + return JsonResponse({"error": "Invalid request method"}, status=400) diff --git a/Courses/__init__.py b/Courses/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/Courses/__pycache__/__init__.cpython-311.pyc b/Courses/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 000000000..84d782bd4 Binary files /dev/null and b/Courses/__pycache__/__init__.cpython-311.pyc differ diff --git a/Courses/__pycache__/__init__.cpython-312.pyc b/Courses/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 000000000..bb467293a Binary files /dev/null and b/Courses/__pycache__/__init__.cpython-312.pyc differ diff --git a/Courses/__pycache__/__init__.cpython-313.pyc b/Courses/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 000000000..04f51e624 Binary files /dev/null and b/Courses/__pycache__/__init__.cpython-313.pyc differ diff --git a/Courses/__pycache__/__init__.cpython-39.pyc b/Courses/__pycache__/__init__.cpython-39.pyc new file mode 100644 index 000000000..26117e0fd Binary files /dev/null and b/Courses/__pycache__/__init__.cpython-39.pyc differ diff --git a/Courses/__pycache__/admin.cpython-311.pyc b/Courses/__pycache__/admin.cpython-311.pyc new file mode 100644 index 000000000..d0a1289d2 Binary files /dev/null and b/Courses/__pycache__/admin.cpython-311.pyc differ diff --git a/Courses/__pycache__/admin.cpython-312.pyc b/Courses/__pycache__/admin.cpython-312.pyc new file mode 100644 index 000000000..5ee21f2db Binary files /dev/null and b/Courses/__pycache__/admin.cpython-312.pyc differ diff --git a/Courses/__pycache__/admin.cpython-313.pyc b/Courses/__pycache__/admin.cpython-313.pyc new file mode 100644 index 000000000..128e7d138 Binary files /dev/null and b/Courses/__pycache__/admin.cpython-313.pyc differ diff --git a/Courses/__pycache__/admin.cpython-39.pyc b/Courses/__pycache__/admin.cpython-39.pyc new file mode 100644 index 000000000..94ef3e736 Binary files /dev/null and b/Courses/__pycache__/admin.cpython-39.pyc differ diff --git a/Courses/__pycache__/apps.cpython-311.pyc b/Courses/__pycache__/apps.cpython-311.pyc new file mode 100644 index 000000000..119f3ae37 Binary files /dev/null and b/Courses/__pycache__/apps.cpython-311.pyc differ diff --git a/Courses/__pycache__/apps.cpython-312.pyc b/Courses/__pycache__/apps.cpython-312.pyc new file mode 100644 index 000000000..3f2ecb8c8 Binary files /dev/null and b/Courses/__pycache__/apps.cpython-312.pyc differ diff --git a/Courses/__pycache__/apps.cpython-313.pyc b/Courses/__pycache__/apps.cpython-313.pyc new file mode 100644 index 000000000..ed3277221 Binary files /dev/null and b/Courses/__pycache__/apps.cpython-313.pyc differ diff --git a/Courses/__pycache__/apps.cpython-39.pyc b/Courses/__pycache__/apps.cpython-39.pyc new file mode 100644 index 000000000..7e865ca41 Binary files /dev/null and b/Courses/__pycache__/apps.cpython-39.pyc differ diff --git a/Courses/__pycache__/models.cpython-311.pyc b/Courses/__pycache__/models.cpython-311.pyc new file mode 100644 index 000000000..457680ee4 Binary files /dev/null and b/Courses/__pycache__/models.cpython-311.pyc differ diff --git a/Courses/__pycache__/models.cpython-312.pyc b/Courses/__pycache__/models.cpython-312.pyc new file mode 100644 index 000000000..f6ece0a88 Binary files /dev/null and b/Courses/__pycache__/models.cpython-312.pyc differ diff --git a/Courses/__pycache__/models.cpython-313.pyc b/Courses/__pycache__/models.cpython-313.pyc new file mode 100644 index 000000000..c3432c713 Binary files /dev/null and b/Courses/__pycache__/models.cpython-313.pyc differ diff --git a/Courses/__pycache__/models.cpython-39.pyc b/Courses/__pycache__/models.cpython-39.pyc new file mode 100644 index 000000000..de61aecf5 Binary files /dev/null and b/Courses/__pycache__/models.cpython-39.pyc differ diff --git a/Courses/admin.py b/Courses/admin.py new file mode 100644 index 000000000..8c38f3f3d --- /dev/null +++ b/Courses/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/Courses/apps.py b/Courses/apps.py new file mode 100644 index 000000000..937ad9081 --- /dev/null +++ b/Courses/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class CoursesConfig(AppConfig): + default_auto_field = 'django.db.models.BigAutoField' + name = 'Courses' diff --git a/Courses/migrations/0001_initial.py b/Courses/migrations/0001_initial.py new file mode 100644 index 000000000..d3e68a280 --- /dev/null +++ b/Courses/migrations/0001_initial.py @@ -0,0 +1,25 @@ +# Generated by Django 5.1.7 on 2025-03-29 09:43 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Course', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=255)), + ('difficulty_level', models.CharField(choices=[('Beginner', 'Beginner'), ('Intermediate', 'Intermediate'), ('Advanced', 'Advanced')], max_length=20)), + ('description', models.TextField()), + ('topics', models.TextField()), + ('created_at', models.DateTimeField(auto_now_add=True)), + ], + ), + ] diff --git a/Courses/migrations/0002_remove_course_created_at_and_more.py b/Courses/migrations/0002_remove_course_created_at_and_more.py new file mode 100644 index 000000000..f8062cbac --- /dev/null +++ b/Courses/migrations/0002_remove_course_created_at_and_more.py @@ -0,0 +1,22 @@ +# Generated by Django 5.1.7 on 2025-03-29 09:52 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('Courses', '0001_initial'), + ] + + operations = [ + migrations.RemoveField( + model_name='course', + name='created_at', + ), + migrations.AlterField( + model_name='course', + name='difficulty_level', + field=models.CharField(max_length=50), + ), + ] diff --git a/Courses/migrations/__init__.py b/Courses/migrations/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/Courses/migrations/__pycache__/0001_initial.cpython-311.pyc b/Courses/migrations/__pycache__/0001_initial.cpython-311.pyc new file mode 100644 index 000000000..33676d313 Binary files /dev/null and b/Courses/migrations/__pycache__/0001_initial.cpython-311.pyc differ diff --git a/Courses/migrations/__pycache__/0001_initial.cpython-312.pyc b/Courses/migrations/__pycache__/0001_initial.cpython-312.pyc new file mode 100644 index 000000000..960e18cf8 Binary files /dev/null and b/Courses/migrations/__pycache__/0001_initial.cpython-312.pyc differ diff --git a/Courses/migrations/__pycache__/0001_initial.cpython-313.pyc b/Courses/migrations/__pycache__/0001_initial.cpython-313.pyc new file mode 100644 index 000000000..48aa779af Binary files /dev/null and b/Courses/migrations/__pycache__/0001_initial.cpython-313.pyc differ diff --git a/Courses/migrations/__pycache__/0001_initial.cpython-39.pyc b/Courses/migrations/__pycache__/0001_initial.cpython-39.pyc new file mode 100644 index 000000000..2ce7bb494 Binary files /dev/null and b/Courses/migrations/__pycache__/0001_initial.cpython-39.pyc differ diff --git a/Courses/migrations/__pycache__/0002_remove_course_created_at_and_more.cpython-311.pyc b/Courses/migrations/__pycache__/0002_remove_course_created_at_and_more.cpython-311.pyc new file mode 100644 index 000000000..bf5590a35 Binary files /dev/null and b/Courses/migrations/__pycache__/0002_remove_course_created_at_and_more.cpython-311.pyc differ diff --git a/Courses/migrations/__pycache__/0002_remove_course_created_at_and_more.cpython-312.pyc b/Courses/migrations/__pycache__/0002_remove_course_created_at_and_more.cpython-312.pyc new file mode 100644 index 000000000..cc83e7cde Binary files /dev/null and b/Courses/migrations/__pycache__/0002_remove_course_created_at_and_more.cpython-312.pyc differ diff --git a/Courses/migrations/__pycache__/0002_remove_course_created_at_and_more.cpython-313.pyc b/Courses/migrations/__pycache__/0002_remove_course_created_at_and_more.cpython-313.pyc new file mode 100644 index 000000000..11f0c07d9 Binary files /dev/null and b/Courses/migrations/__pycache__/0002_remove_course_created_at_and_more.cpython-313.pyc differ diff --git a/Courses/migrations/__pycache__/0002_remove_course_created_at_and_more.cpython-39.pyc b/Courses/migrations/__pycache__/0002_remove_course_created_at_and_more.cpython-39.pyc new file mode 100644 index 000000000..67566f740 Binary files /dev/null and b/Courses/migrations/__pycache__/0002_remove_course_created_at_and_more.cpython-39.pyc differ diff --git a/Courses/migrations/__pycache__/__init__.cpython-311.pyc b/Courses/migrations/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 000000000..64f0655ee Binary files /dev/null and b/Courses/migrations/__pycache__/__init__.cpython-311.pyc differ diff --git a/Courses/migrations/__pycache__/__init__.cpython-312.pyc b/Courses/migrations/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 000000000..19698e9e8 Binary files /dev/null and b/Courses/migrations/__pycache__/__init__.cpython-312.pyc differ diff --git a/Courses/migrations/__pycache__/__init__.cpython-313.pyc b/Courses/migrations/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 000000000..39b7c9ddf Binary files /dev/null and b/Courses/migrations/__pycache__/__init__.cpython-313.pyc differ diff --git a/Courses/migrations/__pycache__/__init__.cpython-39.pyc b/Courses/migrations/__pycache__/__init__.cpython-39.pyc new file mode 100644 index 000000000..379b9cc05 Binary files /dev/null and b/Courses/migrations/__pycache__/__init__.cpython-39.pyc differ diff --git a/Courses/models.py b/Courses/models.py new file mode 100644 index 000000000..ba0f17bd5 --- /dev/null +++ b/Courses/models.py @@ -0,0 +1,14 @@ +from django.db import models + +# Create your models here. + +from django.db import models + +class Course(models.Model): + name = models.CharField(max_length=255) + difficulty_level = models.CharField(max_length=50) + description = models.TextField() + topics = models.TextField() + + def __str__(self): + return self.name diff --git a/Courses/tests.py b/Courses/tests.py new file mode 100644 index 000000000..7ce503c2d --- /dev/null +++ b/Courses/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/Courses/views.py b/Courses/views.py new file mode 100644 index 000000000..91ea44a21 --- /dev/null +++ b/Courses/views.py @@ -0,0 +1,3 @@ +from django.shortcuts import render + +# Create your views here. diff --git a/Cream and Beige Simple Clean Project Overview Presentation.pdf b/Cream and Beige Simple Clean Project Overview Presentation.pdf new file mode 100644 index 000000000..5c64337c6 Binary files /dev/null and b/Cream and Beige Simple Clean Project Overview Presentation.pdf differ diff --git a/Dashboard/__init__.py b/Dashboard/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/Dashboard/__pycache__/__init__.cpython-311.pyc b/Dashboard/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 000000000..0ca4c8aff Binary files /dev/null and b/Dashboard/__pycache__/__init__.cpython-311.pyc differ diff --git a/Dashboard/__pycache__/__init__.cpython-312.pyc b/Dashboard/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 000000000..5be8a64d2 Binary files /dev/null and b/Dashboard/__pycache__/__init__.cpython-312.pyc differ diff --git a/Dashboard/__pycache__/__init__.cpython-313.pyc b/Dashboard/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 000000000..55048be4b Binary files /dev/null and b/Dashboard/__pycache__/__init__.cpython-313.pyc differ diff --git a/Dashboard/__pycache__/__init__.cpython-39.pyc b/Dashboard/__pycache__/__init__.cpython-39.pyc new file mode 100644 index 000000000..43c03237c Binary files /dev/null and b/Dashboard/__pycache__/__init__.cpython-39.pyc differ diff --git a/Dashboard/__pycache__/admin.cpython-311.pyc b/Dashboard/__pycache__/admin.cpython-311.pyc new file mode 100644 index 000000000..8af2368bf Binary files /dev/null and b/Dashboard/__pycache__/admin.cpython-311.pyc differ diff --git a/Dashboard/__pycache__/admin.cpython-312.pyc b/Dashboard/__pycache__/admin.cpython-312.pyc new file mode 100644 index 000000000..2a5007741 Binary files /dev/null and b/Dashboard/__pycache__/admin.cpython-312.pyc differ diff --git a/Dashboard/__pycache__/admin.cpython-313.pyc b/Dashboard/__pycache__/admin.cpython-313.pyc new file mode 100644 index 000000000..29ddd6ef3 Binary files /dev/null and b/Dashboard/__pycache__/admin.cpython-313.pyc differ diff --git a/Dashboard/__pycache__/admin.cpython-39.pyc b/Dashboard/__pycache__/admin.cpython-39.pyc new file mode 100644 index 000000000..ad0f1a508 Binary files /dev/null and b/Dashboard/__pycache__/admin.cpython-39.pyc differ diff --git a/Dashboard/__pycache__/apps.cpython-311.pyc b/Dashboard/__pycache__/apps.cpython-311.pyc new file mode 100644 index 000000000..11d34c41a Binary files /dev/null and b/Dashboard/__pycache__/apps.cpython-311.pyc differ diff --git a/Dashboard/__pycache__/apps.cpython-312.pyc b/Dashboard/__pycache__/apps.cpython-312.pyc new file mode 100644 index 000000000..374120271 Binary files /dev/null and b/Dashboard/__pycache__/apps.cpython-312.pyc differ diff --git a/Dashboard/__pycache__/apps.cpython-313.pyc b/Dashboard/__pycache__/apps.cpython-313.pyc new file mode 100644 index 000000000..9414e8cb4 Binary files /dev/null and b/Dashboard/__pycache__/apps.cpython-313.pyc differ diff --git a/Dashboard/__pycache__/apps.cpython-39.pyc b/Dashboard/__pycache__/apps.cpython-39.pyc new file mode 100644 index 000000000..e747263cc Binary files /dev/null and b/Dashboard/__pycache__/apps.cpython-39.pyc differ diff --git a/Dashboard/__pycache__/forms.cpython-311.pyc b/Dashboard/__pycache__/forms.cpython-311.pyc new file mode 100644 index 000000000..0c58285da Binary files /dev/null and b/Dashboard/__pycache__/forms.cpython-311.pyc differ diff --git a/Dashboard/__pycache__/forms.cpython-312.pyc b/Dashboard/__pycache__/forms.cpython-312.pyc new file mode 100644 index 000000000..615298e30 Binary files /dev/null and b/Dashboard/__pycache__/forms.cpython-312.pyc differ diff --git a/Dashboard/__pycache__/forms.cpython-313.pyc b/Dashboard/__pycache__/forms.cpython-313.pyc new file mode 100644 index 000000000..0915a7deb Binary files /dev/null and b/Dashboard/__pycache__/forms.cpython-313.pyc differ diff --git a/Dashboard/__pycache__/forms.cpython-39.pyc b/Dashboard/__pycache__/forms.cpython-39.pyc new file mode 100644 index 000000000..1f70b99cd Binary files /dev/null and b/Dashboard/__pycache__/forms.cpython-39.pyc differ diff --git a/Dashboard/__pycache__/models.cpython-311.pyc b/Dashboard/__pycache__/models.cpython-311.pyc new file mode 100644 index 000000000..40c01a326 Binary files /dev/null and b/Dashboard/__pycache__/models.cpython-311.pyc differ diff --git a/Dashboard/__pycache__/models.cpython-312.pyc b/Dashboard/__pycache__/models.cpython-312.pyc new file mode 100644 index 000000000..c54c53c37 Binary files /dev/null and b/Dashboard/__pycache__/models.cpython-312.pyc differ diff --git a/Dashboard/__pycache__/models.cpython-313.pyc b/Dashboard/__pycache__/models.cpython-313.pyc new file mode 100644 index 000000000..1353256ca Binary files /dev/null and b/Dashboard/__pycache__/models.cpython-313.pyc differ diff --git a/Dashboard/__pycache__/models.cpython-39.pyc b/Dashboard/__pycache__/models.cpython-39.pyc new file mode 100644 index 000000000..0fdf47099 Binary files /dev/null and b/Dashboard/__pycache__/models.cpython-39.pyc differ diff --git a/Dashboard/__pycache__/urls.cpython-311.pyc b/Dashboard/__pycache__/urls.cpython-311.pyc new file mode 100644 index 000000000..d633980fa Binary files /dev/null and b/Dashboard/__pycache__/urls.cpython-311.pyc differ diff --git a/Dashboard/__pycache__/urls.cpython-312.pyc b/Dashboard/__pycache__/urls.cpython-312.pyc new file mode 100644 index 000000000..d3840a067 Binary files /dev/null and b/Dashboard/__pycache__/urls.cpython-312.pyc differ diff --git a/Dashboard/__pycache__/urls.cpython-313.pyc b/Dashboard/__pycache__/urls.cpython-313.pyc new file mode 100644 index 000000000..e07ea6664 Binary files /dev/null and b/Dashboard/__pycache__/urls.cpython-313.pyc differ diff --git a/Dashboard/__pycache__/urls.cpython-39.pyc b/Dashboard/__pycache__/urls.cpython-39.pyc new file mode 100644 index 000000000..2b0eb6776 Binary files /dev/null and b/Dashboard/__pycache__/urls.cpython-39.pyc differ diff --git a/Dashboard/__pycache__/views.cpython-311.pyc b/Dashboard/__pycache__/views.cpython-311.pyc new file mode 100644 index 000000000..68087d5d8 Binary files /dev/null and b/Dashboard/__pycache__/views.cpython-311.pyc differ diff --git a/Dashboard/__pycache__/views.cpython-312.pyc b/Dashboard/__pycache__/views.cpython-312.pyc new file mode 100644 index 000000000..3aa032746 Binary files /dev/null and b/Dashboard/__pycache__/views.cpython-312.pyc differ diff --git a/Dashboard/__pycache__/views.cpython-313.pyc b/Dashboard/__pycache__/views.cpython-313.pyc new file mode 100644 index 000000000..fe2352a3e Binary files /dev/null and b/Dashboard/__pycache__/views.cpython-313.pyc differ diff --git a/Dashboard/__pycache__/views.cpython-39.pyc b/Dashboard/__pycache__/views.cpython-39.pyc new file mode 100644 index 000000000..a45c0954c Binary files /dev/null and b/Dashboard/__pycache__/views.cpython-39.pyc differ diff --git a/Dashboard/admin.py b/Dashboard/admin.py new file mode 100644 index 000000000..8c38f3f3d --- /dev/null +++ b/Dashboard/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/Dashboard/apps.py b/Dashboard/apps.py new file mode 100644 index 000000000..99a3c0a15 --- /dev/null +++ b/Dashboard/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class DashboardConfig(AppConfig): + default_auto_field = 'django.db.models.BigAutoField' + name = 'Dashboard' diff --git a/Dashboard/forms.py b/Dashboard/forms.py new file mode 100644 index 000000000..23db037a8 --- /dev/null +++ b/Dashboard/forms.py @@ -0,0 +1,17 @@ +from django import forms +from django.contrib.auth.forms import UserCreationForm, AuthenticationForm +from .models import CustomUser + +# Signup Form +class SignupForm(UserCreationForm): + email = forms.EmailField() + name = forms.CharField(max_length=100) + age = forms.IntegerField() + + class Meta: + model = CustomUser + fields = ["name", "age", "email", "password1", "password2"] + +# Login Form +class LoginForm(AuthenticationForm): + username = forms.EmailField(label="Email") diff --git a/Dashboard/migrations/0001_initial.py b/Dashboard/migrations/0001_initial.py new file mode 100644 index 000000000..43cefe996 --- /dev/null +++ b/Dashboard/migrations/0001_initial.py @@ -0,0 +1,34 @@ +# Generated by Django 4.2.20 on 2025-03-28 16:39 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ('auth', '0012_alter_user_first_name_max_length'), + ] + + operations = [ + migrations.CreateModel( + name='CustomUser', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('password', models.CharField(max_length=128, verbose_name='password')), + ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')), + ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')), + ('email', models.EmailField(max_length=254, unique=True)), + ('name', models.CharField(max_length=100)), + ('age', models.IntegerField()), + ('is_active', models.BooleanField(default=True)), + ('is_staff', models.BooleanField(default=False)), + ('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.group', verbose_name='groups')), + ('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.permission', verbose_name='user permissions')), + ], + options={ + 'abstract': False, + }, + ), + ] diff --git a/Dashboard/migrations/__init__.py b/Dashboard/migrations/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/Dashboard/migrations/__pycache__/0001_initial.cpython-311.pyc b/Dashboard/migrations/__pycache__/0001_initial.cpython-311.pyc new file mode 100644 index 000000000..089680342 Binary files /dev/null and b/Dashboard/migrations/__pycache__/0001_initial.cpython-311.pyc differ diff --git a/Dashboard/migrations/__pycache__/0001_initial.cpython-312.pyc b/Dashboard/migrations/__pycache__/0001_initial.cpython-312.pyc new file mode 100644 index 000000000..3b521f395 Binary files /dev/null and b/Dashboard/migrations/__pycache__/0001_initial.cpython-312.pyc differ diff --git a/Dashboard/migrations/__pycache__/0001_initial.cpython-313.pyc b/Dashboard/migrations/__pycache__/0001_initial.cpython-313.pyc new file mode 100644 index 000000000..80f564130 Binary files /dev/null and b/Dashboard/migrations/__pycache__/0001_initial.cpython-313.pyc differ diff --git a/Dashboard/migrations/__pycache__/0001_initial.cpython-39.pyc b/Dashboard/migrations/__pycache__/0001_initial.cpython-39.pyc new file mode 100644 index 000000000..0fe9cdbad Binary files /dev/null and b/Dashboard/migrations/__pycache__/0001_initial.cpython-39.pyc differ diff --git a/Dashboard/migrations/__pycache__/__init__.cpython-311.pyc b/Dashboard/migrations/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 000000000..ddf68b83e Binary files /dev/null and b/Dashboard/migrations/__pycache__/__init__.cpython-311.pyc differ diff --git a/Dashboard/migrations/__pycache__/__init__.cpython-312.pyc b/Dashboard/migrations/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 000000000..ed7db3a63 Binary files /dev/null and b/Dashboard/migrations/__pycache__/__init__.cpython-312.pyc differ diff --git a/Dashboard/migrations/__pycache__/__init__.cpython-313.pyc b/Dashboard/migrations/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 000000000..ae1490806 Binary files /dev/null and b/Dashboard/migrations/__pycache__/__init__.cpython-313.pyc differ diff --git a/Dashboard/migrations/__pycache__/__init__.cpython-39.pyc b/Dashboard/migrations/__pycache__/__init__.cpython-39.pyc new file mode 100644 index 000000000..5646b4770 Binary files /dev/null and b/Dashboard/migrations/__pycache__/__init__.cpython-39.pyc differ diff --git a/Dashboard/models.py b/Dashboard/models.py new file mode 100644 index 000000000..3329c3a85 --- /dev/null +++ b/Dashboard/models.py @@ -0,0 +1,39 @@ +from django.contrib.auth.models import AbstractBaseUser, BaseUserManager, PermissionsMixin +from django.db import models + +# Custom User Manager +class CustomUserManager(BaseUserManager): + def create_user(self, email, name, age, password=None): + if not email: + raise ValueError("Email is required") + email = self.normalize_email(email) + user = self.model(email=email, name=name, age=age) + user.set_password(password) + user.save(using=self._db) + return user + + def create_superuser(self, email, name, age, password): + user = self.create_user(email, name, age, password) + user.is_staff = True + user.is_superuser = True + user.save(using=self._db) + return user + +# Custom User Model +class CustomUser(AbstractBaseUser, PermissionsMixin): + email = models.EmailField(unique=True) + name = models.CharField(max_length=100) + age = models.IntegerField() + is_active = models.BooleanField(default=True) + is_staff = models.BooleanField(default=False) + + objects = CustomUserManager() + + USERNAME_FIELD = "email" + REQUIRED_FIELDS = ["name", "age"] + + def __str__(self): + return self.email + + + diff --git a/Dashboard/templates/Alphabets.html b/Dashboard/templates/Alphabets.html new file mode 100644 index 000000000..b788e61d0 --- /dev/null +++ b/Dashboard/templates/Alphabets.html @@ -0,0 +1,310 @@ +{% load static %} + + + + + +
+ Make a fist with your thumb pointing up to form an “A.” Hold your hand in front of you with your palm facing forward. Close your fingers in a fist, but keep your thumb pressed against the side of your hand and pointing upwards. This is the letter “A.”
+
+ Hold your fingers together with your thumb across your palm for “B.” Extend your fingers so they are straight. Bring them in close to each other so they are touching on the sides. Then, fold your thumb across the front of your palm and hold it there. This is the letter “B.”
+
+ Curl your whole hand into the shape of a "C". Turn your right hand so that your palm is facing towards the left. Then, curl your fingers and thumb to form a half circle or backward “C.” Hold your hand still. This is the letter “C.”
+
+ Touch your fingertips to your thumb and point to make a “D”. Touch the tip of your thumb to every finger except your index finger. Then, point your index finger straight up. Hold your hand still with your palm facing forward. This is the letter “D.”
+
+ Form the letter “B” and curl your fingertips down to make an “E.” Bend all four fingers down to meet your thumb. Press the tips of your fingers against the side of your thumb. This is the letter “E.” + + Keep your thumb and fingertips close to your palm. Otherwise, it might look like an “O" or "C." + +
+
+ Press your index finger and thumb together with straight fingers for “F.” Keep your other 3 fingers straight. This is the letter “F.”
+
+ Point your index finger and turn your hand to the side to make a “G.” Gather your fingers in towards your palm to make a fist. Then, extend your index finger and rest your thumb against your middle finger. Keep your thumb about 0.5 in (1.3 cm) from your palm so that it is parallel to your index finger. Angle your hand so that your palm is facing you and your index finger is pointing to your left. This is the letter “G.”
+
+ Stick out your middle and index fingers to form an “H.” Keep your hand in the same position as it was for the letter “G,” but extend your middle finger as well. Hold your middle finger so it’s right next to your index finger. Angle your hand so that your palm is facing you and your index and middle fingers are pointing to your left. This is the letter “H.”
+
+ Point your pinkie straight up to make an “I.” Form a fist and poke your pinkie finger straight up. This is the letter “I.”
+
+ Use your pinkie to draw the shape of a "J". With your hand still in the position for the letter “I,” bring your finger down and then swoop it upwards in the shape of a letter “J.” Do this multiple times if you want to create multiple Js, or just once for one letter J. + + Keep your palm facing away from you as you do this. + +
+
+ Point the index and middle fingers with a thumb between them for “K.” Press your ring finger and pinkie finger against your palm. Hold your index and middle finger so they are straight up but spread apart in the shape of a V. Then, press your thumb against your palm so that the tip of your thumb is between your index and middle finger near where they meet your hand. This is a “K.”
+
+ Form an L-shape with your thumb and index finger to make an “L.” Press your middle, ring, and pinkie fingers against your palm as you form an L-shape with your index finger and thumb. This is the letter “L.”
+
+ Hold an invisible ball and poke your thumb through for "M." Curl your fingers down towards your palm with your thumb between your index and middle finger. Hold your fingers like you’re wrapping them around a ball. Then, poke your thumb between your ring and pinky finger. This is how you make an “M.” [10] + + Tip: On letters "M", "N", and "T", make the fingers on top of the thumb obviously higher than the others to make for easy interpreting.
+
+ Poke your thumb between your middle and ring finger for “N.” Curl your fingers as if they’re holding a ball. Then, push the tip of your thumb between your middle and ring fingers. This is an “N.”
+
+ Make an "O" with your fingers and thumb. Press the tips of your fingers and thumb together. This is the letter “O.”[12] + + Some people may turn their hand slightly to show the "O" formed by the fingers to differentiate it from "E". + +
+
+ Press your thumb against your middle finger with index pointed for “P.” Press your ring finger and pinkie finger against your palm. Then, extend your index finger as if you're pointing at something. Extend your middle finger so it's pointing down and touch it with your thumb. This is the letter “P.”
+
+ Make the sign for a “G” and then point down for a “Q.” Press your middle, ring, and pinkie fingers against your palm and point with your index finger. Then, rest your thumb on top of your middle finger so that it is about 0.5 in (1.3 cm) from your index finger. Then, point down with your hand in this position. This is the letter “Q.”
+
+ Cross your index finger over your middle finger for an “R.” Press your ring finger, pinkie, and thumb against your palm. Then, wrap your middle finger around the back of your index finger. Hold your hand still with your palm facing forward. This is the letter “R.”[
+
+ Make a fist and put your thumb on top of your fingers for an “S.” This is often confused with "A" so pay careful attention to the thumb position. Press your fingers against your palm and wrap your thumb over them. This is the letter “S.”
+
+ Form a fist with your thumb between the middle and index finger for “T.” Press your fingers against your palm. Then, push your thumb up between your index and middle finger. This is the letter “T.”
+
+ Point your middle and index fingers upwards together to make “U.” Press your thumb, ring finger, and pinkie finger against your palm. Then, point your middle and index finger straight up and hold them against each other. This is the letter “U.”
+
+ Make a "U" and separate your fingers for a “V.” With your hand in the “U” position, spread your fingers apart. This is the letter “V.” Make sure to keep your ring finger, pinkie, and thumb pressed against your palm.[
+
+ Hold up 3 fingers and spread them apart to form “W.” Press your pinkie finger to your palm using your thumb. Then, hold up your index, middle, and ring fingers and spread them apart so that they look like the letter “W.” This is a “W.”
+
+ Make a fist, then raise and crook your index finger to make “X.” Press your thumb against your palm and then wrap your middle, ring, and pinkie fingers over it. Curl your index finger. This is the letter “X.”
+
+ Stick out your pinkie and thumb for a “Y.” Press your other fingers against your palm. This is the letter “Y.”
+
+ Write the letter “Z” in the air with your index finger. Form the letter "D", with your index finger out, and write a letter “Z” in the air.
+Understanding American Sign Language Grammar
+One common misconception about American Sign Language (ASL) is that it is essentially signed English. However, like any other language, ASL has its own system of grammar that is integral to effective communication and understanding.
+
+ ASL commonly uses a type of sentence structure called topicalization...
+
+ In ASL, a non-manual marker (NMM) is an action that gives context or meaning to what is being signed...
+
+ The signing space is an important aspect of ASL that determines where and how signs are placed...
+
+ Sign movement plays a crucial role in conveying meaning in ASL...
+
+ The shape of the hand while signing determines different meanings...
+
+ If you are looking for more ASL resources, check out the following:
+ +
+
+ {{ description }}
+
+ ASL Sign: Extend your dominant hand and move it in a small wave.
+
+ ASL Sign: Touch your fingers to your chin and move your hand forward.
+
+ ASL Sign: Move your dominant hand upward like the sun rising.
+
+ ASL Sign: Wave your hand as you would normally say goodbye.
+
+
+ "Basic Communication & Daily Life"
+"Expressive ASL & Social Conversations"
+ +