<!--th width="120">Rating</th--> <th width="120">Comments</th> <th>Details</th> </tr> </thead> <tbody id="activity-table-body"> '; for ($i = 0; $i < count($activities); $i++) { echo ' <tr> <td>' . @$activities[$i]['activity_school'] . '</td> <td>' . $activities[$i]['activity_author'] . '</td> <td>' . $activities[$i]['activity_name'] . '</td> <!--td align="center">' . portal_convert_number_to_stars(@$activities[$i]['activity_rating']) . '</td--> <td align="center">' . $activities[$i]['comment_count'] . '</td> <td align="center"><a href="/course/details/' . $activities[$i]['diy_identifier'] . '/" title="View details, comments, and ratings">' . portal_icon('run') . '</a></td> </tr> '; } echo ' </tbody> </table> </form> <script type="text/javascript"> // taken from here - http://www.vonloesch.de/node/23 function filterTable(phrase, _id) { var words = phrase.value.toLowerCase().split(" ");
$options = array('no restrict'); $activities = portal_get_diy_activities_from_db($conditions, $params, $options); $list = ''; for ($i = 0; $i < count($activities); $i++) { $activity_options = ''; $activity_used = ''; if ($activities[$i]['diy_identifier'] != '') { $diy_id = $activities[$i]['diy_identifier']; $info = '<a href="#" onclick="toggle_block_element(\'activity-description-' . $activities[$i]['activity_id'] . '\'); return false;" title="View activity description">' . portal_icon('info') . '</a>'; $run = '<a href="/diy/run/' . $diy_id . '/" title="Run this activity">' . portal_icon('run') . '</a>'; $activity_options = ' ' . $info . ' ' . $run . ' '; if (in_array($diy_id, $usage)) { $activity_used = portal_icon('work'); } } $description = portal_web_output_filter($activities[$i]['activity_description']); $activity_box = ' <div class="activity-box"> <div class="activity-title"> ' . $activity_options . ' ' . portal_web_output_filter($activities[$i]['activity_name']) . ' ' . $activity_used . ' </div> <!--div class="activity-info"> (Sensor: ' . $activities[$i]['sensor_type'] . '; Model: ' . $activities[$i]['model_type'] . ') </div--> <div class="activity-description" id="activity-description-' . $activities[$i]['activity_id'] . '"> ' . $description . ' </div> </div>
</p> <br> <h2>Our District <a class="heading-link" href="/district/edit/' . $district_info['district_id'] . '/">' . portal_icon('setup') . ' Change this information</a></h2> <p> <strong>' . $district_info['district_name'] . '</strong><br> ' . $district_info['district_address_1'] . ' ' . $district_info['district_address_2'] . '<br> ' . $district_info['district_city'] . ', ' . $district_info['district_state'] . ' ' . $district_info['district_zip'] . ' </p> <br> <h2>Our Teachers <a class="heading-link" href="/teacher/add/">' . portal_icon('add') . ' Add a new teacher</a></h2> ' . portal_generate_teacher_list($school_id, 'compact') . ' <br> <h2>Our Classes <a class="heading-link" href="/class/add/">' . portal_icon('add') . ' Add a new class</a></h2> ' . portal_generate_class_list($school_id) . ' <br> <h2>Our Students <a class="heading-link" href="/student/add/">' . portal_icon('add') . ' Add a new student</a></h2> ' . portal_generate_student_list($school_id, '', $options) . ' ';
echo '<h2>' . $class_info['class_name'] . '</h2>'; echo portal_generate_student_activity_list($_SESSION['portal']['member_id'], $class_id); $conditions = array(); $params = array(); //$conditions[] = 'login = ?'; //$params[] = $_SESSION['portal']['member_username']; $conditions[] = 'ida.id IN ("' . implode('","', $class_info['diy_activities']) . '")'; $options = array('no restrict'); $activities = portal_get_diy_activities_from_db($conditions, $params, $options); $list = ''; for ($i = 0; $i < count($activities); $i++) { $activity_options = ''; if ($activities[$i]['diy_identifier'] != '') { $diy_id = $activities[$i]['diy_identifier']; $info = '<a href="#" onclick="toggle_block_element(\'activity-description-' . $activities[$i]['activity_id'] . '\'); return false;" title="View activity description">' . portal_icon('info') . '</a>'; $run = '<a href="/diy/run/' . $diy_id . '/" title="Run this activity">' . portal_icon('run') . '</a>'; $activity_options = ' ' . $info . ' ' . $run . ' '; } $description = portal_web_output_filter($activities[$i]['activity_description']); $activity_box = ' <div class="activity-box"> <div class="activity-title"> ' . $activity_options . ' ' . portal_web_output_filter($activities[$i]['activity_name']) . ' </div> <!--div class="activity-info"> (Sensor: ' . $activities[$i]['sensor_type'] . '; Model: ' . $activities[$i]['model_type'] . ') </div--> <div class="activity-description" id="activity-description-' . $activities[$i]['activity_id'] . '">
<?php $page_title = '' . $portal_config['activities_navigation_word'] . ''; if (in_array('create', $GLOBALS['portal_config']['available_actions'])) { echo ' <h2>Creation</h2> <p>Activities used in the ITSI project are created using a system called <strong><a href="/diy/home/" target="_blank">Do-It-Yourself</a></strong>.</p> <h3>Make your own activity</h3> <p><a href="/diy/new/" target="_blank">' . portal_icon('add') . '</a> <a href="/diy/new/" target="_blank">Create a new activity</a> in the <strong>Do-It-Yourself</strong> site</p> '; } if (in_array('copy', $GLOBALS['portal_config']['available_actions'])) { echo ' <h3>Copy an existing activity</h3> <p>Click on the copy icon ' . portal_icon('copy') . ' next to an activity name to make your own customized version of it.</p> '; } echo portal_generate_activity_grid(array(), array(), 'full');
<?php $page_title = 'Info'; if ($_SESSION['portal']['member_type'] != 'student') { $email_field = '<strong>Email:</strong> ' . $_SESSION['user_email'] . '<br>'; } else { $email_field = ''; } echo ' <h2>My Info <a href="/member/edit/' . $_SESSION['portal']['member_id'] . '/" class="heading-link">' . portal_icon('setup') . ' Change this information</a></h2> <p> <strong>Name:</strong> ' . $_SESSION['user_first_name'] . ' ' . $_SESSION['user_last_name'] . '<br> ' . $email_field . ' <strong>Username:</strong> ' . $_SESSION['user_username'] . '<br>'; if (!($portal_config['show_probe_interface'] == "no")) { echo '<strong>Interface:</strong> ' . $portal_config['interfaces'][$_SESSION['portal']['member_interface']] . '<br>'; } echo '<strong>Password: </strong> <em>hidden</em> </p> ';
<h3>Running activities</h3> <p>When students run an activity from the Portal, a Java window will pop up. </p> <p>Students should choose to open the file.</p> <p>Depending on the connection speed, it may take anywhere from a few seconds to a couple minutes for the activity to open.</p> <h3>Saving data</h3> <p>Student data is saved when a student closes an activity. They do not need to click any special button! </p> <h3>Reviewing student work</h3> <p>When you sign in as a teacher, you have access to viewing student progress for the whole class or for an individual student. You can see individual students’ responses by clicking this icon: ' . portal_icon('work') . '</p> <p><em><a href="#top">Return to Contents</a></em></p> <hr> <h2><a name="extras"></a>A few extras</h2>
function portal_generate_activity_grid($activity_ids = array(), $diy_activity_ids = array(), $mode = '') { global $portal_config; $activity_grid = ''; if ($mode == 'preview') { $activities = portal_get_activities(array(), array(), 'unit_order, activity_order'); } else { $activities = portal_get_all_activities(); } // First create the display activities array $display_activities = array(); $level_classes = array(); $level_counts = array(); for ($i = 0; $i < count($activities); $i++) { $this_level = $activities[$i]['level_name'] . ': ' . $activities[$i]['subject_name']; $fixed_level = preg_replace('~[^a-z0-9]~', '', strtolower($this_level)); $class = 'level' . $activities[$i]['level_id']; $level_classes[$this_level] = $class; if (!isset($level_counts[$this_level])) { $level_counts[$this_level] = 0; } $this_unit = $activities[$i]['unit_name']; // Setup Checkboxes $checked = ''; if ($activities[$i]['level_id'] == '999') { if (in_array($activities[$i]['activity_id'], $diy_activity_ids)) { $checked = ' checked="checked"'; $level_counts[$this_level]++; } $field_name = 'diy_activities[]'; } else { if (in_array($activities[$i]['activity_id'], $activity_ids)) { $checked = ' checked="checked"'; $level_counts[$this_level]++; } $field_name = 'activities[]'; } $checkbox = '<input type="checkbox" name="' . $field_name . '" value="' . $activities[$i]['activity_id'] . '"' . $checked . ' onclick="updateTotalActivities(this); updateSectionActivities(\'' . $fixed_level . '\', this);">'; // Setup DIY Items $diy_id = $activities[$i]['diy_identifier']; $id_prefix = ''; if ($activities[$i]['level_id'] == '999') { $id_prefix = 'diy'; } // initialize placeholders for links $copy = ''; $edit = ''; $info = ''; $preview = ''; $report = ''; $run = ''; $try = ''; $guide = ''; if ($diy_id != '') { $available_actions = portal_get_available_actions(); if (in_array('copy', $available_actions)) { $copy_title = 'Make your own version of this activity'; $copy = '<a href="/diy/copy/' . $diy_id . '/" target="_blank" title="' . $copy_title . '">' . portal_icon('copy', $copy_title) . '</a>'; } if (in_array('edit', $available_actions)) { $edit_title = 'Edit this activity'; $edit = '<a href="/diy/edit/' . $diy_id . '/" target="_blank" title="' . $edit_title . '">' . portal_icon('setup', $edit_title) . '</a>'; } if (in_array('info', $available_actions)) { $info_title = 'View activity description'; $info = '<a href="#" onclick="toggle_block_element(\'activity-description-' . $id_prefix . $activities[$i]['activity_id'] . '\'); return false;" title="' . $info_title . '">' . portal_icon('info', $info_title) . '</a>'; } if (in_array('guide', $available_actions) && $activities[$i]['activity_teacher_guide'] != '') { $guide_title = 'View the teacher guide for this activity'; $guide = '<a href="' . $activities[$i]['activity_teacher_guide'] . '" title="' . $guide_title . '" target="_blank">' . portal_icon('guide', $guide_title) . '</a>'; } if (in_array('preview', $available_actions)) { $preview_title = 'View a quick preview version of this activity'; $preview = '<a href="/diy/show/' . $diy_id . '/" target="_blank" title="' . $preview_title . '">' . portal_icon('preview', $preview_title) . '</a>'; } if (in_array('report', $available_actions)) { $report_title = 'View the student data from this activity'; $report = '<a href="/diy/usage/' . $diy_id . '/" target="_blank" title="' . $report_title . '">' . portal_icon('report', $report_title) . '</a>'; } if (in_array('run', $available_actions)) { $run_title = 'Run this activity (and save data)'; $run = '<a href="/diy/run/' . $diy_id . '/" title="' . $run_title . '">' . portal_icon('run', $run_title) . '</a>'; } if (in_array('try', $available_actions)) { $try_title = 'Try this activity (as a teacher, do not save data)'; $try = '<a href="/diy/view/' . $diy_id . '/" title="' . $try_title . '">' . portal_icon('try', $try_title) . '</a>'; } } // don't show an edit link if hte user can't edit this activity if ($activities[$i]['subject_name'] != 'My Activities') { $edit = ''; } // remove items based on the mode if ($mode == 'setup') { $copy = ''; $edit = ''; $run = ''; $report = ''; $try = ''; $preview = ''; $guide = ''; } else { $checkbox = ''; } if ($mode == 'preview') { $report = ''; $run = ''; $copy = ''; $guide = ''; } $activity_options = ' ' . $checkbox . ' ' . $edit . ' ' . $copy . ' ' . $info . ' ' . $guide . ' ' . $report . ' ' . $preview . ' ' . $try . ' ' . $run . ' '; $description = portal_web_output_filter($activities[$i]['activity_description']); $sensor_probe_string = ''; if (@$portal_config['show_probe_model_info'] != 'no' && (@$activities[$i]['sensor_type'] != 'None' || @$activities[$i]['model_type'] != 'None')) { $sensor_probe_string_parts = array(); if (@$activities[$i]['sensor_type'] != 'None') { $sensor_probe_string_parts[] = 'Sensor: ' . @$activities[$i]['sensor_type']; } if (@$activities[$i]['model_type'] != 'None') { $sensor_probe_string_parts[] = 'Model: ' . @$activities[$i]['model_type']; } $sensor_probe_string = '(' . implode('; ', $sensor_probe_string_parts) . ')'; } $activity_box = ' <div class="activity-box"> <div class="activity-title"> ' . $activity_options . ' ' . portal_web_output_filter($activities[$i]['activity_name']) . ' </div> <div class="activity-info"> ' . $sensor_probe_string . ' </div> <div class="activity-description" id="activity-description-' . $id_prefix . $activities[$i]['activity_id'] . '"> ' . $description . ' </div> </div> '; $display_activities[$this_level][$this_unit][] = $activity_box; } // Now loop through the display activities array and generate the unit displays $navigation = array(); $panels = array(); $i = 0; $js_section = ''; $js_section_control = ''; while (list($level, $unit_set) = each($display_activities)) { $fixed_level = preg_replace('~[^a-z0-9]~', '', strtolower($level)); $level_count = $level_counts[$level]; $fixed_level_count = ''; if ($level_count > 0) { $fixed_level_count = ' (' . $level_count . ')'; } $navigation[] = '<li class="unit-navigation ' . $level_classes[$level] . '" id="' . $fixed_level . '-control" onclick="show_section(\'' . $fixed_level . '\', this);">' . $level . ' <span id="' . $fixed_level . '-count" class="navigation-count">' . $fixed_level_count . '</span></li>'; if ($i == 0) { $js_section = $fixed_level; $js_section_control = $fixed_level . '-control'; } $this_panel = ' <div class="unit-activities ' . $level_classes[$level] . '" id="' . preg_replace('~[^a-z0-9]~', '', strtolower($level)) . '"> <script type="text/javascript"> if (window.sectionActivities === undefined) { sectionActivities = []; } sectionActivities["' . $fixed_level . '"] = ' . $level_count . '; </script> '; reset($unit_set); while (list($unit_title, $activity_boxes) = each($unit_set)) { $unit_id = preg_replace('~[^a-z0-9]~', '', strtolower($level . $unit_title)); $select_all = ''; if ($mode == 'setup') { $select_all = '<span class="heading-info"><label><input type="checkbox" onclick="select_activity_checkboxes(\'' . $unit_id . '\', \'' . $fixed_level . '\', this);"> select all</label></span>'; } $this_panel .= ' <div id="' . $unit_id . '"> <h2 class="unit-title">' . portal_web_output_filter($unit_title) . ' ' . $select_all . '</h2> ' . implode("\n", $activity_boxes) . ' </div> '; } $this_panel .= ' </div> '; $panels[] = $this_panel; $i++; } // Now generate the interface $activity_grid = ' ' . portal_generate_icon_legend() . ' <table id="activity-chart" border="0" cellspacing="0" cellpadding="0" width="100%"> <tr> <td id="activity-chart-navigation"> <ul>' . implode("\n", $navigation) . '</ul> </td> <td id="activity-chart-panels"> ' . implode("\n", $panels) . ' </td> </tr> </table> <script type="text/javascript"> show_section("' . $js_section . '", document.getElementById("' . $js_section_control . '")); </script> '; return $activity_grid; }
<p>' . $student_count . ' students enrolled in this class. <a href="/student/add/">Add another student to this class.</a></p> <table class="roster-table"> <tr> <th> </th> <th>First Name</th> <th>Last Name</th> <th>Username</th> <th>Password</th> <th>Interface</th> </tr> '; for ($i = 0; $i < $student_count; $i++) { $edit_link = '<a href="/member/edit/' . $students[$i]['member_id'] . '/">' . portal_icon('setup') . '</a>'; echo ' <tr> <td>' . $edit_link . '</td> <td>' . $students[$i]['member_first_name'] . '</td> <td>' . $students[$i]['member_last_name'] . '</td> <td>' . $students[$i]['member_username'] . '</td> <td>' . $students[$i]['member_password_ue'] . '</td> <td>' . $portal_config['interfaces'][$students[$i]['member_interface']] . '</td> </tr> '; } echo ' </table> ';