converted student to normal doctype
updated python code to add students to exams. removed "unallocated exams" number card from workspace.
This commit is contained in:
parent
26cfd6a866
commit
32a4bb8e97
|
@ -2,31 +2,32 @@
|
|||
"actions": [],
|
||||
"allow_import": 1,
|
||||
"allow_rename": 1,
|
||||
"autoname": "prompt",
|
||||
"autoname": "field:id",
|
||||
"creation": "2023-03-25 22:23:27.804002",
|
||||
"default_view": "List",
|
||||
"doctype": "DocType",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"students"
|
||||
"id"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"fieldname": "students",
|
||||
"fieldtype": "Table",
|
||||
"label": "Students",
|
||||
"options": "Student",
|
||||
"reqd": 1
|
||||
"fieldname": "id",
|
||||
"fieldtype": "Data",
|
||||
"in_list_view": 1,
|
||||
"label": "ID",
|
||||
"reqd": 1,
|
||||
"unique": 1
|
||||
}
|
||||
],
|
||||
"index_web_pages_for_search": 1,
|
||||
"links": [],
|
||||
"modified": "2023-03-25 22:23:44.157433",
|
||||
"modified": "2023-04-15 08:11:07.104086",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Exam Helper",
|
||||
"name": "Class",
|
||||
"naming_rule": "Set by user",
|
||||
"naming_rule": "By fieldname",
|
||||
"owner": "Administrator",
|
||||
"permissions": [
|
||||
{
|
||||
|
|
|
@ -9,14 +9,16 @@ class Exam(Document):
|
|||
def before_save(self):
|
||||
if self.add_from_classes:
|
||||
while self.classes:
|
||||
c = self.classes.pop()
|
||||
c = frappe.get_doc("Class", c.id)
|
||||
for student in c.students:
|
||||
c = self.classes.pop().id
|
||||
students = frappe.get_list(
|
||||
"Student", pluck="name", filters={"classroom": c}
|
||||
)
|
||||
for student in students:
|
||||
# print(vars(student))
|
||||
s = frappe.new_doc("Exam Student")
|
||||
s.update(
|
||||
{
|
||||
"id": student.name,
|
||||
"id": student,
|
||||
"parent": self.name,
|
||||
"parentfield": "students",
|
||||
"parenttype": self.doctype,
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
// Copyright (c) 2023, CSE 2020 Batch and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
// frappe.ui.form.on("Student", {
|
||||
// refresh(frm) {
|
||||
|
||||
// },
|
||||
// });
|
|
@ -1,5 +1,6 @@
|
|||
{
|
||||
"actions": [],
|
||||
"allow_import": 1,
|
||||
"allow_rename": 1,
|
||||
"autoname": "field:id",
|
||||
"creation": "2023-03-25 22:21:02.700909",
|
||||
|
@ -8,7 +9,8 @@
|
|||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"id",
|
||||
"full_name"
|
||||
"full_name",
|
||||
"classroom"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
|
@ -23,18 +25,49 @@
|
|||
"fieldname": "full_name",
|
||||
"fieldtype": "Data",
|
||||
"label": "Full name"
|
||||
},
|
||||
{
|
||||
"fieldname": "classroom",
|
||||
"fieldtype": "Link",
|
||||
"label": "Class",
|
||||
"options": "Class"
|
||||
}
|
||||
],
|
||||
"index_web_pages_for_search": 1,
|
||||
"istable": 1,
|
||||
"links": [],
|
||||
"modified": "2023-03-25 22:21:02.700909",
|
||||
"modified": "2023-04-15 08:21:58.434703",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Exam Helper",
|
||||
"name": "Student",
|
||||
"naming_rule": "By fieldname",
|
||||
"owner": "Administrator",
|
||||
"permissions": [],
|
||||
"permissions": [
|
||||
{
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "System Manager",
|
||||
"share": 1,
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "Exam Cell Staff",
|
||||
"share": 1,
|
||||
"write": 1
|
||||
}
|
||||
],
|
||||
"quick_entry": 1,
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"states": []
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
# Copyright (c) 2023, CSE 2020 Batch and Contributors
|
||||
# See license.txt
|
||||
|
||||
# import frappe
|
||||
from frappe.tests.utils import FrappeTestCase
|
||||
|
||||
|
||||
class TestStudent(FrappeTestCase):
|
||||
pass
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"charts": [],
|
||||
"content": "[{\"id\":\"suN4lkqxEo\",\"type\":\"header\",\"data\":{\"text\":\"<span class=\\\"h4\\\">Quick Glance</span>\",\"col\":12}},{\"id\":\"Z3UwpHWn6i\",\"type\":\"number_card\",\"data\":{\"number_card_name\":\"Total Staff\",\"col\":4}},{\"id\":\"aYKjl0Mvyb\",\"type\":\"number_card\",\"data\":{\"number_card_name\":\"Unallocated exams\",\"col\":4}},{\"id\":\"OD4i1tFW8E\",\"type\":\"spacer\",\"data\":{\"col\":12}},{\"id\":\"-PRIXtwFvV\",\"type\":\"quick_list\",\"data\":{\"quick_list_name\":\"Exam\",\"col\":4}},{\"id\":\"qdAHvNCHpp\",\"type\":\"quick_list\",\"data\":{\"quick_list_name\":\"Exam Hall\",\"col\":4}},{\"id\":\"bxgO5Ntggs\",\"type\":\"quick_list\",\"data\":{\"quick_list_name\":\"Staff\",\"col\":4}},{\"id\":\"8dgJ_ssXPB\",\"type\":\"quick_list\",\"data\":{\"quick_list_name\":\"Class\",\"col\":4}},{\"id\":\"kH3yWooSbF\",\"type\":\"quick_list\",\"data\":{\"quick_list_name\":\"Exam Cell Staff\",\"col\":4}},{\"id\":\"2lsnZcsb2Q\",\"type\":\"quick_list\",\"data\":{\"quick_list_name\":\"Exam Group\",\"col\":4}}]",
|
||||
"content": "[{\"id\":\"suN4lkqxEo\",\"type\":\"header\",\"data\":{\"text\":\"<span class=\\\"h4\\\">Quick Glance</span>\",\"col\":12}},{\"id\":\"Z3UwpHWn6i\",\"type\":\"number_card\",\"data\":{\"number_card_name\":\"Total Staff\",\"col\":4}},{\"id\":\"OD4i1tFW8E\",\"type\":\"spacer\",\"data\":{\"col\":12}},{\"id\":\"-PRIXtwFvV\",\"type\":\"quick_list\",\"data\":{\"quick_list_name\":\"Exam\",\"col\":4}},{\"id\":\"qdAHvNCHpp\",\"type\":\"quick_list\",\"data\":{\"quick_list_name\":\"Exam Hall\",\"col\":4}},{\"id\":\"bxgO5Ntggs\",\"type\":\"quick_list\",\"data\":{\"quick_list_name\":\"Staff\",\"col\":4}},{\"id\":\"8dgJ_ssXPB\",\"type\":\"quick_list\",\"data\":{\"quick_list_name\":\"Class\",\"col\":4}},{\"id\":\"kH3yWooSbF\",\"type\":\"quick_list\",\"data\":{\"quick_list_name\":\"Exam Cell Staff\",\"col\":4}},{\"id\":\"2lsnZcsb2Q\",\"type\":\"quick_list\",\"data\":{\"quick_list_name\":\"Exam Group\",\"col\":4}}]",
|
||||
"creation": "2023-04-02 12:01:34.549910",
|
||||
"docstatus": 0,
|
||||
"doctype": "Workspace",
|
||||
|
@ -11,7 +11,7 @@
|
|||
"is_hidden": 0,
|
||||
"label": "Quick Glance",
|
||||
"links": [],
|
||||
"modified": "2023-04-07 13:58:17.487256",
|
||||
"modified": "2023-04-15 08:37:00.781076",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Exam Helper",
|
||||
"name": "Quick Glance",
|
||||
|
@ -19,10 +19,6 @@
|
|||
{
|
||||
"label": "Total Staff",
|
||||
"number_card_name": "Total Staff"
|
||||
},
|
||||
{
|
||||
"label": "Unallocated exams",
|
||||
"number_card_name": "Unallocated exams"
|
||||
}
|
||||
],
|
||||
"owner": "Administrator",
|
||||
|
|
Loading…
Reference in New Issue