Permalink
Browse files

Improvements to help, and addition of new "Activity modules" help

for teachers adding new modules.
  • Loading branch information...
1 parent 2ee53d1 commit e5dfd0f31f7fe31ffd64a42ca3c4d9bfb47fd6ff moodler committed Oct 21, 2002
Showing with 102 additions and 49 deletions.
  1. +17 −42 course/lib.php
  2. +1 −1 course/social.php
  3. +1 −1 course/topics.php
  4. +1 −1 course/weeks.php
  5. +2 −0 help.php
  6. +69 −0 lang/en/help/mods.html
  7. +1 −0 lang/en/moodle.php
  8. +1 −1 lib/moodlelib.php
  9. +9 −3 lib/weblib.php
View
@@ -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;
}
View
@@ -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>";
}
View
@@ -141,7 +141,7 @@
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>";
}
View
@@ -136,7 +136,7 @@
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>";
}
View
@@ -47,6 +47,8 @@
echo $text;
echo "</P>";
}
+
+ close_window_button();
?>
</BODY>
</HTML>
View
@@ -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>
+
+
View
@@ -48,6 +48,7 @@
$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.";
View
@@ -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;
}
View
@@ -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";
}

0 comments on commit e5dfd0f

Please sign in to comment.