Upgraded add_to_log to send cm->id

This commit is contained in:
moodler 2004-01-31 15:22:04 +00:00
parent 69d79bc31f
commit 037f99aa2d
12 changed files with 32 additions and 32 deletions

View File

@ -33,7 +33,7 @@
require_login($course->id);
add_to_log($course->id, "assignment", "view", "view.php?id=$cm->id", "$assignment->id");
add_to_log($course->id, "assignment", "view", "view.php?id=$cm->id", $assignment->id, $cm->id);
if ($course->category) {
$navigation = "<A HREF=\"../../course/view.php?id=$course->id\">$course->shortname</A> ->";

View File

@ -30,7 +30,7 @@
require_login($course->id);
add_to_log($course->id, "attendance", "view", "view.php?id=$cm->id", "$attendance->id");
add_to_log($course->id, "attendance", "view", "view.php?id=$cm->id", $attendance->id, $cm->id);
/// Print the page header

View File

@ -39,7 +39,7 @@
require_login($course->id);
add_to_log($course->id, "chat", "view", "view.php?id=$cm->id", "$chat->id");
add_to_log($course->id, "chat", "view", "view.php?id=$cm->id", $chat->id, $cm->id);
/// Print the page header

View File

@ -35,7 +35,7 @@
if (! update_record("choice_answers", $newanswer)) {
error("Could not update your choice");
}
add_to_log($course->id, "choice", "update", "view.php?id=$cm->id", "$choice->id");
add_to_log($course->id, "choice", "update", "view.php?id=$cm->id", $choice->id, $cm->id);
} else {
$newanswer->choice = $choice->id;
$newanswer->userid = $USER->id;
@ -44,7 +44,7 @@
if (! insert_record("choice_answers", $newanswer)) {
error("Could not save your choice");
}
add_to_log($course->id, "choice", "add", "view.php?id=$cm->id", "$choice->id");
add_to_log($course->id, "choice", "add", "view.php?id=$cm->id", $choice->id, $cm->id);
}
redirect("$CFG->wwwroot/course/view.php?id=$course->id");
exit;
@ -53,7 +53,7 @@
$strchoice = get_string("modulename", "choice");
$strchoices = get_string("modulenameplural", "choice");
add_to_log($course->id, "choice", "view", "view.php?id=$cm->id", "$choice->id");
add_to_log($course->id, "choice", "view", "view.php?id=$cm->id", $choice->id, $cm->id);
if ($course->category) {
$navigation = "<A HREF=\"../../course/view.php?id=$course->id\">$course->shortname</A> ->";

View File

@ -19,7 +19,7 @@
error("Course module is incorrect");
}
add_to_log($course->id, "dialogue", "view", "view.php?id=$cm->id", "$dialogue->id");
add_to_log($course->id, "dialogue", "view", "view.php?id=$cm->id", $dialogue->id, $cm->id);
if (! $cw = get_record("course_sections", "id", $cm->section)) {
error("Course module is incorrect");

View File

@ -36,7 +36,7 @@
require_login($course->id);
// ...log activity...
add_to_log($course->id, "exercise", "view", "view.php?id=$cm->id", "$exercise->id");
add_to_log($course->id, "exercise", "view", "view.php?id=$cm->id", $exercise->id, $cm->id);
if ($course->category) {
$navigation = "<A HREF=\"../../course/view.php?id=$course->id\">$course->shortname</A> ->";
@ -145,7 +145,7 @@
}
set_field("exercise", "phase", 3, "id", "$exercise->id");
add_to_log($course->id, "exercise", "display", "view.php?id=$cm->id", "$exercise->id");
add_to_log($course->id, "exercise", "display", "view.php?id=$cm->id", "$exercise->id", $cm->id);
redirect("view.php?id=$cm->id", get_string("movingtophase", "exercise", 3));
}
@ -169,7 +169,7 @@
}
else {
set_field("exercise", "phase", 2, "id", "$exercise->id");
add_to_log($course->id, "exercise", "open", "view.php?id=$cm->id", "$exercise->id");
add_to_log($course->id, "exercise", "open", "view.php?id=$cm->id", "$exercise->id", $cm->id);
redirect("view.php?id=$cm->id", get_string("movingtophase", "exercise", 2));
}
}
@ -183,7 +183,7 @@
}
set_field("exercise", "phase", 1, "id", "$exercise->id");
add_to_log($course->id, "exercise", "set up", "view.php?id=$cm->id", "$exercise->id");
add_to_log($course->id, "exercise", "set up", "view.php?id=$cm->id", "$exercise->id", $cm->id);
redirect("view.php?id=$cm->id", get_string("movingtophase", "exercise", 1));
}

View File

@ -85,7 +85,7 @@
if (!$cm->visible and !isteacher($course->id)) {
notice(get_string("activityiscurrentlyhidden"));
}
add_to_log($course->id, "glossary", "view", "view.php?id=$cm->id&tab=$tab", "$glossary->id");
add_to_log($course->id, "glossary", "view", "view.php?id=$cm->id&tab=$tab", $glossary->id, $cm->id);
/// stablishing flag variables
if ( $sortorder = strtolower($sortorder) ) {

View File

@ -19,7 +19,7 @@
error("Course module is incorrect");
}
add_to_log($course->id, "journal", "view", "view.php?id=$cm->id", "$journal->id");
add_to_log($course->id, "journal", "view", "view.php?id=$cm->id", $journal->id, $cm->id);
if (! $cw = get_record("course_sections", "id", $cm->section)) {
error("Course module is incorrect");

View File

@ -35,7 +35,7 @@
require_login($course->id);
add_to_log($course->id, "quiz", "view", "view.php?id=$cm->id", "$quiz->id");
add_to_log($course->id, "quiz", "view", "view.php?id=$cm->id", $quiz->id, $cm->id);
$timenow = time();
@ -43,7 +43,7 @@
// Print the page header
if ($course->category) {
$navigation = "<A HREF=\"../../course/view.php?id=$course->id\">$course->shortname</A> ->";
$navigation = "<a href=\"../../course/view.php?id=$course->id\">$course->shortname</a> ->";
}
$strquizzes = get_string("modulenameplural", "quiz");

View File

@ -40,7 +40,7 @@
switch ($resource->type) {
case REFERENCE:
add_to_log($course->id, "resource", "view", "view.php?id=$cm->id", "$resource->id");
add_to_log($course->id, "resource", "view", "view.php?id=$cm->id", $resource->id, $cm->id);
print_header($pagetitle, "$course->fullname", "$navigation $resource->name", "", "", true,
update_module_button($cm->id, $course->id, $strresource), navmenu($course, $cm));
@ -55,7 +55,7 @@
break;
case WEBLINK:
add_to_log($course->id, "resource", "view", "view.php?id=$cm->id", "$resource->id");
add_to_log($course->id, "resource", "view", "view.php?id=$cm->id", $resource->id, $cm->id);
$inpopup = !empty($_GET["inpopup"]);
@ -109,7 +109,7 @@
} else {
$url = "$resource->reference";
}
add_to_log($course->id, "resource", "view", "view.php?id=$cm->id", "$resource->id");
add_to_log($course->id, "resource", "view", "view.php?id=$cm->id", $resource->id, $cm->id);
echo "<head><title>$course->shortname: $resource->name</title></head>\n";
echo "<frameset rows=\"$CFG->resource_framesize,*\" border=\"2\">";
echo "<frame src=\"view.php?id=$cm->id&frameset=top\">";
@ -210,7 +210,7 @@
/// We can only get here once per resource, so add an entry to the log
add_to_log($course->id, "resource", "view", "view.php?id=$cm->id", "$resource->id");
add_to_log($course->id, "resource", "view", "view.php?id=$cm->id", $resource->id, $cm->id);
/// If we are in a frameset, just print the top of it
@ -305,7 +305,7 @@
case PLAINTEXT:
add_to_log($course->id, "resource", "view", "view.php?id=$cm->id", "$resource->id");
add_to_log($course->id, "resource", "view", "view.php?id=$cm->id", $resource->id, $cm->id);
print_header($pagetitle, "$course->fullname", "$navigation $resource->name",
"", "", true, update_module_button($cm->id, $course->id, $strresource), navmenu($course, $cm));
@ -317,7 +317,7 @@
break;
case HTML:
add_to_log($course->id, "resource", "view", "view.php?id=$cm->id", "$resource->id");
add_to_log($course->id, "resource", "view", "view.php?id=$cm->id", $resource->id, $cm->id);
print_header($pagetitle, "$course->fullname", "$navigation $resource->name",
"", "", true, update_module_button($cm->id, $course->id, $strresource), navmenu($course, $cm));
@ -333,7 +333,7 @@
break;
case PROGRAM: // Code provided by Mark Kimes <hectorp@buckfoodsvc.com>
add_to_log($course->id, "resource", "view", "view.php?id=$cm->id", "$resource->id");
add_to_log($course->id, "resource", "view", "view.php?id=$cm->id", $resource->id, $cm->id);
$temptime = gmdate("YmdHis",time());
@ -380,7 +380,7 @@
break;
case WIKITEXT:
add_to_log($course->id, "resource", "view", "view.php?id=$cm->id", "$resource->id");
add_to_log($course->id, "resource", "view", "view.php?id=$cm->id", $resource->id, $cm->id);
print_header($pagetitle, "$course->fullname", "$navigation $resource->name",
"", "", true, update_module_button($cm->id, $course->id, $strresource), navmenu($course, $cm));

View File

@ -46,7 +46,7 @@
// Check the survey hasn't already been filled out.
if (survey_already_done($survey->id, $USER->id)) {
add_to_log($course->id, "survey", "view graph", "view.php?id=$cm->id", "$survey->id");
add_to_log($course->id, "survey", "view graph", "view.php?id=$cm->id", $survey->id, $cm->id);
print_heading(get_string("surveycompleted", "survey"));
$numusers = survey_count_responses($survey->id);
print_heading(get_string("peoplecompleted", "survey", $numusers));
@ -58,7 +58,7 @@
}
// Start the survey form
add_to_log($course->id, "survey", "view form", "view.php?id=$cm->id", "$survey->id");
add_to_log($course->id, "survey", "view form", "view.php?id=$cm->id", $survey->id, $cm->id);
echo "<form name=form method=post action=save.php>";
echo "<input type=hidden name=id value=$id>";

View File

@ -51,7 +51,7 @@
require_login($course->id);
// ...log activity...
add_to_log($course->id, "workshop", "view", "view.php?id=$cm->id", "$workshop->id");
add_to_log($course->id, "workshop", "view", "view.php?id=$cm->id", $workshop->id, $cm->id);
if ($course->category) {
$navigation = "<A HREF=\"../../course/view.php?id=$course->id\">$course->shortname</A> ->";
@ -107,7 +107,7 @@
// move to phase 4
set_field("workshop", "phase", 4, "id", "$workshop->id");
add_to_log($course->id, "workshop", "assessments only", "view.php?id=$cm->id", "$workshop->id");
add_to_log($course->id, "workshop", "assessments only", "view.php?id=$cm->id", "$workshop->id", $cm->id);
redirect("view.php?a=$workshop->id", get_string("movingtophase", "workshop", 4));
}
@ -121,7 +121,7 @@
// move to phase 3
set_field("workshop", "phase", 3, "id", "$workshop->id");
add_to_log($course->id, "workshop", "allow both", "view.php?id=$cm->id", "$workshop->id");
add_to_log($course->id, "workshop", "allow both", "view.php?id=$cm->id", "$workshop->id", $cm->id);
redirect("view.php?a=$workshop->id", get_string("movingtophase", "workshop", 3));
}
@ -140,7 +140,7 @@
}
else {
set_field("workshop", "phase", 2, "id", "$workshop->id");
add_to_log($course->id, "workshop", "submissions", "view.php?id=$cm->id", "$workshop->id");
add_to_log($course->id, "workshop", "submissions", "view.php?id=$cm->id", "$workshop->id", $cm->id);
redirect("view.php?id=$cm->id", get_string("movingtophase", "workshop", 2));
}
}
@ -155,7 +155,7 @@
// move to phase 5
set_field("workshop", "phase", 5, "id", "$workshop->id");
add_to_log($course->id, "workshop", "close", "view.php?id=$cm->id", "$workshop->id");
add_to_log($course->id, "workshop", "close", "view.php?id=$cm->id", "$workshop->id", $cm->id);
redirect("view.php?a=$workshop->id", get_string("movingtophase", "workshop", 5));
}
@ -290,7 +290,7 @@
}
set_field("workshop", "phase", 6, "id", "$workshop->id");
add_to_log($course->id, "workshop", "display grades", "view.php?id=$cm->id", "$workshop->id");
add_to_log($course->id, "workshop", "display grades", "view.php?id=$cm->id", "$workshop->id", $cm->id);
redirect("view.php?a=$workshop->id", get_string("movingtophase", "workshop", 6));
}
@ -309,7 +309,7 @@
}
set_field("workshop", "phase", 1, "id", "$workshop->id");
add_to_log($course->id, "workshop", "set up", "view.php?id=$cm->id", "$workshop->id");
add_to_log($course->id, "workshop", "set up", "view.php?id=$cm->id", "$workshop->id", $cm->id);
redirect("view.php?a=$workshop->id", get_string("movingtophase", "workshop", 1));
}