<?php
session_start();
include "../sessiontest.php";
include "main_function51.php";
include "delete.php";
include "insert.php";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Soal 51</title>
<link rel="stylesheet" type="text/css" href="../css/accordion_glam.css" />
</head>
<Script type="text/javascript">
window.history.forward(1);
function check_input() {
with ( document.forms.input ) {
valid1 = new Array();
// valid1ation code soal 1
checked = false;
for ( i = 0; !checked && ( i < document.forms["input"]["A5101"].length ); i++ ) {
checked = checked || ( document.forms["input"]["A5101"][ i ].checked == true );
}
valid1[ valid1.length ] = checked ? "true" : "";
checked = false;
for ( i = 0; !checked && ( i < document.forms["input"]["A5102"].length ); i++ ) {
checked = checked || ( document.forms["input"]["A5102"][ i ].checked == true );
}
valid1[ valid1.length ] = checked ? "true" : "";
checked = false;
for ( i = 0; !checked && ( i < document.forms["input"]["A5103"].length ); i++ ) {
checked = checked || ( document.forms["input"]["A5103"][ i ].checked == true );
}
valid1[ valid1.length ] = checked ? "true" : "";
checked = false;
for ( i = 0; !checked && ( i < document.forms["input"]["A5104"].length ); i++ ) {
checked = checked || ( document.forms["input"]["A5104"][ i ].checked == true );
}
valid1[ valid1.length ] = checked ? "true" : "";
checked = false;
for ( i = 0; !checked && ( i < document.forms["input"]["A5105"].length ); i++ ) {
checked = checked || ( document.forms["input"]["A5105"][ i ].checked == true );
}
valid1[ valid1.length ] = checked ? "true" : "";
checked = false;
for ( i = 0; !checked && ( i < document.forms["input"]["A5106"].length ); i++ ) {
checked = checked || ( document.forms["input"]["A5106"][ i ].checked == true );
}
valid1[ valid1.length ] = checked ? "true" : "";
checked = false;
for ( i = 0; !checked && ( i < document.forms["input"]["A5107"].length ); i++ ) {
checked = checked || ( document.forms["input"]["A5107"][ i ].checked == true );
}
valid1[ valid1.length ] = checked ? "true" : "";
checked = false;
for ( i = 0; !checked && ( i < document.forms["input"]["A5108"].length ); i++ ) {
checked = checked || ( document.forms["input"]["A5108"][ i ].checked == true );
}
valid1[ valid1.length ] = checked ? "true" : "";
checked = false;
for ( i = 0; !checked && ( i < document.forms["input"]["A5109"].length ); i++ ) {
checked = checked || ( document.forms["input"]["A5109"][ i ].checked == true );
}
valid1[ valid1.length ] = checked ? "true" : "";
checked = false;
for ( i = 0; !checked && ( i < document.forms["input"]["A5110"].length ); i++ ) {
checked = checked || ( document.forms["input"]["A5110"][ i ].checked == true );
}
valid1[ valid1.length ] = checked ? "true" : "";
checked = false;
for ( i = 0; !checked && ( i < document.forms["input"]["A5111"].length ); i++ ) {
checked = checked || ( document.forms["input"]["A5111"][ i ].checked == true );
}
valid1[ valid1.length ] = checked ? "true" : "";
checked = false;
for ( i = 0; !checked && ( i < document.forms["input"]["A5112"].length ); i++ ) {
checked = checked || ( document.forms["input"]["A5112"][ i ].checked == true );
}
valid1[ valid1.length ] = checked ? "true" : "";
checked = false;
for ( i = 0; !checked && ( i < document.forms["input"]["A5113"].length ); i++ ) {
checked = checked || ( document.forms["input"]["A5113"][ i ].checked == true );
}
valid1[ valid1.length ] = checked ? "true" : "";
checked = false;
for ( i = 0; !checked && ( i < document.forms["input"]["A5114"].length ); i++ ) {
checked = checked || ( document.forms["input"]["A5114"][ i ].checked == true );
}
valid1[ valid1.length ] = checked ? "true" : "";
checked = false;
for ( i = 0; !checked && ( i < document.forms["input"]["A5115"].length ); i++ ) {
checked = checked || ( document.forms["input"]["A5115"][ i ].checked == true );
}
valid1[ valid1.length ] = checked ? "true" : "";
checked = false;
for ( i = 0; !checked && ( i < document.forms["input"]["A5116"].length ); i++ ) {
checked = checked || ( document.forms["input"]["A5116"][ i ].checked == true );
}
valid1[ valid1.length ] = checked ? "true" : "";
checked = false;
for ( i = 0; !checked && ( i < document.forms["input"]["A5117"].length ); i++ ) {
checked = checked || ( document.forms["input"]["A5117"][ i ].checked == true );
}
valid1[ valid1.length ] = checked ? "true" : "";
checked = false;
for ( i = 0; !checked && ( i < document.forms["input"]["A5118"].length ); i++ ) {
checked = checked || ( document.forms["input"]["A5118"][ i ].checked == true );
}
valid1[ valid1.length ] = checked ? "true" : "";
checked = false;
for ( i = 0; !checked && ( i < document.forms["input"]["A5119"].length ); i++ ) {
checked = checked || ( document.forms["input"]["A5119"][ i ].checked == true );
}
valid1[ valid1.length ] = checked ? "true" : "";
checked = false;
for ( i = 0; !checked && ( i < document.forms["input"]["A5120"].length ); i++ ) {
checked = checked || ( document.forms["input"]["A5120"][ i ].checked == true );
}
valid1[ valid1.length ] = checked ? "true" : "";
checked = false;
for ( i = 0; !checked && ( i < document.forms["input"]["A5121"].length ); i++ ) {
checked = checked || ( document.forms["input"]["A5121"][ i ].checked == true );
}
valid1[ valid1.length ] = checked ? "true" : "";
checked = false;
for ( i = 0; !checked && ( i < document.forms["input"]["A5122"].length ); i++ ) {
checked = checked || ( document.forms["input"]["A5122"][ i ].checked == true );
}
valid1[ valid1.length ] = checked ? "true" : "";
checked = false;
for ( i = 0; !checked && ( i < document.forms["input"]["A5123"].length ); i++ ) {
checked = checked || ( document.forms["input"]["A5123"][ i ].checked == true );
}
valid1[ valid1.length ] = checked ? "true" : "";
checked = false;
for ( i = 0; !checked && ( i < document.forms["input"]["A5124"].length ); i++ ) {
checked = checked || ( document.forms["input"]["A5124"][ i ].checked == true );
}
valid1[ valid1.length ] = checked ? "true" : "";
checked = false;
for ( i = 0; !checked && ( i < document.forms["input"]["A5125"].length ); i++ ) {
checked = checked || ( document.forms["input"]["A5125"][ i ].checked == true );
}
valid1[ valid1.length ] = checked ? "true" : "";
checked = false;
for ( i = 0; !checked && ( i < document.forms["input"]["A5126"].length ); i++ ) {
checked = checked || ( document.forms["input"]["A5126"][ i ].checked == true );
}
valid1[ valid1.length ] = checked ? "true" : "";
checked = false;
for ( i = 0; !checked && ( i < document.forms["input"]["A5127"].length ); i++ ) {
checked = checked || ( document.forms["input"]["A5127"][ i ].checked == true );
}
valid1[ valid1.length ] = checked ? "true" : "";
checked = false;
for ( i = 0; !checked && ( i < document.forms["input"]["A5128"].length ); i++ ) {
checked = checked || ( document.forms["input"]["A5128"][ i ].checked == true );
}
valid1[ valid1.length ] = checked ? "true" : "";
checked = false;
for ( i = 0; !checked && ( i < document.forms["input"]["A5129"].length ); i++ ) {
checked = checked || ( document.forms["input"]["A5129"][ i ].checked == true );
}
valid1[ valid1.length ] = checked ? "true" : "";
checked = false;
for ( i = 0; !checked && ( i < document.forms["input"]["A5130"].length ); i++ ) {
checked = checked || ( document.forms["input"]["A5130"][ i ].checked == true );
}
valid1[ valid1.length ] = checked ? "true" : "";
checked = false;
for ( i = 0; !checked && ( i < document.forms["input"]["A5131"].length ); i++ ) {
checked = checked || ( document.forms["input"]["A5131"][ i ].checked == true );
}
valid1[ valid1.length ] = checked ? "true" : "";
checked = false;
for ( i = 0; !checked && ( i < document.forms["input"]["A5132"].length ); i++ ) {
checked = checked || ( document.forms["input"]["A5132"][ i ].checked == true );
}
valid1[ valid1.length ] = checked ? "true" : "";
checked = false;
for ( i = 0; !checked && ( i < document.forms["input"]["A5133"].length ); i++ ) {
checked = checked || ( document.forms["input"]["A5133"][ i ].checked == true );
}
valid1[ valid1.length ] = checked ? "true" : "";
checked = false;
for ( i = 0; !checked && ( i < document.forms["input"]["A5134"].length ); i++ ) {
checked = checked || ( document.forms["input"]["A5134"][ i ].checked == true );
}
valid1[ valid1.length ] = checked ? "true" : "";
checked = false;
for ( i = 0; !checked && ( i < document.forms["input"]["A5135"].length ); i++ ) {
checked = checked || ( document.forms["input"]["A5135"][ i ].checked == true );
}
valid1[ valid1.length ] = checked ? "true" : "";
checked = false;
for ( i = 0; !checked && ( i < document.forms["input"]["A5136"].length ); i++ ) {
checked = checked || ( document.forms["input"]["A5136"][ i ].checked == true );
}
valid1[ valid1.length ] = checked ? "true" : "";
checked = false;
for ( i = 0; !checked && ( i < document.forms["input"]["A5137"].length ); i++ ) {
checked = checked || ( document.forms["input"]["A5137"][ i ].checked == true );
}
valid1[ valid1.length ] = checked ? "true" : "";
checked = false;
for ( i = 0; !checked && ( i < document.forms["input"]["A5138"].length ); i++ ) {
checked = checked || ( document.forms["input"]["A5138"][ i ].checked == true );
}
valid1[ valid1.length ] = checked ? "true" : "";
checked = false;
for ( i = 0; !checked && ( i < document.forms["input"]["A5139"].length ); i++ ) {
checked = checked || ( document.forms["input"]["A5139"][ i ].checked == true );
}
valid1[ valid1.length ] = checked ? "true" : "";
checked = false;
for ( i = 0; !checked && ( i < document.forms["input"]["A5140"].length ); i++ ) {
checked = checked || ( document.forms["input"]["A5140"][ i ].checked == true );
}
valid1[ valid1.length ] = checked ? "true" : "";
checked = false;
for ( i = 0; !checked && ( i < document.forms["input"]["A5141"].length ); i++ ) {
checked = checked || ( document.forms["input"]["A5141"][ i ].checked == true );
}
valid1[ valid1.length ] = checked ? "true" : "";
checked = false;
for ( i = 0; !checked && ( i < document.forms["input"]["A5142"].length ); i++ ) {
checked = checked || ( document.forms["input"]["A5142"][ i ].checked == true );
}
valid1[ valid1.length ] = checked ? "true" : "";
checked = false;
for ( i = 0; !checked && ( i < document.forms["input"]["A5143"].length ); i++ ) {
checked = checked || ( document.forms["input"]["A5143"][ i ].checked == true );
}
valid1[ valid1.length ] = checked ? "true" : "";
checked = false;
for ( i = 0; !checked && ( i < document.forms["input"]["A5144"].length ); i++ ) {
checked = checked || ( document.forms["input"]["A5144"][ i ].checked == true );
}
valid1[ valid1.length ] = checked ? "true" : "";
checked = false;
for ( i = 0; !checked && ( i < document.forms["input"]["A5145"].length ); i++ ) {
checked = checked || ( document.forms["input"]["A5145"][ i ].checked == true );
}
valid1[ valid1.length ] = checked ? "true" : "";
checked = false;
for ( i = 0; !checked && ( i < document.forms["input"]["A5146"].length ); i++ ) {
checked = checked || ( document.forms["input"]["A5146"][ i ].checked == true );
}
valid1[ valid1.length ] = checked ? "true" : "";
checked = false;
for ( i = 0; !checked && ( i < document.forms["input"]["A5147"].length ); i++ ) {
checked = checked || ( document.forms["input"]["A5147"][ i ].checked == true );
}
valid1[ valid1.length ] = checked ? "true" : "";
checked = false;
for ( i = 0; !checked && ( i < document.forms["input"]["A5148"].length ); i++ ) {
checked = checked || ( document.forms["input"]["A5148"][ i ].checked == true );
}
valid1[ valid1.length ] = checked ? "true" : "";
checked = false;
for ( i = 0; !checked && ( i < document.forms["input"]["A5149"].length ); i++ ) {
checked = checked || ( document.forms["input"]["A5149"][ i ].checked == true );
}
valid1[ valid1.length ] = checked ? "true" : "";
checked = false;
for ( i = 0; !checked && ( i < document.forms["input"]["A5150"].length ); i++ ) {
checked = checked || ( document.forms["input"]["A5150"][ i ].checked == true );
}
valid1[ valid1.length ] = checked ? "true" : "";
checked = false;
for ( i = 0; !checked && ( i < document.forms["input"]["A5151"].length ); i++ ) {
checked = checked || ( document.forms["input"]["A5151"][ i ].checked == true );
}
valid1[ valid1.length ] = checked ? "true" : "";
checked = false;
// alert results
_clonefish_message = '';
for ( i in valid1 )
if ( ( valid1[ i ] != 'true' ) )
_clonefish_message += "-" + valid1[ i ] + "\n";
if ( _clonefish_message.length) {
alert( "Ada Soal Yang Belum Dijawab Tolong di Lengkapi : ");
return false;
}
else
return true;
}
}
</Script>
<div id="header">
<div class="shell">
<img src="../images/Logo-Equity.png" align="left" height="95"/></div>
</div><br />
<div id="test-accordion" class="accordion">
<div class="accordion-content">
<form action="finish.php" method="post" name="input" onsubmit="return check_input();">
<p><?php
$i = 1;
$soal=mysql_query("select * from tb_tampung WHERE ID_user = '".$_POST['iduser']."' ORDER BY RAND()");
while ($data=mysql_fetch_array($soal))
{
echo $i.". ".$data["soal"]."<br>";
?></p>
<table width="99%" height="77" border="0">
<input type="hidden" name="iduser" value="<?php echo $_POST['iduser' ] ?>" />
<input type="hidden" name="nama" value="<?php echo $_POST['nama' ] ?>" />
<input type="hidden" name="tanggal" value="<?php echo $_POST['tanggal' ] ?>" />
<input type="hidden" name="bulan" value="<?php echo $_POST['bulan' ] ?>" />
<input type="hidden" name="tahun" value="<?php echo $_POST['tahun' ] ?>" />
<input type="hidden" name="alamat" value="<?php echo $_POST['alamat' ] ?>" />
<input type="hidden" name="jk" value="<?php echo $_POST['jk' ] ?>" />
<input type="hidden" name="email" value="<?php echo $_POST['email' ] ?>" />
<input type="hidden" name="kota" value="<?php echo $_POST['kota' ] ?>" />
<input type="hidden" name="notlpn" value="<?php echo $_POST['notlpn' ] ?>" />
<input type="hidden" name="kota" value="<?php echo $_POST['kota' ] ?>" />
<input type="hidden" name="propinsi" value="<?php echo $_POST['propinsi' ] ?>" />
<?php if($data['gambar'] != "") : ?>
<tr>
<td align="center" valign="middle"></td>
<td width="45%" align="center" valign="middle"></a><img src="EquityTes/<?php echo $data['gambar'];?>" /></td>
<?php endif; ?>
<?php if($data['gambar2'] != "") : ?>
<td width="51%" align="center" valign="middle"></a><img src="EquityTes/<?php echo $data['gambar2'];?>" /></td>
</tr>
<?php endif; ?>
//ada opsi di bawah ini yang saya mau random -->
<tr>
<td width="4%" align="center" valign="top"><input type="radio" name="A<?php echo $data["ID_soal"]; ?>" value="A" /></td>
<td colspan="2" align="left" valign="top"><?php echo $data['jwb1']; ?></td>
</tr>
<tr>
<td align="center" valign="top" ><input type="radio" name="A<?php echo $data["ID_soal"]; ?>" value="B" /></td>
<td colspan="2" align="left" valign="top" ><?php echo $data['jwb2']; ?></td>
</tr>
<?php if($data['jwb3'] != "") : ?>
<tr>
<td height="23" align="center" valign="top" ><input type="radio" name="A<?php echo $data["ID_soal"]; ?>" value="X" /></td>
<td colspan="2" align="left" valign="top" ><?php echo $data['jwb3']; ?></td>
</tr>
<?php endif; rand();?>
//<--- akhir random opsi
</table>
<br />
<?php
$i++;
}
?></p>
<table width="100%" border="0">
<tr>
<td width="90%"> </td>
<td width="10%"><input name="btnfinish" type="submit" value="Finish"/></td>
</tr>
</table>
</form>
</div></div>
</body>
</html>
//ada opsi di bawah ini yang saya mau random -->
function shuffle_assoc($list) {
if (!is_array($list)) return $list;
$keys = array_keys($list);
shuffle($keys);
$random = array();
foreach ($keys as $key){
$random[$key] = $list[$key];
}
return $random;
}
$opsi = array();
$opsi['A'] = $data['jwb1'];
$opsi['B'] = $data['jwb2'];
if($data['jwb3'] != ""){
$opsi['C'] = $data['jwb3'];
}
$opsi = shuffle_assoc($opsi);
foreach($opsi as $key => $jawaban){?>
<tr>
<td width="4%" align="center" valign="top"><input type="radio" name="<?php echo $key ?><?php echo $data["ID_soal"]; ?>" value="<?php echo $key?>" /></td>
<td colspan="2" align="left" valign="top"><?php echo $jawaban; ?></td>
</tr>
<?php }?>
<!-- kode sebelumny...... ->
<div id="header">
<div class="shell">
<img src="../images/Logo-Equity.png" align="left" height="95"/></div>
</div><br />
<div id="test-accordion" class="accordion">
<div class="accordion-content">
<form action="finish.php" method="post" name="input" onsubmit="return check_input();">
<p><?php
function shuffle_assoc($list) {
if (!is_array($list)) return $list;
$keys = array_keys($list);
shuffle($keys);
$random = array();
foreach ($keys as $key){
$random[$key] = $list[$key];
}
return $random;
}
$i = 1;
$soal=mysql_query("select * from tb_tampung WHERE ID_user = '".$_POST['iduser']."' ORDER BY RAND()");
while ($data=mysql_fetch_array($soal))
{
echo $i.". ".$data["soal"]."<br>";
?></p>
<table width="99%" height="77" border="0">
<input type="hidden" name="iduser" value="<?php echo $_POST['iduser' ] ?>" />
<input type="hidden" name="nama" value="<?php echo $_POST['nama' ] ?>" />
<input type="hidden" name="tanggal" value="<?php echo $_POST['tanggal' ] ?>" />
<input type="hidden" name="bulan" value="<?php echo $_POST['bulan' ] ?>" />
<input type="hidden" name="tahun" value="<?php echo $_POST['tahun' ] ?>" />
<input type="hidden" name="alamat" value="<?php echo $_POST['alamat' ] ?>" />
<input type="hidden" name="jk" value="<?php echo $_POST['jk' ] ?>" />
<input type="hidden" name="email" value="<?php echo $_POST['email' ] ?>" />
<input type="hidden" name="kota" value="<?php echo $_POST['kota' ] ?>" />
<input type="hidden" name="notlpn" value="<?php echo $_POST['notlpn' ] ?>" />
<input type="hidden" name="kota" value="<?php echo $_POST['kota' ] ?>" />
<input type="hidden" name="propinsi" value="<?php echo $_POST['propinsi' ] ?>" />
<?php if($data['gambar'] != "") : ?>
<tr>
<td align="center" valign="middle"></td>
<td width="45%" align="center" valign="middle"></a><img src="EquityTes/<?php echo $data['gambar'];?>" /></td>
<?php endif; ?>
<?php if($data['gambar2'] != "") : ?>
<td width="51%" align="center" valign="middle"></a><img src="EquityTes/<?php echo $data['gambar2'];?>" /></td>
</tr>
<?php endif; ?>
<?php
//ada opsi di bawah ini yang saya mau random -->
$opsi = array();
$opsi['A'] = $data['jwb1'];
$opsi['B'] = $data['jwb2'];
if($data['jwb3'] != ""){
$opsi['C'] = $data['jwb3'];
}
$opsi = shuffle_assoc($opsi);
foreach($opsi as $key => $jawaban){?>
<tr>
<td width="4%" align="center" valign="top"><input type="radio" name="<?php echo $key ?><?php echo $data["ID_soal"]; ?>" value="<?php echo $key?>" /></td>
<td colspan="2" align="left" valign="top"><?php echo $jawaban; ?></td>
</tr>
<?php }?>
</table>
<br />
<?php
$i++;
}
?></p>
<table width="100%" border="0">
<tr>
<td width="90%"> </td>
<td width="10%"><input name="btnfinish" type="submit" value="Finish"/></td>
</tr>
</table>
</form>
</div></div>
</body>
</html>