]> git.mjollnir.org Git - moodle.git/commitdiff
Improvements to help, and addition of new "Activity modules" help
authormoodler <moodler>
Mon, 21 Oct 2002 03:00:40 +0000 (03:00 +0000)
committermoodler <moodler>
Mon, 21 Oct 2002 03:00:40 +0000 (03:00 +0000)
for teachers adding new modules.

course/lib.php
course/social.php
course/topics.php
course/weeks.php
help.php
lang/en/help/mods.html [new file with mode: 0644]
lang/en/moodle.php
lib/moodlelib.php
lib/weblib.php

index 9af095e641a1288d069f94cc61601e133173204b..b064802456a016f5ba211cec8485073c1a963618 100644 (file)
@@ -628,60 +628,35 @@ function print_log_graph($course, $userid=0, $type="course.png", $date=0) {
 function add_course_module($mod) {
     GLOBAL $db;
 
-    $timenow = time();
-
-    if (!$rs = $db->Execute("INSERT into course_modules 
-                                SET course   = '$mod->course', 
-                                    module   = '$mod->module',
-                                    instance = '$mod->instance',
-                                    section     = '$mod->section',
-                                    added    = '$timenow' ")) {
-        return 0;
-    }
-    
-    // Get it out again - this is the most compatible way to determine the ID
-    if ($rs = $db->Execute("SELECT id FROM course_modules 
-                            WHERE module = $mod->module AND added = $timenow")) {
-        return $rs->fields[0];
-    } else {
-        return 0;
-    }
+    $mod->added = time();
 
+    return insert_record("course_modules", $mod);
 }
 
 function add_mod_to_section($mod) {
 // Returns the course_sections ID where the mod is inserted
     GLOBAL $db;
 
-    if ($cw = get_record_sql("SELECT * FROM course_sections 
-                              WHERE course = '$mod->course' AND section = '$mod->section'") ) {
+    if ($section = get_record_sql("SELECT * FROM course_sections 
+                                   WHERE course = '$mod->course' AND section = '$mod->section'") ) {
 
-        if ($cw->sequence) {
-            $newsequence = "$cw->sequence,$mod->coursemodule";
+        if ($section->sequence) {
+            $newsequence = "$section->sequence,$mod->coursemodule";
         } else {
             $newsequence = "$mod->coursemodule";
         }
-        if (!$rs = $db->Execute("UPDATE course_sections SET sequence = '$newsequence' WHERE id = '$cw->id'")) {
-            return 0;
+        if (set_field("course_sections", "sequence", $newsequence, "id", $section->id)) {
+            return $section->id;     // Return course_sections ID that was used.
         } else {
-            return $cw->id;     // Return course_sections ID that was used.
+            return 0;
         }
        
     } else {  // Insert a new record
-        if (!$rs = $db->Execute("INSERT into course_sections 
-                                 SET course   = '$mod->course', 
-                                     section     = '$mod->section',
-                                     summary  = '',
-                                     sequence = '$mod->coursemodule' ")) {
-            return 0;
-        }
-        // Get it out again - this is the most compatible way to determine the ID
-        if ($rs = $db->Execute("SELECT id FROM course_sections 
-                                WHERE course = '$mod->course' AND section = '$mod->section'")) {
-            return $rs->fields[0];
-        } else {
-            return 0;
-        }
+        $section->course = $mod->course;
+        $section->section = $mod->section;
+        $section->summary = "";
+        $section->sequence = $mod->coursemodule;
+        return insert_record("course_sections", $section);
     }
 }
 
@@ -692,14 +667,14 @@ function delete_course_module($mod) {
 function delete_mod_from_section($mod, $section) {
     GLOBAL $db;
 
-    if ($cw = get_record("course_sections", "id", "$section") ) {
+    if ($section = get_record("course_sections", "id", "$section") ) {
 
-        $modarray = explode(",", $cw->sequence);
+        $modarray = explode(",", $section->sequence);
 
         if ($key = array_keys ($modarray, $mod)) {
             array_splice($modarray, $key[0], 1);
             $newsequence = implode(",", $modarray);
-            return set_field("course_sections", "sequence", $newsequence, "id", $cw->id);
+            return set_field("course_sections", "sequence", $newsequence, "id", $section->id);
         } else {
             return false;
         }
index b984549537dfa349ab082da77d83313e15401534..19f72996221e2b13923c42f626c355bdad6841ba 100644 (file)
@@ -32,7 +32,7 @@
       if (isediting($site->id)) {
           echo "<DIV ALIGN=right>";
           popup_form("$CFG->wwwroot/course/mod.php?id=$course->id&section=0&add=",
-                      $modnames, "section0", "", get_string("add")."...");
+                      $modnames, "section0", "", get_string("add")."...", "mods", get_string("activities"));
           echo "</DIV>";
       }      
 
index b291a7876ff7090f40e86184362f718e136ee4b7..bfb9164ff61845e2d0e89ee0ec98216be04108fb 100644 (file)
         if (isediting($course->id)) {
             echo "<DIV ALIGN=right>";
             popup_form("$CFG->wwwroot/course/mod.php?id=$course->id&section=$section&add=", 
-                        $modnames, "section$section", "", "$stradd...");
+                        $modnames, "section$section", "", "$stradd...", "mods", get_string("activities"));
             echo "</DIV>";
         }
 
index 55118ec653830315f150da388010968e9a8dcee6..d8a2ac6df0d5fb4ad6618fe17f7f07b6dba0585c 100644 (file)
         if (isediting($course->id)) {
             echo "<DIV ALIGN=right>";
             popup_form("$CFG->wwwroot/course/mod.php?id=$course->id&section=$week&add=", 
-                        $modnames, "section$week", "", "$stradd...");
+                        $modnames, "section$week", "", "$stradd...", "mods", get_string("activities"));
             echo "</DIV>";
         }
 
index 97a04aa6f45bfac779bdd944f5363284e3ffac46..18e95bcbc0c44781209ec7c732e148a3dfcec34f 100644 (file)
--- a/help.php
+++ b/help.php
@@ -47,6 +47,8 @@
         echo $text;
         echo "</P>";
     }
+
+    close_window_button();
 ?>
 </BODY>
 </HTML>
diff --git a/lang/en/help/mods.html b/lang/en/help/mods.html
new file mode 100644 (file)
index 0000000..0d0ceb0
--- /dev/null
@@ -0,0 +1,69 @@
+<P ALIGN=CENTER><B>Activity Modules</B></P>
+
+<P>Moodle contains a wide range of activity modules that can be used to 
+   build up any type of course.</P>
+
+<P><IMG VALIGN=absmiddle SRC="<?=$CFG->wwwroot?>/mod/forum/icon.gif">&nbsp;<B>Forums</B></P>
+<UL>
+<P>This activity can be the most important - it is here that most discussion takes place. 
+   Forums can be structured in different ways, and can include peer rating of each posting.
+   The postings can be viewed in a variety for formats, and can include attachments.  
+   By subscribing to a forum, participants will receive copies of each new posting 
+   in their email.  A teacher can impose subscription on everyone if they want to.
+</UL>
+
+<P><IMG VALIGN=absmiddle SRC="<?=$CFG->wwwroot?>/mod/journal/icon.gif">&nbsp;<B>Journals</B></P>
+<UL>
+<P>This module is a very important reflective activity.  The teacher 
+   asks the student to reflect on a particular topic, and the student can 
+   edit and refine their answer over time.  This answer is private and
+   can only be seen by the teacher, who can offer feedback and a grade 
+   on each journal entry.  It's usually a good idea to have about one 
+   Journal activity per week.</P>
+</UL>
+
+<P><IMG VALIGN=absmiddle SRC="<?=$CFG->wwwroot?>/mod/resource/icon.gif">&nbsp;<B>Resources</B></P>
+<UL>
+<P>Resources are content: information you want to bring into the 
+   course.  These can be prepared files you've uploaded to the course 
+   server; pages you edit directly in Moodle; or simply links to 
+   external web pages that appear within this course.</P>
+</UL>
+
+<P><IMG VALIGN=absmiddle SRC="<?=$CFG->wwwroot?>/mod/assignment/icon.gif">&nbsp;<B>Assignments</B></P>
+<UL>
+<P>Assignments allow the teacher to specify a task that requires students 
+   to prepare digital content (any format) and submit it by uploading it 
+   to the server.  Typical assignments include essays, projects, reports 
+   and so on.  This module includes grading facilities.</P>
+</UL>
+
+<P><IMG VALIGN=absmiddle SRC="<?=$CFG->wwwroot?>/mod/quiz/icon.gif">&nbsp;<B>Quizzes</B></P>
+<UL>
+<P>This module allows you to design and set quiz tests, consisting of 
+   multiple choice, true-false, and short answer questions.  These 
+   questions are kept in a categorised database, and can be re-used
+   within courses and even between courses.  Quizzes can allow 
+   multiple attempts.  Each attempt is automatically marked, and the 
+   teacher can choose whether to give feedback or to show correct answers.
+   This module includes grading facilities.</P>
+</UL>
+
+<P><IMG VALIGN=absmiddle SRC="<?=$CFG->wwwroot?>/mod/choice/icon.gif">&nbsp;<B>Choices</B></P>
+<UL>
+<P>A choice activity is very simple - you ask a question and specify a 
+   choice of multiple responses.  It can be useful as a quick poll to 
+   stimulate thinking about a topic, or to allow the class to vote on 
+   a direction for the course, or to gather research consent.
+</UL>
+
+<P><IMG VALIGN=absmiddle SRC="<?=$CFG->wwwroot?>/mod/survey/icon.gif">&nbsp;<B>Surveys</B></P>
+<UL>
+<P>The Survey module provides a number of verified survey instruments that
+   have been found useful in assessing and stimulating learning in 
+   online environments.  Teachers can use these to gather data from their
+   students that will help them learn about their classs and reflect 
+   on their own teaching.</P>
+</UL>
+
+
index dd891b781761f37da0abd6fabdaf281f96dbe8be..4e81133a3fd6c6b7a1c4a752afa0c22c6e4ded6d 100644 (file)
@@ -48,6 +48,7 @@ $string['chooselogs'] = "Choose which logs you want to see";
 $string['choosetheme'] = "Choose theme";
 $string['chooseuser'] = "Choose a user";
 $string['city'] = "City/town";
+$string['closewindow'] = "Close this window";
 $string['comparelanguage'] = "Compare and edit current language";
 $string['configauth'] = "Choose the authentication module you want to use.  The default is 'email' and has the best security.  The method 'none' has no checking whatsoever - be careful using it unless you really know what you are doing.";
 $string['configgdversion'] = "Indicate the version of GD that is installed.  The version shown by default is the one that has been auto-detected.  Don't change this unless you really know what you're doing.";
index ac7dcc33a235de0a086611efe0194710c864b9a9..d7b81a847a2f7d27a7d139f0deac3c8433d4549e 100644 (file)
@@ -602,7 +602,7 @@ function helpbutton ($page, $title="", $module="moodle", $image=true, $text="")
         $module = "moodle";
     }
     if ($image) {
-        $linkobject = "<IMG BORDER=0 ALT=\"$title\" SRC=\"$CFG->wwwroot/pix/help.gif\">";
+        $linkobject = "<IMG BORDER=0 HEIGHT=17 WIDTH=22 ALT=\"$title\" SRC=\"$CFG->wwwroot/pix/help.gif\">";
     } else {
         $linkobject = $title;
     }
index 57c7ac37eeda45bd6d196a08e9572e7b2f28a5bc..a390e5066fa97005af11e767f4c4ea347277b891 100644 (file)
@@ -229,7 +229,7 @@ function close_window_button() {
 /// Prints a simple button to close a window
 
     echo "<FORM><CENTER>";
-    echo "<INPUT TYPE=button onClick=\"self.close();\" VALUE=\"Close this window\">";
+    echo "<INPUT TYPE=button onClick=\"self.close();\" VALUE=\"".get_string("closewindow")."\">";
     echo "</CENTER></FORM>";
 }
 
@@ -273,13 +273,15 @@ function choose_from_menu ($options, $name, $selected="", $nothing="choose", $sc
     }
 }   
 
-function popup_form ($common, $options, $formname, $selected="", $nothing="choose") {
+function popup_form ($common, $options, $formname, $selected="", $nothing="choose", $help="", $helptext="") {
 ///  Implements a complete little popup form
 ///  $common   = the URL up to the point of the variable that changes
 ///  $options  = A list of value-label pairs for the popup list
 ///  $formname = name must be unique on the page
 ///  $selected = the option that is already selected
 ///  $nothing  = The label for the "no choice" option
+///  $help     = The name of a help page if help is required
+///  $helptext  = The name of the label for the help button
 
     if ($nothing == "choose") {
         $nothing = get_string("choose")."...";
@@ -303,7 +305,11 @@ function popup_form ($common, $options, $formname, $selected="", $nothing="choos
             echo ">$value</OPTION>\n";
         }
     }
-    echo "</SELECT></FORM>\n";
+    echo "</SELECT>";
+    if ($help) {
+        helpbutton($help, $helptext);
+    }
+    echo "</FORM>\n";
 }