New course option to enable/disable display of "recent activity"

This commit is contained in:
moodler
2002-11-12 04:26:16 +00:00
parent cbb0fee071
commit 13beeacbcd
8 changed files with 77 additions and 36 deletions
+10
View File
@@ -98,6 +98,16 @@
formerr($err["numsections"]);
?></td>
</tr>
<tr valign=top>
<td><P><? print_string("showrecent") ?>:</td>
<td><?
unset($choices);
$choices["0"] = get_string("no");
$choices["1"] = get_string("yes");
choose_from_menu ($choices, "showrecent", $form->showrecent, "");
helpbutton("courserecent", get_string("showrecent")); ?>
</td>
</tr>
<tr valign=top>
<td><P><? print_string("wordforteacher") ?>:</td>
<td><input type="text" name="teacher" size=25 value="<? p($form->teacher) ?>">
+22 -16
View File
@@ -207,25 +207,31 @@
echo "</TABLE>";
echo "</TD><TD WIDTH=210>";
if ($news or $course->showrecent) {
echo "</TD><TD WIDTH=210>";
/// Print all the news items.
/// Print all the news items.
if ($news) {
print_simple_box(get_string("latestnews"), $align="CENTER", $width="100%", $color="$THEME->cellheading");
print_simple_box_start("CENTER", "100%", "#FFFFFF", 3, 0);
echo "<FONT SIZE=1>";
forum_print_latest_discussions($news->id, $course->newsitems, "minimal", "DESC", false);
echo "</FONT>";
print_simple_box_end();
echo "<BR>";
if ($news) {
print_simple_box(get_string("latestnews"), $align="CENTER", $width="100%", $color="$THEME->cellheading");
print_simple_box_start("CENTER", "100%", "#FFFFFF", 3, 0);
echo "<FONT SIZE=1>";
forum_print_latest_discussions($news->id, $course->newsitems, "minimal", "DESC", false);
echo "</FONT>";
print_simple_box_end();
echo "<BR>";
}
/// Print all the recent activity
if ($course->showrecent) {
print_simple_box(get_string("recentactivity"), $align="CENTER", $width="100%", $color="$THEME->cellheading");
print_simple_box_start("CENTER", "100%", "#FFFFFF", 3, 0);
print_recent_activity($course);
print_simple_box_end();
}
echo "<BR><IMG SRC=\"../pix/spacer.gif\" WIDTH=210 HEIGHT=1>";
}
// Print all the recent activity
print_simple_box(get_string("recentactivity"), $align="CENTER", $width="100%", $color="$THEME->cellheading");
print_simple_box_start("CENTER", "100%", "#FFFFFF", 3, 0);
print_recent_activity($course);
print_simple_box_end();
echo "</TD></TR></TABLE>\n";
+22 -19
View File
@@ -201,28 +201,31 @@
}
echo "</TABLE>";
if ($news or $course->showrecent) {
echo "</TD><TD WIDTH=210>";
echo "</TD><TD WIDTH=210>";
// Print all the news items.
// Print all the news items.
if ($news) {
print_simple_box(get_string("latestnews"), $align="CENTER", $width="100%", $color="$THEME->cellheading");
print_simple_box_start("CENTER", "100%", "#FFFFFF", 3, 0);
echo "<FONT SIZE=1>";
forum_print_latest_discussions($news->id, $course->newsitems, "minimal", "DESC", false);
echo "</FONT>";
print_simple_box_end();
echo "<BR>";
}
if ($news) {
print_simple_box(get_string("latestnews"), $align="CENTER", $width="100%", $color="$THEME->cellheading");
print_simple_box_start("CENTER", "100%", "#FFFFFF", 3, 0);
echo "<FONT SIZE=1>";
forum_print_latest_discussions($news->id, $course->newsitems, "minimal", "DESC", false);
echo "</FONT>";
print_simple_box_end();
echo "<BR>";
}
// Print all the recent activity
if ($course->showrecent) {
print_simple_box(get_string("recentactivity"), $align="CENTER", $width="100%", $color="$THEME->cellheading");
print_simple_box_start("CENTER", "100%", "#FFFFFF", 3, 0);
print_recent_activity($course);
print_simple_box_end();
}
// Print all the recent activity
print_simple_box(get_string("recentactivity"), $align="CENTER", $width="100%", $color="$THEME->cellheading");
print_simple_box_start("CENTER", "100%", "#FFFFFF", 3, 0);
print_recent_activity($course);
print_simple_box_end();
echo "<BR><IMG SRC=\"../pix/spacer.gif\" WIDTH=210 HEIGHT=1>";
echo "<BR><IMG SRC=\"../pix/spacer.gif\" WIDTH=210 HEIGHT=1>";
}
echo "</TD></TR></TABLE>\n";
+16
View File
@@ -0,0 +1,16 @@
<P ALIGN=CENTER><B>Recent Activity</B></P>
<P>Moodle can display "recent activity" on the course home page.
<P>This shows the everything that has happened in the course since
the last time the viewer logged in to the course, including
new posts, new users, submitted journals etc.
<P>It is highly recommended you leave this feature enabled in
your courses, as it helps give a sense of activity in the course.
Knowing what everyone else is doing also helps to promote a
collaborative atmosphere in the class.
<P>You might want to disable this feature for extremely large or
heavily used courses, as it may slow down the display of
the course page.
+1
View File
@@ -421,6 +421,7 @@ $string['showallweeks'] = "Show all weeks";
$string['showlistofcourses'] = "Show list of courses";
$string['showonlytopic'] = "Show only topic \$a";
$string['showonlyweek'] = "Show only week \$a";
$string['showrecent'] = "Show recent activity";
$string['showtheselogs'] = "Show these logs";
$string['socialheadline'] = "Social forum - latest topics";
$string['showallcourses'] = "Show all courses";
+4
View File
@@ -193,6 +193,10 @@ function main_upgrade($oldversion=0) {
print_simple_box_end();
}
if ($oldversion < 2002111200) {
execute_sql(" ALTER TABLE `course` ADD `showrecent` TINYINT(5) UNSIGNED DEFAULT '1' NOT NULL AFTER `numsections` ");
}
return true;
}
+1
View File
@@ -44,6 +44,7 @@ CREATE TABLE `course` (
`guest` tinyint(2) unsigned NOT NULL default '0',
`startdate` int(10) unsigned NOT NULL default '0',
`numsections` smallint(5) unsigned NOT NULL default '1',
`showrecent` smallint(5) unsigned NOT NULL default '1',
`marker` int(10) unsigned NOT NULL default '0',
`timecreated` int(10) unsigned NOT NULL default '0',
`timemodified` int(10) unsigned NOT NULL default '0',
+1 -1
View File
@@ -5,7 +5,7 @@
// database to determine whether upgrades should
// be performed (see lib/db/*.php)
$version = 2002111100; // The current version is a date (YYYYMMDDXX)
$version = 2002111200; // The current version is a date (YYYYMMDDXX)
$release = "1.0.6.2"; // User-friendly version number