} else { $paper_modules = Paper_utils::get_modules($paperID, $mysqli); foreach ($paper_modules as $paper_moduleID => $paper_module) { if ($userObject->is_staff_user_on_module($paper_moduleID)) { $on_staff_module = true; } } } if ($on_staff_module == false and !in_array('SYSTEM', array_values($paper_modules))) { $msg = sprintf($string['furtherassistance'], $configObject->get('support_email'), $configObject->get('support_email')); $notice->display_notice_and_exit($mysqli, $string['pagenotfound'], $msg, $string['accessdenied'], '/artwork/page_not_found.png', '#C00000', true, true); } if ($properties->get_paper_type() == '4') { // OSCE require_once '../classes/killer_question.class.php'; $killer_questions = new Killer_question($paperID, $mysqli); $killer_questions->load(); } $exclusions = new Exclusion($paperID, $mysqli); $exclusions->load(); /** * Displays a warning if any questions are duplicated on the paper (not Surveys). * @param array $q_screens - Array of question IDs. If there are more than one element for the same ID you have a duplicate. * @param array $string - Language translations */ function check_duplicates($q_screens, $string) { foreach ($q_screens as $q_screen => $qs) { if (count($qs) > 1) { echo "<tr><td colspan=\"2\" class=\"warnicon\"><img src=\"../artwork/small_yellow_warning_icon.gif\" width=\"12\" height=\"11\" alt=\"" . $string['warning'] . "\" /></td><td colspan=\"4\" class=\"warn\"> <strong>" . $string['Duplicate questions'] . ":</strong> Q" . implode(', Q', $qs) . "</td></tr>\n"; }
$msg = sprintf($string['furtherassistance'], $configObject->get('support_email'), $configObject->get('support_email')); if ($userObject->has_role(array('Staff', 'Admin', 'SysAdmin'))) { $userID = $_GET['userID']; $propertyObj = PaperProperties::get_paper_properties_by_id($_GET['paperID'], $mysqli, $string); $paperID = $_GET['paperID']; } elseif ($userObject->has_role('Student')) { $userID = $userObject->get_user_ID(); $propertyObj = PaperProperties::get_paper_properties_by_crypt_name($_GET['id'], $mysqli, $string, true); if (!$propertyObj->is_question_fb_released()) { $notice->display_notice_and_exit($mysqli, $string['pagenotfound'], $msg, $string['pagenotfound'], '../artwork/page_not_found.png', '#C00000', true, true); } $paperID = $propertyObj->get_property_id(); } else { $notice->display_notice_and_exit($mysqli, $string['pagenotfound'], $msg, $string['pagenotfound'], '../artwork/page_not_found.png', '#C00000', true, true); } $killer_questions = new Killer_question($paperID, $mysqli); $killer_questions->load(); $killed = false; // Get the module ID and calendar year of the OSCE station. $result = $mysqli->prepare("SELECT username, title, surname, first_names, grade, yearofstudy, student_id FROM (users, sid) WHERE users.id = ? AND users.id = sid.userID"); $result->bind_param('i', $userID); $result->execute(); $result->bind_result($username, $title, $surname, $first_names, $grade, $year, $student_id); $result->fetch(); $result->close(); $original_username = $username; if (isset($demo) and $demo == true) { $surname = demo_replace($surname, $demo); $first_names = demo_replace($first_names, $demo); $student_id = demo_replace_number($student_id, $demo); }
// along with Rogō. If not, see <http://www.gnu.org/licenses/>. /** * * Work out if a question is set to be a killer question or not and then * set or unset accordingly. * * @author Simon Wilkinson * @version 1.0 * @copyright Copyright (c) 2014 The University of Nottingham * @package */ require '../../include/staff_auth.inc'; require '../../include/errors.inc'; require_once '../../classes/killer_question.class.php'; require_once '../../classes/logger.class.php'; $paperID = check_var('paperID', 'POST', true, false, true); $q_id = check_var('q_id', 'POST', true, false, true); $qNumber = check_var('qNumber', 'POST', true, false, true); $killer_questions = new Killer_question($paperID, $mysqli); $killer_questions->load(); // Get the existing killer questions for the paper. $logger = new Logger($mysqli); if ($killer_questions->is_killer_question($q_id)) { $killer_questions->unset_question($q_id); $logger->track_change('Paper', $paperID, $userObject->get_user_ID(), 'on', 'off', "killer question {$qNumber}"); } else { $killer_questions->set_question($q_id); $logger->track_change('Paper', $paperID, $userObject->get_user_ID(), 'off', 'on', "killer question {$qNumber}"); } $killer_questions->save(); $mysqli->close();