MDL-48942 mod_survey: synced security checks in view.php and graph.php
This commit is contained in:
@@ -242,6 +242,7 @@ $string['selectedquestions'] = 'Selected questions from a scale, all students';
|
||||
$string['summary'] = 'Summary';
|
||||
$string['survey:addinstance'] = 'Add a new survey';
|
||||
$string['surveycompleted'] = 'You\'ve completed this survey. The graph below shows a summary of your results compared to the class averages.';
|
||||
$string['surveycompletednograph'] = 'You have completed this survey.';
|
||||
$string['survey:download'] = 'Download responses';
|
||||
$string['surveygraph'] = 'Survey graph';
|
||||
$string['surveyname'] = 'Survey name';
|
||||
|
||||
+13
-5
@@ -107,11 +107,19 @@ $completion->set_module_viewed($cm);
|
||||
$numusers = survey_count_responses($survey->id, $currentgroup, $groupingid);
|
||||
|
||||
if ($showscales) {
|
||||
echo $OUTPUT->box(get_string("surveycompleted", "survey"));
|
||||
echo $OUTPUT->box(get_string("peoplecompleted", "survey", $numusers));
|
||||
echo '<div class="resultgraph">';
|
||||
survey_print_graph("id=$cm->id&sid=$USER->id&group=$currentgroup&type=student.png");
|
||||
echo '</div>';
|
||||
// Ensure that graph.php will allow the user to see the graph.
|
||||
if (has_capability('mod/survey:readresponses', $context) || !$groupmode || groups_is_member($currentgroup)) {
|
||||
|
||||
echo $OUTPUT->box(get_string("surveycompleted", "survey"));
|
||||
echo $OUTPUT->box(get_string("peoplecompleted", "survey", $numusers));
|
||||
|
||||
echo '<div class="resultgraph">';
|
||||
survey_print_graph("id=$cm->id&sid=$USER->id&group=$currentgroup&type=student.png");
|
||||
echo '</div>';
|
||||
} else {
|
||||
echo $OUTPUT->box(get_string("surveycompletednograph", "survey"));
|
||||
echo $OUTPUT->box(get_string("peoplecompleted", "survey", $numusers));
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user