// If we are copying in the same session we can copy the objectives if ($new_calendar_year == $calendar_year) { $i = 0; foreach ($old_qids as $old_id) { $new_question_id = $new_qids[$i]; $result = $mysqli->prepare("INSERT INTO relationships (SELECT NULL, idMod, '{$new_paper_id}', '{$new_question_id}', obj_id," . " calendar_year, vle_api, map_level FROM relationships WHERE question_id = {$old_id} AND paper_id = ?)"); $result->bind_param('i', $paperid); $result->execute(); $result->close(); $i++; } } else { // We are copying between sessions we need to check for changed sessions/objectives $mappings_copy_objID = array(); $old_course = getObjectives($moduleIDs, $calendar_year, $paperid, '', $mysqli); $new_course = getObjectives($moduleIDs, $new_calendar_year, $paperid, '', $mysqli); if (count($old_course) > 0 and count($new_course) > 0) { copy_between_sessions($mappings_copy_objID, $old_course, $new_course); // Copy the objectives for each session where the objective still exists $result = $mysqli->prepare("INSERT INTO relationships (SELECT NULL, idMod, ?, ?, ?, ?, vle_api, map_level FROM" . " relationships WHERE question_id = ? AND paper_id = ? AND obj_id = ?)"); $nw_paperid = 0; $nw_qid = 0; $nw_mapid = 0; $nw_calyr = 0; $nw_oldid = 0; $nw_oldpapid = 0; $bw_oldoid = 0; $result->bind_param('iiisiii', $nw_paperid, $nw_qid, $nw_mapid, $nw_calyr, $nw_oldid, $nw_oldpapid, $nw_oldoid); if ($mysqli->error) { $error[] = 'mysqli error ' . $mysql->error; }
$action = filter_input(INPUT_GET, 'action'); if ($action === NULL) { $action = "home"; } } $action = strtolower($action); require_once '../private/dbapp.php'; switch ($action) { // Surveys. case "survey": require 'model/audiences.php'; $ages = getAges(); require 'model/genres.php'; $genres = getGenres(); require 'model/surveys.php'; $objectives = getObjectives(); $game_lengths = getGameLengths(); $title = "Comparative Review - Survey"; $active = "app"; include '../view/head.php'; include '../view/header.php'; include 'content/video_game_survey.php'; break; case "submit_survey": // echo "<!-- Get the different answers from the form. -->\n"; $survey["game_length_id"] = filter_input(INPUT_POST, "game_length", FILTER_VALIDATE_INT); $survey["age_id"] = filter_input(INPUT_POST, "age", FILTER_VALIDATE_INT); $survey["gender"] = trim(filter_input(INPUT_POST, "gender", FILTER_SANITIZE_STRING)); $survey["comments"] = trim(filter_input(INPUT_POST, "comments", FILTER_SANITIZE_STRING)); $survey["objective"] = trim(filter_input(INPUT_POST, "objective", FILTER_SANITIZE_STRING)); $survey["suggestions"] = trim(filter_input(INPUT_POST, "suggestions", FILTER_SANITIZE_STRING));
$papersRes->execute(); $papersRes->bind_result($property_id); while ($papersRes->fetch()) { $papers_tmp[] = $property_id; } $papersRes->close(); if (isset($papers_tmp)) { $i = 0; foreach ($papers_tmp as $p_id) { $papers[$p_id] = getPaper($p_id); } } $objsBySession = array(); foreach ($papers as $p_id => $paper) { $moduleIDs = Paper_utils::get_modules($paperID, $mysqli); $objsBySession[$p_id] = getObjectives($moduleIDs, $paper['session'], $p_id, $paper['questionID'], $mysqli); } $n = 0; $allsession = array(); $id_guid_map = array(); $guid_id_map = array(); $obs_canonical = array(); foreach ($objsBySession as $p_id => $module) { if ($module !== 'error') { foreach ($module as $moduleID => $sessions) { foreach ($sessions as $id => $session) { if (isset($session['GUID']) and $session['GUID'] != '') { $guid = $session['GUID']; } elseif (isset($id_guid_map[$id])) { $guid = $id_guid_map[$id]; } else {
<tr><td colspan="2" style="background-color:#1E3C7B"> </td></tr> <?php $questionID_list = substr($questionID_list, 0, -1); $total_random_mark = 0; $total_marks = 0; if ($row_no > 0) { $tmp_match = Paper_utils::academic_year_from_title($paper_title); if ($tmp_match !== false and $tmp_match != $session) { echo "<tr><td colspan=\"4\" style=\"padding: 0\"><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"width:100%; font-size:100%\">\n"; echo "<tr><td class=\"redwarn\" style=\"width:40px\"><img src=\"../artwork/exclamation_red_bg.png\" width=\"32\" height=\"32\" alt=\"Warning\" style=\"margin-bottom:-1px\" /></td><td colspan=\"7\" class=\"redwarn\"><strong>" . $string['warning'] . "</strong> "; printf($string['nomatchsession'], $tmp_match, $session); echo "</td></tr>\n</table>\n</td></tr>\n"; } $ul_start = false; $moduleIDs = Paper_utils::get_modules($paperID, $mysqli); $objsBySession = getObjectives($moduleIDs, $session, $paperID, $questionID_list, $mysqli); if ($objsBySession == 'error') { ?> <table border="0" cellpadding="0" cellspacing="0" style="width:100%"> <tr> <td class="redwarn" style="width:40px; line-height:0"><img src="../artwork/exclamation_red_bg.png" width="32" height="32" alt="Warning" /></td> <td class="redwarn">Error connecting to the curriculum mapping system.</td> </tr> </table> </body> </html> <?php exit; } unset($objsBySession['none_of_the_above']); ?>
public function get_outcomes($ac_year = 'all', $vle_api_data = null) { $outcomes = array(); $vle_api_cache = array(); // Get the VLE API we're using currently if (is_null($vle_api_data)) { $vle_api_data = MappingUtils::get_vle_api($this->idMod, date_utils::get_current_academic_year(), $vle_api_cache, $this->db); } // Get years for which there are mappings for the current mapping source if ($ac_year == 'all') { $all_years = getYearsForModules($vle_api_data['api'], array($this->idMod => $this->module_id), $this->db); } else { $all_years = array($ac_year); } foreach ($all_years as $ac_year) { $obs = getObjectives(array($this->idMod => $this->module_id), $ac_year, '', '', $this->db); if (is_array($obs) and isset($obs[$this->module_id])) { foreach ($obs[$this->module_id] as $session) { if (isset($session['objectives'])) { foreach ($session['objectives'] as $objective) { if (isset($objective['guid'])) { $uid = $objective['guid']; } elseif (isset($objective['id'])) { $uid = $objective['id']; } else { $uid = ''; } if ($uid != '') { // Build list of IDs but use the latest text $ids = isset($outcomes[$uid]) ? $outcomes[$uid]['ids'] : array(); $ids[] = $objective['id']; $outcomes[$uid] = array('ids' => $ids, 'label' => $objective['content']); } } } } } } if (count($outcomes) > 0) { uasort($outcomes, function ($a, $b) { if ($a['label'] == $b['label']) { return 0; } return $a['label'] < $b['label'] ? -1 : 1; }); } // Filter local mappings to remove duplicates $last_id = -1; $last_text = ''; if ($vle_api_data['api'] == '') { foreach ($outcomes as $id => $outcome) { if ($last_id != -1) { if ($outcome['label'] == $last_text) { $outcomes[$last_id]['ids'][] = $id; unset($outcomes[$id]); } else { $last_id = $id; $last_text = $outcome['label']; } } else { $last_id = $id; } } } return $outcomes; }
* @package */ require_once '../include/staff_auth.inc'; require_once '../include/errors.inc'; require_once '../include/mapping.inc'; require_once '../classes/moduleutils.class.php'; $errors = array(); if (empty($_POST['source_y']) or empty($_POST['dest_y']) or empty($_POST['moduleID'])) { $errors[] = "Undefined source or destination year"; } elseif ($_POST['source_y'] == $_POST['dest_y']) { $errors[] = "Source and destination years cannot be the same"; } else { // Get the sessions for the source year $module_code = module_utils::get_moduleid_from_id($_POST['moduleID'], $mysqli); $modules_array = array($_POST['moduleID'] => $module_code); $objectives = getObjectives($modules_array, $_POST['source_y'], '', '', $mysqli); try { copyObjectives($objectives, $_POST['moduleID'], $module_code, $_POST['dest_y'], $mysqli); } catch (Exception $ex) { $errors[] = "An error occured when copying the objectives. Please try again."; } } ?> <!DOCTYPE html> <html> <head> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="content-type" content="text/html;charset=<?php echo $configObject->get('cfg_page_charset'); ?> " />