From 91bf28d731d308f12f84aab7070e146ddae3b34a Mon Sep 17 00:00:00 2001 From: Brandon Lee Date: Fri, 2 Jul 2021 18:11:39 -0500 Subject: [PATCH] added delete button for assignments on assignment details page --- README.md | 25 +++++++++--------- db.sqlite3 | Bin 196608 -> 196608 bytes forum/__pycache__/urls.cpython-39.pyc | Bin 934 -> 1010 bytes forum/__pycache__/views.cpython-39.pyc | Bin 9095 -> 9395 bytes .../templates/assignmentdetails_teacher.html | 24 ++++++++++++----- forum/urls.py | 1 + forum/views.py | 11 +++++++- 7 files changed, 42 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index cd5e8e7..aec8167 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,13 @@ A free, open-source learning management system (LMS) build on Django and deployed on Heroku. ## Dev Notes -* 6/19/2021 (v.0.1.1): Patch refining existing features: +* 7/2/2021 (v0.1.2): Minor UI additions patch: + * Now use an iframe to display GitHub readme on home pages + * Added "report an issue" button to page footer + * Added social media sharing buttons to page footer + * Now display cumulative grade on student assignments overview + * Added delete button for assignments on assignment details page +* 6/19/2021 (v0.1.1): Patch refining existing features: * Used CloudFlare proxy for HTTPS protocol to get website working on secure browsers (still unsafe due to half of protocol being unsecure) * Clicking on students on the Students page for teachers now shows a tabular summary of the student assignments. * Assignment page for students and teachers has been switched from a simple list of assignment names to a tabular summary of grades and submissions. @@ -13,22 +19,17 @@ A free, open-source learning management system (LMS) build on Django and deploye * Creating assignments as a teacher and grading student submissions. * Submitting text submissions to assignments as a student and viewing the grades once available. -## Priority Backlog (Next Patch) -- [X] Use an iframe to display readme on home pages -- [X] Add "report an issue" button -- [X] Add social media sharing buttons -- [X] Display cumulative grade on student assignments overview -- [ ] Email notifications for assignment updates -- [ ] Delete option for assignments +## Priority Backlog (Next Patch - v0.1.3) +- [X] "Unsaved changes" confirmation dialogue before leaving form pages +- [X] Show assignment details on new submission form +- [X] File attachment uploading for assignments and submissions ## Backlog -* "Unsaved changes" confirmation dialogue before leaving form pages -* Show assignment details on new submission form -* File uploads for assignments and submissions +* Email notifications for assignment updates * Status tags instead of unread/read formatting for assignments * Feature voting * Non-assignment pages -* Actual SSL certification +* Full SSL certification * Switch session course tracking method from cookies to request kwargs * Render readme iframe as formatted HTML * A breadcrumbs navigation bar diff --git a/db.sqlite3 b/db.sqlite3 index 45a13c97d2ed0d099f08dc99033501a6879fbeca..9ffa6f62194394bd4fb00591845ae5ede8caa9b1 100644 GIT binary patch delta 672 zcmaiy%WD%+6vl6^ePC^R+G5?PnC=9baA%Ut+=OoOve?Ju(WW)o)I6rmOdiuD4S8%D zDu~M}NZg43LM3RxO`)rrMHeE13oW#(1VXJ?yHM0y?Z%a7bvVECeIFc7tu|Pz4Q^gF z>^-{XHtfB)r|TdH4jXY;iCK^cFOkM4{idmJ7Y*$iHyh)o2gb(ZXM$lJAp_d58G2{$ zSDedgichD@#biR$G?JmkvXF~avr$Q>xvG$fo0X~Zf|eq_m5MVQ^ewrIs&^$PyV7=> z=%Ri;5DSx(K3&WtM4FK^84DF6icMW`TjX##HnlL5@h0QRVDzq~R8sxfl+Ec`x2W*~ zoukt9qFV_DQ*+8%yr6k0XDKYLWG5GA6LwEP3oM2?F;uZ8Wqm%t$x%|0!x3%Otp}p^ zHJ&WbE20uAkjiQzp4TI;fK()feAQaYhp3yT{Oi&K3xq~(~c0Kv63e? z!OggCSDhB?q%^JG2`RoTtt7n(ndYJ?Pb4=N4te}x`4>23bHfw2kT2f6@V1gG!? zy3lQm)ILJJ>%%a5CNsh@!#fBL;4SPlhy3{Pj~bdMOBnovECVs}gzb(uMphp}{pmJ# zocWvU@3---zxEvj-{3QJpu>J+;$m~=4c_XzeC9s@-=X1Jv95cyx^6 iUTlPY##@N7chG_s%Xkg-))5}-fm1ZlJUqhJhkpYvpwgxQ delta 668 zcmaiy%}>*C7{}Wm6&NxeFycjx<7T2I?QiyF3zu%tp)fngHU^is z?yT&|%dxayoG)typDHoRob8#yzL`Bq)uS5?X=28=IXO8P!I@B|RUflU$JvS%VotRA(hGYm|i<-OCjxi$igKAe)p% zc-ov(<39Iv#Ewp+HFa9E5&=6nmGsk*^n@P83}$IYpjqB^TB_U23H=_y?Wz5GwGFQS zHMg|#c7;4pF8y=L;SPczNH}@Zh7RF;ON+yCHaM=gb)z3ZQ7xpS{`(q2E@&=Nut&fN z9Km(IEF*mhelKV8LEvf nbfNb&A9BJ`Guj3LThM@yu+en9gX+dU>ZRJ7j{43%y4w8*h;}{Z6;aCl+>KmlGIy*5IR1wxHvOCFE=%>WO6K1BBRjc{Y;vfTlAjbiSi}y{`-pQ5D9VL(=6U?9~yYWu} yn3+I+FXR&0l)-YtTEnrV!TF98f+{?ItVuVCs3Rro4LrYgeirwnK785 zgbS=1qKbPV10w@ah6N;}$?8|612ncs0YoT*hzcN~$y1~PV(Wqk=E)BQbp+T_Qgc#E zQZ<>2v_OJslLI)#O>YT8MB@{Si!;;na#Qn4co>0>UVB`QoDMlV3Da2S*0~FC@ j^7GSF->j;{!pL0-G6m$-qMFJ2%4&=Tlf#q^nK%Rhqg6?C delta 111 zcmdn&+3wDl$ji&c00c$#_Y&qBPUMqe6qu;}OP>D?F$4fpL>s#R diff --git a/forum/templates/assignmentdetails_teacher.html b/forum/templates/assignmentdetails_teacher.html index 377649f..5a74f4f 100644 --- a/forum/templates/assignmentdetails_teacher.html +++ b/forum/templates/assignmentdetails_teacher.html @@ -4,12 +4,24 @@ {% block content %}
{% csrf_token %} -

Assignment:

-

- Start date:
- End date:
- Total points:
-

+
+
+

Assignment:

+

+ Start date:
+ End date:
+ Total points:
+

+
+
Delete assignment
+ +

Description:


diff --git a/forum/urls.py b/forum/urls.py index 826de4a..67cf332 100644 --- a/forum/urls.py +++ b/forum/urls.py @@ -14,5 +14,6 @@ path('assignments/newassignment', views.newassignment, name='newassignment'), path('assignments/', views.assignmentdetails, name='assignmentdetails'), path('assignments//submit', views.newsubmission, name='newsubmission'), + path('assignments//delete', views.delete_assignment, name='delete_assignment'), path('assignments/submissions/assignment_id=/student_id=', views.viewsubmission, name='viewsubmission'), ] diff --git a/forum/views.py b/forum/views.py index 7540cce..4d16256 100644 --- a/forum/views.py +++ b/forum/views.py @@ -263,4 +263,13 @@ def studentgrades(request, student_id): context["student"] = student return render(request, "studentgrades.html", context) else: - return redirect('home') \ No newline at end of file + return redirect('home') + +def delete_assignment(request, assignment_id): + if not request.user.is_authenticated: + return redirect('home') + course = Course.objects.filter(id=request.session.get('selected_course_id')).first() + if (course.owner != request.user): + return redirect('home') + Assignment.objects.filter(id=assignment_id).delete() + return redirect('forum:assignments') \ No newline at end of file