Factory_contract is basically made up of two contracts. The first is the StudentDetails contract mainly to get details of students in the school. In the same contract, the Principal is set as the only person who can admit and expel a student,
The parent contract which is the Factory_contract is where other contract can get an instance of the studentDetails contract. They can access to the StudentDetails contract from the Factory_contract. You can try it too