mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
Print images correctly on questions included from categories in
other courses.
This commit is contained in:
parent
52dcc2f9e6
commit
263cff8b75
1 changed files with 14 additions and 6 deletions
|
@ -411,11 +411,19 @@ function quiz_print_question($number, $question, $grade, $courseid,
|
||||||
/// Prints a quiz question, any format
|
/// Prints a quiz question, any format
|
||||||
/// $question is provided as an object
|
/// $question is provided as an object
|
||||||
|
|
||||||
|
if ($question->image) {
|
||||||
|
if ($quizcategory = get_record("quiz_categories", "id", $question->category)) {
|
||||||
|
$question->course = $quizcategory->course;
|
||||||
|
} else {
|
||||||
|
$question->course = $courseid;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($question->qtype == DESCRIPTION) { // Special case question - has no answers etc
|
if ($question->qtype == DESCRIPTION) { // Special case question - has no answers etc
|
||||||
echo '<p align="center">';
|
echo '<p align="center">';
|
||||||
echo text_to_html($question->questiontext);
|
echo text_to_html($question->questiontext);
|
||||||
if ($question->image) {
|
if ($question->image) {
|
||||||
print_file_picture($question->image, $courseid);
|
print_file_picture($question->image, $question->course);
|
||||||
}
|
}
|
||||||
echo '</p>';
|
echo '</p>';
|
||||||
return true;
|
return true;
|
||||||
|
@ -450,7 +458,7 @@ function quiz_print_question($number, $question, $grade, $courseid,
|
||||||
case NUMERICAL:
|
case NUMERICAL:
|
||||||
echo text_to_html($question->questiontext);
|
echo text_to_html($question->questiontext);
|
||||||
if ($question->image) {
|
if ($question->image) {
|
||||||
print_file_picture($question->image, $courseid);
|
print_file_picture($question->image, $question->course);
|
||||||
}
|
}
|
||||||
if ($response) {
|
if ($response) {
|
||||||
$value = "VALUE=\"$response[0]\"";
|
$value = "VALUE=\"$response[0]\"";
|
||||||
|
@ -485,7 +493,7 @@ function quiz_print_question($number, $question, $grade, $courseid,
|
||||||
}
|
}
|
||||||
echo text_to_html($question->questiontext);
|
echo text_to_html($question->questiontext);
|
||||||
if ($question->image) {
|
if ($question->image) {
|
||||||
print_file_picture($question->image, $courseid);
|
print_file_picture($question->image, $question->course);
|
||||||
}
|
}
|
||||||
|
|
||||||
$truechecked = "";
|
$truechecked = "";
|
||||||
|
@ -530,7 +538,7 @@ function quiz_print_question($number, $question, $grade, $courseid,
|
||||||
}
|
}
|
||||||
echo text_to_html($question->questiontext);
|
echo text_to_html($question->questiontext);
|
||||||
if ($question->image) {
|
if ($question->image) {
|
||||||
print_file_picture($question->image, $courseid);
|
print_file_picture($question->image, $question->course);
|
||||||
}
|
}
|
||||||
echo "<TABLE ALIGN=right>";
|
echo "<TABLE ALIGN=right>";
|
||||||
echo "<TR><TD valign=top>$stranswer: </TD><TD>";
|
echo "<TR><TD valign=top>$stranswer: </TD><TD>";
|
||||||
|
@ -586,7 +594,7 @@ function quiz_print_question($number, $question, $grade, $courseid,
|
||||||
echo text_to_html($question->questiontext);
|
echo text_to_html($question->questiontext);
|
||||||
}
|
}
|
||||||
if (!empty($question->image)) {
|
if (!empty($question->image)) {
|
||||||
print_file_picture($question->image, $courseid);
|
print_file_picture($question->image, $question->course);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($shuffleanswers) {
|
if ($shuffleanswers) {
|
||||||
|
@ -636,7 +644,7 @@ function quiz_print_question($number, $question, $grade, $courseid,
|
||||||
}
|
}
|
||||||
echo text_to_html($question->questiontext);
|
echo text_to_html($question->questiontext);
|
||||||
if ($question->image) {
|
if ($question->image) {
|
||||||
print_file_picture($question->image, $courseid);
|
print_file_picture($question->image, $question->course);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// First, get all the questions available
|
/// First, get all the questions available
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue