if (count($_POST) > 0 && $assn && isset($assignments[$assn])) { include $assn; return; } // View $OUTPUT->header(); $OUTPUT->bodyStart(); // Settings button and dialog echo '<span style="position: fixed; right: 10px; top: 5px;">'; if ($USER->instructor) { echo '<a href="grades.php" target="_blank"><button class="btn btn-info">Grade detail</button></a> ' . "\n"; } SettingsForm::button(); $OUTPUT->exitButton(); echo '</span>'; SettingsForm::start(); SettingsForm::select("exercise", __('Please select an assignment'), $assignments); SettingsForm::dueDate(); SettingsForm::done(); SettingsForm::end(); $OUTPUT->flashMessages(); $OUTPUT->welcomeUserCourse(); if ($assn && isset($assignments[$assn])) { include $assn; } else { if ($USER->instructor) { echo "<p>Please use settings to select an assignment for this tool.</p>\n"; } else { echo "<p>This tool needs to be configured - please see your instructor.</p>\n"; } }