function display_question_section() { $json = $GLOBALS['json']; $currentQuestion = $GLOBALS['current-question']; $questionCount = $GLOBALS['question-count']; $questionIndex = $currentQuestion - 1; $previousQuestion = ($questionIndex - 1 + $questionCount) % $questionCount + 1; $nextQuestion = ($questionIndex + 1) % $questionCount + 1; echo <<<_HD \t \t<section class="question-area"> \t\t<span id="current-question">{$currentQuestion}</span><span> / </span><span id="question-count">{$questionCount}</span> \t\t\t \t\t<form id="question-form" method="post" action="#"> \t\t\t<!-- the question content --> _HD; display_question($json, $currentQuestion); display_options($json, $currentQuestion); echo <<<_HD \t \t\t\t<p id="navigation-buttons"> \t\t\t\t<button id="previous" class="navigation" name="display-question" value="{$previousQuestion}"><<</button> \t\t\t\t<button id="next" class="navigation" name="display-question" value="{$nextQuestion}">>></button> \t\t\t\t<input id="current-question" type="hidden" name="current-question" value={$currentQuestion}> \t\t\t\t<input id="question-count" type="hidden" name="question-count" value={$questionCount}> \t \t\t</p> \t\t</form> \t</section> _HD; }
" class="vspace">JavaScript API <small class="del">deprecated!</small></h2> <?php check_notified_request(TBL_JSOPT); ?> <p> If you wish to use the JavaScript (JS) visualization API, you can customize it here. These options are stored on your MySQL database. <em>Leave fields blank for default values</em>. </p> <p>This API will be not supported in a future, and maybe it will be removed definitely in next smt2 releases.</p> <br /> <form action="savesettings.php" method="post"> <?php $jsoption = db_select_all(TBL_PREFIX . TBL_JSOPT, "*", "1"); echo display_options($jsoption); ?> <fieldset> <input type="hidden" name="submit" value="<?php echo TBL_JSOPT; ?> " /> <input type="submit" class="button round" value="Set JS replay options" /> </fieldset> </form> --> <?php include INC_DIR . 'footer.php';
<tr> <th colspan="2"> <input type="submit" name="action" value="Preview"> <?php if ($process && count($errors) == 0) { ?> <input type="submit" name="action" value="Submit"> <?php } ?> </th> </tr> <tr> <th class="subr">Are you real?</th> <td><select name="sane"><?php display_options(array("I, Robot", "I used to be", "WTF?", "Yes", "No, but I'd still want to submit this"), "2"); ?> </select></td> </tr> </table> </form> <?php site_footer(); // Display an option list with one selected function display_options($options, $current) { foreach ($options as $k => $v) { echo '<option value="', $k, '"', $k == $current ? ' selected="selected"' : '', '>', htmlentities($v, ENT_QUOTES | ENT_IGNORE, 'UTF-8'), "</option>\n"; } } /* vim: set et ts=4 sw=4 ft=php: : */
$old_q_type = $q_type; $old_q_id = $q_id; $old_theme = $theme; $old_screen = $screen; $old_correct_fback = $correct_fback; $options_array = array(); // Clear options array } $options_array[] = array('q_type' => $q_type, 'score_method' => $score_method, 'display_method' => $display_method, 'settings' => $settings, 'correct' => $correct, 'scenario' => $scenario, 'leadin' => $leadin, 'q_media' => $q_media, 'q_media_width' => $q_media_width, 'q_media_height' => $q_media_height, 'option_text' => $option_text, 'o_media' => $o_media, 'o_media_width' => $o_media_width, 'o_media_height' => $o_media_height, 'marks_correct' => $marks_correct, 'marks_incorrect' => $marks_incorrect); } // End of While loop $result->close(); // Print the options for the last question on the screen. $excluded = $exclusions->get_exclusions_by_qid($old_q_id); if (count($options_array) > 0) { display_options($old_screen, $options_array, $old_q_id, $old_theme, $old_scenario, $old_leadin, $old_notes, $paper_type, $_GET['method'], $reviews, $excluded, false); } echo '</td></tr></table></td></tr>'; echo "<tr><td colspan=\"2\" style=\"border-top: dotted #808080 1px; color:#808080; font-size:90%; font-weight:bold\"> </td>\n</tr>\n"; echo '</table>'; if ($_GET['method'] == 'ebel') { if (isset($_GET['std_setID'])) { $result = $mysqli->prepare("SELECT category, percentage FROM ebel WHERE std_setID = ?"); $result->bind_param('i', $_GET['std_setID']); $result->execute(); $result->bind_result($category, $percentage); while ($result->fetch()) { $ebel[$category] = isset($percentage) ? round($percentage, 2) : null; } $result->close(); }
echo '</p>'; if (isset($_GET['tab'])) { $tab = $_GET['tab']; } else { $tab = 'functionality'; } display_tabs($tab); // options form print $msg; echo '<form method="post">'; switch ($tab) { case 'functionality': functionality_options($options); break; case 'display': display_options($options); break; case 'origin': origin_options($options); break; case 'size_and_position': size_and_position_options($options); break; case 'components': components_options($options); break; case 'flickr': flickr_options($options); break; case 'picasa': picasa_options($options);
$old_scenario = $scenario; $old_notes = $notes; $old_q_type = $q_type; $old_q_id = $q_id; $old_theme = $theme; $old_screen = $screen; $options_array = array(); // Clear options array } $options_array[] = array('q_type' => $q_type, 'score_method' => $score_method, 'display_method' => $display_method, 'correct' => $correct, 'scenario' => $scenario, 'q_media' => $q_media, 'q_media_width' => $q_media_width, 'q_media_height' => $q_media_height, 'option_text' => $option_text, 'o_media' => $o_media, 'o_media_width' => $o_media_width, 'o_media_height' => $o_media_height, 'marks_correct' => $marks_correct, 'marks_incorrect' => $marks_incorrect, 'marks_partial' => $marks_partial); } // End of While loop $stmt->close(); // Print the options for the last question on the screen. $excluded = $exclusions->get_exclusions_by_qid($old_q_id); display_options($old_screen, $options_array, $old_q_id, $old_theme, $old_scenario, $old_leadin, $old_notes, $paper_type, 'modified_angoff', $reviews, $excluded, true); echo '</td></tr></table>'; echo '<br />'; echo '<input type="hidden" name="module" value="' . $module . '" />'; echo '<input type="hidden" name="folder" value="' . $folder . '" />'; echo '<input type="hidden" name="paperID" value="' . $paperID . '" />'; echo '<input type="hidden" name="setterID" value="' . $setterID . '" />'; echo '<input type="hidden" name="review_string" value="' . $review_string . '" />'; if (isset($_GET['std_setID'])) { echo '<input type="hidden" name="std_setID" value="' . $_GET['std_setID'] . '" />'; } echo "<input type=\"hidden\" name=\"method\" value=\"Modified Angoff\" />\n"; $mysqli->close(); ?> <div align="center"> <input type="checkbox" name="alterpassmark" value="1" checked /> <?php