feat: class evaluators
This commit is contained in:
@@ -52,6 +52,7 @@ def before_uninstall():
|
||||
def create_lms_roles():
|
||||
create_course_creator_role()
|
||||
create_moderator_role()
|
||||
create_evaluator_role()
|
||||
|
||||
|
||||
def delete_lms_roles():
|
||||
@@ -91,6 +92,19 @@ def create_moderator_role():
|
||||
role.save(ignore_permissions=True)
|
||||
|
||||
|
||||
def create_evaluator_role():
|
||||
if not frappe.db.exists("Role", "Class Evaluator"):
|
||||
role = frappe.new_doc("Role")
|
||||
role.update(
|
||||
{
|
||||
"role_name": "Class Evaluator",
|
||||
"home_page": "",
|
||||
"desk_access": 0,
|
||||
}
|
||||
)
|
||||
role.save(ignore_permissions=True)
|
||||
|
||||
|
||||
def delete_custom_fields():
|
||||
fields = [
|
||||
"user_category",
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"course",
|
||||
"title"
|
||||
"title",
|
||||
"evaluator"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
@@ -23,14 +24,20 @@
|
||||
"fieldname": "title",
|
||||
"fieldtype": "Data",
|
||||
"in_list_view": 1,
|
||||
"label": "Title",
|
||||
"label": "Course Title",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "evaluator",
|
||||
"fieldtype": "Link",
|
||||
"label": "Evaluator",
|
||||
"options": "Course Evaluator"
|
||||
}
|
||||
],
|
||||
"index_web_pages_for_search": 1,
|
||||
"istable": 1,
|
||||
"links": [],
|
||||
"modified": "2022-11-11 15:51:45.560864",
|
||||
"modified": "2023-07-13 14:21:49.953345",
|
||||
"modified_by": "Administrator",
|
||||
"module": "LMS",
|
||||
"name": "Class Course",
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
],
|
||||
"index_web_pages_for_search": 1,
|
||||
"links": [],
|
||||
"modified": "2022-04-01 15:14:03.300260",
|
||||
"modified": "2023-07-13 11:30:22.641076",
|
||||
"modified_by": "Administrator",
|
||||
"module": "LMS",
|
||||
"name": "Course Evaluator",
|
||||
@@ -45,6 +45,30 @@
|
||||
"role": "System Manager",
|
||||
"share": 1,
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "Moderator",
|
||||
"share": 1,
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "Class Evaluator",
|
||||
"share": 1,
|
||||
"write": 1
|
||||
}
|
||||
],
|
||||
"sort_field": "modified",
|
||||
|
||||
@@ -42,6 +42,7 @@ def get_schedule(course, date):
|
||||
"Evaluator Schedule",
|
||||
filters={"parent": evaluator},
|
||||
fields=["day", "start_time", "end_time"],
|
||||
order_by="start_time",
|
||||
)
|
||||
booked_slots = frappe.get_all(
|
||||
"LMS Certificate Request",
|
||||
|
||||
@@ -104,7 +104,7 @@
|
||||
],
|
||||
"index_web_pages_for_search": 1,
|
||||
"links": [],
|
||||
"modified": "2023-02-22 16:00:34.361934",
|
||||
"modified": "2023-07-13 11:30:53.432076",
|
||||
"modified_by": "Administrator",
|
||||
"module": "LMS",
|
||||
"name": "LMS Certificate Evaluation",
|
||||
@@ -121,6 +121,18 @@
|
||||
"role": "System Manager",
|
||||
"share": 1,
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "Class Evaluator",
|
||||
"share": 1,
|
||||
"write": 1
|
||||
}
|
||||
],
|
||||
"sort_field": "modified",
|
||||
|
||||
@@ -93,7 +93,7 @@
|
||||
],
|
||||
"index_web_pages_for_search": 1,
|
||||
"links": [],
|
||||
"modified": "2023-02-28 19:53:17.534351",
|
||||
"modified": "2023-07-13 11:30:41.740461",
|
||||
"modified_by": "Administrator",
|
||||
"module": "LMS",
|
||||
"name": "LMS Certificate Request",
|
||||
@@ -111,6 +111,18 @@
|
||||
"select": 1,
|
||||
"share": 1,
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "Class Evaluator",
|
||||
"share": 1,
|
||||
"write": 1
|
||||
}
|
||||
],
|
||||
"sort_field": "modified",
|
||||
|
||||
@@ -138,7 +138,7 @@
|
||||
],
|
||||
"index_web_pages_for_search": 1,
|
||||
"links": [],
|
||||
"modified": "2023-06-22 15:57:25.190084",
|
||||
"modified": "2023-07-13 11:30:09.097605",
|
||||
"modified_by": "Administrator",
|
||||
"module": "LMS",
|
||||
"name": "LMS Class",
|
||||
@@ -168,6 +168,18 @@
|
||||
"role": "Moderator",
|
||||
"share": 1,
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "Class Evaluator",
|
||||
"share": 1,
|
||||
"write": 1
|
||||
}
|
||||
],
|
||||
"sort_field": "modified",
|
||||
|
||||
@@ -56,3 +56,8 @@ lms.patches.v0_0.convert_course_description_to_html #11-05-2023
|
||||
lms.patches.v1_0.rename_assignment_doctype
|
||||
execute:frappe.permissions.reset_perms("LMS Assignment")
|
||||
execute:frappe.permissions.reset_perms("LMS Quiz")
|
||||
lms.patches.v1_0.create_class_evaluator_role
|
||||
execute:frappe.permissions.reset_perms("LMS Class")
|
||||
execute:frappe.permissions.reset_perms("Course Evaluator")
|
||||
execute:frappe.permissions.reset_perms("LMS Certificate Request")
|
||||
execute:frappe.permissions.reset_perms("LMS Certificate Evaluation")
|
||||
5
lms/patches/v1_0/create_class_evaluator_role.py
Normal file
5
lms/patches/v1_0/create_class_evaluator_role.py
Normal file
@@ -0,0 +1,5 @@
|
||||
from lms.install import create_evaluator_role
|
||||
|
||||
|
||||
def execute():
|
||||
create_evaluator_role()
|
||||
@@ -180,7 +180,7 @@
|
||||
{% if class_courses | length %}
|
||||
<div class="cards-parent">
|
||||
{% for course in class_courses %}
|
||||
<div>
|
||||
<div class="h-100">
|
||||
{{ widgets.CourseCard(course=course, read_only=False) }}
|
||||
<button class="btn icon-btn btn-default btn-block btn-remove-course" data-course="{{ course.name }}">
|
||||
<svg class="icon icon-sm">
|
||||
|
||||
@@ -301,6 +301,14 @@ const show_course_modal = () => {
|
||||
fieldname: "course",
|
||||
reqd: 1,
|
||||
},
|
||||
{
|
||||
fieldtype: "Link",
|
||||
options: "Course Evaluator",
|
||||
label: __("Evaluator"),
|
||||
fieldname: "evaluator",
|
||||
fetch_from: "course.evaluator",
|
||||
reqd: 1,
|
||||
},
|
||||
],
|
||||
primary_action_label: __("Add"),
|
||||
primary_action(values) {
|
||||
@@ -310,7 +318,7 @@ const show_course_modal = () => {
|
||||
});
|
||||
course_modal.show();
|
||||
setTimeout(() => {
|
||||
$(".modal-body").css("min-height", "200px");
|
||||
$(".modal-body").css("min-height", "300px");
|
||||
}, 1000);
|
||||
};
|
||||
|
||||
@@ -321,6 +329,7 @@ const add_course = (values) => {
|
||||
doc: {
|
||||
doctype: "Class Course",
|
||||
course: values.course,
|
||||
evaluator: values.evaluator,
|
||||
parenttype: "LMS Class",
|
||||
parentfield: "courses",
|
||||
parent: $(".class-details").data("class"),
|
||||
|
||||
Reference in New Issue
Block a user