diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..f2a809e9 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.sqlite3 +__pycache__/ \ No newline at end of file diff --git a/Dr_R/__pycache__/__init__.cpython-310.pyc b/Dr_R/__pycache__/__init__.cpython-310.pyc deleted file mode 100644 index 5e03c42d..00000000 Binary files a/Dr_R/__pycache__/__init__.cpython-310.pyc and /dev/null differ diff --git a/Dr_R/__pycache__/__init__.cpython-311.pyc b/Dr_R/__pycache__/__init__.cpython-311.pyc deleted file mode 100644 index 27ade7ec..00000000 Binary files a/Dr_R/__pycache__/__init__.cpython-311.pyc and /dev/null differ diff --git a/Dr_R/__pycache__/settings.cpython-310.pyc b/Dr_R/__pycache__/settings.cpython-310.pyc deleted file mode 100644 index 4c1ad2c7..00000000 Binary files a/Dr_R/__pycache__/settings.cpython-310.pyc and /dev/null differ diff --git a/Dr_R/__pycache__/settings.cpython-311.pyc b/Dr_R/__pycache__/settings.cpython-311.pyc deleted file mode 100644 index a54e759c..00000000 Binary files a/Dr_R/__pycache__/settings.cpython-311.pyc and /dev/null differ diff --git a/Dr_R/__pycache__/urls.cpython-310.pyc b/Dr_R/__pycache__/urls.cpython-310.pyc deleted file mode 100644 index 2e181ca3..00000000 Binary files a/Dr_R/__pycache__/urls.cpython-310.pyc and /dev/null differ diff --git a/Dr_R/__pycache__/urls.cpython-311.pyc b/Dr_R/__pycache__/urls.cpython-311.pyc deleted file mode 100644 index 5d6a29b2..00000000 Binary files a/Dr_R/__pycache__/urls.cpython-311.pyc and /dev/null differ diff --git a/Dr_R/__pycache__/wsgi.cpython-310.pyc b/Dr_R/__pycache__/wsgi.cpython-310.pyc deleted file mode 100644 index 85ab0000..00000000 Binary files a/Dr_R/__pycache__/wsgi.cpython-310.pyc and /dev/null differ diff --git a/Dr_R/__pycache__/wsgi.cpython-311.pyc b/Dr_R/__pycache__/wsgi.cpython-311.pyc deleted file mode 100644 index 4d7e2749..00000000 Binary files a/Dr_R/__pycache__/wsgi.cpython-311.pyc and /dev/null differ diff --git a/astros/__pycache__/__init__.cpython-310.pyc b/astros/__pycache__/__init__.cpython-310.pyc deleted file mode 100644 index 4cc6480f..00000000 Binary files a/astros/__pycache__/__init__.cpython-310.pyc and /dev/null differ diff --git a/astros/__pycache__/__init__.cpython-311.pyc b/astros/__pycache__/__init__.cpython-311.pyc deleted file mode 100644 index 1f6884f2..00000000 Binary files a/astros/__pycache__/__init__.cpython-311.pyc and /dev/null differ diff --git a/astros/__pycache__/admin.cpython-310.pyc b/astros/__pycache__/admin.cpython-310.pyc deleted file mode 100644 index 394cd896..00000000 Binary files a/astros/__pycache__/admin.cpython-310.pyc and /dev/null differ diff --git a/astros/__pycache__/admin.cpython-311.pyc b/astros/__pycache__/admin.cpython-311.pyc deleted file mode 100644 index 4d0f106f..00000000 Binary files a/astros/__pycache__/admin.cpython-311.pyc and /dev/null differ diff --git a/astros/__pycache__/apps.cpython-310.pyc b/astros/__pycache__/apps.cpython-310.pyc deleted file mode 100644 index 76f5ee0b..00000000 Binary files a/astros/__pycache__/apps.cpython-310.pyc and /dev/null differ diff --git a/astros/__pycache__/apps.cpython-311.pyc b/astros/__pycache__/apps.cpython-311.pyc deleted file mode 100644 index e2e42a0c..00000000 Binary files a/astros/__pycache__/apps.cpython-311.pyc and /dev/null differ diff --git a/astros/__pycache__/models.cpython-310.pyc b/astros/__pycache__/models.cpython-310.pyc deleted file mode 100644 index 19ccbd1c..00000000 Binary files a/astros/__pycache__/models.cpython-310.pyc and /dev/null differ diff --git a/astros/__pycache__/models.cpython-311.pyc b/astros/__pycache__/models.cpython-311.pyc deleted file mode 100644 index 9c8e64ad..00000000 Binary files a/astros/__pycache__/models.cpython-311.pyc and /dev/null differ diff --git a/astros/__pycache__/tests.cpython-311.pyc b/astros/__pycache__/tests.cpython-311.pyc deleted file mode 100644 index 7b376b3c..00000000 Binary files a/astros/__pycache__/tests.cpython-311.pyc and /dev/null differ diff --git a/astros/__pycache__/urls.cpython-310.pyc b/astros/__pycache__/urls.cpython-310.pyc deleted file mode 100644 index b50c7d9f..00000000 Binary files a/astros/__pycache__/urls.cpython-310.pyc and /dev/null differ diff --git a/astros/__pycache__/urls.cpython-311.pyc b/astros/__pycache__/urls.cpython-311.pyc deleted file mode 100644 index 24c11cb8..00000000 Binary files a/astros/__pycache__/urls.cpython-311.pyc and /dev/null differ diff --git a/astros/__pycache__/views.cpython-310.pyc b/astros/__pycache__/views.cpython-310.pyc deleted file mode 100644 index 215ddf10..00000000 Binary files a/astros/__pycache__/views.cpython-310.pyc and /dev/null differ diff --git a/astros/__pycache__/views.cpython-311.pyc b/astros/__pycache__/views.cpython-311.pyc deleted file mode 100644 index 9d5433a5..00000000 Binary files a/astros/__pycache__/views.cpython-311.pyc and /dev/null differ diff --git a/astros/management/commands/__pycache__/create_question_embeddings.cpython-311.pyc b/astros/management/commands/__pycache__/create_question_embeddings.cpython-311.pyc deleted file mode 100644 index 14fb39a4..00000000 Binary files a/astros/management/commands/__pycache__/create_question_embeddings.cpython-311.pyc and /dev/null differ diff --git a/astros/migrations/__pycache__/__init__.cpython-310.pyc b/astros/migrations/__pycache__/__init__.cpython-310.pyc deleted file mode 100644 index 06920aa8..00000000 Binary files a/astros/migrations/__pycache__/__init__.cpython-310.pyc and /dev/null differ diff --git a/astros/migrations/__pycache__/__init__.cpython-311.pyc b/astros/migrations/__pycache__/__init__.cpython-311.pyc deleted file mode 100644 index 6695b38a..00000000 Binary files a/astros/migrations/__pycache__/__init__.cpython-311.pyc and /dev/null differ diff --git a/astros/templates/astros/all_courses.html b/astros/templates/astros/all_courses.html index 36c3ede9..e77ac589 100644 --- a/astros/templates/astros/all_courses.html +++ b/astros/templates/astros/all_courses.html @@ -23,17 +23,26 @@

All courses

diff --git a/astros/views.py b/astros/views.py index b22b263f..36a9dcf7 100644 --- a/astros/views.py +++ b/astros/views.py @@ -61,7 +61,10 @@ def all_courses(request): @login_required(login_url='astros:login') def course_enroll(request, course_id, code): # Making sure the request is done by a Student. - student = get_object_or_404(Student, pk=request.user.pk) + try: + student = get_object_or_404(Student, pk=request.user.pk) + except: + return HttpResponse(json.dumps({'state':False, 'response': 'LOGIN FIRST'})) course = get_object_or_404(Course, pk = course_id) if not Enrollment.objects.filter(student=student, course=course).exists(): # Checking whether code is valid. diff --git a/db.sqlite3 b/db.sqlite3 deleted file mode 100644 index 45225f8f..00000000 Binary files a/db.sqlite3 and /dev/null differ diff --git a/deimos/__pycache__/__init__.cpython-310.pyc b/deimos/__pycache__/__init__.cpython-310.pyc deleted file mode 100644 index b492c523..00000000 Binary files a/deimos/__pycache__/__init__.cpython-310.pyc and /dev/null differ diff --git a/deimos/__pycache__/__init__.cpython-311.pyc b/deimos/__pycache__/__init__.cpython-311.pyc deleted file mode 100644 index 64c310cc..00000000 Binary files a/deimos/__pycache__/__init__.cpython-311.pyc and /dev/null differ diff --git a/deimos/__pycache__/admin.cpython-310.pyc b/deimos/__pycache__/admin.cpython-310.pyc deleted file mode 100644 index efc97e99..00000000 Binary files a/deimos/__pycache__/admin.cpython-310.pyc and /dev/null differ diff --git a/deimos/__pycache__/admin.cpython-311.pyc b/deimos/__pycache__/admin.cpython-311.pyc deleted file mode 100644 index 13deea47..00000000 Binary files a/deimos/__pycache__/admin.cpython-311.pyc and /dev/null differ diff --git a/deimos/__pycache__/apps.cpython-310.pyc b/deimos/__pycache__/apps.cpython-310.pyc deleted file mode 100644 index 4735de32..00000000 Binary files a/deimos/__pycache__/apps.cpython-310.pyc and /dev/null differ diff --git a/deimos/__pycache__/apps.cpython-311.pyc b/deimos/__pycache__/apps.cpython-311.pyc deleted file mode 100644 index f2299ea5..00000000 Binary files a/deimos/__pycache__/apps.cpython-311.pyc and /dev/null differ diff --git a/deimos/__pycache__/forms.cpython-310.pyc b/deimos/__pycache__/forms.cpython-310.pyc deleted file mode 100644 index 8ddd6777..00000000 Binary files a/deimos/__pycache__/forms.cpython-310.pyc and /dev/null differ diff --git a/deimos/__pycache__/forms.cpython-311.pyc b/deimos/__pycache__/forms.cpython-311.pyc deleted file mode 100644 index 0c2e65f9..00000000 Binary files a/deimos/__pycache__/forms.cpython-311.pyc and /dev/null differ diff --git a/deimos/__pycache__/models.cpython-310.pyc b/deimos/__pycache__/models.cpython-310.pyc deleted file mode 100644 index 3624c4d2..00000000 Binary files a/deimos/__pycache__/models.cpython-310.pyc and /dev/null differ diff --git a/deimos/__pycache__/models.cpython-311.pyc b/deimos/__pycache__/models.cpython-311.pyc deleted file mode 100644 index 3abd23a8..00000000 Binary files a/deimos/__pycache__/models.cpython-311.pyc and /dev/null differ diff --git a/deimos/__pycache__/urls.cpython-310.pyc b/deimos/__pycache__/urls.cpython-310.pyc deleted file mode 100644 index 6e3665d1..00000000 Binary files a/deimos/__pycache__/urls.cpython-310.pyc and /dev/null differ diff --git a/deimos/__pycache__/urls.cpython-311.pyc b/deimos/__pycache__/urls.cpython-311.pyc deleted file mode 100644 index 6c927f84..00000000 Binary files a/deimos/__pycache__/urls.cpython-311.pyc and /dev/null differ diff --git a/deimos/__pycache__/utils.cpython-311.pyc b/deimos/__pycache__/utils.cpython-311.pyc deleted file mode 100644 index 22f52851..00000000 Binary files a/deimos/__pycache__/utils.cpython-311.pyc and /dev/null differ diff --git a/deimos/__pycache__/views.cpython-310.pyc b/deimos/__pycache__/views.cpython-310.pyc deleted file mode 100644 index e884b0f6..00000000 Binary files a/deimos/__pycache__/views.cpython-310.pyc and /dev/null differ diff --git a/deimos/__pycache__/views.cpython-311.pyc b/deimos/__pycache__/views.cpython-311.pyc deleted file mode 100644 index be00902a..00000000 Binary files a/deimos/__pycache__/views.cpython-311.pyc and /dev/null differ diff --git a/deimos/migrations/0022_assignmentstudent_is_complete.py b/deimos/migrations/0022_assignmentstudent_is_complete.py new file mode 100644 index 00000000..b93638a0 --- /dev/null +++ b/deimos/migrations/0022_assignmentstudent_is_complete.py @@ -0,0 +1,18 @@ +# Generated by Django 4.2.3 on 2023-11-13 05:58 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('deimos', '0021_questionstudent_is_complete'), + ] + + operations = [ + migrations.AddField( + model_name='assignmentstudent', + name='is_complete', + field=models.BooleanField(default=False), + ), + ] diff --git a/deimos/migrations/0023_merge_20231119_1639.py b/deimos/migrations/0023_merge_20231119_1639.py new file mode 100644 index 00000000..47ce5874 --- /dev/null +++ b/deimos/migrations/0023_merge_20231119_1639.py @@ -0,0 +1,14 @@ +# Generated by Django 4.2.4 on 2023-11-19 15:39 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('deimos', '0020_remove_practicetestassignment_assignment_and_more'), + ('deimos', '0022_assignmentstudent_is_complete'), + ] + + operations = [ + ] diff --git a/deimos/migrations/__pycache__/0001_initial.cpython-310.pyc b/deimos/migrations/__pycache__/0001_initial.cpython-310.pyc deleted file mode 100644 index 052db1bf..00000000 Binary files a/deimos/migrations/__pycache__/0001_initial.cpython-310.pyc and /dev/null differ diff --git a/deimos/migrations/__pycache__/0001_initial.cpython-311.pyc b/deimos/migrations/__pycache__/0001_initial.cpython-311.pyc deleted file mode 100644 index 5269eccd..00000000 Binary files a/deimos/migrations/__pycache__/0001_initial.cpython-311.pyc and /dev/null differ diff --git a/deimos/migrations/__pycache__/0002_initial.cpython-310.pyc b/deimos/migrations/__pycache__/0002_initial.cpython-310.pyc deleted file mode 100644 index 205419c1..00000000 Binary files a/deimos/migrations/__pycache__/0002_initial.cpython-310.pyc and /dev/null differ diff --git a/deimos/migrations/__pycache__/0002_initial.cpython-311.pyc b/deimos/migrations/__pycache__/0002_initial.cpython-311.pyc deleted file mode 100644 index e223d464..00000000 Binary files a/deimos/migrations/__pycache__/0002_initial.cpython-311.pyc and /dev/null differ diff --git a/deimos/migrations/__pycache__/0003_rename_note_text_note_content_remove_student_notes_and_more.cpython-310.pyc b/deimos/migrations/__pycache__/0003_rename_note_text_note_content_remove_student_notes_and_more.cpython-310.pyc deleted file mode 100644 index fa639a50..00000000 Binary files a/deimos/migrations/__pycache__/0003_rename_note_text_note_content_remove_student_notes_and_more.cpython-310.pyc and /dev/null differ diff --git a/deimos/migrations/__pycache__/0003_rename_note_text_note_content_remove_student_notes_and_more.cpython-311.pyc b/deimos/migrations/__pycache__/0003_rename_note_text_note_content_remove_student_notes_and_more.cpython-311.pyc deleted file mode 100644 index d276c5c2..00000000 Binary files a/deimos/migrations/__pycache__/0003_rename_note_text_note_content_remove_student_notes_and_more.cpython-311.pyc and /dev/null differ diff --git a/deimos/migrations/__pycache__/0004_alter_assignmentstudent_grade_alter_enrollment_grade_and_more.cpython-310.pyc b/deimos/migrations/__pycache__/0004_alter_assignmentstudent_grade_alter_enrollment_grade_and_more.cpython-310.pyc deleted file mode 100644 index e1da19a2..00000000 Binary files a/deimos/migrations/__pycache__/0004_alter_assignmentstudent_grade_alter_enrollment_grade_and_more.cpython-310.pyc and /dev/null differ diff --git a/deimos/migrations/__pycache__/0004_alter_assignmentstudent_grade_alter_enrollment_grade_and_more.cpython-311.pyc b/deimos/migrations/__pycache__/0004_alter_assignmentstudent_grade_alter_enrollment_grade_and_more.cpython-311.pyc deleted file mode 100644 index acc2536f..00000000 Binary files a/deimos/migrations/__pycache__/0004_alter_assignmentstudent_grade_alter_enrollment_grade_and_more.cpython-311.pyc and /dev/null differ diff --git a/deimos/migrations/__pycache__/0005_alter_questionattempt_content.cpython-310.pyc b/deimos/migrations/__pycache__/0005_alter_questionattempt_content.cpython-310.pyc deleted file mode 100644 index ed927c59..00000000 Binary files a/deimos/migrations/__pycache__/0005_alter_questionattempt_content.cpython-310.pyc and /dev/null differ diff --git a/deimos/migrations/__pycache__/0005_alter_questionattempt_content.cpython-311.pyc b/deimos/migrations/__pycache__/0005_alter_questionattempt_content.cpython-311.pyc deleted file mode 100644 index 689365e4..00000000 Binary files a/deimos/migrations/__pycache__/0005_alter_questionattempt_content.cpython-311.pyc and /dev/null differ diff --git a/deimos/migrations/__pycache__/0006_questionattempt_timestamp_questionstudent_success.cpython-310.pyc b/deimos/migrations/__pycache__/0006_questionattempt_timestamp_questionstudent_success.cpython-310.pyc deleted file mode 100644 index b77200fb..00000000 Binary files a/deimos/migrations/__pycache__/0006_questionattempt_timestamp_questionstudent_success.cpython-310.pyc and /dev/null differ diff --git a/deimos/migrations/__pycache__/0006_questionattempt_timestamp_questionstudent_success.cpython-311.pyc b/deimos/migrations/__pycache__/0006_questionattempt_timestamp_questionstudent_success.cpython-311.pyc deleted file mode 100644 index ea538a31..00000000 Binary files a/deimos/migrations/__pycache__/0006_questionattempt_timestamp_questionstudent_success.cpython-311.pyc and /dev/null differ diff --git a/deimos/migrations/__pycache__/0007_rename_is_successful_questionattempt_success.cpython-310.pyc b/deimos/migrations/__pycache__/0007_rename_is_successful_questionattempt_success.cpython-310.pyc deleted file mode 100644 index f6d083ea..00000000 Binary files a/deimos/migrations/__pycache__/0007_rename_is_successful_questionattempt_success.cpython-310.pyc and /dev/null differ diff --git a/deimos/migrations/__pycache__/0007_rename_is_successful_questionattempt_success.cpython-311.pyc b/deimos/migrations/__pycache__/0007_rename_is_successful_questionattempt_success.cpython-311.pyc deleted file mode 100644 index a9626e4e..00000000 Binary files a/deimos/migrations/__pycache__/0007_rename_is_successful_questionattempt_success.cpython-311.pyc and /dev/null differ diff --git a/deimos/migrations/__pycache__/0008_questionstudent_instances_created_and_more.cpython-310.pyc b/deimos/migrations/__pycache__/0008_questionstudent_instances_created_and_more.cpython-310.pyc deleted file mode 100644 index 97efba95..00000000 Binary files a/deimos/migrations/__pycache__/0008_questionstudent_instances_created_and_more.cpython-310.pyc and /dev/null differ diff --git a/deimos/migrations/__pycache__/0008_questionstudent_instances_created_and_more.cpython-311.pyc b/deimos/migrations/__pycache__/0008_questionstudent_instances_created_and_more.cpython-311.pyc deleted file mode 100644 index 9903e75f..00000000 Binary files a/deimos/migrations/__pycache__/0008_questionstudent_instances_created_and_more.cpython-311.pyc and /dev/null differ diff --git a/deimos/migrations/__pycache__/0009_assignmentstudent_due_date.cpython-310.pyc b/deimos/migrations/__pycache__/0009_assignmentstudent_due_date.cpython-310.pyc deleted file mode 100644 index a50a6029..00000000 Binary files a/deimos/migrations/__pycache__/0009_assignmentstudent_due_date.cpython-310.pyc and /dev/null differ diff --git a/deimos/migrations/__pycache__/0009_assignmentstudent_due_date.cpython-311.pyc b/deimos/migrations/__pycache__/0009_assignmentstudent_due_date.cpython-311.pyc deleted file mode 100644 index 6c0ea89a..00000000 Binary files a/deimos/migrations/__pycache__/0009_assignmentstudent_due_date.cpython-311.pyc and /dev/null differ diff --git a/deimos/migrations/__pycache__/0010_questionmodifiedscore.cpython-310.pyc b/deimos/migrations/__pycache__/0010_questionmodifiedscore.cpython-310.pyc deleted file mode 100644 index cd32192f..00000000 Binary files a/deimos/migrations/__pycache__/0010_questionmodifiedscore.cpython-310.pyc and /dev/null differ diff --git a/deimos/migrations/__pycache__/0010_questionmodifiedscore.cpython-311.pyc b/deimos/migrations/__pycache__/0010_questionmodifiedscore.cpython-311.pyc deleted file mode 100644 index b1f744f5..00000000 Binary files a/deimos/migrations/__pycache__/0010_questionmodifiedscore.cpython-311.pyc and /dev/null differ diff --git a/deimos/migrations/__pycache__/0010_remove_note_question_remove_note_student_and_more.cpython-310.pyc b/deimos/migrations/__pycache__/0010_remove_note_question_remove_note_student_and_more.cpython-310.pyc deleted file mode 100644 index 77de6c66..00000000 Binary files a/deimos/migrations/__pycache__/0010_remove_note_question_remove_note_student_and_more.cpython-310.pyc and /dev/null differ diff --git a/deimos/migrations/__pycache__/0010_remove_note_question_remove_note_student_and_more.cpython-311.pyc b/deimos/migrations/__pycache__/0010_remove_note_question_remove_note_student_and_more.cpython-311.pyc deleted file mode 100644 index e47252b9..00000000 Binary files a/deimos/migrations/__pycache__/0010_remove_note_question_remove_note_student_and_more.cpython-311.pyc and /dev/null differ diff --git a/deimos/migrations/__pycache__/0010_remove_noteimage_note_remove_questionnote_question_and_more.cpython-311.pyc b/deimos/migrations/__pycache__/0010_remove_noteimage_note_remove_questionnote_question_and_more.cpython-311.pyc deleted file mode 100644 index 028e88aa..00000000 Binary files a/deimos/migrations/__pycache__/0010_remove_noteimage_note_remove_questionnote_question_and_more.cpython-311.pyc and /dev/null differ diff --git a/deimos/migrations/__pycache__/0011_merge_20231008_1628.cpython-310.pyc b/deimos/migrations/__pycache__/0011_merge_20231008_1628.cpython-310.pyc deleted file mode 100644 index 8391f016..00000000 Binary files a/deimos/migrations/__pycache__/0011_merge_20231008_1628.cpython-310.pyc and /dev/null differ diff --git a/deimos/migrations/__pycache__/0011_merge_20231008_1628.cpython-311.pyc b/deimos/migrations/__pycache__/0011_merge_20231008_1628.cpython-311.pyc deleted file mode 100644 index 23abe093..00000000 Binary files a/deimos/migrations/__pycache__/0011_merge_20231008_1628.cpython-311.pyc and /dev/null differ diff --git a/deimos/migrations/__pycache__/0011_note_noteimage.cpython-311.pyc b/deimos/migrations/__pycache__/0011_note_noteimage.cpython-311.pyc deleted file mode 100644 index 9165551c..00000000 Binary files a/deimos/migrations/__pycache__/0011_note_noteimage.cpython-311.pyc and /dev/null differ diff --git a/deimos/migrations/__pycache__/0012_alter_assignmentstudent_assignment_and_more.cpython-310.pyc b/deimos/migrations/__pycache__/0012_alter_assignmentstudent_assignment_and_more.cpython-310.pyc deleted file mode 100644 index 8644175c..00000000 Binary files a/deimos/migrations/__pycache__/0012_alter_assignmentstudent_assignment_and_more.cpython-310.pyc and /dev/null differ diff --git a/deimos/migrations/__pycache__/0012_alter_assignmentstudent_assignment_and_more.cpython-311.pyc b/deimos/migrations/__pycache__/0012_alter_assignmentstudent_assignment_and_more.cpython-311.pyc deleted file mode 100644 index d78f15b6..00000000 Binary files a/deimos/migrations/__pycache__/0012_alter_assignmentstudent_assignment_and_more.cpython-311.pyc and /dev/null differ diff --git a/deimos/migrations/__pycache__/0013_alter_assignmentstudent_assignment_and_more.cpython-310.pyc b/deimos/migrations/__pycache__/0013_alter_assignmentstudent_assignment_and_more.cpython-310.pyc deleted file mode 100644 index 4bb9a970..00000000 Binary files a/deimos/migrations/__pycache__/0013_alter_assignmentstudent_assignment_and_more.cpython-310.pyc and /dev/null differ diff --git a/deimos/migrations/__pycache__/0013_alter_assignmentstudent_assignment_and_more.cpython-311.pyc b/deimos/migrations/__pycache__/0013_alter_assignmentstudent_assignment_and_more.cpython-311.pyc deleted file mode 100644 index 67dbf533..00000000 Binary files a/deimos/migrations/__pycache__/0013_alter_assignmentstudent_assignment_and_more.cpython-311.pyc and /dev/null differ diff --git a/deimos/migrations/__pycache__/0014_notetemporary.cpython-310.pyc b/deimos/migrations/__pycache__/0014_notetemporary.cpython-310.pyc deleted file mode 100644 index 7ab87374..00000000 Binary files a/deimos/migrations/__pycache__/0014_notetemporary.cpython-310.pyc and /dev/null differ diff --git a/deimos/migrations/__pycache__/0014_notetemporary.cpython-311.pyc b/deimos/migrations/__pycache__/0014_notetemporary.cpython-311.pyc deleted file mode 100644 index 46d6fc14..00000000 Binary files a/deimos/migrations/__pycache__/0014_notetemporary.cpython-311.pyc and /dev/null differ diff --git a/deimos/migrations/__pycache__/0015_questionattempt_submitted_answer.cpython-310.pyc b/deimos/migrations/__pycache__/0015_questionattempt_submitted_answer.cpython-310.pyc deleted file mode 100644 index f4ed0d57..00000000 Binary files a/deimos/migrations/__pycache__/0015_questionattempt_submitted_answer.cpython-310.pyc and /dev/null differ diff --git a/deimos/migrations/__pycache__/0015_questionattempt_submitted_answer.cpython-311.pyc b/deimos/migrations/__pycache__/0015_questionattempt_submitted_answer.cpython-311.pyc deleted file mode 100644 index 25825c47..00000000 Binary files a/deimos/migrations/__pycache__/0015_questionattempt_submitted_answer.cpython-311.pyc and /dev/null differ diff --git a/deimos/migrations/__pycache__/0016_questionattempt_submitted_units_and_more.cpython-310.pyc b/deimos/migrations/__pycache__/0016_questionattempt_submitted_units_and_more.cpython-310.pyc deleted file mode 100644 index c3ad1a78..00000000 Binary files a/deimos/migrations/__pycache__/0016_questionattempt_submitted_units_and_more.cpython-310.pyc and /dev/null differ diff --git a/deimos/migrations/__pycache__/0016_questionattempt_submitted_units_and_more.cpython-311.pyc b/deimos/migrations/__pycache__/0016_questionattempt_submitted_units_and_more.cpython-311.pyc deleted file mode 100644 index 981c7c80..00000000 Binary files a/deimos/migrations/__pycache__/0016_questionattempt_submitted_units_and_more.cpython-311.pyc and /dev/null differ diff --git a/deimos/migrations/__pycache__/0017_questionstudent_num_units_attempts.cpython-310.pyc b/deimos/migrations/__pycache__/0017_questionstudent_num_units_attempts.cpython-310.pyc deleted file mode 100644 index 4db6e15b..00000000 Binary files a/deimos/migrations/__pycache__/0017_questionstudent_num_units_attempts.cpython-310.pyc and /dev/null differ diff --git a/deimos/migrations/__pycache__/0017_questionstudent_num_units_attempts.cpython-311.pyc b/deimos/migrations/__pycache__/0017_questionstudent_num_units_attempts.cpython-311.pyc deleted file mode 100644 index 466ec2fc..00000000 Binary files a/deimos/migrations/__pycache__/0017_questionstudent_num_units_attempts.cpython-311.pyc and /dev/null differ diff --git a/deimos/migrations/__pycache__/0018_alter_questionattempt_submitted_answer_and_more.cpython-310.pyc b/deimos/migrations/__pycache__/0018_alter_questionattempt_submitted_answer_and_more.cpython-310.pyc deleted file mode 100644 index 9cb4fed5..00000000 Binary files a/deimos/migrations/__pycache__/0018_alter_questionattempt_submitted_answer_and_more.cpython-310.pyc and /dev/null differ diff --git a/deimos/migrations/__pycache__/0018_alter_questionattempt_submitted_answer_and_more.cpython-311.pyc b/deimos/migrations/__pycache__/0018_alter_questionattempt_submitted_answer_and_more.cpython-311.pyc deleted file mode 100644 index 7e7f0240..00000000 Binary files a/deimos/migrations/__pycache__/0018_alter_questionattempt_submitted_answer_and_more.cpython-311.pyc and /dev/null differ diff --git a/deimos/migrations/__pycache__/0019_note_title_notetemporary_title.cpython-311.pyc b/deimos/migrations/__pycache__/0019_note_title_notetemporary_title.cpython-311.pyc deleted file mode 100644 index d938d521..00000000 Binary files a/deimos/migrations/__pycache__/0019_note_title_notetemporary_title.cpython-311.pyc and /dev/null differ diff --git a/deimos/migrations/__pycache__/0019_practicetestassignment.cpython-310.pyc b/deimos/migrations/__pycache__/0019_practicetestassignment.cpython-310.pyc index e29268c3..602c8eee 100644 Binary files a/deimos/migrations/__pycache__/0019_practicetestassignment.cpython-310.pyc and b/deimos/migrations/__pycache__/0019_practicetestassignment.cpython-310.pyc differ diff --git a/deimos/migrations/__pycache__/0020_alter_questionstudent_num_units_attempts.cpython-311.pyc b/deimos/migrations/__pycache__/0020_alter_questionstudent_num_units_attempts.cpython-311.pyc deleted file mode 100644 index ee9c189c..00000000 Binary files a/deimos/migrations/__pycache__/0020_alter_questionstudent_num_units_attempts.cpython-311.pyc and /dev/null differ diff --git a/deimos/migrations/__pycache__/0020_remove_practicetestassignment_assignment_and_more.cpython-310.pyc b/deimos/migrations/__pycache__/0020_remove_practicetestassignment_assignment_and_more.cpython-310.pyc index f3d20fac..c6abdb83 100644 Binary files a/deimos/migrations/__pycache__/0020_remove_practicetestassignment_assignment_and_more.cpython-310.pyc and b/deimos/migrations/__pycache__/0020_remove_practicetestassignment_assignment_and_more.cpython-310.pyc differ diff --git a/deimos/migrations/__pycache__/0021_questionstudent_is_complete.cpython-311.pyc b/deimos/migrations/__pycache__/0021_questionstudent_is_complete.cpython-311.pyc deleted file mode 100644 index 74dfbff1..00000000 Binary files a/deimos/migrations/__pycache__/0021_questionstudent_is_complete.cpython-311.pyc and /dev/null differ diff --git a/deimos/migrations/__pycache__/__init__.cpython-310.pyc b/deimos/migrations/__pycache__/__init__.cpython-310.pyc deleted file mode 100644 index 6c953127..00000000 Binary files a/deimos/migrations/__pycache__/__init__.cpython-310.pyc and /dev/null differ diff --git a/deimos/migrations/__pycache__/__init__.cpython-311.pyc b/deimos/migrations/__pycache__/__init__.cpython-311.pyc deleted file mode 100644 index 205ab9ab..00000000 Binary files a/deimos/migrations/__pycache__/__init__.cpython-311.pyc and /dev/null differ diff --git a/deimos/models.py b/deimos/models.py index ad18acdf..7994899d 100644 --- a/deimos/models.py +++ b/deimos/models.py @@ -74,6 +74,7 @@ class AssignmentStudent(models.Model): assignment = models.ForeignKey(Assignment, on_delete=models.CASCADE) grade = models.FloatField(validators=[MaxValueValidator(100)], default=0, null=True) due_date = models.DateTimeField(null=True, blank=True) + is_complete = models.BooleanField(default=False) def get_grade(self): """ @@ -101,6 +102,10 @@ def get_grade(self): self.grade = 0 self.assignment.num_points = total return self.grade + + def get_status(self): + return self.is_complete + def save(self, *args, **kwargs): if not self.due_date: self.due_date = self.assignment.due_date @@ -118,6 +123,12 @@ class QuestionStudent(models.Model): instances_created = models.BooleanField(default=False) num_units_attempts = models.IntegerField(default=0, null=True, blank=True, validators=[MinValueValidator(0)]) is_complete = models.BooleanField(default=False) + + def save(self, *args, **kwargs): + if self.success == True: + self.is_complete = True + super(QuestionStudent, self).save(*args, **kwargs) + def create_instances(self): """ Get variable instances from the variables associated to the question. @@ -254,11 +265,9 @@ def get_status(self): Otherwise False """ parent_question = self.question.parent_question if self.question.parent_question else self.question - question_students = QuestionStudent.objects.filter(question__parent_question=parent_question) - for qs in question_students: - if not qs.is_complete: - return False - return True + children_complete = not QuestionStudent.objects.filter(question__parent_question=parent_question, student=self.student, is_complete=False).exists() + parent_qs = QuestionStudent.objects.get(question=parent_question, student=self.student) + return parent_qs.is_complete and children_complete def get_potential(self, no_unit = False): """ diff --git a/deimos/static/deimos/css/style.css b/deimos/static/deimos/css/style.css index 5f3734ef..3a0a70e2 100644 --- a/deimos/static/deimos/css/style.css +++ b/deimos/static/deimos/css/style.css @@ -428,7 +428,17 @@ div.image-container img.course-image { } +.edit-btn { + background-color: rgba(23, 137, 252, 1) !important; + transition: background-color 0.2s !important; + color: rgba(0,0,0,0.95) !important; + font-weight:400 !important; + font-family: 'Aileron', sans-serif; +} +.edit-btn:hover { + background-color: rgba(23, 137, 252, 0.7) !important; +} /* ------------------------------Style for answer_question.html-------------*/ .formatted-mp { @@ -727,6 +737,8 @@ more than assignment display */ .original-size { font-size: initial; + width: auto; + height: auto; } @keyframes blink { 0%, 100% { diff --git a/deimos/templates/deimos/answer_question.html b/deimos/templates/deimos/answer_question.html index 00f0faf2..5772f2d2 100644 --- a/deimos/templates/deimos/answer_question.html +++ b/deimos/templates/deimos/answer_question.html @@ -230,9 +230,9 @@

Question {{question_dict.question.number}}

{% elif question_dict.questtype == 'mp' %} {% if not question_dict.question_student.success %} -
Match the following pairs
+
Match the following pairs
{% else %} -
You correctly matched the pairs.
+
You correctly matched the pairs.
{% endif %}
diff --git a/deimos/templates/deimos/assignment_display.html b/deimos/templates/deimos/assignment_display.html index 7143a072..dee6ba24 100644 --- a/deimos/templates/deimos/assignment_display.html +++ b/deimos/templates/deimos/assignment_display.html @@ -1,17 +1,24 @@ +{% load my_custom_tags %}
  • {{assignment.name | safe}} - + {% if assignment.assigned_date %} -

    Assigned on {{ assignment.assigned_date|date:"m/d/Y" }}

    +

    Assigned on {{ assignment.assigned_date|format_date }}

    {% endif %} {% if assignment.due_date %} -

    Due on {{ assignment.due_date|date:"m/d/Y" }}

    +

    Due on {{ assignment.due_date|format_date }}

    {% endif %}
    + {% if status %} + + {% endif %}
    +
  • \ No newline at end of file diff --git a/deimos/templates/deimos/assignment_management.html b/deimos/templates/deimos/assignment_management.html index f5457122..b8955025 100644 --- a/deimos/templates/deimos/assignment_management.html +++ b/deimos/templates/deimos/assignment_management.html @@ -16,7 +16,6 @@ {% endif %}
    -<<<<<<< HEAD