Exemplo n.º 1
0
        $file = File::encodeFile($file);
    } elseif (isset($_GET['downloadConditionCsv'])) {
        $csv = Csv::createCsv($rows);
        $file = http_post_data($filesystemURI . '/csv', Csv::encodeCsv($csv), true);
        $file = File::decodeFile($file);
        $file->setDisplayName('conditions.csv');
        $file = File::encodeFile($file);
    }
    echo $file;
    exit(0);
}
if (isset($_GET['sortby'])) {
    $condition_data['sortby'] = $_GET['sortby'];
}
if (isset($_GET['sortId'])) {
    $condition_data['sortId'] = $_GET['sortId'];
}
// construct a new header
$h = Template::WithTemplateFile('include/Header/Header.template.html');
$h->bind($user_course_data);
$h->bind(array("name" => $user_course_data['courses'][0]['course']['name'], "notificationElements" => $notifications, "navigationElement" => $menu));
// construct a content element for setting exam paper conditions
$setCondition = Template::WithTemplateFile('include/Condition/SetCondition.template.html');
$setCondition->bind($condition_data);
$userList = Template::WithTemplateFile('include/Condition/UserList.template.html');
$userList->bind($condition_data);
// wrap all the elements in some HTML and show them on the page
$w = new HTMLWrapper($h, $setCondition, $userList);
$w->defineForm(basename(__FILE__) . "?cid=" . $cid, false, $setCondition);
$w->set_config_file('include/configs/config_condition.json');
$w->show();
Exemplo n.º 2
0
                $URI = $databaseURI . "/user/" . $uid;
                http_put_data($URI, $newUserSettings, true, $message);
                if ($message == "201") {
                    $notifications[] = MakeNotification("success", Language::Get('main', 'languageChanged', $langTemplate));
                }
            } else {
                $notifications = $notifications + $f->notifications;
            }
        }
    }
}
// load user data from the database
$databaseURI = $getSiteURI . "/accountsettings/user/{$uid}";
$accountSettings_data = http_get($databaseURI, true);
$accountSettings_data = json_decode($accountSettings_data, true);
// construct a new header
$h = Template::WithTemplateFile('include/Header/Header.template.html');
$h->bind($accountSettings_data);
$h->bind(array("name" => Language::Get('main', 'accountSettings', $langTemplate), "backTitle" => Language::Get('main', 'course', $langTemplate), "backURL" => "index.php", "notificationElements" => $notifications));
// construct a content element for account information
$accountInfo = Template::WithTemplateFile('include/AccountSettings/AccountInfo.template.html');
$accountInfo->bind($accountSettings_data);
// construct a content element for changing password
$changePassword = Template::WithTemplateFile('include/AccountSettings/ChangePassword.template.html');
$changePassword->bind($accountSettings_data);
// wrap all the elements in some HTML and show them on the page
$w = new HTMLWrapper($h, $accountInfo, $changePassword);
$w->defineForm(basename(__FILE__), false, $changePassword);
$w->defineForm(basename(__FILE__), false, $accountInfo);
$w->set_config_file('include/configs/config_default.json');
$w->show();
Exemplo n.º 3
0
        if ($signed !== false) {
            $notifications[] = $signed;
        } else {
            $notifications[] = MakeNotification("error", Language::Get('main', 'errorLogin', $langTemplate));
        }
    }
} else {
    $notifications = array();
}
// check if already logged in
if (Authentication::checkLogin()) {
    header('Location: index.php');
    exit;
}
// construct a new header
$h = Template::WithTemplateFile('include/Header/Header.template.html');
$h->bind(array("backTitle" => Language::Get('main', 'changeCourse', $langTemplate), "name" => Language::Get('main', 'title', $langTemplate), "hideBackLink" => "true", "hideLogoutLink" => "true", "notificationElements" => $notifications));
// construct a login element
$userLogin = Template::WithTemplateFile('include/Login/Login.template.html');
// if back Parameter is given bind it to the userLogin to create hidden input
if (isset($_GET['back'])) {
    $backparameter = cleanInput($_GET['back']);
    $backdata = array("backURL" => $backparameter);
} else {
    $backdata = array();
}
$userLogin->bind($backdata);
// wrap all the elements in some HTML and show them on the page
$w = new HTMLWrapper($h, $userLogin);
$w->set_config_file('include/configs/config_default.json');
$w->show();
Exemplo n.º 4
0
    } elseif ($_POST['action'] == "ExerciseSheetLecturer" && isset($_POST['deleteSheet'])) {
        $URL = $logicURI . "/exercisesheet/exercisesheet/{$_POST['deleteSheet']}";
        $result = http_delete($URL, true, $message);
        if ($message == 201) {
            $sheetNotifications[$_POST['deleteSheet']][] = MakeNotification('success', Language::Get('main', 'successDeleteSubmission', $langTemplate));
        } else {
            $sheetNotifications[$_POST['deleteSheet']][] = MakeNotification('error', Language::Get('main', 'errorDeleteSubmission', $langTemplate));
        }
    }
}
// load GetSite data for Admin.php
$URL = $getSiteURI . "/admin/user/{$uid}/course/{$cid}";
$admin_data = http_get($URL, true);
$admin_data = json_decode($admin_data, true);
$admin_data['filesystemURI'] = $filesystemURI;
$admin_data['cid'] = $cid;
$user_course_data = $admin_data['user'];
$menu = MakeNavigationElement($user_course_data, PRIVILEGE_LEVEL::ADMIN);
// construct a new header
$h = Template::WithTemplateFile('include/Header/Header.template.html');
$h->bind($user_course_data);
$h->bind(array("name" => $user_course_data['courses'][0]['course']['name'], "backTitle" => Language::Get('main', 'changeCourse', $langTemplate), "backURL" => "index.php", "notificationElements" => $notifications, "navigationElement" => $menu));
$t = Template::WithTemplateFile('include/ExerciseSheet/ExerciseSheetLecturer.template.html');
$t->bind($admin_data);
if (isset($sheetNotifications)) {
    $t->bind(array("SheetNotificationElements" => $sheetNotifications));
}
$w = new HTMLWrapper($h, $t);
$w->defineForm(basename(__FILE__) . "?cid=" . $cid, false, $t);
$w->set_config_file('include/configs/config_admin_lecturer.json');
$w->show();
Exemplo n.º 5
0
}
$editExternalId = Template::WithTemplateFile('include/CourseManagement/EditExternalId.template.html');
$editExternalId->bind($externalid_data);
if (isset($editExternalIdNotifications)) {
    $editExternalId->bind(array("EditExternalIdNotificationElements" => $editExternalIdNotifications));
}
$addExternalId = Template::WithTemplateFile('include/CourseManagement/AddExternalId.template.html');
if (isset($addExternalIdNotifications)) {
    $addExternalId->bind(array("AddExternalIdNotificationElements" => $addExternalIdNotifications));
}
// construct a content element for adding users
$addUser = Template::WithTemplateFile('include/CourseManagement/AddUser.template.html');
if (isset($addUserNotifications)) {
    $addUser->bind(array("AddUserNotificationElements" => $addUserNotifications));
}
/**
 * @todo combine the templates into a single file
 */
// wrap all the elements in some HTML and show them on the page
$w = new HTMLWrapper($h, $courseSettings, $plugins, $addExerciseType, $editExerciseType, $grantRights, $revokeRights, $addUser, $editExternalId, $addExternalId);
$w->defineForm(basename(__FILE__) . "?cid=" . $cid, false, $courseSettings);
$w->defineForm(basename(__FILE__) . "?cid=" . $cid, false, $plugins);
$w->defineForm(basename(__FILE__) . "?cid=" . $cid, false, $addExerciseType);
$w->defineForm(basename(__FILE__) . "?cid=" . $cid, false, $editExerciseType);
$w->defineForm(basename(__FILE__) . "?cid=" . $cid, false, $grantRights);
$w->defineForm(basename(__FILE__) . "?cid=" . $cid, false, $revokeRights);
$w->defineForm(basename(__FILE__) . "?cid=" . $cid, false, $addUser);
$w->defineForm(basename(__FILE__) . "?cid=" . $cid, false, $editExternalId);
$w->defineForm(basename(__FILE__) . "?cid=" . $cid, false, $addExternalId);
$w->set_config_file('include/configs/config_course_management.json');
$w->show();
Exemplo n.º 6
0
                        }
                    } else {
                        $errormsg = Language::Get('main', 'unknownError', $langTemplate);
                        $notifications[] = MakeNotification('error', $errormsg);
                    }
                }
            } else {
                $errormsg = Language::Get('main', 'invalidFileType', $langTemplate);
                $notifications[] = MakeNotification('error', $errormsg);
            }
        }
    }
}
// load tutorUpload data from GetSite
$URL = $getSiteURI . "/tutorupload/user/{$uid}/course/{$cid}";
$tutorUpload_data = http_get($URL, true);
$tutorUpload_data = json_decode($tutorUpload_data, true);
$tutorUpload_data['filesystemURI'] = $filesystemURI;
$tutorUpload_data['cid'] = $cid;
$user_course_data = $tutorUpload_data['user'];
$menu = MakeNavigationElement($user_course_data, PRIVILEGE_LEVEL::TUTOR, true);
// construct a new header
$h = Template::WithTemplateFile('include/Header/Header.template.html');
$h->bind($user_course_data);
$h->bind(array("name" => isset($user_course_data['courses'][0]['course']['name']) ? $user_course_data['courses'][0]['course']['name'] : null, "notificationElements" => $notifications, "navigationElement" => $menu));
// construct a content element for uploading markings
$tutorUpload = Template::WithTemplateFile('include/TutorUpload/TutorUpload.template.html');
$tutorUpload->bind($tutorUpload_data);
$w = new HTMLWrapper($h, $tutorUpload);
$w->set_config_file('include/configs/config_upload_exercise.json');
$w->show();
Exemplo n.º 7
0
}
if (isset($_POST['sortUsers'])) {
    $markingTool_data['sortUsers'] = $_POST['sortUsers'];
}
$markingTool_data['URI'] = $URI;
$markingTool_data['cid'] = $cid;
$user_course_data = $markingTool_data['user'];
$menu = MakeNavigationElement($user_course_data, PRIVILEGE_LEVEL::TUTOR, true);
// construct a new header
$h = Template::WithTemplateFile('include/Header/Header.template.html');
$h->bind($user_course_data);
$h->bind(array("name" => $user_course_data['courses'][0]['course']['name'], "navigationElement" => $menu));
$searchSettings = Template::WithTemplateFile('include/MarkingTool/MarkingToolSettings.template.html');
$searchSettings->bind($markingTool_data);
// wrap all the elements in some HTML and show them on the page
$w = new HTMLWrapper($h, $searchSettings);
$allOutputs = 0;
if (!empty($markingTool_data['groups'])) {
    // find selected sheet
    $selectedSheet = null;
    foreach ($markingTool_data['exerciseSheets'] as $sheet) {
        if (!isset($sheet['id'])) {
            continue;
        }
        if ($sheet['id'] == $sid) {
            $selectedSheet = $sheet;
            break;
        }
    }
    $groups = $markingTool_data['groups'];
    //unset($markingTool_data['groups']);
Exemplo n.º 8
0
// construct a content element for the ability to look at the upload history of a student
if ($courseStatus >= 1) {
    $uploadHistorySettings = Template::WithTemplateFile('include/UploadHistory/UploadHistorySettings.template.html');
    $uploadHistorySettings->bind($uploadHistoryOptions_data);
}
$uploadHistory = Template::WithTemplateFile('include/UploadHistory/UploadHistory.template.html');
if (isset($uploadHistory_data)) {
    $uploadHistory->bind($uploadHistory_data);
}
if (isset($uploadHistoryNotifications)) {
    $uploadHistory->bind(array("UploadHistoryNotificationElements" => $uploadHistoryNotifications));
}
if ($courseStatus >= 1) {
    $uploadHistoryGroup = Template::WithTemplateFile('include/UploadHistory/UploadHistoryGroup.template.html');
    if (isset($uploadHistory_data)) {
        $uploadHistoryGroup->bind($uploadHistory_data);
    }
    if (isset($uploadHistoryGroupNotifications)) {
        $uploadHistoryGroup->bind(array("UploadHistoryNotificationElements" => $uploadHistoryGroupNotifications));
    }
}
// wrap all the elements in some HTML and show them on the page
$w = new HTMLWrapper($h, isset($uploadHistorySettings) ? $uploadHistorySettings : null, isset($uploadHistoryGroup) ? $uploadHistoryGroup : null, isset($uploadHistory) ? $uploadHistory : null);
if (isset($uploadHistorySettings)) {
    $w->defineForm(basename(__FILE__) . "?cid=" . $cid, false, $uploadHistorySettings);
}
if (isset($uploadHistory)) {
    $w->defineForm(basename(__FILE__) . "?cid=" . $cid, false, $uploadHistory);
}
$w->set_config_file('include/configs/config_default.json');
$w->show();
Exemplo n.º 9
0
 * Constructs the page that is displayed to a tutor.
 *
 * @author Felix Schmidt
 * @author Florian Lücke
 * @author Ralf Busch
 */
include_once dirname(__FILE__) . '/include/Boilerplate.php';
include_once dirname(__FILE__) . '/../Assistants/Structures.php';
global $globalUserData;
Authentication::checkRights(PRIVILEGE_LEVEL::TUTOR, $cid, $uid, $globalUserData);
$langTemplate = 'Tutor_Controller';
Language::loadLanguageFile('de', $langTemplate, 'json', dirname(__FILE__) . '/');
// load tutor data from GetSite
$URI = $getSiteURI . "/tutor/user/{$uid}/course/{$cid}";
$tutor_data = http_get($URI, true);
$tutor_data = json_decode($tutor_data, true);
$tutor_data['filesystemURI'] = $filesystemURI;
$tutor_data['cid'] = $cid;
// check userrights for course
$user_course_data = $tutor_data['user'];
$menu = MakeNavigationElement($user_course_data, PRIVILEGE_LEVEL::TUTOR);
// construct a new header
$h = Template::WithTemplateFile('include/Header/Header.template.html');
$h->bind($user_course_data);
$h->bind(array("name" => $user_course_data['courses'][0]['course']['name'], "backTitle" => Language::Get('main', 'changeCourse', $langTemplate), "backURL" => "index.php", "notificationElements" => $notifications, "navigationElement" => $menu));
$t = Template::WithTemplateFile('include/ExerciseSheet/ExerciseSheetTutor.template.html');
$t->bind($tutor_data);
$w = new HTMLWrapper($h, $t);
$w->defineForm(basename(__FILE__) . "?cid=" . $cid, false, $t);
$w->set_config_file('include/configs/config_student_tutor.json');
$w->show();
Exemplo n.º 10
0
// construct a content element for assigning tutors automatically
$assignAutomatically = Template::WithTemplateFile('include/TutorAssign/AssignAutomatically.template.html');
$assignAutomatically->bind($tutorAssign_data);
if (isset($assignAutomaticallyNotifications)) {
    $assignAutomatically->bind(array("AssignAutomaticallyNotificationElements" => $assignAutomaticallyNotifications));
}
// construct a content element for assigning tutors manually
$assignManually = Template::WithTemplateFile('include/TutorAssign/AssignManually.template.html');
$assignManually->bind($tutorAssign_data);
if (isset($assignManuallyNotifications)) {
    $assignManually->bind(array("AssignManuallyNotificationElements" => $assignManuallyNotifications));
}
// construct a content element for removing assignments from tutors
$assignRemove = Template::WithTemplateFile('include/TutorAssign/AssignRemove.template.html');
if (isset($assignRemoveNotifications)) {
    $assignRemove->bind(array("AssignRemoveNotificationElements" => $assignRemoveNotifications));
}
// construct a content element for creating submissions for unsubmitted users
$assignMake = Template::WithTemplateFile('include/TutorAssign/AssignMake.template.html');
if (isset($assignMakeNotifications)) {
    $assignMake->bind(array("AssignMakeNotificationElements" => $assignMakeNotifications));
}
// wrap all the elements in some HTML and show them on the page
$w = new HTMLWrapper($h, $assignAutomatically, $assignManually, $assignMake, $assignRemove);
$w->defineForm(basename(__FILE__) . "?cid=" . $cid . "&sid=" . $sid, false, $assignAutomatically);
$w->defineForm(basename(__FILE__) . "?cid=" . $cid . "&sid=" . $sid, false, $assignManually);
$w->defineForm(basename(__FILE__) . "?cid=" . $cid . "&sid=" . $sid, false, $assignMake);
$w->defineForm(basename(__FILE__) . "?cid=" . $cid . "&sid=" . $sid, false, $assignRemove);
$w->set_config_file('include/configs/config_tutor_assign.json');
//$w->set_config_file('include/configs/config_default.json');
$w->show();
Exemplo n.º 11
0
if (isset($cid)) {
    $sheetSettings->bind(array('cid' => $cid));
}
if (isset($uid)) {
    $sheetSettings->bind(array('uid' => $uid));
}
if (isset($sid)) {
    $sheetSettings->bind(array('sid' => $sid));
    // if (!isset($_POST['action']) || $_POST['action']=='new'){
    $result = http_get($serverURI . "/DB/DBForm/form/exercisesheet/{$sid}", true);
    $forms = json_decode($result, true);
    $result = http_get($serverURI . "/DB/DBProcess/process/exercisesheet/{$sid}", true);
    $processes = json_decode($result, true);
    // }
}
if (isset($processes)) {
    $sheetSettings->bind(array('processes' => $processes));
}
if (isset($forms)) {
    $sheetSettings->bind(array('forms' => $forms));
}
$sheetSettings->bind($exerciseTypes);
$sheetSettings->bind($processorModules);
if (isset($sheet_data)) {
    $sheetSettings->bind($sheet_data);
}
// wrap all the elements in some HTML and show them on the page
$w = new HTMLWrapper($h, $sheetSettings, $createExercise);
$w->defineForm(basename(__FILE__) . "?cid=" . $cid . (isset($sid) ? "&sid={$sid}" : ''), true, $sheetSettings, $createExercise);
$w->set_config_file('include/configs/config_createSheet.json');
$w->show();
Exemplo n.º 12
0
// construct a new header
$h = Template::WithTemplateFile('include/Header/Header.template.html');
$h->bind($user_course_data);
$h->bind(array("name" => Language::Get('main', 'settings', $langTemplate), "backTitle" => Language::Get('main', 'courses', $langTemplate), "backURL" => "index.php", "notificationElements" => $notifications, "navigationElement" => $menu));
// construct a content element for creating new courses
$createCourse = Template::WithTemplateFile('include/MainSettings/CreateCourse.template.html');
$createCourse->bind($mainSettings_data);
if (count($notifications) != 0) {
    $createCourse->bind($_POST);
}
// construct a content element for setting admins
$setAdmin = Template::WithTemplateFile('include/MainSettings/SetAdmin.template.html');
$setAdmin->bind($mainSettings_data);
// construct a content element for creating new users
$createUser = Template::WithTemplateFile('include/MainSettings/CreateUser.template.html');
if (count($notifications) != 0) {
    $createUser->bind($_POST);
}
// construct a content element for deleting users
$deleteUser = Template::WithTemplateFile('include/MainSettings/DeleteUser.template.html');
/**
 * @todo combine the templates into a single file
 */
// wrap all the elements in some HTML and show them on the page
$w = new HTMLWrapper($h, $createCourse, $setAdmin, $createUser, $deleteUser);
$w->defineForm(basename(__FILE__), false, $createCourse);
$w->defineForm(basename(__FILE__), false, $setAdmin);
$w->defineForm(basename(__FILE__), false, $createUser);
$w->defineForm(basename(__FILE__), false, $deleteUser);
$w->set_config_file('include/configs/config_default.json');
$w->show();
Exemplo n.º 13
0
$groupMembers = Template::WithTemplateFile('include/Group/GroupMembers.template.html');
$groupMembers->bind($group_data);
// construct a content element for managing groups
if ($isInGroup) {
    $groupManagement = Template::WithTemplateFile('include/Group/GroupManagement.template.html');
    $groupManagement->bind($group_data);
}
// construct a content element for creating groups
if ($isLeader) {
    $invitationsFromGroup = Template::WithTemplateFile('include/Group/InvitationsFromGroup.template.html');
    $invitationsFromGroup->bind($group_data);
}
// construct a content element for joining groups
if ($hasInvitations) {
    $invitationsToGroup = Template::WithTemplateFile('include/Group/InvitationsToGroup.template.html');
    $invitationsToGroup->bind($group_data);
}
// wrap all the elements in some HTML and show them on the page
$w = new HTMLWrapper($h, $groupMembers, isset($invitationsToGroup) ? $invitationsToGroup : null, isset($groupManagement) ? $groupManagement : null, isset($invitationsFromGroup) ? $invitationsFromGroup : null);
$w->defineForm(basename(__FILE__) . "?cid=" . $cid . "&sid=" . $sid, false, $groupMembers);
if (isset($groupManagement)) {
    $w->defineForm(basename(__FILE__) . "?cid=" . $cid . "&sid=" . $sid, false, $groupManagement);
}
if (isset($invitationsFromGroup)) {
    $w->defineForm(basename(__FILE__) . "?cid=" . $cid . "&sid=" . $sid, false, $invitationsFromGroup);
}
if (isset($invitationsToGroup)) {
    $w->defineForm(basename(__FILE__) . "?cid=" . $cid . "&sid=" . $sid, false, $invitationsToGroup);
}
$w->set_config_file('include/configs/config_group.json');
$w->show();