Hi rameshwar ....
In dashboard actually displaying courses overview i.e., the login user enrolled for which course actually.....let we modify simply like this way
I think consider three steps we can display the quiz's in the courses:-
1.Check if the user is enrolled for the course or not.
2.if the login user is enrolled to the course('s)
$sectiondata = $DB->get_records_sql("SELECT COALESCE(name, concat('Topic ', section)) as name, section, sequence FROM {course_sections} where course=$course->id and section <> 0 ORDER BY section");
Repeat the query for each course as well as concat('Topic ', section)) Whatever you choose for the course format.
3.In that we get sections as well as course_module_id check if it is quiz or else if quiz we can get the content and display it. or just give a link to that page from dashboard (first run query can understand automatically)