} ?> <?php echo($QTEXT); ?> </div> <form id="forminput"> <?php if ( $EX !== false ) { echo('<button onclick="runit()" class="btn btn-primary" type="button">Check Code</button>'."\n"); } else { echo('<button onclick="runit()" class="btn btn-primary" type="button">Run Python</button>'."\n"); } if ( strlen($CODE) > 0 ) { echo('<button onclick="resetcode()" class="btn btn-default" type="button">Reset Code</button> '); } echo('<button onclick="$(\'#info\').modal();return false;" class="btn btn-default" type="button"><span class="glyphicon glyphicon-info-sign"></span></button>'."\n"); if ( $USER->instructor ) SettingsForm::button(); $OUTPUT->exitButton(); if ( $USER->instructor ) { if ( $EX === false ) { echo(' <a href="grades.php" class="btn btn-default" target="_blank">View Student Code</a>'."\n"); } else { echo(' <a href="grades.php" class="btn btn-default" target="_blank">View Grades</a>'."\n"); } } ?> <img id="spinner" src="static/spinner.gif" style="vertical-align: middle;display: none"> <span id="redo" style="color:red;display:none"> Please correct your code and re-run. </span> <span id="complete" style="color:green;display:none"> Execution complete. </span> <span id="gradegood" style="color:green;display:none"> Grade updated on server. </span> <span id="gradelow" style="color:green;display:none"> Grade updated on server. </span> <span id="gradebad" style="color:red;display:none"> Error storing grade on server. </span>
// Get any due date information $dueDate = SettingsForm::getDueDate(); // Let the assignment handle the POST 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 {
// Handle our own manual set of the manual_key setting if (isset($_POST['manual_key'])) { Settings::linkSet('manual_key', $_POST['manual_key']); $_SESSION['debug_log'] = Settings::getDebugArray(); $_SESSION['success'] = "Setting updated"; header('Location: ' . addSession('index.php')); return; } // Start of the output $OUTPUT->header(); // Start of the view $OUTPUT->bodyStart(); $OUTPUT->flashMessages(); // Place the settings button in the upper right. if ($USER->instructor) { SettingsForm::button(true); } // Put out the hidden settings form using predefined UI routines if ($USER->instructor) { SettingsForm::start(); echo '<label for="sample_key">Please enter a string for "sample_key" below.<br/>' . "\n"; SettingsForm::text('sample_key'); echo "</label>\n"; SettingsForm::end(); } echo "<h1>Settings Test Harness</h1>\n"; $OUTPUT->welcomeUserCourse(); if ($USER->instructor) { echo "<p>Press the settings button in the upper left to change the settings.</p>\n"; } // Load the old values for the settings