Hello
I have trawled the many forums and have been unable to find an answer to this so I am wondering if some kind soul can help out. We are looking at using a semester system in our purely online school. All our students have to apply to be apart of our school before they then have free reign of our courses in the semesters. We have a few levels and a membership scheme for high level classes and need an enrolment process in place that can deal with this. We have tried the Registeration Enrolment which does do most of the work for us but would like to somehow link this to the certificates issued and save in a previous course so that if there is a certificate for such a person they can enrol and if not they cannot. This would need to be configurable for each class and in some cases will need to look for a couple of certificates. Let me give an example of the different aspects we need.
The class must have a maximum enrolment of 30 students and each student can enrol in no more than 3 classes.
A level one course they must have an application approved in order to gain access to this level.
A level two course they must have received a certificate in the level one course and have an application approved in order to gain access to this level.
A level three course they must have received a certificate in 1 of two of the level two courses and have an application approved as well so be a paid member in order to gain access to this level.
I thought that it maybe easy to use code to add in a look up for the certificate issued and compare it to the course password but I am not that clearer and got stuck. I tried adding it in different place and it kept giving an error so I guess I have not got it right or in the right place.
So what I tried is
if(!empty($course->password) {
if(!($certificate_issues->classname WHERE $certificate_issues->userid == $USER->id AND $certificate_issues->classname == $course->password) == $course->password) {
$err = get_string('errprerequisite','block_registration');
throw new Exception($err);
}
Please can someone help me!
Oh before I forget we have Moodle 1.9