--- /Users/sbourget/Desktop/MDL/moodle 1.9 CLEAN/mod/quiz/lib.php 2007-06-21 10:02:56.000000000 -0400 +++ /Applications/MAMP/htdocs/moodle19/mod/quiz/lib.php 2007-07-22 09:39:31.000000000 -0400 @@ -12,6 +12,7 @@ require_once($CFG->libdir.'/pagelib.php'); require_once($CFG->libdir.'/questionlib.php'); +require_once("locallib.php"); /// CONSTANTS /////////////////////////////////////////////////////////////////// @@ -893,4 +894,68 @@ // otherwise, this user does not have permission return false; } + +/** + * Prints quiz summaries on MyMoodle Page + * + */ +function quiz_print_overview($courses, &$htmlarray) { + global $USER, $CFG; +// These next 6 Lines are constant in all modules (just change module name) + if (empty($courses) || !is_array($courses) || count($courses) == 0) { + return array(); + } + + if (!$quizs = get_all_instances_in_courses('quiz',$courses)) { + return; + } +// Get Necessary Sirings + $strquiz = get_string('modulename', 'quiz'); + $strquizcloses = get_string('quizcloses', 'quiz'); + $strquizopens = get_string('quizopens', 'quiz'); + $strattempts = get_string('attempts', 'quiz'); + $strnotattempted = get_string('noattempts', 'quiz'); + $strattempted = get_string('attempted', 'quiz'); + + foreach ($quizs as $quiz) { + if ($quiz->timeclose != 0) { // A quiz is scheduled + $str = '