MDL-15332 - Item analysis links to the question edit form even for users without an appropriate capability.

This commit is contained in:
tjhunt
2008-06-20 16:30:35 +00:00
parent 4a04703937
commit 2054096041
+5 -1
View File
@@ -316,7 +316,11 @@ class quiz_report extends quiz_default_report {
$q = $questions[$qnum];
$qid = $q['id'];
$question = get_record('question', 'id', $qid);
$qnumber = " (".link_to_popup_window('/question/question.php?id='.$qid,'editquestion', $qid, 450, 550, get_string('edit'), 'none', true ).") ";
if (question_has_capability_on($question, 'edit') || question_has_capability_on($question, 'view')) {
$qnumber = " (".link_to_popup_window('/question/question.php?id='.$qid,'&cmid='.$cm->id.'editquestion', $qid, 450, 550, get_string('edit'), 'none', true ).") ";
} else {
$qnumber = $qid;
}
$qname = '<div class="qname">'.format_text($question->name." : ", $question->questiontextformat, $format_options, $quiz->course).'</div>';
$qicon = print_question_icon($question, true);
$qreview = quiz_question_preview_button($quiz, $question);