" /> <input type="hidden" name="question_id" value="<?php print $question_id; ?> " /> <br/><br/><br/> <button type="submit" class="btn btn-primary">Додати</button> </div> </div> </form> <?php } ?> <?php $test_type = $data[0]['test_type']; if ($test_type == 'many') { multiple($test_type, $t_id, $question_id, $data); } elseif ($test_type == 'one') { single($test_type, $t_id, $question_id, $data); } elseif ($test_type == 'yn') { yn($test_type, 2, $t_id, $question_id, $data); } elseif ($test_type == 'text') { text($test_type, $t_id, $question_id, $data); } elseif ($test_type == 'order') { order($test_type, $t_id, $question_id, $data); } ?> <div class="col-xs-9 col-sm-8 col-md-6 col-lg-4 col-xs-offset-3 col-sm-offset-2 col-md-offset-2 col-lg-offset-2"> <a href="<?php print URL; ?> ?c=manageTests&f=create_question_hand">назад</a>
$a = explode(':', $val); if (strpos($a[1], '//') === 0) { DT_Example::$lookup_libraries['css'][$a[0]] = $a[1]; } else { $get = explode('?', $a[1]); DT_Example::$lookup_libraries['css'][$a[0]] = realpath($get[0]) . (count($get) > 1 ? '?' . $get[1] : ''); } }); break; case "j": case "js": multiple($value, function ($val) { $a = explode(':', $val); if (strpos($a[1], '//') === 0) { DT_Example::$lookup_libraries['js'][$a[0]] = $a[1]; } else { $get = explode('?', $a[1]); DT_Example::$lookup_libraries['js'][$a[0]] = realpath($get[0]) . (count($get) > 1 ? '?' . $get[1] : ''); } }); break; case "l": case "libs": $a = explode(' ', $value); for ($i = 0; $i < count($a); $i++) { $b = explode(':', $a[$i]); $additional_libs[$b[0]][] = $b[1]; } break; case "m": case "media":
function topFix($team, $spells) { $arrangement = $team; $conflict = array(-1, -1); $fix = -1; $key = 0; for ($i = 0; $i < 5; $i++) { if ($team[$i] == 0) { $conflict[$key] = $i; if ($key == 2) { break; } $key++; } } if ($key == 0) { return $arrangement; } if ($spells[$conflict[0] * 2] == 12 || $spells[$conflict[0] * 2 + 1] == 12) { # got tp? # you're goin top $arrangement[$conflict[0]] == 1; $fix = $conflict[1]; } else { $arrangement[$conflict[1]] == 1; $fix = $conflict[0]; } //one of them is fixed // the other is stored in fix $probability = probability($arrangement[$fix], [$spells[$fix * 2], $spells[$fix * 2 + 1]]); $arrangement[$fix] = multiple($probability, 0); return $arrangement; }
?> " /> <input type="hidden" name="test_count" value="<?php print $t; ?> " /> <br/><br/><br/> <button type="submit" class="btn btn-primary">Додати</button> </div> </div> </form> <?php } ?> <?php if ($e == 'many') { multiple($e, $t, $t_id); } elseif ($e == 'one') { single($e, $t, $t_id); } elseif ($e == 'yn') { yn($e, 2, $t_id); } elseif ($e == 'text') { text($e, $t_id); } elseif ($e == 'order') { order($e, $t, $t_id); } ?> <div class="col-xs-9 col-sm-8 col-md-6 col-lg-4 col-xs-offset-3 col-sm-offset-2 col-md-offset-2 col-lg-offset-2"> <a href="<?php print URL; ?>
<input type="submit" /> </form> </body> </html> <?php include("./lib.php"); $operand1 = isset($_POST["operand1"]) ? $_POST["operand1"] : false; $operand2 = isset($_POST["operand2"]) ? $_POST["operand2"] : false; if (($operand1 == false) || ($operand2 == false)) { exit; } if (!(is_numeric($operand1) && is_numeric($operand2))) { die("No numeric"); } $operator = isset($_POST["operator"]) ? $_POST["operator"] : false; if ($operator == false) { exit; } $result = 0; if ($operator == "plus") { $result = plus($operand1, $operand2); } else if ($operator == "minus") { $result = minus($operand1, $operand2); } else if ($operator == "multiple") { $result = multiple($operand1, $operand2); } else { $result = divide($operand1, $operand2); } echo($operand1." ".$operator." ".$operand2." = ".$result); ?>
function mathOperation($arg1, $arg2, $operation) { switch ($operation) { case "sum": return "Результат сложения: " . sum($arg1, $arg2); break; case "multiplication": return "Результат умножения: " . multiple($arg1, $arg2); break; case "division": return "Результат деления: " . division($arg1, $arg2); break; case "subtraction": return "Результат вычитания: " . subtraction($arg1, $arg2); break; } }
$per_page = 5; $page = 1; if (isset($_GET['page'])) { $page = $_GET['page']; } $start = ($page - 1) * $per_page; $sql = "select * from exams where exa_id={$examid}"; $result = mysqli_query($conn, $sql); require '../phpfiles/multiplefunction.php'; require '../phpfiles/singlefunction.php'; $olnumbering = $start + 1; echo "<ol type='1' start=\"{$olnumbering}\">"; $row = mysqli_fetch_assoc($result); for ($i = $olnumbering; $i <= $row['exa_nom']; $i++) { echo '<li>'; multiple($olnumbering); echo '</li>'; } echo "</ol>"; $total = $row['exa_nos'] + $row['exa_nom']; if ($olnumbering > $row['exa_nom']) { echo "<ol type='1' start=\"{$olnumbering}\">"; for ($i = $olnumbering; $i <= $total; $i++) { echo '<li>'; single($olnumbering); echo '</li>'; } echo "</ol>"; } ?>
$page = $_GET['page']; } echo "<input type='hidden' name='examid' value=\"{$examid}\" />"; //$start = ($page-1)*$per_page; $sql = "select * from exams where exa_id={$examid}"; $result = mysqli_query($conn, $sql); require './phpfiles/multiplefunctionanswer.php'; require './phpfiles/singlefunctionanswer.php'; // $olnumbering=$start+1; $sql = "select * from questionsm where quem_exam_id={$examid}"; $result = mysqli_query($conn, $sql); $nosindex = 1; echo "<ol type='1' >"; while ($row = mysqli_fetch_assoc($result)) { echo '<li>'; multiple($row); echo '</li>'; $nosindex++; } echo "</ol>"; $sql = "select * from questionss where que_exam_id={$examid}"; $result = mysqli_query($conn, $sql); echo "<ol type='1' start=\"{$nosindex}\">"; while ($row = mysqli_fetch_assoc($result)) { echo '<li>'; single($row); echo '</li>'; } echo "</ol>"; ?>
$page = 1; if (isset($_GET['page'])) { $page = $_GET['page']; } echo "<input type='hidden' name='examid' value=\"{$examid}\" />"; //$start = ($page-1)*$per_page; $sql = "select * from exams where exa_id={$examid}"; $result = mysqli_query($conn, $sql); require '../phpfiles/multiplefunction.php'; require '../phpfiles/singlefunction.php'; // $olnumbering=$start+1; echo "<ol type='1' >"; $row = mysqli_fetch_assoc($result); for ($i = 1; $i <= $row['exa_nom']; $i++) { echo '<li>'; multiple($i); echo '</li>'; } echo "</ol>"; $nosindex = $row['exa_nom'] + 1; echo "<ol type='1' start=\"{$nosindex}\">"; for ($i = 1; $i <= $row['exa_nos']; $i++) { echo '<li>'; single($i); echo '</li>'; } echo "</ol>"; ?> <input type="submit" value="ادخل الاسئلة"> </form>