mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 12:40:01 +01:00
small fix to the versioning code
This commit is contained in:
parent
a2b8226353
commit
9274189f25
@ -328,7 +328,7 @@
|
||||
}
|
||||
notify("$strattemptsexist<br /><a href=\"report.php?id=$cm->id\">$strviewallanswers ($usercount $strusers)</a>");
|
||||
|
||||
$sumgrades = quiz_print_question_list($modform->questions, $modform->grades, false);
|
||||
$sumgrades = quiz_print_question_list($modform->questions, $modform->grades, false, $modform->instance);
|
||||
if (!set_field('quiz', 'sumgrades', $sumgrades, 'id', $modform->instance)) {
|
||||
error('Failed to set sumgrades');
|
||||
}
|
||||
@ -357,7 +357,7 @@
|
||||
echo '<tr><td width="50%" valign="top">';
|
||||
print_simple_box_start("center", "100%");
|
||||
print_heading($modform->name);
|
||||
$sumgrades = quiz_print_question_list($modform->questions, $modform->grades);
|
||||
$sumgrades = quiz_print_question_list($modform->questions, $modform->grades, true, $modform->instance);
|
||||
if (!set_field('quiz', 'sumgrades', $sumgrades, 'id', $modform->instance)) {
|
||||
error('Failed to set sumgrades');
|
||||
}
|
||||
|
@ -1217,7 +1217,7 @@ function quiz_gradesmenu_options($defaultgrade) {
|
||||
return $gradesmenu;
|
||||
}
|
||||
|
||||
function quiz_print_question_list($questionlist, $grades, $allowdelete=true) {
|
||||
function quiz_print_question_list($questionlist, $grades, $allowdelete=true, $quizid=0) {
|
||||
// Prints a list of quiz questions in a small layout form with knobs
|
||||
// returns sum of maximum grades
|
||||
// $questionlist is comma-separated list
|
||||
@ -1295,9 +1295,10 @@ function quiz_print_question_list($questionlist, $grades, $allowdelete=true) {
|
||||
echo '<td align="center">';
|
||||
|
||||
if ($canedit) {
|
||||
$context = $quizid ? '&contextquiz='.$quizid : '';
|
||||
echo "<a title=\"$strpreview\" href=\"javascript:void();\" onClick=\"openpopup('/mod/quiz/preview.php?id=$qnum','$strpreview','scrollbars=yes,resizable=yes,width=700,height=480', false)\">
|
||||
<img src=\"../../pix/t/preview.gif\" border=\"0\" alt=\"$strpreview\" /></a> ";
|
||||
echo "<a title=\"$stredit\" href=\"question.php?id=$qnum\">
|
||||
echo "<a title=\"$stredit\" href=\"question.php?id=$qnum$context\">
|
||||
<img src=\"../../pix/t/edit.gif\" border=\"0\" alt=\"$stredit\" /></a> ";
|
||||
if ($allowdelete) {
|
||||
echo "<a title=\"$strremove\" href=\"edit.php?delete=$qnum&sesskey=$USER->sesskey\">
|
||||
@ -2006,7 +2007,7 @@ function quizzes_question_used($id) {
|
||||
|
||||
function quiz_parse_fieldname($name, $nameprefix='question') {
|
||||
$reg = array();
|
||||
if(preg_match("/q(\\d+)(\w+)/", $name, $reg)) {
|
||||
if (preg_match("/$nameprefix(\\d+)(\w+)/", $name, $reg)) {
|
||||
return array('mode' => $reg[2], 'id' => (int)$reg[1]);
|
||||
} else {
|
||||
return false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user