mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
MDL-12945 fixing mod indexes broken by previous commit; merged from MOODLE_19_STABLE
This commit is contained in:
parent
78117f38bc
commit
52ae8c057a
8 changed files with 72 additions and 43 deletions
|
@ -51,21 +51,12 @@
|
|||
|
||||
$currentsection = "";
|
||||
|
||||
foreach ($cms as $cm) {
|
||||
if (!coursemodule_visible_for_user($cm)) {
|
||||
$modinfo = get_fast_modinfo($course);
|
||||
foreach ($modinfo->instances['choice'] as $cm) {
|
||||
if (!$cm->uservisible) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!empty($answers[$cm->instance])) {
|
||||
$answer = $answers[$cm->instance];
|
||||
} else {
|
||||
$answer = "";
|
||||
}
|
||||
if (!empty($answer->optionid)) {
|
||||
$aa = format_string(choice_get_option_text(null, $answer->optionid));
|
||||
} else {
|
||||
$aa = "";
|
||||
}
|
||||
$printsection = "";
|
||||
if ($cm->section !== $currentsection) {
|
||||
if ($cm->section) {
|
||||
|
@ -80,6 +71,17 @@
|
|||
$class = $cm->visible ? '' : 'class="dimmed"';
|
||||
$tt_href = "<a $class href=\"view.php?id=$cm->id\">".format_string($cm->name)."</a>";
|
||||
|
||||
if (!empty($answers[$cm->instance])) {
|
||||
$answer = $answers[$cm->instance];
|
||||
} else {
|
||||
$answer = "";
|
||||
}
|
||||
if (!empty($answer->optionid)) {
|
||||
$aa = format_string(choice_get_option_text(null, $answer->optionid));
|
||||
} else {
|
||||
$aa = "";
|
||||
}
|
||||
|
||||
if ($course->format == "weeks" || $course->format == "topics") {
|
||||
$table->data[] = array ($printsection, $tt_href, $aa);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue