Rename Assessment to Assessment Plan
This commit is contained in:
parent
233ecfdd9c
commit
a56224c03a
@ -229,12 +229,12 @@ def get_data():
|
|||||||
"type": "list"
|
"type": "list"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"module_name": "Assessment",
|
"module_name": "Assessment Plan",
|
||||||
"color": "#8a70be",
|
"color": "#8a70be",
|
||||||
"icon": "fa fa-file-text-alt",
|
"icon": "fa fa-file-text-alt",
|
||||||
"label": _("Assessment"),
|
"label": _("Assessment Plan"),
|
||||||
"link": "List/Assessment",
|
"link": "List/Assessment Plan",
|
||||||
"_doctype": "Assessment",
|
"_doctype": "Assessment Plan",
|
||||||
"type": "list"
|
"type": "list"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -112,7 +112,7 @@ def get_data():
|
|||||||
"items": [
|
"items": [
|
||||||
{
|
{
|
||||||
"type": "doctype",
|
"type": "doctype",
|
||||||
"name": "Assessment"
|
"name": "Assessment Plan"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "doctype",
|
"type": "doctype",
|
||||||
|
@ -108,7 +108,6 @@ portal_menu_items = [
|
|||||||
{"title": _("Issues"), "route": "/issues", "reference_doctype": "Issue", "role":"Customer"},
|
{"title": _("Issues"), "route": "/issues", "reference_doctype": "Issue", "role":"Customer"},
|
||||||
{"title": _("Addresses"), "route": "/addresses", "reference_doctype": "Address"},
|
{"title": _("Addresses"), "route": "/addresses", "reference_doctype": "Address"},
|
||||||
{"title": _("Announcements"), "route": "/announcement", "reference_doctype": "Announcement"},
|
{"title": _("Announcements"), "route": "/announcement", "reference_doctype": "Announcement"},
|
||||||
{"title": _("Assessment Schedule"), "route": "/assessment", "reference_doctype": "Assessment", "role":"Student"},
|
|
||||||
{"title": _("Fees"), "route": "/fees", "reference_doctype": "Fees", "role":"Student"}
|
{"title": _("Fees"), "route": "/fees", "reference_doctype": "Fees", "role":"Student"}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -9,18 +9,20 @@ def execute():
|
|||||||
frappe.reload_doc("schools", "doctype", "grading_scale_interval")
|
frappe.reload_doc("schools", "doctype", "grading_scale_interval")
|
||||||
rename_field("Grading Scale Interval", "to_score", "threshold")
|
rename_field("Grading Scale Interval", "to_score", "threshold")
|
||||||
|
|
||||||
|
frappe.rename_doc("DocType", "Assessment", "Assessment Plan", force=True)
|
||||||
|
|
||||||
#Rename Assessment Results
|
#Rename Assessment Results
|
||||||
frappe.reload_doc("schools", "doctype", "assessment")
|
frappe.reload_doc("schools", "doctype", "assessment_plan")
|
||||||
rename_field("Assessment", "grading_structure", "grading_scale")
|
rename_field("Assessment Plan", "grading_structure", "grading_scale")
|
||||||
|
|
||||||
frappe.reload_doc("schools", "doctype", "assessment_result")
|
frappe.reload_doc("schools", "doctype", "assessment_result")
|
||||||
for assessment in frappe.get_all("Assessment", fields=["name", "grading_scale"]):
|
for assessment in frappe.get_all("Assessment Plan", fields=["name", "grading_scale"]):
|
||||||
for stud_result in frappe.db.sql("select * from `tabAssessment Result` where parent= %s", assessment.name, as_dict=True):
|
for stud_result in frappe.db.sql("select * from `tabAssessment Result` where parent= %s", assessment.name, as_dict=True):
|
||||||
if stud_result.result:
|
if stud_result.result:
|
||||||
assessment_result = frappe.new_doc("Assessment Result")
|
assessment_result = frappe.new_doc("Assessment Result")
|
||||||
assessment_result.student = stud_result.student
|
assessment_result.student = stud_result.student
|
||||||
assessment_result.student_name = stud_result.student_name
|
assessment_result.student_name = stud_result.student_name
|
||||||
assessment_result.assessment = assessment.name
|
assessment_result.assessment_plan = assessment.name
|
||||||
assessment_result.grading_scale = assessment.grading_scale
|
assessment_result.grading_scale = assessment.grading_scale
|
||||||
assessment_result.total_score = stud_result.result
|
assessment_result.total_score = stud_result.result
|
||||||
assessment_result.flags.ignore_validate = True
|
assessment_result.flags.ignore_validate = True
|
||||||
|
@ -174,13 +174,13 @@ def get_evaluation_criterias(course):
|
|||||||
fields=["evaluation_criteria", "weightage"], filters={"parent": course}, order_by= "idx")
|
fields=["evaluation_criteria", "weightage"], filters={"parent": course}, order_by= "idx")
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def get_assessment_details(assessment):
|
def get_assessment_details(assessment_plan):
|
||||||
"""Returns Evaluation Criteria and Maximum Score from Assessment Master.
|
"""Returns Evaluation Criteria and Maximum Score from Assessment Plan Master.
|
||||||
|
|
||||||
:param Assessment: Assessment
|
:param Assessment Plan: Assessment Plan
|
||||||
"""
|
"""
|
||||||
return frappe.get_list("Assessment Evaluation Criteria", \
|
return frappe.get_list("Assessment Evaluation Criteria", \
|
||||||
fields=["evaluation_criteria", "maximum_score"], filters={"parent": assessment}, order_by= "idx")
|
fields=["evaluation_criteria", "maximum_score"], filters={"parent": assessment_plan}, order_by= "idx")
|
||||||
|
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
|
@ -1,56 +0,0 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
|
|
||||||
# For license information, please see license.txt
|
|
||||||
|
|
||||||
from __future__ import unicode_literals
|
|
||||||
from frappe.model.document import Document
|
|
||||||
import frappe
|
|
||||||
from frappe import _
|
|
||||||
|
|
||||||
class Assessment(Document):
|
|
||||||
def validate(self):
|
|
||||||
self.validate_overlap()
|
|
||||||
|
|
||||||
def validate_overlap(self):
|
|
||||||
"""Validates overlap for Student Group/Student Batch, Instructor, Room"""
|
|
||||||
|
|
||||||
from erpnext.schools.utils import validate_overlap_for
|
|
||||||
|
|
||||||
#Validate overlapping course schedules.
|
|
||||||
if self.student_batch:
|
|
||||||
validate_overlap_for(self, "Course Schedule", "student_batch")
|
|
||||||
|
|
||||||
if self.student_group:
|
|
||||||
validate_overlap_for(self, "Course Schedule", "student_group")
|
|
||||||
|
|
||||||
validate_overlap_for(self, "Course Schedule", "instructor")
|
|
||||||
validate_overlap_for(self, "Course Schedule", "room")
|
|
||||||
|
|
||||||
#validate overlapping assessment schedules.
|
|
||||||
if self.student_batch:
|
|
||||||
validate_overlap_for(self, "Assessment", "student_batch")
|
|
||||||
|
|
||||||
if self.student_group:
|
|
||||||
validate_overlap_for(self, "Assessment", "student_group")
|
|
||||||
|
|
||||||
validate_overlap_for(self, "Assessment", "room")
|
|
||||||
validate_overlap_for(self, "Assessment", "supervisor", self.supervisor)
|
|
||||||
|
|
||||||
|
|
||||||
def get_assessment_list(doctype, txt, filters, limit_start, limit_page_length=20):
|
|
||||||
user = frappe.session.user
|
|
||||||
student = frappe.db.sql("select name from `tabStudent` where student_email_id= %s", user)
|
|
||||||
if student:
|
|
||||||
return frappe. db.sql('''select course, schedule_date, from_time, to_time, sgs.name from `tabAssessment` as assessment,
|
|
||||||
`tabStudent Group Student` as sgs where assessment.student_group = sgs.parent and sgs.student = %s and assessment.docstatus=1
|
|
||||||
order by assessment.name asc limit {0} , {1}'''
|
|
||||||
.format(limit_start, limit_page_length), student, as_dict = True)
|
|
||||||
|
|
||||||
def get_list_context(context=None):
|
|
||||||
return {
|
|
||||||
"show_sidebar": True,
|
|
||||||
'no_breadcrumbs': True,
|
|
||||||
"title": _("Assessment Schedule"),
|
|
||||||
"get_list": get_assessment_list,
|
|
||||||
"row_template": "templates/includes/assessment/assessment_row.html"
|
|
||||||
}
|
|
@ -5,7 +5,7 @@ cur_frm.add_fetch("student_group", "course", "course");
|
|||||||
cur_frm.add_fetch("examiner", "instructor_name", "examiner_name");
|
cur_frm.add_fetch("examiner", "instructor_name", "examiner_name");
|
||||||
cur_frm.add_fetch("supervisor", "instructor_name", "supervisor_name");
|
cur_frm.add_fetch("supervisor", "instructor_name", "supervisor_name");
|
||||||
|
|
||||||
frappe.ui.form.on("Assessment", {
|
frappe.ui.form.on("Assessment Plan", {
|
||||||
course: function(frm) {
|
course: function(frm) {
|
||||||
if (frm.doc.course && frm.doc.maximum_assessment_score) {
|
if (frm.doc.course && frm.doc.maximum_assessment_score) {
|
||||||
frappe.call({
|
frappe.call({
|
@ -625,7 +625,7 @@
|
|||||||
"label": "Amended From",
|
"label": "Amended From",
|
||||||
"length": 0,
|
"length": 0,
|
||||||
"no_copy": 1,
|
"no_copy": 1,
|
||||||
"options": "Assessment",
|
"options": "Assessment Plan",
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"print_hide": 1,
|
"print_hide": 1,
|
||||||
"print_hide_if_no_value": 0,
|
"print_hide_if_no_value": 0,
|
||||||
@ -649,10 +649,10 @@
|
|||||||
"istable": 0,
|
"istable": 0,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"menu_index": 0,
|
"menu_index": 0,
|
||||||
"modified": "2016-12-15 14:35:50.780052",
|
"modified": "2017-01-04 16:21:40.752137",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Schools",
|
"module": "Schools",
|
||||||
"name": "Assessment",
|
"name": "Assessment Plan",
|
||||||
"name_case": "",
|
"name_case": "",
|
||||||
"owner": "Administrator",
|
"owner": "Administrator",
|
||||||
"permissions": [
|
"permissions": [
|
||||||
@ -683,5 +683,6 @@
|
|||||||
"read_only_onload": 0,
|
"read_only_onload": 0,
|
||||||
"sort_field": "modified",
|
"sort_field": "modified",
|
||||||
"sort_order": "DESC",
|
"sort_order": "DESC",
|
||||||
|
"track_changes": 0,
|
||||||
"track_seen": 0
|
"track_seen": 0
|
||||||
}
|
}
|
37
erpnext/schools/doctype/assessment_plan/assessment_plan.py
Normal file
37
erpnext/schools/doctype/assessment_plan/assessment_plan.py
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
|
||||||
|
# For license information, please see license.txt
|
||||||
|
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
from frappe.model.document import Document
|
||||||
|
import frappe
|
||||||
|
from frappe import _
|
||||||
|
|
||||||
|
class AssessmentPlan(Document):
|
||||||
|
def validate(self):
|
||||||
|
self.validate_overlap()
|
||||||
|
|
||||||
|
def validate_overlap(self):
|
||||||
|
"""Validates overlap for Student Group/Student Batch, Instructor, Room"""
|
||||||
|
|
||||||
|
from erpnext.schools.utils import validate_overlap_for
|
||||||
|
|
||||||
|
#Validate overlapping course schedules.
|
||||||
|
if self.student_batch:
|
||||||
|
validate_overlap_for(self, "Course Schedule", "student_batch")
|
||||||
|
|
||||||
|
if self.student_group:
|
||||||
|
validate_overlap_for(self, "Course Schedule", "student_group")
|
||||||
|
|
||||||
|
validate_overlap_for(self, "Course Schedule", "instructor")
|
||||||
|
validate_overlap_for(self, "Course Schedule", "room")
|
||||||
|
|
||||||
|
#validate overlapping assessment schedules.
|
||||||
|
if self.student_batch:
|
||||||
|
validate_overlap_for(self, "Assessment Plan", "student_batch")
|
||||||
|
|
||||||
|
if self.student_group:
|
||||||
|
validate_overlap_for(self, "Assessment Plan", "student_group")
|
||||||
|
|
||||||
|
validate_overlap_for(self, "Assessment Plan", "room")
|
||||||
|
validate_overlap_for(self, "Assessment Plan", "supervisor", self.supervisor)
|
@ -6,7 +6,7 @@ from __future__ import unicode_literals
|
|||||||
import frappe
|
import frappe
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
# test_records = frappe.get_test_records('Assessment')
|
# test_records = frappe.get_test_records('Assessment Plan')
|
||||||
|
|
||||||
class TestAssessment(unittest.TestCase):
|
class TestAssessmentPlan(unittest.TestCase):
|
||||||
pass
|
pass
|
@ -2,15 +2,15 @@
|
|||||||
// For license information, please see license.txt
|
// For license information, please see license.txt
|
||||||
|
|
||||||
cur_frm.add_fetch("student", "title", "student_name");
|
cur_frm.add_fetch("student", "title", "student_name");
|
||||||
cur_frm.add_fetch("assessment", "grading_scale", "grading_scale");
|
cur_frm.add_fetch("assessment_plan", "grading_scale", "grading_scale");
|
||||||
cur_frm.add_fetch("assessment", "maximum_assessment_score", "maximum_score");
|
cur_frm.add_fetch("assessment_plan", "maximum_assessment_score", "maximum_score");
|
||||||
|
|
||||||
frappe.ui.form.on("Assessment Result", {
|
frappe.ui.form.on("Assessment Result", {
|
||||||
assessment: function(frm) {
|
assessment_plan: function(frm) {
|
||||||
frappe.call({
|
frappe.call({
|
||||||
method: "erpnext.schools.api.get_assessment_details",
|
method: "erpnext.schools.api.get_assessment_details",
|
||||||
args: {
|
args: {
|
||||||
assessment: frm.doc.assessment
|
assessment_plan: frm.doc.assessment_plan
|
||||||
},
|
},
|
||||||
callback: function(r) {
|
callback: function(r) {
|
||||||
if (r.message) {
|
if (r.message) {
|
||||||
|
@ -101,7 +101,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"fieldname": "assessment",
|
"fieldname": "assessment_plan",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
"ignore_user_permissions": 0,
|
"ignore_user_permissions": 0,
|
||||||
@ -109,10 +109,10 @@
|
|||||||
"in_filter": 0,
|
"in_filter": 0,
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"in_standard_filter": 0,
|
"in_standard_filter": 0,
|
||||||
"label": "Assessment",
|
"label": "Assessment Plan",
|
||||||
"length": 0,
|
"length": 0,
|
||||||
"no_copy": 0,
|
"no_copy": 0,
|
||||||
"options": "Assessment",
|
"options": "Assessment Plan",
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"precision": "",
|
"precision": "",
|
||||||
"print_hide": 0,
|
"print_hide": 0,
|
||||||
@ -388,7 +388,7 @@
|
|||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"istable": 0,
|
"istable": 0,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"modified": "2016-12-27 17:05:36.436123",
|
"modified": "2017-01-04 16:56:33.868949",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Schools",
|
"module": "Schools",
|
||||||
"name": "Assessment Result",
|
"name": "Assessment Result",
|
||||||
@ -423,5 +423,6 @@
|
|||||||
"sort_field": "modified",
|
"sort_field": "modified",
|
||||||
"sort_order": "DESC",
|
"sort_order": "DESC",
|
||||||
"title_field": "student_name",
|
"title_field": "student_name",
|
||||||
|
"track_changes": 0,
|
||||||
"track_seen": 0
|
"track_seen": 0
|
||||||
}
|
}
|
@ -10,7 +10,7 @@ from erpnext.schools.api import get_grade
|
|||||||
|
|
||||||
class AssessmentResult(Document):
|
class AssessmentResult(Document):
|
||||||
def validate(self):
|
def validate(self):
|
||||||
self.maximum_score = frappe.db.get_value("Assessment", self.assessment, "maximum_assessment_score")
|
self.maximum_score = frappe.db.get_value("Assessment Plan", self.assessment_plan, "maximum_assessment_score")
|
||||||
self.validate_grade()
|
self.validate_grade()
|
||||||
|
|
||||||
def validate_grade(self):
|
def validate_grade(self):
|
||||||
|
@ -21,11 +21,11 @@ frappe.ui.form.on("Course", "refresh", function(frm) {
|
|||||||
frappe.set_route("List", "Course Schedule");
|
frappe.set_route("List", "Course Schedule");
|
||||||
});
|
});
|
||||||
|
|
||||||
frm.add_custom_button(__("Assessment"), function() {
|
frm.add_custom_button(__("Assessment Plan"), function() {
|
||||||
frappe.route_options = {
|
frappe.route_options = {
|
||||||
course: frm.doc.name
|
course: frm.doc.name
|
||||||
}
|
}
|
||||||
frappe.set_route("List", "Assessment");
|
frappe.set_route("List", "Assessment Plan");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
@ -55,11 +55,11 @@ class CourseSchedule(Document):
|
|||||||
|
|
||||||
#validate overlapping assessment schedules.
|
#validate overlapping assessment schedules.
|
||||||
if self.student_batch:
|
if self.student_batch:
|
||||||
validate_overlap_for(self, "Assessment", "student_batch")
|
validate_overlap_for(self, "Assessment Plan", "student_batch")
|
||||||
|
|
||||||
if self.student_group:
|
if self.student_group:
|
||||||
validate_overlap_for(self, "Assessment", "student_group")
|
validate_overlap_for(self, "Assessment Plan", "student_group")
|
||||||
|
|
||||||
validate_overlap_for(self, "Assessment", "room")
|
validate_overlap_for(self, "Assessment Plan", "room")
|
||||||
validate_overlap_for(self, "Assessment", "supervisor", self.instructor)
|
validate_overlap_for(self, "Assessment Plan", "supervisor", self.instructor)
|
||||||
|
|
||||||
|
@ -10,11 +10,11 @@ frappe.ui.form.on("Student Group", {
|
|||||||
frappe.set_route("List", "Course Schedule");
|
frappe.set_route("List", "Course Schedule");
|
||||||
});
|
});
|
||||||
|
|
||||||
frm.add_custom_button(__("Assessment"), function() {
|
frm.add_custom_button(__("Assessment Plan"), function() {
|
||||||
frappe.route_options = {
|
frappe.route_options = {
|
||||||
student_group: frm.doc.name
|
student_group: frm.doc.name
|
||||||
}
|
}
|
||||||
frappe.set_route("List", "Assessment");
|
frappe.set_route("List", "Assessment Plan");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user