feat: assignment submission and ui

This commit is contained in:
Jannat Patel
2022-11-18 17:05:38 +05:30
parent a4ec058a81
commit 74210245cf
25 changed files with 284 additions and 134 deletions

View File

@@ -1,7 +1,6 @@
import frappe
from lms.lms.utils import has_course_moderator_role
from frappe import _
from lms.lms.utils import has_course_moderator_role
def get_context(context):
@@ -16,13 +15,20 @@ def get_context(context):
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)
context.published_courses = frappe.get_all("LMS Course", {"published": 1}, ["name", "title"])
context.class_info = frappe.db.get_value(
"LMS Class",
class_name,
["name", "title", "start_date", "end_date", "description"],
as_dict=True,
)
context.published_courses = frappe.get_all(
"LMS Course", {"published": 1}, ["name", "title"]
)
context.class_courses = frappe.get_all("Class Course", {
"parent": class_name
}, pluck="course")
context.class_courses = frappe.get_all(
"Class Course", {"parent": class_name}, pluck="course"
)
context.class_students = frappe.get_all("Class Student", {
"parent": class_name
}, ["student", "student_name", "username"])
context.class_students = frappe.get_all(
"Class Student", {"parent": class_name}, ["student", "student_name", "username"]
)