condensed next function into elearningcoursepage.php