changed $courseid to optional_param and default to 1, if not exist. Fix issue #7