for teachers adding new modules.
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);
}
}
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;
}
if (isediting($site->id)) {
echo "<DIV ALIGN=right>";
popup_form("$CFG->wwwroot/course/mod.php?id=$course->id§ion=0&add=",
- $modnames, "section0", "", get_string("add")."...");
+ $modnames, "section0", "", get_string("add")."...", "mods", get_string("activities"));
echo "</DIV>";
}
if (isediting($course->id)) {
echo "<DIV ALIGN=right>";
popup_form("$CFG->wwwroot/course/mod.php?id=$course->id§ion=$section&add=",
- $modnames, "section$section", "", "$stradd...");
+ $modnames, "section$section", "", "$stradd...", "mods", get_string("activities"));
echo "</DIV>";
}
if (isediting($course->id)) {
echo "<DIV ALIGN=right>";
popup_form("$CFG->wwwroot/course/mod.php?id=$course->id§ion=$week&add=",
- $modnames, "section$week", "", "$stradd...");
+ $modnames, "section$week", "", "$stradd...", "mods", get_string("activities"));
echo "</DIV>";
}
echo $text;
echo "</P>";
}
+
+ close_window_button();
?>
</BODY>
</HTML>
--- /dev/null
+<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"> <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"> <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"> <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"> <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"> <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"> <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"> <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>
+
+
$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.";
$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;
}
/// 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>";
}
}
}
-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")."...";
echo ">$value</OPTION>\n";
}
}
- echo "</SELECT></FORM>\n";
+ echo "</SELECT>";
+ if ($help) {
+ helpbutton($help, $helptext);
+ }
+ echo "</FORM>\n";
}