diff --git a/lang/en/attendance.php b/lang/en/attendance.php index 50517202014..1e57f0e6ecc 100755 --- a/lang/en/attendance.php +++ b/lang/en/attendance.php @@ -57,8 +57,14 @@ $string['downloadexceltotals'] = "Download Summary Excel Spreadsheet"; $string['downloadtextfull'] = "Download Full Text Report"; $string['downloadtexttotals'] = "Download Summary Text Report"; $string['autoattend'] = "Automatically take attendance based on user activity logs"; +$string['defaultautoattend'] = "Whether to take attendance based on user activity logs by default"; $string['autoattendmulti'] = "Automatically take attendance for all rolls based on user activity logs"; $string['auto'] = "auto"; +$string['gradevalue'] = "Make this roll gradeable"; +$string['defaultgrade'] = " Whether to make attendance rolls gradeable by default"; +$string['gradevaluemulti'] = "Make these rolls gradeable"; +$string['maxgradevalue'] = "Maximum grade value for full attendance"; +$string['defaultmaxgrade'] = "What the default maximum grade value for full attendance should be"; ?> diff --git a/mod/attendance/add.php b/mod/attendance/add.php index c53c5b83013..d26774944c5 100644 --- a/mod/attendance/add.php +++ b/mod/attendance/add.php @@ -142,60 +142,6 @@ if (isset($_POST["course"])) { unset($SESSION->modform); // Clear any old ones that may be hanging around. - - - -/* optional_variable($id); // Course Module ID, or - optional_variable($a); // attendance ID - -/// populate the appropriate objects - if ($id) { - if (! $course = get_record("course", "id", $id)) { - error("Course is misconfigured"); - } - if (! $attendance = get_record("attendance", "course", $id)) { - error("Course module is incorrect"); - } - if (! $cm = get_coursemodule_from_instance("attendance", $attendance->id, $id)) { - error("Course Module ID was incorrect"); - } - if (! $attendances = get_records("attendance", "course", $cm->course)) { - error("Course module is incorrect"); - } - - } else { - if (! $attendance = get_record("attendance", "id", $a)) { - error("Course module is incorrect"); - } - if (! $course = get_record("course", "id", $attendance->course)) { - error("Course is misconfigured"); - } - if (! $cm = get_coursemodule_from_instance("attendance", $attendance->id, $course->id)) { - error("Course Module ID was incorrect"); - } - if (! $attendances = get_records("attendance", "course", $cm->course)) { - error("Course module is incorrect"); - } - } - - require_login($course->id); - - add_to_log($course->id, "attendance", "add", "add.php?id=$course->id"); - -/// Print the page header - if ($course->category) { - $navigation = "id\">$course->shortname ->"; - } - - $strattendances = get_string("modulenameplural", "attendance"); - $strattendance = get_string("modulename", "attendance"); - $straddmultiple = get_string("addmultiple", "attendance"); - - print_header("$course->shortname: $straddmultiple", "$course->fullname", - "$navigation id>$strattendances -> $straddmultiple", - "", "", true, " ", - navmenu($course)); -*/ /// Print the main part of the page @@ -204,6 +150,13 @@ if (isset($_POST["course"])) { //require_once("lib.php") // determine the end date for the course based on the number of sections and the start date $course->enddate = $course->startdate + $course->numsections * 604800; + +if (isset($CFG->attendance_dynsection) && ($CFG->attendance_dynsection == "1")) { $form->dynsection = 1; } +if (isset($CFG->attendance_autoattend) && ($CFG->attendance_autoattend == "1")) { $form->autoattend = 1; } +if (isset($CFG->attendance_grade) && ($CFG->attendance_grade == "1")) { $form->grade = 1; } +$form->maxgrade = isset($CFG->attendance_maxgrade)?$CFG->attendance_maxgrade:0; +$form->hours = isset($CFG->attendance_default_hours)?$CFG->attendance_default_hours:1; + ?>