Skip to content

Commit

Permalink
Added per-course config and use of a word for "student"
Browse files Browse the repository at this point in the history
  • Loading branch information
martin committed Jun 2, 2002
1 parent 6777e02 commit 5e69314
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 20 deletions.
10 changes: 8 additions & 2 deletions course/edit.html
Expand Up @@ -41,9 +41,15 @@
</td> </td>
</tr> </tr>
<tr valign=top> <tr valign=top>
<td><P>Word used to refer<BR>to your role:</td> <td><P>Word for teacher:</td>
<td><input type="text" name="teacher" size=25 value="<? p($form->teacher) ?>"> <td><input type="text" name="teacher" size=25 value="<? p($form->teacher) ?>">
<? formerr($err["teacher"]) ?> (eg Teacher, Tutor, Facilitator etc) <? formerr($err["teacher"]) ?>
</td>
</tr>
<tr valign=top>
<td><P>Word for student:</td>
<td><input type="text" name="student" size=25 value="<? p($form->student) ?>">
(eg Student, Participant etc) <? formerr($err["student"]) ?>
</td> </td>
</tr> </tr>
<tr valign=top> <tr valign=top>
Expand Down
35 changes: 19 additions & 16 deletions course/edit.php
Expand Up @@ -21,6 +21,10 @@
if (!isadmin()) { if (!isadmin()) {
error("Only administrators can use this page"); error("Only administrators can use this page");
} }

if (! $site = get_record("course", "category", 0)) {
redirect("$CFG->wwwroot/admin/");
}
} }




Expand Down Expand Up @@ -79,6 +83,13 @@
} else { } else {
$ts = getdate(time() + 3600 * 24); $ts = getdate(time() + 3600 * 24);
$te = getdate(time() + 3600 * 24 * 7 * 16); $te = getdate(time() + 3600 * 24 * 7 * 16);
$form->teacher = "Facilitator";
$form->student = "Student";
$form->fullname = "Course Fullname 101";
$form->shortname = "CF101";
$form->summary = "Write a concise and interesting paragraph here that explains what this course is about.";
$form->format = 0;
$form->category = 1;
} }


$form->startday = $ts[mday]; $form->startday = $ts[mday];
Expand All @@ -88,15 +99,6 @@
$form->endday = $te[mday]; $form->endday = $te[mday];
$form->endmonth = $te[mon]; $form->endmonth = $te[mon];
$form->endyear = $te[year]; $form->endyear = $te[year];

if (!$course) {
$form->teacher = "Facilitator";
$form->fullname = "Course Fullname 101";
$form->shortname = "CF101";
$form->summary = "Write a concise and interesting paragraph here that explains what this course is about.";
$form->format = 0;
$form->category = 1;
}
} }


for ($i=1;$i<=31;$i++) { for ($i=1;$i<=31;$i++) {
Expand All @@ -113,15 +115,14 @@


//$form->owners = get_records_sql_menu("SELECT u.id, CONCAT(u.firstname, " ", u.lastname) FROM users u, teachers t WHERE t.user = u.id"); //$form->owners = get_records_sql_menu("SELECT u.id, CONCAT(u.firstname, " ", u.lastname) FROM users u, teachers t WHERE t.user = u.id");


if (isadmin()) { if (isset($course)) {
print_header("Admin: Creating a new course", "$CFG->sitename: Administration",
"<A HREF=\"$CFG->wwwroot/admin/\">Admin</A>
-> Create a new course", $focus);

} else {
print_header("Edit course settings", "$course->fullname", print_header("Edit course settings", "$course->fullname",
"<A HREF=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</A> "<A HREF=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</A>
-> Edit course settings", $focus); -> Edit course settings", $focus);
} else {
print_header("Admin: Creating a new course", "$site->shortname: Administration",
"<A HREF=\"$CFG->wwwroot/admin/\">Admin</A>
-> Create a new course", $focus);
} }


print_simple_box_start("center", "", "$THEME->cellheading"); print_simple_box_start("center", "", "$THEME->cellheading");
Expand All @@ -147,8 +148,10 @@ function validate_form($course, &$form, &$err) {
$err["summary"] = "Missing summary"; $err["summary"] = "Missing summary";


if (empty($form->teacher)) if (empty($form->teacher))
$err["teacher"] = "Missing Teacher/Tutor/Instructor/Facilitator"; $err["teacher"] = "Must choose something";


if (empty($form->student))
$err["student"] = "Must choose something";


if ($form->startdate > $form->enddate) if ($form->startdate > $form->enddate)
$err["startdate"] = "Starts after it ends!"; $err["startdate"] = "Starts after it ends!";
Expand Down
2 changes: 1 addition & 1 deletion course/social.php
Expand Up @@ -20,7 +20,7 @@


//echo "<BR><BR>"; //echo "<BR><BR>";
print_simple_box("People", $align="CENTER", $width="100%", $color="$THEME->cellheading"); print_simple_box("People", $align="CENTER", $width="100%", $color="$THEME->cellheading");
$moddata[]="<A HREF=\"../user/index.php?id=$course->id\">Participants</A>"; $moddata[]="<A HREF=\"../user/index.php?id=$course->id\">List of all people</A>";
$modicon[]="<IMG SRC=\"../user/users.gif\" HEIGHT=16 WIDTH=16 ALT=\"List of everyone\">"; $modicon[]="<IMG SRC=\"../user/users.gif\" HEIGHT=16 WIDTH=16 ALT=\"List of everyone\">";
$moddata[]="<A HREF=\"../user/view.php?id=$USER->id&course=$course->id\">Edit my profile</A>"; $moddata[]="<A HREF=\"../user/view.php?id=$USER->id&course=$course->id\">Edit my profile</A>";
$modicon[]="<IMG SRC=\"../user/user.gif\" HEIGHT=16 WIDTH=16 ALT=\"Me\">"; $modicon[]="<IMG SRC=\"../user/user.gif\" HEIGHT=16 WIDTH=16 ALT=\"Me\">";
Expand Down
2 changes: 1 addition & 1 deletion course/weeks.php
Expand Up @@ -37,7 +37,7 @@
// Links to people // Links to people


print_simple_box("People", $align="CENTER", $width="100%", $color="$THEME->cellheading"); print_simple_box("People", $align="CENTER", $width="100%", $color="$THEME->cellheading");
$moddata[]="<A HREF=\"../user/index.php?id=$course->id\">Participants</A>"; $moddata[]="<A HREF=\"../user/index.php?id=$course->id\">List of all people</A>";
$modicon[]="<IMG SRC=\"../user/users.gif\" HEIGHT=16 WIDTH=16 ALT=\"List of everyone\">"; $modicon[]="<IMG SRC=\"../user/users.gif\" HEIGHT=16 WIDTH=16 ALT=\"List of everyone\">";
$moddata[]="<A HREF=\"../user/view.php?id=$USER->id&course=$course->id\">Edit my profile</A>"; $moddata[]="<A HREF=\"../user/view.php?id=$USER->id&course=$course->id\">Edit my profile</A>";
$modicon[]="<IMG SRC=\"../user/user.gif\" HEIGHT=16 WIDTH=16 ALT=\"Me\">"; $modicon[]="<IMG SRC=\"../user/user.gif\" HEIGHT=16 WIDTH=16 ALT=\"Me\">";
Expand Down

0 comments on commit 5e69314

Please sign in to comment.