コード例 #1
0
ファイル: paper_by_session.php プロジェクト: vinod-co/centa
}
?>
'"><?php 
echo $string['longitudinal'];
?>
</td>
  </table>
  </th><th style="width:100%; text-align:right">&nbsp;</th>
  </tr>
  <tr><td colspan="2" style="background-color:#1E3C7B">&nbsp;</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>&nbsp;&nbsp;";
        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>
コード例 #2
0
ファイル: copy.php プロジェクト: vinod-co/centa
/**
 * Copies the paper properties record.
 *
 * @param object $db						- Link to MySQL database
 * @param string $calendar_year	- Looks up and updates the academic session - used with learning objectives
 * @param string $moduleIDs			- Looks up and updates the modules the paper is on - used with learning objectives
 * @param object $userObj				- Currently logged in user object.
 * @param object $configObject	- Configuration settings object.
 *
 * @return int - ID of the newly inserted property record.
 */
function copyProperties($db, &$calendar_year, &$new_calendar_year, &$moduleIDs, $userObj, $configObject)
{
    $userID = $userObj->get_user_ID();
    $moduleIDs = Paper_utils::get_modules($_POST['paperID'], $db);
    $result = $db->prepare("SELECT * FROM properties WHERE property_id = ? LIMIT 1");
    $result->bind_param('i', $_POST['paperID']);
    $result->execute();
    $result->store_result();
    $result->bind_result($property_id, $paper_title, $start_date, $end_date, $timezone, $paper_type, $paper_prologue, $paper_postscript, $bgcolor, $fgcolor, $themecolor, $labelcolor, $fullscreen, $marking, $bidirectional, $pass_mark, $distinction_mark, $paper_owner, $folder, $labs, $rubric, $calculator, $exam_duration, $deleted, $created, $random_mark, $total_mark, $display_correct_answer, $display_question_mark, $display_students_response, $display_feedback, $hide_if_unanswered, $calendar_year, $external_review_deadline, $internal_review_deadline, $sound_demo, $latex_needed, $password, $retired, $crypt_name, $recache_marks);
    $result->fetch();
    $result->close();
    $paper_type = $_POST['paper_type'];
    // Override the paper type with what is posted.
    if ($paper_type == 2 and $configObject->get('cfg_summative_mgmt')) {
        $duration = 0;
        if (isset($_POST['duration_hours'])) {
            $duration += $_POST['duration_hours'] * 60;
        }
        if (isset($_POST['duration_mins'])) {
            $duration += $_POST['duration_mins'];
        }
        $tmp_exam_duration = $duration;
    } else {
        $tmp_exam_duration = $exam_duration;
    }
    if ($paper_type == 2) {
        if ($configObject->get('cfg_summative_mgmt')) {
            $tmp_start_date = NULL;
            $tmp_end_date = NULL;
            $labs = NULL;
        } else {
            $tmp_start_date = '20200505090000';
            $tmp_end_date = '20200505100000';
        }
    } else {
        $tmp_start_date = $start_date;
        $tmp_end_date = $end_date;
    }
    $tmp_random_mark = $random_mark;
    if ($tmp_random_mark == '') {
        $tmp_random_mark = NULL;
    }
    $tmp_total_mark = $total_mark;
    if ($tmp_total_mark == '') {
        $tmp_total_mark = NULL;
    }
    $tmp_external_review_deadline = $external_review_deadline;
    if ($tmp_external_review_deadline == '') {
        $tmp_external_review_deadline = NULL;
    }
    $tmp_internal_review_deadline = $internal_review_deadline;
    if ($tmp_internal_review_deadline == '') {
        $tmp_internal_review_deadline = NULL;
    }
    if (isset($_POST['session'])) {
        $new_calendar_year = $_POST['session'];
        if ($new_calendar_year == '') {
            $new_calendar_year = NULL;
        }
    } else {
        $academic_year_title = Paper_utils::academic_year_from_title($_POST['new_paper']);
        if ($academic_year_title !== false) {
            $new_calendar_year = $academic_year_title;
        } else {
            $new_calendar_year = $calendar_year;
        }
    }
    $addPaper = $db->prepare("INSERT INTO properties VALUES (NULL, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, NULL, NOW(), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, NULL, NULL, 0)");
    $addPaper->bind_param('ssssssssssssisiiisssiidisssssssssis', $_POST['new_paper'], $tmp_start_date, $tmp_end_date, $timezone, $paper_type, $paper_prologue, $paper_postscript, $bgcolor, $fgcolor, $themecolor, $labelcolor, $fullscreen, $marking, $bidirectional, $pass_mark, $distinction_mark, $userID, $folder, $labs, $rubric, $calculator, $tmp_exam_duration, $tmp_random_mark, $tmp_total_mark, $display_correct_answer, $display_question_mark, $display_students_response, $display_feedback, $hide_if_unanswered, $new_calendar_year, $tmp_external_review_deadline, $tmp_internal_review_deadline, $sound_demo, $latex_needed, $password);
    $addPaper->execute();
    $new_paper_id = $db->insert_id;
    $addPaper->close();
    // Get the old reviewers and populate the new paper with.
    $result2 = $db->prepare("SELECT reviewerID, type FROM properties_reviewers WHERE paperID = ?");
    $result2->bind_param('i', $_POST['paperID']);
    $result2->execute();
    $result2->store_result();
    $result2->bind_result($reviewerID, $type);
    while ($result2->fetch()) {
        $stmt = $db->prepare("INSERT INTO properties_reviewers VALUES (NULL, ?, ?, ?)");
        $stmt->bind_param('iis', $new_paper_id, $reviewerID, $type);
        $stmt->execute();
        $stmt->close();
    }
    $result2->close();
    // Set the modules on the new paper
    Paper_utils::update_modules($moduleIDs, $new_paper_id, $db, $userObj);
    if ($paper_type == 2 and $configObject->get('cfg_summative_mgmt')) {
        if (isset($_POST['barriers_needed'])) {
            $barriers_needed = 1;
        } else {
            $barriers_needed = 0;
        }
        $result = $db->prepare("INSERT INTO scheduling VALUES (NULL, ?, ?, ?, ?, ?, ?, ?)");
        $result->bind_param('isissis', $new_paper_id, $_POST['period'], $barriers_needed, $_POST['cohort_size'], $_POST['notes'], $_POST['sittings'], $_POST['campus']);
        $result->execute();
        $result->close();
    }
    // Query the database to get the creation date and then set crypt_name.
    $result2 = $db->prepare("SELECT property_id, UNIX_TIMESTAMP(created), paper_ownerID FROM properties WHERE property_id = ?");
    $result2->bind_param('i', $new_paper_id);
    $result2->execute();
    $result2->store_result();
    $result2->bind_result($property_id, $created, $paper_ownerID);
    $result2->fetch();
    $result2->close();
    $hash = $property_id . $created . $paper_ownerID;
    $update = $db->prepare("UPDATE properties SET crypt_name = ? WHERE property_id = ?");
    $update->bind_param('si', $hash, $property_id);
    $update->execute();
    $update->close();
    return $new_paper_id;
}
コード例 #3
0
ファイル: details.php プロジェクト: vinod-co/centa
if ($properties->get_summative_lock()) {
    echo "<tr><td colspan=\"2\"><div class=\"yellowwarn\"><img src=\"../artwork/paper_locked_padlock.png\" width=\"32\" height=\"32\" alt=\"Locked\" /></div></td><td colspan=\"4\" style=\"vertical-align:middle\"><div class=\"yellowwarn\">" . $string['paperlockedwarning'] . " <a href=\"#\" class=\"blacklink\" onclick=\"launchHelp(189); return false;\">" . $string['paperlockedclick'] . "</a></div></td></tr>\n";
} elseif ($properties->get_paper_type() == '2' and $properties->get_start_date() !== null) {
    $tmp_hour = date("G", $properties->get_start_date());
    if (date("Y", $properties->get_start_date()) > date("Y") + 1) {
        echo "<tr><td colspan=\"2\" style=\"width:40px; line-height:0\" class=\"redwarn\"><img src=\"../artwork/late_warning_icon.png\" width=\"32\" height=\"32\" alt=\"Warning\" /></td><td colspan=\"4\" class=\"redwarn\">";
        printf($string['farfuturewarning'], $properties->get_display_start_date());
        echo "</td></tr>\n";
    } elseif ($tmp_hour < $configObject->get('cfg_hour_warning')) {
        echo "<tr><td colspan=\"2\" style=\"width:40px; line-height:0\" class=\"redwarn\"><img src=\"../artwork/late_warning_icon.png\" width=\"32\" height=\"32\" alt=\"Warning\" /></td><td colspan=\"4\" class=\"redwarn\">";
        printf($string['earlywarning'], $configObject->get('cfg_hour_warning'));
        echo "</td></tr>\n";
    }
}
if ($properties->get_calendar_year() !== null) {
    $tmp_match = Paper_utils::academic_year_from_title($properties->get_paper_title());
    if ($tmp_match !== false and $tmp_match != $properties->get_calendar_year()) {
        echo "<tr><td colspan=\"6\" 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; line-height:0\"><img src=\"../artwork/exclamation_red_bg.png\" width=\"32\" height=\"32\" alt=\"Warning\" /></td><td colspan=\"7\" class=\"redwarn\"><strong>" . $string['warning'] . "</strong>&nbsp;&nbsp;";
        printf($string['nomatchsession'], $tmp_match, $properties->get_calendar_year());
        echo "</td></tr>\n</table>\n</td></tr>\n";
    }
}
$q_screen = array();
$screen_marks = 0;
$old_screen = 0;
$question_number = 0;
$marks_incorrect_error = false;
$paper_warnings = array();
for ($x = 1; $x <= $row_no; $x++) {
    $status = $status_array[$temp_array[$x]['status']];