Auto populate the Course ID field

Re: Auto populate the Course ID field

napisao/la Sandipa Mukherjee -
Broj odgovora: 0
Slika Particularly helpful Moodlers
Go to your moodle / course / edit_form.php function name definition(),
Go to after where idnumber is declared, paste this code
GLOBAL $COURSE;
if (!empty($COURSE)){
//print_r($COURSE->id); die;
$mform->hardFreeze('idnumber');
$mform->setDefault('idnumber', $COURSE->id);
}
hope it helps to populate the id in idnumber text box.
Thanks and regards,
Sandipa