### Clone and Install Frappe UI Starter Source: https://github.com/frappe/education/blob/develop/frontend/README.md Steps to clone the starter template into an existing Frappe app and install dependencies. Ensure you are in the root folder of your Frappe app before cloning. ```bash cd apps/todo npx degit NagariaHussain/doppio_frappeui_starter frontend cd frontend yarn yarn dev ``` -------------------------------- ### Install Education App with Bench Source: https://github.com/frappe/education/blob/develop/README.md Use this command after installing ERPNext and the Education app to install the Education app on a specific Frappe site. ```bash $ bench --site sitename install-app education ``` -------------------------------- ### Download Easy Install Script for Frappe Education Source: https://github.com/frappe/education/blob/develop/README.md Use this command to download the easy install script for setting up Frappe Education in a production environment. ```bash wget https://frappe.io/easy-install.py ``` -------------------------------- ### Run Frappe Education with Docker Compose Source: https://github.com/frappe/education/blob/develop/README.md Start the Frappe Education application containers using Docker Compose. The application will be available at http://education.localhost:8000. ```bash docker compose up -d ``` -------------------------------- ### Deploy Frappe Education Production Instance Source: https://github.com/frappe/education/blob/develop/README.md Run this command after downloading the easy install script to deploy a production-ready Frappe Education instance. Remember to replace placeholder values with your specific details. ```bash python3 ./easy-install.py deploy \ --project=education_prod_setup \ --email=your_email.example.com \ --image=ghcr.io/frappe/education \ --version=stable \ --app=education \ --sitename subdomain.domain.tld ``` -------------------------------- ### Get Course Schedule Events Source: https://context7.com/frappe/education/llms.txt Fetches course schedule data formatted for calendar display, including course, room, student group, instructor, and timings. Requires start and end dates, and optional filters. ```python import json events = frappe.call( "education.education.api.get_course_schedule_events", start="2024-09-01", end="2024-09-30", filters=json.dumps({"student_group": "Batch-A-CS-2024"}) ) # [ # { # "name": "EDU-CSH-2024-00101", # "course": "Introduction to Programming", # "from_time": "2024-09-03 09:00:00", # "to_time": "2024-09-03 11:00:00", # "room": "Lab-1", # "student_group": "Batch-A-CS-2024", # "allDay": 0 # }, ... # ] ``` -------------------------------- ### Get Fee Components Source: https://context7.com/frappe/education/llms.txt Retrieves individual fee components (category, description, amount) from a specified Fee Structure, ordered by row index. ```python components = frappe.call( "education.education.api.get_fee_components", fee_structure="FS-2024-0001" ) # [ # {"fees_category": "Tuition", "description": "Semester tuition", "amount": 15000.0}, # {"fees_category": "Library", "description": "Library fee", "amount": 500.0}, # ] ``` -------------------------------- ### Get Assessment Criteria Source: https://context7.com/frappe/education/llms.txt Retrieves assessment criteria and their weightage configured for a specific course. ```python criteria = frappe.call( "education.education.api.get_assessment_criteria", course="Introduction to Programming" ) # [ # {"assessment_criteria": "Midterm Exam", "weightage": 40}, # {"assessment_criteria": "Final Exam", "weightage": 60}, # ] ``` -------------------------------- ### Schedule Bulk Recurring Courses Source: https://context7.com/frappe/education/llms.txt Creates Course Schedule documents for specified weekdays between course start and end dates. Skips overlapping schedules and supports rescheduling. ```python tool = frappe.get_doc({ "doctype": "Course Scheduling Tool", "course": "Data Structures", "student_group": "Batch-A-CS-2024", "instructor": "EMP-00042", "room": "LH-3", "from_time": "09:00:00", "to_time": "11:00:00", "course_start_date": "2024-09-01", "course_end_date": "2024-12-15", "class_schedule_color": "blue", "reschedule": 0 }) result = tool.schedule_course(days=["Monday", "Wednesday"]) # { # "course_schedules": [, ...], # successfully created # "course_schedules_errors": ["2024-10-14", ...], # overlap conflicts # "rescheduled": [], # "reschedule_errors": [] # } ``` -------------------------------- ### Get School Abbreviation and Logo Source: https://context7.com/frappe/education/llms.txt Retrieves the school/college name abbreviation and logo URL from Education Settings. Used for the portal navbar. ```python branding = frappe.call("education.education.api.get_school_abbr_logo") # {"name": "MIT", "logo": "/files/school_logo.png"} ``` -------------------------------- ### Get Current Student Enrollment Source: https://context7.com/frappe/education/llms.txt Retrieves the most recent active program enrollment for a student. Returns None if no active enrollment is found. ```python enrollment = frappe.call( "education.education.api.get_current_enrollment", student="EDU-STU-2024-00001" ) # { # "program_enrollment": "EDU-PE-2024-00033", # "student_name": "Alice Smith", # "program": "Bachelor of Computer Science", # "student_batch": "2024", # "academic_year": "2024-25", # "academic_term": "Semester 1 2024-25" # } ``` -------------------------------- ### Get Logged-in Student's Profile Source: https://context7.com/frappe/education/llms.txt Fetches the full profile of the currently logged-in student, including current program and student groups. Throws AuthenticationError if called as Guest. ```python # Called from the Vue frontend via frappe-ui createResource info = frappe.call("education.education.api.get_student_info") # { # "name": "EDU-STU-2024-00001", # "student_name": "Alice Smith", # "student_email_id": "alice@university.edu", # "current_program": { "program": "Bachelor of Computer Science", ... }, # "student_groups": [{"label": "Batch-A-CS-2024"}, ...] # } ``` -------------------------------- ### Get Student Course Schedule Source: https://context7.com/frappe/education/llms.txt Returns upcoming course schedule entries for a student's groups within a program, ordered by date. Used by the student portal's Schedule page. ```python schedule = frappe.call( "education.education.api.get_course_schedule_for_student", program_name="Bachelor of Computer Science", student_groups=[{"label": "Batch-A-CS-2024"}] ) # [ # { # "schedule_date": "2024-09-16", # "course": "Data Structures", # "from_time": "09:00:00", # "to_time": "11:00:00", # "room": "LH-3", # "instructor": "Dr. Patel", # "title": "Data Structures by Dr. Patel" # }, ... # ] ``` -------------------------------- ### Get Student Group Students Source: https://context7.com/frappe/education/llms.txt Retrieves students from a specific student group. Set `include_inactive` to 1 to include inactive students. ```python # Active students only students = frappe.call( "education.education.api.get_student_group_students", student_group="Batch-A-CS-2024" ) # [{"student": "EDU-STU-2024-00001", "student_name": "Alice Smith"}, ...] ``` ```python # Include inactive students_all = frappe.call( "education.education.api.get_student_group_students", student_group="Batch-A-CS-2024", include_inactive=1 ) ``` -------------------------------- ### Get Student Invoices with Payment Status Source: https://context7.com/frappe/education/llms.txt Retrieves all submitted sales invoices for a student, including their payment status, program, amount, and due date. Also provides the print format name for PDF downloads. ```python data = frappe.call( "education.education.api.get_student_invoices", student="EDU-STU-2024-00001" ) # { # "invoices": [ # { # "status": "Unpaid", # "program": "Bachelor of Computer Science", # "amount": "₹ 15500.00", # "due_date": "2024-10-01", # "payment_date": "-", # "invoice": "ACC-SINV-2024-00123" # }, # { # "status": "Paid", # "program": "Bachelor of Computer Science", # "amount": "₹ 15500.00", # "due_date": "-", # "payment_date": "2024-08-15", # "invoice": "ACC-SINV-2024-00088" # } # ], # "print_format": "Fee Invoice" # } ``` -------------------------------- ### Get Student Topic Progress Source: https://context7.com/frappe/education/llms.txt Retrieves content completion statuses for a specific topic within a course enrollment. For quizzes, it also includes score, result, and time taken. ```python student = frappe.get_doc("Student", "EDU-STU-2024-00001") topic = frappe.get_doc("Topic", "Introduction to Algorithms") progress = student.get_topic_progress( course_enrollment_name="EDU-CE-2024-00088", topic=topic ) # [ # {"content": "ART-001", "content_type": "Article", "is_complete": True}, # {"content": "VID-002", "content_type": "Video", "is_complete": False}, # {"content": "QUIZ-01", "content_type": "Quiz", "is_complete": True, "score": 8, "result": "Pass"}, # ] ``` -------------------------------- ### Get Grade from Percentage Source: https://context7.com/frappe/education/llms.txt Resolves a grade code from a Grading Scale document based on a percentage score. Grading scale intervals are cached for performance. ```python grade = frappe.call( "education.education.api.get_grade", grading_scale="Default Grading Scale", percentage=78.5 ) # "B+" ``` -------------------------------- ### Download Docker Configuration Files Source: https://github.com/frappe/education/blob/develop/README.md Download the docker-compose.yml and init.sh files to set up the Frappe Education environment using Docker. ```bash mkdir frappe-education cd frappe-education # Download the docker-compose file wget -O docker-compose.yml https://raw.githubusercontent.com/frappe/education/develop/docker/docker-compose.yml # Download the setup script wget -O init.sh https://raw.githubusercontent.com/frappe/education/develop/docker/init.sh ``` -------------------------------- ### Enroll Student in Course Source: https://context7.com/frappe/education/llms.txt Creates a Course Enrollment record linking a student to a specific course under a Program Enrollment. Returns the existing enrollment if one already exists. ```python student = frappe.get_doc("Student", "EDU-STU-2024-00001") course_enrollment = student.enroll_in_course( course_name="Data Structures", program_enrollment="EDU-PE-2024-00055" ) print(course_enrollment.name) # "EDU-CE-2024-00088" ``` -------------------------------- ### Vue Student Portal API Pattern with createResource Source: https://context7.com/frappe/education/llms.txt Demonstrates the use of `createResource` from `frappe-ui` in a Vue 3/Pinia store for interacting with backend APIs. It shows patterns for fetching student info, attendance, and applying for leave. ```javascript // frontend/src/stores/student.js — Load student profile on portal boot import { defineStore } from 'pinia' import { createResource } from 'frappe-ui' export const studentStore = defineStore('education-student', () => { const student = createResource({ url: 'education.education.api.get_student_info', onSuccess(info) { // info.current_program, info.student_groups populated }, onError(err) { console.error(err) }, }) // Fetch attendance for a student group const attendanceResource = createResource({ url: 'education.education.api.get_student_attendance', params: { student: 'EDU-STU-2024-00001', student_group: 'Batch-A-CS-2024' }, transform: (records) => records.map(r => ({ title: r.status, date: r.date, background_color: r.status === 'Present' ? 'bg-green-100' : 'bg-red-200', })), auto: true, }) // Apply leave const applyLeave = createResource({ url: 'education.education.api.apply_leave', params: { leave_data: { student: 'EDU-STU-2024-00001', student_name: 'Alice Smith', from_date: '2024-09-20', to_date: '2024-09-22', reason: 'Medical' }, program_name: 'Bachelor of Computer Science', }, onSuccess: () => { attendanceResource.reload() }, }) return { student, attendanceResource, applyLeave } }) ``` -------------------------------- ### Vue Student Portal `createResource` API Pattern Source: https://context7.com/frappe/education/llms.txt Demonstrates how the Vue Student Portal frontend utilizes `createResource` from `frappe-ui` to interact with backend APIs, including fetching student information, attendance, and applying for leave. ```APIDOC ## Vue Student Portal `createResource` API Pattern ### Description The student portal frontend (Vue 3 + Pinia + frappe-ui) calls all backend APIs using `createResource`. Every whitelisted Python function is reachable at `/api/method/`. ### API Endpoints #### `education.education.api.get_student_info` - **Purpose**: Fetches general student information. - **Usage**: Used to load student profile on portal boot. #### `education.education.api.get_student_attendance` - **Purpose**: Fetches attendance records for a student group. - **Parameters**: `student` (string), `student_group` (string). - **Transform**: Maps records to objects with `title`, `date`, and `background_color`. #### `education.education.api.apply_leave` - **Purpose**: Allows a student to apply for leave. - **Parameters**: `leave_data` (object with `student`, `student_name`, `from_date`, `to_date`, `reason`), `program_name` (string). - **Callback**: On success, reloads attendance data. ### Request Example (JavaScript) ```javascript import { defineStore } from 'pinia' import { createResource } from 'frappe-ui' export const studentStore = defineStore('education-student', () => { const student = createResource({ url: 'education.education.api.get_student_info', onSuccess(info) { // info.current_program, info.student_groups populated }, onError(err) { console.error(err) }, }) // Fetch attendance for a student group const attendanceResource = createResource({ url: 'education.education.api.get_student_attendance', params: { student: 'EDU-STU-2024-00001', student_group: 'Batch-A-CS-2024' }, transform: (records) => records.map(r => ({ title: r.status, date: r.date, background_color: r.status === 'Present' ? 'bg-green-100' : 'bg-red-200', })), auto: true, }) // Apply leave const applyLeave = createResource({ url: 'education.education.api.apply_leave', params: { leave_data: { student: 'EDU-STU-2024-00001', student_name: 'Alice Smith', from_date: '2024-09-20', to_date: '2024-09-22', reason: 'Medical' }, program_name: 'Bachelor of Computer Science', }, onSuccess: () => { attendanceResource.reload() }, }) return { student, attendanceResource, applyLeave } }) ``` ``` -------------------------------- ### Enroll Student in Program Source: https://context7.com/frappe/education/llms.txt Creates and submits a Program Enrollment for a student using the latest Academic Year. Returns the enrollment document and is safe to call multiple times. ```python student = frappe.get_doc("Student", "EDU-STU-2024-00001") enrollment = student.enroll_in_program("Bachelor of Computer Science") print(enrollment.name) # "EDU-PE-2024-00055" print(enrollment.docstatus) # 1 (submitted) ``` -------------------------------- ### CourseSchedulingTool.schedule_course(days) Source: https://context7.com/frappe/education/llms.txt Creates individual Course Schedule documents for specified weekdays within a date range. It handles overlaps by skipping conflicting dates and supports rescheduling. ```APIDOC ## CourseSchedulingTool.schedule_course(days) ### Description A whitelisted instance method on the **Course Scheduling Tool** doctype. Creates individual **Course Schedule** documents for every occurrence of the specified weekdays between `course_start_date` and `course_end_date`. Skips dates that have overlapping schedules for the same instructor, room, or student group. Supports rescheduling (delete + recreate). ### Method Instance method on `Course Scheduling Tool` doctype. ### Endpoint `tool.schedule_course(days)` ### Parameters #### Path Parameters - **days** (list of strings) - Required - A list of weekdays (e.g., `["Monday", "Wednesday"]`) for which to create schedules. ### Request Example ```python tool = frappe.get_doc({ "doctype": "Course Scheduling Tool", "course": "Data Structures", "student_group": "Batch-A-CS-2024", "instructor": "EMP-00042", "room": "LH-3", "from_time": "09:00:00", "to_time": "11:00:00", "course_start_date": "2024-09-01", "course_end_date": "2024-12-15", "class_schedule_color": "blue", "reschedule": 0 }) result = tool.schedule_course(days=["Monday", "Wednesday"]) ``` ### Response #### Success Response (200) - **course_schedules** (list) - A list of successfully created `Course Schedule` documents. - **course_schedules_errors** (list) - A list of dates with overlap conflicts. - **rescheduled** (list) - A list of successfully rescheduled course schedules. - **reschedule_errors** (list) - A list of errors encountered during rescheduling. ### Response Example ```json { "course_schedules": [, ...], "course_schedules_errors": ["2024-10-14", ...], "rescheduled": [], "reschedule_errors": [] } ``` ``` -------------------------------- ### Set CSRF Token, Page Title, and Favicon Source: https://github.com/frappe/education/blob/develop/education/public/frontend/index.html Initializes the frontend by setting the CSRF token from server-side rendering, dynamically updating the page title, and ensuring a favicon is present and linked. ```javascript window.csrf_token = '{{ frappe.session.csrf_token }}' window.document.title = '{{ abbr }}' let link = document.querySelector("link[rel~='icon']"); if (!link) { link = document.createElement('link'); link.rel = 'icon'; document.getElementsByTagName('head')[0].appendChild(link); } link.href = '{{ logo }}' ``` -------------------------------- ### Enroll Student Applicant to Student and Program Enrollment Source: https://context7.com/frappe/education/llms.txt Converts a Student Applicant to a Student and creates a Program Enrollment. Publishes realtime progress events. Use when a new student needs to be officially registered. ```python import frappe result = frappe.call( "education.education.api.enroll_student", source_name="EDU-APP-2024-00023" ) # result is a ProgramEnrollment doc dict print(result.student) # "EDU-STU-2024-00056" print(result.program) # "Bachelor of Computer Science" print(result.academic_year) # "2024-25" ``` ```bash # REST (cookie/token auth) curl -X POST https://education.example.com/api/method/education.education.api.enroll_student \ -H "Authorization: token api_key:api_secret" \ -d "source_name=EDU-APP-2024-00023" ``` -------------------------------- ### Student.enroll_in_program(program_name) Source: https://context7.com/frappe/education/llms.txt Enrolls a student into a specified program by creating a Program Enrollment record. It uses the latest Academic Year and returns the enrollment document. This method is safe to call multiple times. ```APIDOC ## Student.enroll_in_program(program_name) ### Description Instance method on the **Student** doctype. Creates and submits a **Program Enrollment** for the student using the latest Academic Year. Returns the enrollment document. Safe to call multiple times — returns the existing enrollment if a duplicate exists. ### Method Instance method on `Student` doctype. ### Endpoint `student.enroll_in_program(program_name)` ### Parameters #### Path Parameters - **program_name** (string) - Required - The name of the program to enroll the student in. ### Request Example ```python student = frappe.get_doc("Student", "EDU-STU-2024-00001") enrollment = student.enroll_in_program("Bachelor of Computer Science") print(enrollment.name) print(enrollment.docstatus) ``` ### Response #### Success Response (200) - **name** (string) - The name of the created Program Enrollment document. - **docstatus** (integer) - The document status (1 indicates submitted). ### Response Example ```python # Assuming enrollment is successful print(enrollment.name) # "EDU-PE-2024-00055" print(enrollment.docstatus) # 1 ``` -------------------------------- ### Get Student Attendance Records Source: https://context7.com/frappe/education/llms.txt Retrieves attendance records for a student within a specific student group, including date, status, and document name. Used for displaying attendance on a calendar. ```python records = frappe.call( "education.education.api.get_student_attendance", student="EDU-STU-2024-00001", student_group="Batch-A-CS-2024" ) # [ # {"date": "2024-09-03", "status": "Present", "name": "EDU-STA-2024-00201"}, # {"date": "2024-09-05", "status": "Absent", "name": "EDU-STA-2024-00202"}, # {"date": "2024-09-10", "status": "Leave", "name": "EDU-STA-2024-00210"}, # ] ``` -------------------------------- ### Initialize Report Variables and Letterhead Source: https://github.com/frappe/education/blob/develop/education/education/report/course_wise_assessment_report/course_wise_assessment_report.html Sets up variables for letterhead and report columns. It retrieves the default letterhead for the company or a globally set default if none is specified. ```JavaScript {% var letterhead = filters.letter_head || (frappe.get_doc(":Company", filters.company) && frappe.get_doc(":Company", filters.company).default_letter_head) || frappe.defaults.get_default("letter_head"); var report_columns = report.get_columns_for_print(); %} ``` -------------------------------- ### enroll_student Source: https://context7.com/frappe/education/llms.txt Converts a Student Applicant to a Student and creates a Program Enrollment. It also publishes realtime progress events. ```APIDOC ## enroll_student(source_name) ### Description Accepts a **Student Applicant** document name, maps it to a new **Student** record, and returns a new **Program Enrollment** document pre-populated with the applicant's program, academic year, term, and category. Publishes realtime progress events (`enroll_student_progress`) to the requesting user. ### Method POST ### Endpoint `/api/method/education.education.api.enroll_student` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **source_name** (string) - Required - The name of the Student Applicant document. ### Request Example ```python import frappe result = frappe.call( "education.education.api.enroll_student", source_name="EDU-APP-2024-00023" ) print(result.student) print(result.program) print(result.academic_year) ``` ```bash curl -X POST https://education.example.com/api/method/education.education.api.enroll_student \ -H "Authorization: token api_key:api_secret" \ -d "source_name=EDU-APP-2024-00023" ``` ### Response #### Success Response (200) - **ProgramEnrollment** (dict) - A dictionary representing the newly created Program Enrollment document. #### Response Example ```json { "student": "EDU-STU-2024-00056", "program": "Bachelor of Computer Science", "academic_year": "2024-25" } ``` ``` -------------------------------- ### Create Bulk Fee Invoices/Sales Orders Source: https://context7.com/frappe/education/llms.txt Generates Sales Invoices or Sales Orders for enrolled students based on a Fee Schedule. For more than 10 students, it enqueues a background task. ```python fee_schedule = frappe.get_doc("Fee Schedule", "EDU-FSC-2024-00003") fee_schedule.create_fees() # Realtime progress events: "fee_schedule_progress" with {"progress": 0..100, "reload": 1} # Fee Schedule status transitions: Draft → Invoice Pending → Invoice Created (or Failed) ``` -------------------------------- ### Student.enroll_in_course(course_name, program_enrollment, enrollment_date) Source: https://context7.com/frappe/education/llms.txt Enrolls a student in a specific course under a given Program Enrollment. Returns the existing enrollment if one already exists. ```APIDOC ## Student.enroll_in_course(course_name, program_enrollment, enrollment_date) ### Description Instance method on the **Student** doctype. Creates a **Course Enrollment** record linking the student to a specific course under a Program Enrollment. Returns the existing enrollment if one already exists. ### Method Instance method on `Student` doctype. ### Endpoint `student.enroll_in_course(course_name, program_enrollment, enrollment_date)` ### Parameters #### Path Parameters - **course_name** (string) - Required - The name of the course to enroll the student in. - **program_enrollment** (string) - Required - The name of the Program Enrollment document. - **enrollment_date** (string) - Optional - The date of enrollment (YYYY-MM-DD format). ### Request Example ```python student = frappe.get_doc("Student", "EDU-STU-2024-00001") course_enrollment = student.enroll_in_course( course_name="Data Structures", program_enrollment="EDU-PE-2024-00055" ) print(course_enrollment.name) ``` ### Response #### Success Response (200) - **name** (string) - The name of the created Course Enrollment document. ### Response Example ```python # Assuming enrollment is successful print(course_enrollment.name) # "EDU-CE-2024-00088" ``` ``` -------------------------------- ### Initiate Razorpay Payment Source: https://context7.com/frappe/education/llms.txt Creates a Razorpay order for outstanding amounts on a Sales Invoice and returns options for the checkout widget. Requires Razorpay keys from Education Settings. ```python options = frappe.call( "education.education.billing.get_payment_options", doctype="Sales Invoice", docname="ACC-SINV-2024-00123", phone="9876543210" ) # { # "key_id": "rzp_live_xxxxx", # "name": "My University", # "description": "Payment for 15500 course", # "order_id": "order_OzqBxxxxxxx", # "amount": 1550000, # paise (x100) # "currency": "INR", # "prefill": {"name": "Alice Smith", "email": "alice@university.edu", "contact": "9876543210"} # } ``` -------------------------------- ### get_payment_options(doctype, docname, phone, currency) Source: https://context7.com/frappe/education/llms.txt Initiates a Razorpay payment by creating an order for the outstanding amount on a Sales Invoice and returning the necessary options for the checkout widget. ```APIDOC ## get_payment_options(doctype, docname, phone, currency) ### Description Creates a Razorpay order for the outstanding amount on a Sales Invoice and returns the options object needed to open the Razorpay checkout widget. Reads `razorpay_key` and `razorpay_secret` from **Education Settings**. ### Method `frappe.call` ### Endpoint education.education.billing.get_payment_options ### Parameters #### Query Parameters - **doctype** (string) - Required - The document type, typically "Sales Invoice". - **docname** (string) - Required - The name of the document (e.g., Sales Invoice ID). - **phone** (string) - Required - The customer's phone number. - **currency** (string) - Optional - The currency for the payment (defaults to INR if not provided). ### Request Example ```python options = frappe.call( "education.education.billing.get_payment_options", doctype="Sales Invoice", docname="ACC-SINV-2024-00123", phone="9876543210" ) ``` ### Response #### Success Response (200) - **key_id** (string) - The Razorpay API key ID. - **name** (string) - The name of the merchant/university. - **description** (string) - A description of the payment. - **order_id** (string) - The Razorpay generated order ID. - **amount** (integer) - The payment amount in the smallest currency unit (e.g., paise for INR). - **currency** (string) - The currency of the payment. - **prefill** (object) - An object containing pre-filled customer details. - **name** (string) - Customer's name. - **email** (string) - Customer's email address. - **contact** (string) - Customer's phone number. ### Response Example ```json { "key_id": "rzp_live_xxxxx", "name": "My University", "description": "Payment for 15500 course", "order_id": "order_OzqBxxxxxxx", "amount": 1550000, "currency": "INR", "prefill": {"name": "Alice Smith", "email": "alice@university.edu", "contact": "9876543210"} } ``` ``` -------------------------------- ### FeeSchedule.create_fees() Source: https://context7.com/frappe/education/llms.txt Generates Sales Invoices or Sales Orders for enrolled students based on a Fee Schedule. For more than 10 students, this operation is enqueued as a background task. ```APIDOC ## FeeSchedule.create_fees() ### Description A whitelisted instance method on the **Fee Schedule** doctype. Generates Sales Invoices (or Sales Orders if `create_so` is enabled in Education Settings) for every enrolled student in every Student Group attached to the schedule. For > 10 students the job is enqueued as a background task. ### Method Instance method on `Fee Schedule` doctype. ### Endpoint `fee_schedule.create_fees()` ### Parameters This method does not take any explicit parameters. ### Request Example ```python fee_schedule = frappe.get_doc("Fee Schedule", "EDU-FSC-2024-00003") fee_schedule.create_fees() ``` ### Response #### Realtime Progress Events - **fee_schedule_progress**: Emits progress updates with `{"progress": 0..100, "reload": 1}`. #### Status Transitions - **Draft** → **Invoice Pending** → **Invoice Created** (or **Failed**) ``` -------------------------------- ### Set CSRF Token and Page Title Source: https://github.com/frappe/education/blob/develop/frontend/index.html Initializes the CSRF token from the server and sets the browser tab title. This code runs on page load. ```javascript window.csrf_token = '{{ frappe.session.csrf_token }}' window.document.title = '{{ abbr }}' ``` -------------------------------- ### Check Education App Permissions Source: https://context7.com/frappe/education/llms.txt Verifies if the current user has administrator privileges or the 'Education Manager' role. This is used to gate access to the app's main interface. ```python from education.api.permissions import has_app_permission if not has_app_permission(): frappe.throw("Not permitted", frappe.PermissionError) ``` -------------------------------- ### get_fee_components Source: https://context7.com/frappe/education/llms.txt Retrieves the line items (fees category, description, amount) for a given Fee Structure. ```APIDOC ## get_fee_components ### Description Returns each fee component (fees category, description, amount) from a **Fee Structure**, ordered by row index. ### Method frappe.call ### Parameters - **fee_structure** (string) - Required - The name of the Fee Structure. ### Request Example ```python components = frappe.call( "education.education.api.get_fee_components", fee_structure="FS-2024-0001" ) ``` ### Response Example ```json [ {"fees_category": "Tuition", "description": "Semester tuition", "amount": 15000.0}, {"fees_category": "Library", "description": "Library fee", "amount": 500.0}, ] ``` ``` -------------------------------- ### Dynamically Set Favicon Source: https://github.com/frappe/education/blob/develop/frontend/index.html Ensures a favicon link exists in the head and sets its source dynamically. This allows for custom branding. ```javascript let link = document.querySelector("link[rel~='icon']"); if (!link) { link = document.createElement('link'); link.rel = 'icon'; document.getElementsByTagName('head')[0].appendChild(link); } link.href = '{{ logo }}' ``` -------------------------------- ### get_student_info Source: https://context7.com/frappe/education/llms.txt Fetches the full profile of the currently logged-in student, including their current program and student groups. ```APIDOC ## get_student_info() ### Description Returns the **Student** record linked to the currently authenticated user's email, enriched with `current_program` (from `get_current_enrollment`) and `student_groups`. Used by the Vue student portal on every page load. Throws `AuthenticationError` if called as Guest. ### Parameters This endpoint does not require any parameters. ### Request Example ```python # Called from the Vue frontend via frappe-ui createResource info = frappe.call("education.education.api.get_student_info") # { # "name": "EDU-STU-2024-00001", # "student_name": "Alice Smith", # "student_email_id": "alice@university.edu", # "current_program": { "program": "Bachelor of Computer Science", ... }, # "student_groups": [{"label": "Batch-A-CS-2024"}, ...] # } ``` ### Response #### Success Response (200) - **name** (string) - The student's unique identifier. - **student_name** (string) - The full name of the student. - **student_email_id** (string) - The student's email address. - **current_program** (object) - Details of the student's current program enrollment. - **student_groups** (array) - A list of student groups the student belongs to. ``` -------------------------------- ### get_fee_structure Source: https://context7.com/frappe/education/llms.txt Looks up the name of a Fee Structure document based on program and academic term. ```APIDOC ## get_fee_structure ### Description Returns the name of the **Fee Structure** document matching the given program and optional academic term. Returns `None` if no match is found. ### Method frappe.call ### Parameters - **program** (string) - Required - The name of the program. - **academic_term** (string) - Optional - The academic term. ### Request Example ```python fee_structure_name = frappe.call( "education.education.api.get_fee_structure", program="Bachelor of Computer Science", academic_term="Semester 1 2024-25" ) ``` ### Response Example ```json "FS-2024-0001" ``` ``` -------------------------------- ### Handle Razorpay Payment Success Source: https://context7.com/frappe/education/llms.txt Verifies Razorpay payment signature, creates a Payment Record, generates a Payment Entry, and marks the invoice as paid. This function is idempotent. ```python frappe.call( "education.education.billing.handle_payment_success", response={ "razorpay_order_id": "order_OzqBxxxxxxx", "razorpay_payment_id": "pay_Pxxxxxxxx", "razorpay_signature": "abc123def456..." }, against_invoice="ACC-SINV-2024-00123", billing_details={ "id": "EDU-STU-2024-00001", "mobile_number": "9876543210", "email": "alice@university.edu", "currency": "INR", "outstanding_amount": 15500 } ) ``` -------------------------------- ### apply_leave Source: https://context7.com/frappe/education/llms.txt Applies for student leave by marking attendance as 'Leave' for a specified date range. ```APIDOC ## apply_leave(leave_data, program_name) ### Description Marks Student Attendance as "Leave" for the specified date range. If `attendance_based_on_course_schedule` is enabled in Education Settings, leave is applied per Course Schedule entry; otherwise it iterates all dates and student groups. The `leave_data` dict must contain `student`, `student_name`, `from_date`, `to_date`. ### Parameters #### Path Parameters - **leave_data** (object) - Required - A dictionary containing leave application details: - **student** (string) - Required - The student's ID. - **student_name** (string) - Required - The student's name. - **from_date** (string) - Required - The start date of the leave (YYYY-MM-DD). - **to_date** (string) - Required - The end date of the leave (YYYY-MM-DD). - **reason** (string) - Optional - The reason for the leave. - **program_name** (string) - Required - The name of the program the leave is for. ### Request Example ```python import json leave_data = { "student": "EDU-STU-2024-00001", "student_name": "Alice Smith", "from_date": "2024-09-20", "to_date": "2024-09-22", "reason": "Medical leave" } frappe.call( "education.education.api.apply_leave", leave_data=leave_data, program_name="Bachelor of Computer Science" ) ``` ### Response #### Success Response (200) This endpoint does not return a specific JSON response body upon success, but indicates successful application of leave. ``` -------------------------------- ### handle_payment_success(response, against_invoice, billing_details) Source: https://context7.com/frappe/education/llms.txt Verifies a Razorpay payment, settles it against a Sales Invoice, and updates the invoice status. This function is idempotent. ```APIDOC ## handle_payment_success(response, against_invoice, billing_details) ### Description Verifies the Razorpay payment signature, creates a **Payment Record** with status "Captured", generates and submits a **Payment Entry** against the Sales Invoice, and marks the invoice as paid. Idempotent — ignores duplicate calls for the same order+payment combination. ### Method `frappe.call` ### Endpoint education.education.billing.handle_payment_success ### Parameters #### Request Body - **response** (object) - Required - The response object from Razorpay containing payment details. - **razorpay_order_id** (string) - The Razorpay order ID. - **razorpay_payment_id** (string) - The Razorpay payment ID. - **razorpay_signature** (string) - The payment signature for verification. - **against_invoice** (string) - Required - The name of the Sales Invoice document to settle against. - **billing_details** (object) - Required - Details related to the billing transaction. - **id** (string) - The ID of the billing record. - **mobile_number** (string) - The customer's mobile number. - **email** (string) - The customer's email address. - **currency** (string) - The currency of the transaction. - **outstanding_amount** (float) - The outstanding amount of the invoice. ### Request Example ```python frappe.call( "education.education.billing.handle_payment_success", response={ "razorpay_order_id": "order_OzqBxxxxxxx", "razorpay_payment_id": "pay_Pxxxxxxxx", "razorpay_signature": "abc123def456..." }, against_invoice="ACC-SINV-2024-00123", billing_details={ "id": "EDU-STU-2024-00001", "mobile_number": "9876543210", "email": "alice@university.edu", "currency": "INR", "outstanding_amount": 15500 } ) ``` ``` -------------------------------- ### Configure Development Environment for CSRF Source: https://github.com/frappe/education/blob/develop/frontend/README.md Add this key-value pair to your `site_config.json` to prevent CSRFToken errors during development with the Vite dev server. This is not needed in production. ```json "ignore_csrf": 1 ``` -------------------------------- ### Mark Bulk Student Attendance Source: https://context7.com/frappe/education/llms.txt Creates Student Attendance records for present and absent students. Ensures the attendance date is within the Student Group's Academic Year. Use either `course_schedule` or `student_group` + `date`. ```python import json students_present = json.dumps([ {"student": "EDU-STU-2024-00001", "student_name": "Alice Smith"}, {"student": "EDU-STU-2024-00002", "student_name": "Bob Jones"}, ]) students_absent = json.dumps([ {"student": "EDU-STU-2024-00003", "student_name": "Carol White"}, ]) frappe.call( "education.education.api.mark_attendance", students_present=students_present, students_absent=students_absent, course_schedule="EDU-CSH-2024-00101", # OR use student_group + date instead of course_schedule: # student_group="Batch-A-CS-2024", # date="2024-09-15", ) # Displays: "Attendance has been marked successfully." ``` ```bash curl -X POST https://education.example.com/api/method/education.education.api.mark_attendance \ -H "Authorization: token api_key:api_secret" \ -d 'students_present=[{"student":"EDU-STU-2024-00001","student_name":"Alice Smith"}]' \ -d 'students_absent=[{"student":"EDU-STU-2024-00003","student_name":"Carol White"}]' \ -d "course_schedule=EDU-CSH-2024-00101" ``` -------------------------------- ### get_student_invoices Source: https://context7.com/frappe/education/llms.txt Retrieves a list of all submitted sales invoices for a student, including their payment status and details. ```APIDOC ## get_student_invoices(student) ### Description Returns all submitted Sales Invoices for a student (Paid, Unpaid, Overdue, Partly Paid) with status, program, amount, due date, and payment date. Also returns the configured print format name for PDF downloads. ### Parameters #### Path Parameters - **student** (string) - Required - The name or ID of the student. ### Request Example ```python data = frappe.call( "education.education.api.get_student_invoices", student="EDU-STU-2024-00001" ) # { # "invoices": [ # { # "status": "Unpaid", # "program": "Bachelor of Computer Science", # "amount": "₹ 15500.00", # "due_date": "2024-10-01", # "payment_date": "-", # "invoice": "ACC-SINV-2024-00123" # }, # { # "status": "Paid", # "program": "Bachelor of Computer Science", # "amount": "₹ 15500.00", # "due_date": "-", # "payment_date": "2024-08-15", # "invoice": "ACC-SINV-2024-00088" # } # ], # "print_format": "Fee Invoice" # } ``` ### Response #### Success Response (200) - **invoices** (array) - A list of invoice objects, each containing status, program, amount, due_date, payment_date, and invoice ID. - **print_format** (string) - The name of the print format for PDF downloads. ``` -------------------------------- ### get_assessment_criteria Source: https://context7.com/frappe/education/llms.txt Fetches the assessment criteria and their weightage configured for a specific course. ```APIDOC ## get_assessment_criteria ### Description Returns the list of assessment criteria and their weightage configured on a **Course** master document. ### Method frappe.call ### Parameters - **course** (string) - Required - The name of the course. ### Request Example ```python criteria = frappe.call( "education.education.api.get_assessment_criteria", course="Introduction to Programming" ) ``` ### Response Example ```json [ {"assessment_criteria": "Midterm Exam", "weightage": 40}, {"assessment_criteria": "Final Exam", "weightage": 60}, ] ``` ``` -------------------------------- ### Lookup Fee Structure Name Source: https://context7.com/frappe/education/llms.txt Finds the name of a Fee Structure document based on program and academic term. Returns `None` if no match is found. ```python fee_structure_name = frappe.call( "education.education.api.get_fee_structure", program="Bachelor of Computer Science", academic_term="Semester 1 2024-25" ) # "FS-2024-0001" ``` -------------------------------- ### get_school_abbr_logo() Source: https://context7.com/frappe/education/llms.txt Retrieves the school or college name abbreviation and logo URL from Education Settings. This is typically used for displaying branding elements in the portal navbar. ```APIDOC ## get_school_abbr_logo() ### Description Returns the school/college name abbreviation and logo URL from Education Settings, used by the portal navbar. ### Method `frappe.call` ### Endpoint education.education.api.get_school_abbr_logo ### Response #### Success Response (200) - **name** (string) - The school/college name abbreviation. - **logo** (string) - The URL of the school logo. ### Response Example ```json { "name": "MIT", "logo": "/files/school_logo.png" } ``` ```