- The
SchoolSystemFactorycontract is responsible for deploying instances of theSchoolSystemcontract. - It keeps track of deployed
SchoolSystemcontracts by storing their addresses in thedeployedSchoolSystemsarray.
-
createSchoolSystem:- Function to deploy a new instance of the
SchoolSystemcontract. - Accepts parameters
nameandsymbolfor the name and symbol of the associated KIP17 token. - Emits an event
SchoolSystemDeployedafter deployment.
- Function to deploy a new instance of the
-
getDeployedSchoolSystemsCount:- View function to get the number of deployed
SchoolSystemcontracts. - Returns the length of the
deployedSchoolSystemsarray.
- View function to get the number of deployed
- The
SchoolSystemcontract represents a system for managing courses, students, and lecturers in a school. - It inherits from the
KIP17contract, allowing it to act as a Klaytn-based non-fungible token (NFT). - The contract also uses the
Ownablecontract, enabling ownership management functionalities.
courseCount,lecturerCount, andstudentCount: Counters for tracking the number of courses, lecturers, and students.- Various mappings for storing course details, lecturer and student tokens, and attendance information.
onlyAdmin,onlyLecturer, andonlyStudent: Modifiers restricting access to certain functions based on roles.
- Initializes the contract with the name and symbol of the associated KIP17 token.
-
Management Functions:
employ_Lecturer: Employ a new lecturer.admit_student: Admit a new student.transferOwnership: Transfer ownership of the contract.
-
Course Management Functions:
createCourse: Create a new course.registerForCourse: Register a student for a course.
-
Class Session Functions:
createClassSession: Create a new class session for a course.markAttendance: Mark attendance for a class session.
-
Query Functions:
getSessionIdsForLecturer: Get session IDs for a lecturer.getTotalRegisteredCourses: Get the total number of registered courses for a student.calculateAttendancePercentage: Calculate the attendance percentage for a student.
courseNameExists: Check if a course name already exists.getCourseSessionIds: Get session IDs for a specific course.
StudentRegistered: Fired when a student registers for a course.CourseCreated: Fired when a new course is created.ClassSessionCreated: Fired when a new class session is created.AttendanceMarked: Fired when attendance is marked for a class session.