/** * Returns the sessions having the supplied id. Must be a session associated witha module that the user is taking in the currently loaded course. * * @param $session_id * * @return bool|Module */ function get_session_by_id($session_id) { $modules = get_modules_for_user(LOADED_COURSE_ID); $date = null; $the_session = null; foreach ($modules as $m) { foreach ($m->sessions as $s) { if ($s->id == $session_id) { return $s; } } } return false; }
/** * Called via ajax. Used to populate the popup where the user can set estimated work load on modules. */ function action_edit_module_settings() { $tpl = new tpl('edit_module_settings'); $tpl->set('modules', get_modules_for_user(LOADED_COURSE_ID)); $tpl->set('course_standard_module_hours', get_course_standard_module_hours(LOADED_COURSE_ID)); $tpl->set('user_standard_module_hours', get_user_standard_module_hours(LOADED_COURSE_ID)); echo $tpl->render(); }