// if the current user isn't an admin, redirect to the home page echo '<ul>'; $portal_teachers = portal_get_all_teachers($_PORTAL['project_info']['project_id']); // print_r($portal_teachers); // for each teacher in the current portal foreach ($portal_teachers as $teacher) { echo '<li>' . $teacher['member_first_name'] . " " . $teacher['member_last_name'] . " (" . $teacher['member_id'] . ")" . "</li>"; $class_ids = portal_get_teacher_classes($teacher['member_id']); // for each class that the teacher has echo '<ul>'; foreach ($class_ids as $class_id) { $class_activities = portal_get_class_diy_activities($class_id); if (count($class_activities) == 0) { continue; } $registered_students = portal_get_class_students($class_id); if (count($registered_students) == 0) { continue; } $class = portal_get_class_info($class_id); // count the number of students registered echo '<li>' . $class['class_name'] . ': ' . count($registered_students) . ' students</li>'; // count the number of students that have a learner session $activity_usage = array(); foreach ($registered_students as $stu) { $used = portal_get_diy_activity_usage_from_db($stu['member_id']); foreach ($used as $act_id) { if (array_key_exists($act_id, $activity_usage)) { $activity_usage[$act_id]++; } else { $activity_usage[$act_id] = 1;
<?php header('Content-type: application/xml'); $class_uuid = $_PORTAL['action']; // get the first column of the first row $class_id = portal_get_class_id($class_uuid); $students = portal_get_class_students($class_id); // print "<!-- \n"; // print_r($students); // print " -->\n"; ?> <otrunk id='<?php print "{$class_uuid}"; ?> '> <imports> <import class='org.concord.framework.otrunk.wrapper.OTObjectSet' /> <import class='org.concord.otrunk.user.OTUserObject' /> </imports> <objects> <OTObjectSet> <objects> <?php foreach ($students as $student) { print "<OTUserObject name='" . $student['member_first_name'] . " " . $student['member_last_name'] . "'>\n"; print "<userDataMap>\n"; print "<entry key='portal_member_id'><string>" . $student['member_id'] . "</string></entry>\n"; print "<entry key='diy_member_id'><string>" . $student['diy_member_id'] . "</string></entry>\n"; print "<entry key='sds_member_id'><string>" . $student['sds_member_id'] . "</string></entry>\n"; print "<entry key='cc_member_id'><string>" . $student['cc_member_id'] . "</string></entry>\n"; print "</userDataMap>\n";