Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Part 2 #3

Open
wants to merge 2 commits into
base: base-sha/b0a93b24c77c7ac0e387ffbe94c72811e548f4e1
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,521 changes: 1,521 additions & 0 deletions kalima/kalima/custom/department.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"fieldtype": "Link",
"in_list_view": 1,
"label": "Department",
"options": "Faculty Department",
"options": "Department",
"reqd": 1
}
],
Expand Down
3 changes: 2 additions & 1 deletion kalima/kalima/doctype/applicant_student/applicant_student.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ frappe.ui.form.on("Applicant Student", {
label: 'Department',
fieldname: 'department',
fieldtype: 'Link',
options: "Faculty Department",
// options: "Faculty Department",
options: "Department",
reqd: 1,
get_query: function () {
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,7 @@
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2024-07-03 11:13:25.512499",
"modified": "2024-07-07 15:37:40.143362",
"modified_by": "Administrator",
"module": "Kalima",
"name": "Applicant Student",
Expand Down
4 changes: 2 additions & 2 deletions kalima/kalima/doctype/class/class.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
"fieldtype": "Link",
"in_list_view": 1,
"label": "Department",
"options": "Faculty Department",
"options": "Department",
"reqd": 1
},
{
Expand Down Expand Up @@ -146,7 +146,7 @@
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2024-06-10 13:44:05.474622",
"modified": "2024-07-07 13:32:35.881782",
"modified_by": "Administrator",
"module": "Kalima",
"name": "Class",
Expand Down
2 changes: 1 addition & 1 deletion kalima/kalima/doctype/complaints/complaints.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"fieldtype": "Link",
"in_list_view": 1,
"label": "Department",
"options": "Faculty Department",
"options": "Department",
"read_only": 1
},
{
Expand Down
2 changes: 1 addition & 1 deletion kalima/kalima/doctype/constant/constant.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"fieldtype": "Link",
"in_list_view": 1,
"label": "Department",
"options": "Faculty Department",
"options": "Department",
"reqd": 1
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"fieldtype": "Link",
"in_list_view": 1,
"label": "Department",
"options": "Faculty Department"
"options": "Department"
},
{
"fieldname": "score",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"fieldname": "department",
"fieldtype": "Link",
"label": "Department",
"options": "Faculty Department"
"options": "Department"
},
{
"fieldname": "column_break_aolq",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"fieldtype": "Link",
"in_list_view": 1,
"label": "Department",
"options": "Faculty Department",
"options": "Department",
"reqd": 1
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"fieldname": "department",
"fieldtype": "Link",
"label": "Department",
"options": "Faculty Department"
"options": "Department"
},
{
"fieldname": "module",
Expand Down
2 changes: 1 addition & 1 deletion kalima/kalima/doctype/exam_students/exam_students.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"fieldtype": "Link",
"in_list_view": 1,
"label": "Department",
"options": "Faculty Department"
"options": "Department"
},
{
"fieldname": "stage",
Expand Down
12 changes: 0 additions & 12 deletions kalima/kalima/doctype/group_class/group_class.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,6 @@ frappe.ui.form.on("Group Class", {
pres(frm);
},
after_save: function (frm) {
// const selected_modules = [];
// const department = frm.doc.department;

// // Get selected modules
// frm.fields_dict.presented_modules.$wrapper.find('input[type="checkbox"]:checked').each(function () {
// selected_modules.push($(this).val());
// });

// if (selected_modules.length === 0 || !department) {
// return;
// }
// generate_classes(frm);
Comment on lines -19 to -30

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Remove commented-out code.

The commented-out code in the after_save function should be removed if it is no longer needed to keep the codebase clean.

Suggested change
// const selected_modules = [];
// const department = frm.doc.department;
// // Get selected modules
// frm.fields_dict.presented_modules.$wrapper.find('input[type="checkbox"]:checked').each(function () {
// selected_modules.push($(this).val());
// });
// if (selected_modules.length === 0 || !department) {
// return;
// }
// generate_classes(frm);
after_save: function (frm) {
},

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this comment correct?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this comment helpful?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the comment type correct?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the comment area correct?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What type of LLM test could this comment become?

  • 👍 - this comment is really good/important and we should always make it
  • 👎 - this comment is really bad and we should never make it
  • no reaction - don't turn this comment into an LLM test

},
async refresh(frm) {
await pres(frm);
Expand Down
2 changes: 1 addition & 1 deletion kalima/kalima/doctype/group_class/group_class.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"fieldname": "department",
"fieldtype": "Link",
"label": "Department",
"options": "Faculty Department",
"options": "Department",
"reqd": 1
},
{
Expand Down
16 changes: 11 additions & 5 deletions kalima/kalima/doctype/group_class/group_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

class GroupClass(Document):
pass


@frappe.whitelist()
def fetch_students(selected_modules, department):
if not selected_modules or not department:
Expand Down Expand Up @@ -60,17 +62,21 @@ def fetch_students(selected_modules, department):

return students



@frappe.whitelist()
def create_classes(group_class_doc,group_class_modules,students):
def create_classes(group_title,year,stage,semester,department,group_class_modules,students):
group_class_modules = json.loads(str(group_class_modules))
for module in group_class_modules:
# Convert the group_class_doc to a dictionary
group_class_doc = json.loads(str(group_class_doc))
# group_class_doc = json.loads(str(group_class_doc))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Remove commented-out code.

The commented-out line # group_class_doc = json.loads(str(group_class_doc)) should be removed if it is no longer needed to keep the codebase clean.

Suggested change
# group_class_doc = json.loads(str(group_class_doc))
students = json.loads(str(students))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this comment correct?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this comment helpful?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the comment type correct?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the comment area correct?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What type of LLM test could this comment become?

  • 👍 - this comment is really good/important and we should always make it
  • 👎 - this comment is really bad and we should never make it
  • no reaction - don't turn this comment into an LLM test

students = json.loads(str(students))

create_class(group_class_doc["group_title"],module,group_class_doc["year"],group_class_doc["stage"],group_class_doc["semester"],group_class_doc["department"],students)
create_class(group_title,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Consider using keyword arguments for better readability.

Using keyword arguments when calling create_class can improve readability and reduce the risk of passing arguments in the wrong order.

Suggested change
create_class(group_title,
create_class(group_title=group_title,
module=module,
year=year,
stage=stage,
semester=semester,
department=department,
students=students)
return "Classes created successfully."

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this comment correct?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this comment helpful?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the comment type correct?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the comment area correct?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What type of LLM test could this comment become?

  • 👍 - this comment is really good/important and we should always make it
  • 👎 - this comment is really bad and we should never make it
  • no reaction - don't turn this comment into an LLM test

module,
year,
stage,
semester,
department,
students)

return "Classes created successfully."

Expand Down
2 changes: 1 addition & 1 deletion kalima/kalima/doctype/library/library.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"fieldname": "department",
"fieldtype": "Link",
"label": "Department",
"options": "Faculty Department"
"options": "Department"
},
{
"fieldname": "column_break_qkzn",
Expand Down
5 changes: 3 additions & 2 deletions kalima/kalima/doctype/outgoing/outgoing.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ frappe.ui.form.on("Outgoing", {
} else if (frm.doc.receivers_type == "Teachers") {
await getEntitiesAndShowDialog("Employee", ["name", "employee_name"], "employee_name", "receive_teachers", "teacher");
} else if (frm.doc.receivers_type == "Departments") {
var all_students = await frappe.db.get_list("Faculty Department", {
fields: ['name', 'arabic_title']
// var all_students = await frappe.db.get_list("Faculty Department", {
var all_students = await frappe.db.get_list("Department", {
fields: ['name', 'arabic_title']
});

var fields = [];
Expand Down
2 changes: 1 addition & 1 deletion kalima/kalima/doctype/outgoing/outgoing.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"fieldname": "sent_to",
"fieldtype": "Link",
"label": "Sender",
"options": "Faculty Department"
"options": "Department"
},
{
"fieldname": "document_number",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"fieldtype": "Link",
"in_list_view": 1,
"label": "Department",
"options": "Faculty Department"
"options": "Department"
},
{
"fieldname": "study_type",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"fieldname": "department",
"fieldtype": "Link",
"label": "Department",
"options": "Faculty Department",
"options": "Department",
"reqd": 1
},
{
Expand Down
7 changes: 4 additions & 3 deletions kalima/kalima/doctype/presented_module/presented_module.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,15 @@
"fetch_from": "module.faculty",
"fieldname": "faculty",
"fieldtype": "Data",
"label": "Faculty"
"label": "Faculty",
"read_only": 1
},
{
"fieldname": "department",
"fieldtype": "Link",
"in_list_view": 1,
"label": "Department",
"options": "Faculty Department",
"options": "Department",
"reqd": 1
},
{
Expand Down Expand Up @@ -426,7 +427,7 @@
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2024-07-04 09:37:21.128000",
"modified": "2024-07-07 15:27:55.467903",
"modified_by": "Administrator",
"module": "Kalima",
"name": "Presented Module",
Expand Down
7 changes: 4 additions & 3 deletions kalima/kalima/doctype/student/student.json
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,9 @@
},
{
"fieldname": "graduation_year",
"fieldtype": "Date",
"label": "Graduation Year"
"fieldtype": "Select",
"label": "Graduation Year",
"options": "2030\n2029\n2028\n2027\n2026\n2025\n2024\n2023\n2022\n2021\n2020\n2019\n2018\n2017\n2016\n2015\n2014\n2013\n2012\n2011\n2010"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Consider dynamic generation of graduation years.

Instead of hardcoding the graduation years, consider generating them dynamically to avoid frequent updates.

Suggested change
"options": "2030\n2029\n2028\n2027\n2026\n2025\n2024\n2023\n2022\n2021\n2020\n2019\n2018\n2017\n2016\n2015\n2014\n2013\n2012\n2011\n2010"
"options": (() => {
const currentYear = new Date().getFullYear();
const startYear = 2010;
return Array.from({ length: currentYear - startYear + 1 }, (_, i) => currentYear - i).join('\n');
})()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this comment correct?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this comment helpful?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the comment type correct?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the comment area correct?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What type of LLM test could this comment become?

  • 👍 - this comment is really good/important and we should always make it
  • 👎 - this comment is really bad and we should never make it
  • no reaction - don't turn this comment into an LLM test

},
{
"fieldname": "branch",
Expand Down Expand Up @@ -908,7 +909,7 @@
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2024-07-06 11:38:45.932457",
"modified": "2024-07-07 15:23:53.002388",
"modified_by": "Administrator",
"module": "Kalima",
"name": "Student",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"fieldtype": "Link",
"in_list_view": 1,
"label": "Department",
"options": "Faculty Department",
"options": "Department",
"reqd": 1
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@
"fieldname": "department",
"fieldtype": "Link",
"label": "Department",
"options": "Faculty Department"
"options": "Department"
},
{
"fieldname": "continuous_score",
Expand Down
12 changes: 6 additions & 6 deletions kalima/kalima/doctype/student_scores/student_scores.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,37 +31,37 @@
"fieldtype": "Link",
"in_list_view": 1,
"label": "Department",
"options": "Faculty Department"
"options": "Department"
},
{
"fieldname": "continuous",
"fieldtype": "Float",
"label": "Continuous",
"options": "Faculty Department"
"options": "Department"
},
{
"fieldname": "practical",
"fieldtype": "Float",
"label": "Practical",
"options": "Faculty Department"
"options": "Department"
},
{
"fieldname": "final",
"fieldtype": "Float",
"label": "Final",
"options": "Faculty Department"
"options": "Department"
},
{
"fieldname": "curve",
"fieldtype": "Float",
"label": "Curve",
"options": "Faculty Department"
"options": "Department"
},
{
"fieldname": "total",
"fieldtype": "Float",
"label": "Total",
"options": "Faculty Department"
"options": "Department"
},
{
"default": "0",
Expand Down
2 changes: 1 addition & 1 deletion kalima/kalima/doctype/students_fees/students_fees.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
"fieldname": "faculty",
"fieldtype": "Link",
"label": "Faculty",
"options": "Faculty Department",
"options": "Department",
"reqd": 1
},
{
Expand Down
2 changes: 1 addition & 1 deletion kalima/kalima/doctype/transfer/transfer.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"fieldname": "department",
"fieldtype": "Link",
"label": "Department",
"options": "Faculty Department"
"options": "Department"
},
{
"fieldname": "date",
Expand Down
Empty file.
Loading