get_record('course', array('id'=>$id))) { error("Course ID is incorrect"); } $capabilities = feedback_load_course_capabilities($course->id); require_login($course->id); add_to_log($course->id, 'feedback', 'view all', htmlspecialchars('index.php?id='.$course->id), $course->id); /// Print the page header $strfeedbacks = get_string("modulenameplural", "feedback"); $strfeedback = get_string("modulename", "feedback"); $navlinks = array(); $navlinks[] = array('name' => $strfeedbacks, 'link' => "", 'type' => 'activity'); $navigation = build_navigation($navlinks); print_header_simple(get_string('modulename', 'feedback').' '.get_string('activities'), "", $navigation, "", "", true, null, navmenu($course)); /// Get all the appropriate data if (! $feedbacks = get_all_instances_in_course("feedback", $course)) { notice("There are no feedbacks", htmlspecialchars('../../course/view.php?id='.$course->id)); die; } /// Print the list of instances (your module will probably extend this) $timenow = time(); $strname = get_string("name"); $strweek = get_string("week"); $strtopic = get_string("topic"); $strresponses = get_string('responses', 'feedback'); if ($course->format == "weeks") { if($capabilities->viewreports) { $table->head = array ($strweek, $strname, $strresponses); $table->align = array ("center", "left", 'center'); }else{ $table->head = array ($strweek, $strname); $table->align = array ("center", "left"); } } else if ($course->format == "topics") { if($capabilities->viewreports) { $table->head = array ($strtopic, $strname, $strresponses); $table->align = array ("center", "left", "center"); }else{ $table->head = array ($strtopic, $strname); $table->align = array ("center", "left"); } } else { if($capabilities->viewreports) { $table->head = array ($strname, $strresponses); $table->align = array ("left", "center"); }else{ $table->head = array ($strname); $table->align = array ("left"); } } foreach ($feedbacks as $feedback) { //get the responses of each feedback if($capabilities->viewreports) { $completedFeedbackCount = intval(feedback_get_completeds_group_count($feedback)); } if (!$feedback->visible) { //Show dimmed if the mod is hidden $link = ''.$feedback->name.''; } else { //Show normal if the mod is visible $link = ''.$feedback->name.''; } if ($course->format == "weeks" or $course->format == "topics") { $tabledata = array ($feedback->section, $link); } else { $tabledata = array ($link); } if($capabilities->viewreports) { $tabledata[] = $completedFeedbackCount; } $table->data[] = $tabledata; } echo "
"; print_table($table); /// Finish the page print_footer($course); ?>