Ejemplo n.º 1
0
		var lock=false;
		var splitter = /(?:,\s*)/;
		var last1 = $('#enter-names').val().split(splitter);
		function getcheckbox(name) {
			var ret=[];
			$('input:checkbox[name="'+name+'"]:checked:visible').each(function() {
				ret.push($(this).val());
			});
			return ret.join();
		}
		$('#enter-sparts').select2({
			multiple: "multiple"
		});
		$('#enter-langs').select2({
			data: <?php 
echo json_encode(select2_getlangs());
?>
,
			multiple: "multiple"
		}).on('change', function() {
			var sparts = {}, langs = $('#enter-langs').val() || <?php 
echo json_encode($db->langs());
?>
;
			<?php 
foreach ($db->sparts_by_lang as $l => $_sparts) {
    ?>
				if ($.inArray("<?php 
    echo $l;
    ?>
",langs) > -1) {
Ejemplo n.º 2
0
<?php

require_once '/var/www/config.php';
sro('/Includes/mysql.php');
sro('/Includes/session.php');
sro('/Includes/functions.php');
sro('/PHP5/quiz/common.php');
sro('/PHP5/lib/PHPLang/db.php');
sro('/PHP5/lib/PHPLang/display.php');
global $sql_stmts;
//requireRank(1);
$langs = select2_getlangs();
?>
<style>
code {
	white-space: pre;
}
</style>
<header>
	<h1>Quiz Creator</h1>
</header>
<article id="quiz">
	<form action="#">
	<select id="lang" style="width: 150px"></select>
	<input class="autosizeable" id="id" required placeholder="Unique ID">
	<input class="autosizeable" id="name" required placeholder="Name">
	<input class="autosizeable" id="category" required placeholder="Category">
	<br>
	<input id="n_questions" placeholder="# of questions (or blank or 'auto')">
	<label><input type="checkbox" id="no_shuffle">Fixed order?</label>
	<br>