$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();
} 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();
$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();
} $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();
} } 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();
$markingElement = Template::WithTemplateFile('include/MarkingTool/MarkingTool.template.html'); $markingElement->bind($markingTool_data); $markingElement->bind(array('selectedSheet' => $selectedSheet)); $markingElement->bind(array('group' => $group)); if (isset($GroupNotificationElements[$group['leader']['id']])) { $markingElement->bind(array('GroupNotificationElements' => $GroupNotificationElements[$group['leader']['id']])); unset($GroupNotificationElements[$group['leader']['id']]); } $w->insert($markingElement); $w->defineForm(basename(__FILE__) . "?cid=" . $cid . "&sid=" . $sid, false, $markingElement); } if ($allOutputs == 0) { $markingElement = Template::WithTemplateFile('include/MarkingTool/MarkingToolEmpty.template.html'); $markingElement->bind($markingTool_data); $w->insert($markingElement); } } else { $markingElement = Template::WithTemplateFile('include/MarkingTool/MarkingToolEmpty.template.html'); $markingElement->bind($markingTool_data); $w->insert($markingElement); } if (!empty($GroupNotificationElements)) { foreach ($GroupNotificationElements as $key => $notifs) { $notifications = array_merge($notifications, $notifs); } } $h->bind(array("notificationElements" => $notifications)); $searchSettings->bind(array('allOutputs' => $allOutputs)); $w->defineForm(basename(__FILE__) . "?cid=" . $cid . "&sid=" . $sid, false, $searchSettings); $w->set_config_file('include/configs/config_marking_tool.json'); $w->show();
* 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();
// 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();
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();
$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();