require_login($course->id, false);
- $context = get_context_instance(CONTEXT_MODULE, $cm->id);
+ $context = get_context_instance(CONTEXT_MODULE, $cm->id);
//has_capability('mod/survey:readresponses', $context->id, true);
if (! $survey = get_record("survey", "id", $cm->instance)) {
echo " <a href=\"report.php?action=questions&id=$id\">$strquestions</a>";
echo " <a href=\"report.php?action=students&id=$id\">$course->students</a>";
if (has_capability('mod/survey:download', $context->id)) {
- echo " <a href=\"report.php?action=download&id=$id\">$strdownload</a>";
+ echo " <a href=\"report.php?action=download&id=$id\">$strdownload</a>";
}
if (empty($action)) {
$action = "summary";
echo "<a href=\"report.php?action=questions&id=$id\">$strquestions</a>";
echo " <a href=\"report.php?action=students&id=$id\">$course->students</a>";
if (has_capability('mod/survey:download', $context->id)) {
- echo " <a href=\"report.php?action=download&id=$id\">$strdownload</a>";
- }
+ echo " <a href=\"report.php?action=download&id=$id\">$strdownload</a>";
+ }
if (empty($action)) {
$action = "questions";
}
break;
case "download":
- has_capability('mod/survey:download', $context->id, true);
+ has_capability('mod/survey:download', $context->id, true);
print_heading($strdownload);
echo '<p align="center">'.get_string("downloadinfo", "survey").'</p>';
require_login($course->id, false, $cm);
- $context = get_context_instance(CONTEXT_MODULE, $cm->id);
+ $context = get_context_instance(CONTEXT_MODULE, $cm->id);
has_capability('mod/survey:participate', $context->id, true);
- if (! $survey = get_record("survey", "id", $cm->instance)) {
+ if (! $survey = get_record("survey", "id", $cm->instance)) {
error("Survey ID was incorrect");
}
//if (isteacheredit($course->id) or ($groupmode == VISIBLEGROUPS)) {
if (has_capability('mod/survey:readresponses', $context->id) or ($groupmode == VISIBLEGROUPS)) {
- $currentgroup = 0;
+ $currentgroup = 0;
}
-
- if (isteacher($course->id)) {
+
+ if (isteacher($course->id)) {
//if (has_capability('mod/survey:readresponses', $context->id)) {
$numusers = survey_count_responses($survey->id, $currentgroup);
echo "<div class=\"reportlink\"><a href=\"report.php?id=$cm->id\">".