feat: progress page

This commit is contained in:
Jannat Patel
2022-11-15 18:56:45 +05:30
parent d9e44e0f91
commit ae2c15fe8c
13 changed files with 240 additions and 48 deletions

View File

@@ -1,8 +1,18 @@
import frappe
from lms.lms.utils import has_course_moderator_role
from frappe import _
def get_context(context):
context.no_cache = 1
if not has_course_moderator_role():
message = "Only Moderators have access to this page."
if frappe.session.user == "Guest":
message = "Please login to access this page."
raise frappe.PermissionError(_(message))
class_name = frappe.form_dict["classname"]
context.class_info = frappe.db.get_value("LMS Class", class_name, ["name", "title", "start_date", "end_date", "description"], as_dict=True)
@@ -14,4 +24,4 @@ def get_context(context):
context.class_students = frappe.get_all("Class Student", {
"parent": class_name
}, ["student", "student_name"])
}, ["student", "student_name", "username"])