Html->script(array('site_js/quiztest')); ?>
Quiz Result
";
break;
default :
echo "".$this->Html->image("pending.png",array('title'=>'pending','id'=>$option))."";
break;
}
}else{
echo "".$this->Html->image("wrong.png",array('title'=>'wrong','id'=>$option))."";
}
echo "";
echo "
".$this->Form->input ( "Quiztestdetail.$option.result", array ('label' => false,'div'=>false ,'required'=>false ,'value'=>$str_arr[2]) )."
";
echo $this->Form->hidden ( "Quiztestdetail.$option.type", array ('value'=>'1') );
echo $this->Form->hidden ( "Quiztestdetail.$option.quizoption_id", array ('value'=>$quizoption_id) );
echo $this->Form->hidden ( "Quiztestdetail.$option.penalty", array ('value'=>$data['Quizoption']['penalty']) );
echo "
".$this->Form->input("Quiztestdetail.$option.isCorrect",array('type'=>'select','required','options'=>$arr_RW,'onchange'=>"shMark($option)",'label'=>'Select','empty'=>array(''=>'Please Select'),'default'=>$str_arr[0])) ."
";
if(!empty($str_arr[1])):
$css = "style='display:block'";
$mark = $str_arr[1];
else:
$css = "style='display:none'";
$mark = $data['Quizoption']['point'];
endif;
echo "
".
"
".$this->Form->input('point',array('value'=>$data['Quizoption']['point'],'readonly','label'=>'Points Possible')) ."
".
"
".$this->Form->input("Quiztestdetail.$option.mark",array('value'=>$mark)) ."
" .
"
";
echo "
";
break;
case '2' :
if(!empty($quiztestdetails[$quizoption_id])){
switch ($str_arr[0]) {
case ACTIVE:
echo "".$this->Html->image("right.png",array('title'=>'right','id'=>$option))."";
break;
case INACTIVE:
echo "".$this->Html->image("wrong.png",array('title'=>'wrong','id'=>$option))."";
break;
default :
echo "".$this->Html->image("pending.png",array('title'=>'pending','id'=>$option))."";
break;
}
}else{
echo "".$this->Html->image("wrong.png",array('title'=>'wrong','id'=>$option))."";
}
echo "";
echo "
".$this->Form->input ( "Quiztestdetail.$option.result", array ('type' => 'textarea', 'label' => false, 'div'=>false,'required'=>false,'value'=>$str_arr[2] ) )."
";
echo $this->Form->hidden ( "Quiztestdetail.$option.type", array ('value'=>'2') );
echo $this->Form->hidden ( "Quiztestdetail.$option.quizoption_id", array ('value'=>$quizoption_id) );
echo $this->Form->hidden ( "Quiztestdetail.$option.penalty", array ('value'=>$data['Quizoption']['penalty']) );
echo "
".$this->Form->input("Quiztestdetail.$option.isCorrect",array('type'=>'select','required','options'=>$arr_RW,'onchange'=>"shMark($option)",'label'=>'Select','empty'=>array(''=>'Please Select'),'default'=>$str_arr[0])) ."
";
if(!empty($str_arr[1])):
$css = "style='display:block'";
$mark = $str_arr[1];
else:
$css = "style='display:none'";
$mark = $data['Quizoption']['point'];
endif;
echo "
".
"
".$this->Form->input('point',array('value'=>$data['Quizoption']['point'],'readonly','label'=>'Points Possible')) ."
".
"
".$this->Form->input("Quiztestdetail.$option.mark",array('value'=>$mark)) ."
" .
"
";
echo "
";
break;
case '3' :
case '4' :
case '7' :
$chk_radio = '';
if(!empty($quiztestdetails[$quizoption_id])){
if($data['Quizoption']['answer'] == ','.$str_arr[2].','){
echo "".$this->Html->image("right.png")."";
}else{
echo "".$this->Html->image("wrong.png")."";
}
}else{
echo "".$this->Html->image("wrong.png")."";
}
foreach ( $data ['Optiondetail'] as $optiondetail ) {
if(!empty($quiztestdetails[$quizoption_id])){
if($optiondetail ['id'] == $str_arr[2]){
$chk_radio = 'checked';
}else{
$chk_radio = '';
}
}else{
$chk_radio = '';
}
if(substr($data['Quizoption']['answer'],1,-1)==$optiondetail ['id']){
$css_r = "style='color: #319455;font-weight:bold;'";
}else{
$css_r = '';
}
echo " " . $optiondetail ['answeroption'] . "
";
}
break;
case '5' :
if ($data ['Optiondetail'] [0] ['answeroption'] < $data ['Optiondetail'] [1] ['answeroption']) {
if ($data ['Optiondetail'] [0] ['answeroption'] <= $str_arr[2] && $str_arr[2] <= $data ['Optiondetail'] [1] ['answeroption']) {
echo "".$this->Html->image("right.png")."";
} else {
echo "".$this->Html->image("wrong.png")."";
}
$answer = $data ['Optiondetail'] [0] ['answeroption'] .'-'. $data ['Optiondetail'] [1] ['answeroption'];
} else {
if ($data ['Optiondetail'] [0] ['answeroption'] >= $str_arr[2] && $str_arr[2] >= $data ['Optiondetail'] [1] ['answeroption']) {
echo "".$this->Html->image("right.png")."";
} else {
echo "".$this->Html->image("wrong.png")."";
}
$answer = $data ['Optiondetail'] [1] ['answeroption'] .'-'. $data ['Optiondetail'] [0] ['answeroption'];
}
echo "".$this->Form->input ( "Quiztestdetail.$option.result", array ('label' => false, 'value'=>$str_arr[2]) )."
";
echo "Correct Answer:".$answer."
";
break;
case '6' :
$pass = true;
$arrRans = explode ( ",", substr ( trim ( $data ['Quizoption'] ['answer'] ), 1, - 1 ) );
$arrAns = explode ( ",", substr($str_arr[2],1) );
if (sizeof ( $arrRans ) == sizeof ( $arrAns )) {
foreach ( $arrRans as $k ) {
if (! in_array ( $k, $arrAns )) {
$pass = false;
}
}
} else {
$pass = false;
}
if ($pass == true) {
echo "".$this->Html->image("right.png")."";
} else {
echo "".$this->Html->image("wrong.png")."";
}
$chk = '';
foreach ( $data ['Optiondetail'] as $optiondetail ) {
$chk_arr = explode(',',substr($str_arr[2],1));
if(in_array($optiondetail ['id'],$arrRans)){
$css_chk = "ibold ic_green";
}else{
$css_chk = '';
}
if(in_array($optiondetail ['id'],$chk_arr)){
$chk = 'checked';
}else{
$chk = '';
}
echo "".$this->Form->input ( "Quiztestdetail.$option.result", array ('type' => 'checkbox', 'value' => $optiondetail ['id'], 'label' => $optiondetail ['answeroption'], 'checked'=>$chk) )."
";
}
break;
/*case '7' :
$arr = '';
foreach ( $data ['Optiondetail'] as $optiondetail ) {
$arr [$optiondetail ['id']] = $optiondetail ['answeroption'];
}
echo $this->Form->input ("Quiztestdetail.$option.result", array ('type' => 'select', 'options' => $arr, 'label' => false, 'selected'=>$quiztestdata[$quizoption_id], 'empty' => array ('' => 'Please select' ) ) );
break;*/
case '8' :
if(!empty($quiztestdetails[$quizoption_id])){
if($data['Quizoption']['answer'] == $str_arr[2]){
echo "".$this->Html->image("right.png")."";
}else{
echo "".$this->Html->image("wrong.png")."";
}
}
$chk_option = $str = $str_count ='';
for($i = 1; $i <= 10; $i ++) {
if($i == $str_arr[2]){
$chk_option = 'checked = checked';
}else{
$chk_option = '';
}
if($data['Quizoption']['answer'] == $i){
$css_scale = "style='color: #319455;font-weight:bold;'";
}else{
$css_scale = '';
}
$str_count .= "$i";
$str .= " ";
}
echo "".
"
".$data ['Optiondetail'] [0] ['answeroption']."
".$data ['Optiondetail'] [1] ['answeroption']."
";
break;
}
$option++;
}
echo "";
echo "
";
echo $this->Form->end ();
?>