示例#1
0
// You should have received a copy of the GNU General Public License
// along with Rogo.  If not, see <http://www.gnu.org/licenses/>.
/**
* 
* @author Simon Wilkinson
* @version 1.0
* @copyright Copyright (c) 2014 The University of Nottingham
* @package
*/
require '../include/staff_auth.inc';
require_once '../include/errors.inc';
require_once '../include/paper_security.inc';
require_once '../classes/paperproperties.class.php';
$paperID = check_var('paperID', 'GET', true, false, true);
// Get some paper properties
$propertyObj = PaperProperties::get_paper_properties_by_id($paperID, $mysqli, $string);
$paper_title = $propertyObj->get_paper_title();
$start_date = $propertyObj->get_start_date();
$end_date = $propertyObj->get_end_date();
$calendar_year = $propertyObj->get_calendar_year();
$paper_bgcolor = $propertyObj->get_bgcolor();
$paper_fgcolor = $propertyObj->get_fgcolor();
$paper_themecolor = $propertyObj->get_themecolor();
$paper_labelcolor = $propertyObj->get_labelcolor();
$type = $propertyObj->get_rubric();
$paper_prologue = $propertyObj->get_paper_prologue();
$marking = $propertyObj->get_marking();
$display_photos = $propertyObj->get_display_correct_answer();
$labs = $propertyObj->get_labs();
$crypt_name = $propertyObj->get_crypt_name();
$review_type = $propertyObj->get_display_question_mark();
示例#2
0
* @version 1.0
* @copyright Copyright (c) 2014 The University of Nottingham
* @package
*/
require '../include/staff_student_auth.inc';
require '../include/demo_replace.inc';
require './osce.inc';
require_once '../classes/paperproperties.class.php';
require_once '../classes/killer_question.class.php';
if ($userObject->has_role('Demo')) {
    $demo = true;
}
$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.
示例#3
0
// You should have received a copy of the GNU General Public License
// along with Rogō.  If not, see <http://www.gnu.org/licenses/>.
/**
* 
* Confirm that it is OK to proceed deleting a paper.
*
* @author Simon Wilkinson
* @version 1.0
* @copyright Copyright (c) 2014 The University of Nottingham
* @package
*/
require '../include/staff_auth.inc';
require_once '../include/errors.inc';
require_once '../classes/paperproperties.class.php';
$paperID = check_var('paperID', 'GET', true, false, true);
$properties = PaperProperties::get_paper_properties_by_id($paperID, $mysqli, $string, true);
if ($properties->get_summative_lock() == 1) {
    $msg = sprintf($string['furtherassistance'], $configObject->get('support_email'), $configObject->get('support_email'));
    $notice->display_notice_and_exit($mysqli, $string['paperlocked'], $msg, $string['paperlocked'], '../artwork/padlock_48.png', '#C00000', true, true);
}
$mysqli->close();
?>
<!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');
?>
" />
  
示例#4
0
    while ($result->fetch()) {
        if (($paper_type == '2' or $paper_type == '4') and $end_date != '' and date("Y-m-d H:i:s") > $end_date) {
            //echo "<tr><td style=\"width:20px\"><img src=\"../artwork/small_padlock.png\" width=\"18\" height=\"18\" alt=\"" . $string['warning'] . "\" /></td><td><input type=\"radio\" name=\"property_id\" value=\"$paper_title\" disabled><span style=\"color:#808080\">$paper_title</span></td></tr>\n";
        } elseif ($start_date < date("Y-m-d H:i:s") and $end_date > date("Y-m-d H:i:s")) {
            echo "<tr><td style=\"width:20px\"><img src=\"../artwork/small_yellow_warning_icon.gif\" width=\"12\" height=\"11\" alt=\"" . $string['warning'] . "\" /></td><td><input type=\"radio\" name=\"property_id\" value=\"{$paper_title}\" disabled><span style=\"color:#808080\">{$paper_title}</span></td></tr>\n";
        } else {
            echo "<tr><td style=\"width:20px\">&nbsp;</td><td><input type=\"radio\" name=\"property_id\" value=\"{$property_id}\" id=\"{$property_id}\"><label for=\"{$property_id}\">{$paper_title}</label></td></tr>\n";
        }
    }
    $result->close();
    echo "</table>\n</div>";
    echo '<input type="hidden" id="outcomes" name="outcomes" value="" />';
    echo "<div style=\"text-align:center; padding-top:4px;\"><img src=\"../artwork/working.gif\" id=\"working\" width=\"16\" height=\"16\" alt=\"Working\" style=\"display: none\" /> <input type=\"submit\" class=\"ok\" name=\"submit\" value=\"" . $string['addtopaper'] . "\" /><input type=\"button\" class=\"cancel\" name=\"cancel\" id=\"cancel\" value=\"" . $string['cancel'] . "\" /></div>\n</form>\n";
} else {
    $property_id = $_POST['property_id'];
    $properties = PaperProperties::get_paper_properties_by_id($property_id, $mysqli, $string);
    ?>
<!DOCTYPE html>
<html>
<head>
  <title><?php 
    echo $string['linktopaper'];
    ?>
</title>
  <link rel="stylesheet" type="text/css" href="../css/body.css" />
  <link rel="stylesheet" type="text/css" href="../css/dialog.css" />
  <link rel="stylesheet" type="text/css" href="../css/header.css" />
  <style>
    body {font-size:90%; background-color:EEECDC; text-align:center}
  </style>
  <script type="text/javascript" src="../js/jquery-1.11.1.min.js"></script>
示例#5
0
*
* Remove the link between a question an a paper.
*
* @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/logger.class.php';
require_once '../classes/paperproperties.class.php';
check_var('questionID', 'POST', true, false, false);
check_var('pID', 'POST', true, false, false);
$tmp_paperID = check_var('paperID', 'POST', true, false, true);
$properties = PaperProperties::get_paper_properties_by_id($tmp_paperID, $mysqli, $string);
// Check that the paper is not summative and not locked.
if ($properties->get_summative_lock()) {
    exit;
}
$tmp_pIDs = explode(',', substr($_POST['pID'], 1));
$tmp_questionIDs = explode(',', substr($_POST['questionID'], 1));
for ($i = 0; $i < count($tmp_pIDs); $i++) {
    if ($result = $mysqli->prepare("DELETE FROM papers WHERE p_id = ?")) {
        $result->bind_param('i', $tmp_pIDs[$i]);
        $result->execute();
        $result->close();
        // Look up any std set IDs for the paper.
        $std_setIDs = array();
        $result = $mysqli->prepare("SELECT id FROM std_set WHERE paperID = ?");
        $result->bind_param('i', $tmp_paperID);
示例#6
0
 /**
  * IMPORT: Loads a ZIP file, parses and adds contents to the database.
  */
 public function import($paperID = 0)
 {
     if ($paperID != 0) {
         $this->properties = PaperProperties::get_paper_properties_by_id($paperID, $this->db, $this->string);
     }
     $this->logger = new Logger($this->db);
     $this->status_array = QuestionStatus::get_all_statuses_by_name($this->db, $this->string);
     $this->get_keyword_ids();
     $this->zip_filename = $this->userID . '_raf.zip';
     $tmp_path = $this->configObj->get('cfg_tmpdir');
     if (!move_uploaded_file($_FILES['raffile']['tmp_name'], $tmp_path . $this->zip_filename)) {
         echo uploadError($_FILES['raffile']['error']);
         exit;
     }
     $dest_dir = $tmp_path . $this->userID;
     if (!file_exists($dest_dir)) {
         mkdir($dest_dir, 0700);
     }
     $zip = new ZipArchive();
     if ($zip->open($tmp_path . $this->zip_filename) === TRUE) {
         $zip->extractTo($dest_dir);
         if (file_exists($dest_dir . '/raf.json')) {
             $this->data = file_get_contents($dest_dir . '/raf.json');
         } else {
             $zip->close();
             $msg = sprintf($this->string['furtherassistance'], $this->configObj->get('support_email'), $this->configObj->get('support_email'));
             $this->notice->display_notice_and_exit($this->db, $this->string['invalidraf'], $msg, $this->string['invalidraf'], '../artwork/exclamation_48.png', '#C00000', true, true);
         }
         $this->copy_images($dest_dir, $tmp_path);
         $this->load_raf_data();
         unlink($dest_dir . '/raf.json');
         $zip->close();
     } else {
         $msg = sprintf($this->string['furtherassistance'], $this->configObj->get('support_email'), $this->configObj->get('support_email'));
         $this->notice->display_notice_and_exit($this->db, $this->string['invalidzip'], $msg, $this->string['invalidzip'], '../artwork/exclamation_48.png', '#C00000', true, true);
     }
 }