Пример #1
0
 /**
  * Enrole the student on a module.
  *
  * @param $idMod moduleID of module
  * @param $attempt
  * @param $session session of module
  * @param int $auto_update if system add
  *
  * @return bool return true if successful.
  */
 public function add_student_to_module($idMod, $attempt, $session, $auto_update = 0)
 {
     // need to check its a self reg module
     if (module_utils::get_full_details_by_ID($idMod, $this->db) === false) {
         return false;
     }
     if (UserUtils::is_user_on_module($this, $idMod, $session, $this->db)) {
         //don't add a user to a module multiple times
         return true;
     }
     $return = UserUtils::add_student_to_module($this->get_user_ID(), $idMod, $attempt, $session, $auto_update);
     $this->load_student_modules();
     return $return;
 }
Пример #2
0
echo "<tr>\n";
foreach ($table_order as $col_title) {
    echo "<th style=\"background-color:#1E3C7B\" class=\"coltitle\">{$col_title}</th>\n";
}
?>
  </tr>
  </thead>

  <tbody>
<?php 
$stmt = false;
if ($userObject->has_role(array('Admin', 'SysAdmin')) or $userObject->get_user_ID() == $userID) {
    $log_viewable = true;
} else {
    $idMod = array_keys($userObject->get_staff_modules());
    $log_viewable = UserUtils::is_user_on_module($userID, $idMod, '', $mysqli);
}
$paper_types = array('Formative Self-Assessment', 'Progress Test', 'Summative Exam', 'Survey', 'OSCE Station', 'Offline Paper', 'Peer Review');
if ($log_viewable) {
    if (stripos($user_details['roles'], 'External Examiner') !== false) {
        // Get the papers the External is down to review.
        $external_array = array();
        $sql = "SELECT DISTINCT\n\t\t\t\t\t\t\t\tcrypt_name, paper_title, property_id, paper_type, started, DATE_FORMAT(started,'{$configObject->get('cfg_long_date_time')}') AS display_started\n\t\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\t\t(properties, properties_reviewers)\n\t\t\t\t\t\t\tLEFT JOIN\n\t\t\t\t\t\t\t\treview_metadata\n\t\t\t\t\t\t\tON\n\t\t\t\t\t\t\t\tproperties.property_id = review_metadata.paperID AND review_metadata.reviewerID = ?\n\t\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t\tproperties.property_id = properties_reviewers.paperID AND\n\t\t\t\t\t\t\t\tproperties_reviewers.reviewerID = ? AND\n\t\t\t\t\t\t\t\tdeleted IS NULL\n\t\t\t\t\t\t\tORDER BY\n\t\t\t\t\t\t\t\tpaper_title";
        $stmt = $mysqli->prepare($sql);
        $stmt->bind_param('ii', $userID, $userID);
        $stmt->execute();
        $stmt->bind_result($crypt_name, $paper_title, $property_id, $paper_type, $started, $display_started);
        while ($stmt->fetch()) {
            $paper[$results_no]['crypt_name'] = $crypt_name;
            $paper[$results_no]['q_paper'] = $paper_title;
            $paper[$results_no]['id'] = $property_id;