public function addParticipantToDatabaseFromMatriculationNumber($matNr, $term = 0)
 {
     $ldapManager = exam_organization_ldap_manager::getInstance();
     $imtLogin = $ldapManager->matriculationNumber2imtLogin($matNr);
     $lastName = $ldapManager->matriculationNumber2lastName($matNr);
     $firstName = $ldapManager->matriculationNumber2firstName($matNr);
     $eoDatabase = exam_organization_database::getInstance();
     $result1 = $eoDatabase->addParticipantToCourse($imtLogin, $lastName, $firstName, $matNr);
     //add participant to course
     $result2 = $eoDatabase->addParticipantToExam($imtLogin, $term);
     //add participant to exam
     //HIS LSF import
     if (isset($_SESSION["exam_organization_excelRowArray"])) {
         $rowStringArray = $_SESSION["exam_organization_excelRowArray"];
         if (isset($rowStringArray[$matNr])) {
             $result3 = $eoDatabase->saveExcelRow($term, $matNr, $rowStringArray[$matNr]);
             //add participant to exam
         }
     }
     //return result state
     if (!($result1 == FALSE) && !($result2 == FALSE)) {
         return TRUE;
     }
     return FALSE;
 }
예제 #2
0
파일: mail.php 프로젝트: rolwi/koala
function sendRoundMail($sendingUser, $courseObject, $courseId, $term, $subject = "", $body = "")
{
    //get recipeints
    $recipients = array();
    $eoDatabase = exam_organization_database::getInstance();
    $participants = $eoDatabase->getParticipantsForTerm($term);
    //prefetch mail addresses
    $ldapManager = exam_organization_ldap_manager::getInstance();
    foreach ($participants as $participant) {
        $ldapManager->markForPreload($participant["matriculationNumber"]);
    }
    $ldapManager->preload();
    $header = 'MIME-Version: 1.0' . "\r\n";
    if ($sendingUser->get_full_name() == "Root User") {
        $lecturerName = "Root User";
        $lecturerMail = "*****@*****.**";
    } else {
        $lecturerMailArray = $sendingUser->get_email_forwarding();
        $lecturerMail = $lecturerMailArray[1];
        $lecturerName = $sendingUser->get_full_name();
    }
    $header .= "Content-type: text/html; charset=utf-8\r\n";
    $header .= 'From: ' . $lecturerName . ' <' . $lecturerMail . '>' . "\r\n";
    //get mail addresses
    foreach ($participants as $participant) {
        $mailAdress = $ldapManager->matriculationNumber2mail($participant["matriculationNumber"]);
        //$recipients[]=$mailAdress;
        $header .= "Bcc: " . $mailAdress . "\r\n";
    }
    $header .= "Bcc: " . $lecturerMail . "\r\n";
    //send mail to author
    //create recipients string
    $recipientsString = "";
    $first = true;
    foreach ($recipients as $recipient) {
        if ($first) {
            $first = FALSE;
            $recipientsString .= $recipient;
        } else {
            $recipientsString .= ", " . $recipient;
        }
    }
    //get staff members subgroup to send mail
    $staffGroup = $courseObject->get_group_staff();
    //send mail
    $sendingUser->mail(gettext("Circular") . ": " . $subject, $body);
    $staffGroup->mail(gettext("Circular") . ": " . $subject, $body);
    $returnValue = mail($recipientsString, '=?UTF-8?B?' . base64_encode(gettext("Circular") . ": " . $subject) . '?=', $body, $header);
    return returnValue;
}
예제 #3
0
         $eoDatabase = exam_organization_database::getInstance();
         $imt_login = $eoDatabase->getLogin($matnr);
         $data = $eoDatabase->getParticipantData($imt_login);
         if ($data) {
             $value_student = utf8_encode($data["forename"] . " " . $data["name"]);
             $value_matnr = $matnr;
             $js_focus = "document.getElementById('1').select();";
             $barcodeDisabled = 'disabled="true"';
         } else {
             $problems = gettext("Matriculation Number not found");
         }
     }
 } else {
     if ($_POST['hidden_action'] == "savePoints") {
         $matnr = $_POST["hidden_matnr"];
         $eoDatabase = exam_organization_database::getInstance();
         $i = 1;
         $points = 0.0;
         $isNT = isset($_POST['checkbox']);
         $assignments = intval($_POST['hidden_counter']);
         for ($i = 1; $i <= $assignments; $i++) {
             $value = $isNT ? 0 : str_replace(",", ".", $_POST['input_exam_results_a' . $i]);
             $eoDatabase->setAssignmentResult($matnr, $i, $value, $examTerm);
             $points += floatval($value);
         }
         $NTvalue = $isNT ? $_POST['checkbox'] : "NULL";
         $eoDatabase->setNT($examTerm, $matnr, $NTvalue);
         $points = $isNT ? $_POST['checkbox'] : number_format($points, 1) . " points";
         $points = str_replace(".", ",", $points);
         $ack = gettext("[points] saved for [student]");
         $ack = str_replace("[points]", $points, $ack);
예제 #4
0
function deleteParticipantFromTerm($examObject, $term, $value = -1)
{
    $eoDatabase = exam_organization_database::getInstance();
    $result = $eoDatabase->deleteParticipantFromTerm($term, $value);
    exit(0);
}
 public function getRooms($term)
 {
     $returnArray = array();
     $eoDatabase = exam_organization_database::getInstance();
     $availableRooms = $eoDatabase->getRoomList();
     foreach ($availableRooms as $room) {
         if (self::$course->get_attribute("EXAM" . $term . "_checkbox_room_" . $room) === "on") {
             $returnArray["checkbox_room_" . $room] = "checked";
         } else {
             $returnArray["checkbox_room_" . $room] = "";
         }
     }
     return $returnArray;
 }
예제 #6
0
 private function addBonusToDatabase($usernameBonusArray)
 {
     $eoDatabase = exam_organization_database::getInstance();
     foreach ($usernameBonusArray as $userName => $bonus) {
         $eoDatabase->setBonus($userName, $bonus);
     }
 }