X Tutup
dbprefix; if ( SettingsForm::handleSettingsPost() ) { header( 'Location: '.addSession('index.php') ) ; return; } // All the assignments we support $assignments = array( 'regex_sum.php' => 'Sum with a Regular Expression', 'http_headers.php' => 'Exploring HyperText Transport Protocol', 'comment_html.php' => 'Sum comment data from HTML', 'knows.php' => 'Follow links in a series of web pages.', 'comment_xml.php' => 'Sum comment data from XML', 'comment_json.php' => 'Sum comment data from JSON', 'geo_json.php' => 'Retrieve data from OpenStreetMap JSON API', 'google_geo_json.php' => 'Retrieve GEO data from a JSON API (Deprecated)', 'freebie.php' => 'Choose your own grade', ); $oldsettings = Settings::linkGetAll(); $assn = Settings::linkGet('exercise'); $custom = LTIX::ltiCustomGet('exercise'); if ( $assn && isset($assignments[$assn]) ) { // Configured } else if ( strlen($custom) > 0 && isset($assignments[$custom]) ) { Settings::linkSet('exercise', $custom); $assn = $custom; } // Get any due date information $dueDate = SettingsForm::getDueDate(); // Let the assignment handle the POST if ( count($_POST) > 0 && $assn && isset($assignments[$assn]) ) { require($assn); return; } $menu = false; if ( $LAUNCH->link && $LAUNCH->user && $LAUNCH->user->instructor ) { $menu = new \Tsugi\UI\MenuSet(); $menu->addLeft('Student Data', 'grades.php'); if ( $CFG->launchactivity ) { $menu->addRight(__('Launches'), 'analytics'); } $menu->addRight(__('Settings'), '#', /* push */ false, SettingsForm::attr()); } // View $OUTPUT->header(); ?> bodyStart(); $OUTPUT->topNav($menu); // Settings dialog SettingsForm::start(); SettingsForm::select("exercise", __('Please select an assignment'),$assignments); SettingsForm::dueDate(); SettingsForm::done(); SettingsForm::end(); $OUTPUT->welcomeUserCourse(); $OUTPUT->flashMessages(); if ( $assn && isset($assignments[$assn]) ) { require($assn); } else { if ( $USER->instructor ) { echo("

Please use settings to select an assignment for this tool.

\n"); } else { echo("

This tool needs to be configured - please see your instructor.

\n"); } } $OUTPUT->footer();
X Tutup