Auto populate the Course ID field

Re: Auto populate the Course ID field

by Sandipa Mukherjee -
Number of replies: 0
Picture of 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