course)) { error("Course is misconfigured"); } require_login($course->id); if (! $survey = get_record("survey", "id", $cm->instance)) { error("Survey ID was incorrect"); } if ($course->category) { $navigation = "id\">$course->shortname ->"; } $strsurveys = get_string("modulenameplural", "survey"); $strsurvey = get_string("modulename", "survey"); print_header("$course->shortname: $survey->name", "$course->fullname", "$navigation id>$strsurveys -> $survey->name", "", "", true, update_module_button($cm->id, $course->id, $strsurvey), navmenu($course, $cm)); if (isteacher($course->id)) { $numusers = survey_count_responses($survey->id); echo "
id\">". get_string("viewsurveyresponses", "survey", $numusers)."
"; } else if (!$cm->visible) { notice(get_string("activityiscurrentlyhidden")); } if (isguest()) { notify(get_string("guestsnotallowed", "survey")); } // Check the survey hasn't already been filled out. if (survey_already_done($survey->id, $USER->id)) { add_to_log($course->id, "survey", "view graph", "view.php?id=$cm->id", "$survey->id"); print_heading(get_string("surveycompleted", "survey")); $numusers = survey_count_responses($survey->id); print_heading(get_string("peoplecompleted", "survey", $numusers)); echo "