diff --git a/lms/public/css/style.css b/lms/public/css/style.css
index 6b7f6baa..30299073 100644
--- a/lms/public/css/style.css
+++ b/lms/public/css/style.css
@@ -75,7 +75,7 @@ body {
.field-label {
color: var(--gray-900);
- font-weight: 600;
+ font-weight: 500;
}
.field-input {
@@ -117,7 +117,7 @@ body {
.image-preview {
width: 100%;
height: 100%;
- border: none;
+ border-radius: var(--border-radius-md);
}
.file-source-preview {
@@ -1913,15 +1913,9 @@ li {
.modal-footer {
padding: 0.75rem 1.5rem !important;
- border-top: none !important;
- background-color: var(--gray-50) !important;
justify-content: flex-end !important;
}
-.modal-footer .btn:first-child {
- margin-right: 0.5rem;
-}
-
.modal-header .modal-title {
color: var(--gray-900);
line-height: 1.5rem;
diff --git a/lms/www/assignment_submission/assignment_submission.html b/lms/www/assignment_submission/assignment_submission.html
index d6f51016..a1278bd9 100644
--- a/lms/www/assignment_submission/assignment_submission.html
+++ b/lms/www/assignment_submission/assignment_submission.html
@@ -44,29 +44,38 @@
- {{ _("Question")}}
+ {{ _("Student") }}
+ {{ submission.member_name }}
+
+
+
+
{{ assignment.question }}
- {{ _("Submit your assignment")}}
+ {{ _("Submit")}}
+
+
+ {{ _("Upload assignment as {0}").format(assignment.type) }}
- {% if submission.status == "Not Graded" %}
+ {% if submission.status == "Not Graded" and submission.member == frappe.session.user %}
{{ _("Clear") }}
{% endif %}
- {{ _("Upload a {0}").format(assignment.type) }}
+ {{ _("Browse").format(assignment.type) }}
-
{% endmacro %}
\ No newline at end of file
diff --git a/lms/www/assignment_submission/assignment_submission.py b/lms/www/assignment_submission/assignment_submission.py
index 186b7df5..55a16f94 100644
--- a/lms/www/assignment_submission/assignment_submission.py
+++ b/lms/www/assignment_submission/assignment_submission.py
@@ -1,11 +1,14 @@
import frappe
from frappe import _
+from lms.lms.utils import has_course_moderator_role
def get_context(context):
context.no_cache = 1
+ context.is_moderator = has_course_moderator_role()
submission = frappe.form_dict["submission"]
assignment = frappe.form_dict["assignment"]
+
context.assignment = frappe.db.get_value(
"LMS Assignment", assignment, ["title", "name", "type", "question"], as_dict=1
)
@@ -16,9 +19,11 @@ def get_context(context):
context.submission = frappe.db.get_value(
"LMS Assignment Submission",
submission,
- ["name", "assignment_attachment", "comments", "status"],
+ ["name", "assignment_attachment", "comments", "status", "member", "member_name"],
as_dict=True,
)
+ if not context.is_moderator and frappe.session.user != context.submission.member:
+ raise frappe.PermissionError(_("You don't have permission to access this page."))
if not context.assignment or not context.submission:
raise frappe.PermissionError(_("Invalid Submission URL"))
diff --git a/lms/www/assignments/assignment.html b/lms/www/assignments/assignment.html
index cf2d0135..ee9a66a8 100644
--- a/lms/www/assignments/assignment.html
+++ b/lms/www/assignments/assignment.html
@@ -58,7 +58,7 @@
- {% if class_students | length and (is_moderator or is_student) %}
+ {% if is_moderator %}
{{ AssessmentsSection(class_info) }}
+ {% endif %}
+ {% if class_students | length and (is_moderator or is_student) %}
{{ LiveClassSection(class_info, live_classes) }}
@@ -154,9 +158,9 @@
{% for course in class_courses %}
-
+
{% if is_moderator %}
@@ -251,15 +255,29 @@
-
- {{ _("Please select the assignments you wish to include for the assessment of this class. Your selections will be automatically saved upon clicking. If you decide to remove an item from the list, simply uncheck it.") }}
-
-