print_error('cannotaccessgroup', 'grades'); } } $courseName = $course->fullname; $courseName_xx = htmlspecialchars($courseName); $pickArray = array(); $pickcount = 0; while ($pickcount < 500) { $pickname = "pick{$pickcount}"; $picktest = optional_param($pickname, '~', PARAM_TEXT); if ($picktest != '~') { $pickArray[] = $picktest; } $pickcount++; } $readFile = new sl_roster($DB, $url, $teacherid, $username, $password); echo "<html><body><pre>"; $assignmentList = ''; foreach ($pickArray as $assignment) { $res1 = $readFile->getSchoolLoopGradesForAssignment($id, $assignment); foreach ($res1 as $singleGrade) { $postfile .= "{$singleGrade['sectionSID']} {$singleGrade['studentSID']} {$singleGrade['assignmentSID']} {$singleGrade['grade']}\n"; } $assignmentList .= htmlspecialchars($assignment) . ', '; } echo <<<PAGE_HEAD </pre> <p></p><ul> <h3>School Loop Synchronization - Grade</h3>
} if (!($course = $DB->get_record('course', array('id' => $id)))) { print_error('nocourseid'); } require_login($course); $context = get_context_instance(CONTEXT_COURSE, $id); require_capability('moodle/grade:export', $context); require_capability('gradeexport/sl:view', $context); if (groups_get_course_groupmode($COURSE) == SEPARATEGROUPS and !has_capability('moodle/site:accessallgroups', $context)) { if (!groups_is_member($groupid, $USER->id)) { print_error('cannotaccessgroup', 'grades'); } } $courseName = $course->fullname; $courseName_xx = htmlspecialchars($courseName); $readFile = new sl_roster($DB, $url, $teacherid, $username, $password); $studentList = $readFile->getAllStudentsOnRoster(); $sectionList = $readFile->getSectionNames(); echo <<<PAGE_HEAD <html><body> <p></p><ul> <h3>School Loop Synchronization - Students</h3> <p>Below are the students that are listed by Schoolloop</p> <table> <col width="150"> <col width="300"> <col width="300"> <tr valign="top"><td>Moodle Course:</td>
print_error('nocourseid'); } require_login($course); $context = get_context_instance(CONTEXT_COURSE, $id); require_capability('moodle/grade:export', $context); require_capability('gradeexport/sl:view', $context); if (groups_get_course_groupmode($COURSE) == SEPARATEGROUPS and !has_capability('moodle/site:accessallgroups', $context)) { if (!groups_is_member($groupid, $USER->id)) { print_error('cannotaccessgroup', 'grades'); } } $courseName = $course->fullname; $courseName_xx = htmlspecialchars($courseName); $section = required_param('section', PARAM_TEXT); // SL section to synchronize $readFile = new sl_roster($DB, $url, $teacherid, $username, $password); $studentList = $readFile->getStudentsOfPeriod($section); $sectionList = $readFile->getSectionNames(); $assignmentIdMap1 = $readFile->getAssignmentMap($section); $gMods = $readFile->lookUpCourseGradeItems($id, $assignmentIdMap1); $gModMap = $readFile->getCourseGradeItemMap($id); $combinedMap = array(); foreach ($assignmentIdMap1 as $key => $val) { $combinedMap[$key] = $key; } foreach ($gModMap as $key => $val) { $combinedMap[$key] = $key; } ksort($combinedMap); echo <<<PAGE_HEAD <html><body>
require_capability('gradeexport/sl:view', $context); if (groups_get_course_groupmode($COURSE) == SEPARATEGROUPS and !has_capability('moodle/site:accessallgroups', $context)) { if (!groups_is_member($groupid, $USER->id)) { print_error('cannotaccessgroup', 'grades'); } } echo "<html><body><p><a href=\"../../report/user/index.php?id={$id}\">The Course User Report</a></p><ul>\n"; $fileloc1 = "SampleRoster.xml"; $fileloc2 = "http://bobcat:8080/wu/samples/SampleRoster.xml"; $username = ""; $password = ""; //sample (test) values $secid = "en442-01"; $secid2 = "en442-02"; $student1 = 21; $readFile = new sl_roster($DB, $fileloc2, 502, $username, $password); $assignmentIdMap1 = $readFile->getAssignmentMap($secid); $assignmentIdMap2 = $readFile->getAssignmentMap($secid2); print_tablez("Sections from Schoolloop", $readFile->getSectionNames()); print_tablez("Assignments for {$secid}", $assignmentIdMap1); print_tablez("Assignments for {$secid2}", $assignmentIdMap2); $studentList = $readFile->getStudentsOfPeriod($secid); print_tabley("Section {$secid} - Students from Schoolloop", $studentList, array('firstName', 'lastName', 'moodleId', 'studentId', 'systemID')); $studentList2 = $readFile->getStudentsOfPeriod($secid2); print_tabley("Section {$secid2} - Students from Schoolloop", $studentList2, array('firstName', 'lastName', 'moodleId', 'studentId', 'systemID')); $cMods = $readFile->lookUpCourseModules($id, $assignmentIdMap1); print_tabley("Modules for course {$id} (system id from {$secid})", $cMods, array('id', 'module', 'name', 'systemID')); $gMods = $readFile->lookUpCourseGradeItems($id, $assignmentIdMap1); print_tabley("Grade Items course {$id} (system id from {$secid})", $gMods, array('id', 'module', 'name', 'systemID')); $grade = $DB->get_records('grade_items', array('courseid' => $id)); print_tablex("Grades Items for Course {$id}", $grade, array('courseid', 'itemname', 'iteminstance', 'itemmodule'));
} require_login($course); $context = get_context_instance(CONTEXT_COURSE, $id); require_capability('moodle/grade:export', $context); require_capability('gradeexport/sl:view', $context); if (groups_get_course_groupmode($COURSE) == SEPARATEGROUPS and !has_capability('moodle/site:accessallgroups', $context)) { if (!groups_is_member($groupid, $USER->id)) { print_error('cannotaccessgroup', 'grades'); } } $courseName = $course->fullname; $courseName_xx = htmlspecialchars($courseName); $teacherid_xx = htmlspecialchars($teacherid); $action = required_param('action', PARAM_RAW); // thing to do $readFile = new sl_roster($DB, $url, $teacherid, $username, $password); //$_SESSION['readFile'] = ""; $nextPage = 'sync_grades.php'; if ($action == 'Sync Assignments') { $nextPage = 'sync_assignments.php'; } echo <<<PAGE_HEAD <html><body> <p></p><ul> <h3>School Loop Synchronization - Select Section</h3> <p>The next step is to pick the course section from schoolloop that you want to synchronize assignments/grades.</p> <table>
if (!($course = $DB->get_record('course', array('id' => $id)))) { print_error('nocourseid'); } require_login($course); $context = get_context_instance(CONTEXT_COURSE, $id); require_capability('moodle/grade:export', $context); require_capability('gradeexport/sl:view', $context); if (groups_get_course_groupmode($COURSE) == SEPARATEGROUPS and !has_capability('moodle/site:accessallgroups', $context)) { if (!groups_is_member($groupid, $USER->id)) { print_error('cannotaccessgroup', 'grades'); } } $courseName = $course->fullname; $courseName_xx = htmlspecialchars($courseName); $teacherid_xx = htmlspecialchars($teacherid); $readFile = new sl_roster($DB, $url, $teacherid, $username, $password); $assignmentIdMap1 = $readFile->getAllAssignmentMap(); $gModMap = $readFile->getCourseGradeItemMap($id); $intersectionMap = array(); foreach ($assignmentIdMap1 as $key => $val) { if (array_key_exists($key, $gModMap)) { $intersectionMap[$key] = $key; } } ksort($combinedMap); echo <<<PAGE_HEAD <html><body> <p></p><ul> <h3>School Loop Synchronization - Select Section</h3>