Permalink
Browse files

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

  • Loading branch information...
1 parent cbb0fee commit 13beeacbcd28bda88ba7909f2bf69ff65e73595f moodler committed Nov 12, 2002
Showing with 80 additions and 39 deletions.
  1. +10 −0 course/edit.html
  2. +23 −17 course/topics.php
  3. +24 −21 course/weeks.php
  4. +16 −0 lang/en/help/courserecent.html
  5. +1 −0 lang/en/moodle.php
  6. +4 −0 lib/db/mysql.php
  7. +1 −0 lib/db/mysql.sql
  8. +1 −1 version.php
View
@@ -99,6 +99,16 @@
?></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) ?>">
(<? print_string("wordforteachereg") ?>) <? formerr($err["teacher"]) ?>
View
@@ -207,25 +207,31 @@
echo "</TABLE>";
- echo "</TD><TD WIDTH=210>";
-
-/// Print all the news items.
+ if ($news or $course->showrecent) {
+ echo "</TD><TD WIDTH=210>";
+
+ /// 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>";
+ }
+
+ /// 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();
+ }
- 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>";
+ 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";
View
@@ -201,28 +201,31 @@
}
echo "</TABLE>";
-
- echo "</TD><TD WIDTH=210>";
-
- // 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 or $course->showrecent) {
+ echo "</TD><TD WIDTH=210>";
+
+ // 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>";
+ }
+
+ // 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";
@@ -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.
View
@@ -421,6 +421,7 @@
$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";
View
@@ -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;
}
View
@@ -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',
View
@@ -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

0 comments on commit 13beeac

Please sign in to comment.