diff --git a/mod/journal/index.php b/mod/journal/index.php index 838c8d63ea3..e39993d9165 100644 --- a/mod/journal/index.php +++ b/mod/journal/index.php @@ -13,7 +13,7 @@ add_to_log($course->id, "journal", "view all", "index.php?id=$course->id", ""); if ($course->category) { - $navigation = "id\">$course->shortname ->"; + $navigation = "id\">$course->shortname ->"; } $strjournal = get_string("modulename", "journal"); @@ -37,14 +37,11 @@ $timenow = time(); if ($course->format == "weeks") { - $table->head = array ($strweek, $strquestion, $stranswer); - $table->align = array ("CENTER", "LEFT", "LEFT"); + $strsection = $strweek; } else if ($course->format == "topics") { - $table->head = array ($strtopic, $strquestion, $stranswer); - $table->align = array ("CENTER", "LEFT", "LEFT"); + $strsection = $strtopic; } else { - $table->head = array ($strquestion, $stranswer); - $table->align = array ("LEFT", "LEFT"); + $strsection = ""; } foreach ($journals as $journal) { @@ -55,36 +52,15 @@ } else { $journal->timefinish = 9999999999; } + $journalopen = ($journal->timestart < $timenow && $timenow < $journal->timefinish); - $entrytext = get_field("journal_entries", "text", "userid", $USER->id, "journal", $journal->id); + journal_user_complete_index($course, $USER, $journal, $journalopen, "$strsection $journal->section"); - $text = text_to_html($entrytext)."
coursemodule\">"; - - if ($journalopen) { - $text .= "$stredit
"; - } else { - $text .= "$strview"; - } - if (!empty($journal->section)) { - $section = "$journal->section"; - } else { - $section = ""; - } - if ($course->format == "weeks" or $course->format == "topics") { - $table->data[] = array ($section, - text_to_html($journal->intro), - $text); - } else { - $table->data[] = array (text_to_html($journal->intro), - $text); - } } echo "coursemodule\">"; + echo get_string("edit")."
"; + } else { + echo "coursemodule\">"; + echo get_string("view")."
"; + } + + if ($entry = get_record("journal_entries", "userid", $user->id, "journal", $journal->id)) { + if ($entry->modified) { + echo "".get_string("lastedited").": ".userdate($entry->modified)."
"; + } + if ($entry->text) { + echo format_text($entry->text, $entry->format); + } + if ($entry->teacher) { + $grades = make_grades_menu($journal->assessed); + journal_print_feedback($course, $entry, $grades); + } + } else { + print_string("noentry", "journal"); + } + + print_simple_box_end(); + echo "