<?php include("session.php"); ?>
<html>
<head>
<title>网络考试系统企业版</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="css/css9.css" type="text/css">
</head>
<body bgcolor="#999999">

<?php //include("admin_no_url.php") ?>
<?php include("anti_sql2.php") ?>
<?php include("conn.php") ?>
<?php include("my_strpos.php"); ?>
 
<? 
   
 $objcode=new com("datacode.dbcode"); 
   
?>



<?php 

    $read_student_id=$_SESSION["studentid"]; 
	
?>

<table width="800" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height=45 align="center" valign="top" bgcolor="#FFFFFF">&nbsp;</td>
  </tr>
  <tr>
    <td height="1547"  align="center" valign="top" bgcolor="#FFFFFF"><table width=95%   border="0" align="center" cellpadding="0" cellspacing="0" bordercolorlight="#CCCCCC" bordercolordark="#FFFFFF" bgcolor="#FFFFFF" style="word-break:break-all;">
      <tr>
        <td height="98" valign=top><table width=95%  border=0 align=center cellpadding=0 cellspacing=0>
          <tr>
            <td width="100%" height=51 colspan="4" bgcolor=#FFFFFF><div align=center><font color=#333333 size="+2"><b><u>我收藏的试题列表</u></b></font></div></td>
          </tr>
          <tr>
            <td height=31 colspan="4" align="center" bgcolor=#FFFFFF>
            <a href="my_cang_shiti_allundo.php?stuid=<?php echo $read_student_id; ?>"><b>[全部取消收藏]</b></a>
            </td>
          </tr>
        </table>
          </td>
      </tr>
      
      </table>
<? 

 	$sql="select  *  from  cang ";
	$sql=$sql."   where  stuid='".$read_student_id."'";
	
	$k=0;
	$rs=$conn->execute($sql);
	
	$ss="";
	$dd="";
	$tt="";
	$pp="";
	$lunshu="";
	
	while (!$rs->EOF)
	{
 	 
	  $cang_juan_id=$rs->fields["juan_id"];
	  $read_s=trim($rs->fields["test_ssele"]);
  	  $read_d=trim($rs->fields["test_dsele"]);
  	  $read_t=trim($rs->fields["test_tiankong"]);
  	  $read_p=trim($rs->fields["test_panduan"]);
  	  $read_lunshu=trim($rs->fields["test_lunshu"]);
	  
	  $ss=$ss.$read_s;
	  $dd=$dd.$read_d;
	  $tt=$tt.$read_t;
	  $pp=$pp.$read_p;
	  $lunshu=$lunshu.$read_lunshu;
	  
	  $rs->MoveNext();
	  
	}  
	
	
	$s_exist=0;
  	$d_exist=0;
  	$t_exist=0;
  	$p_exist=0;
  	$lunshu_exist=0;
  

  	if ($ss!='' )
  	{
    	$s_exist=1;
  	} 

  	if ($dd!='' )
  	{
    	$d_exist=1;
  	} 

  	if ($tt!='' )
  	{
    	$t_exist=1;
  	} 

  	if ($pp!='' )
  	{
   	 	$p_exist=1;
  	} 

  	if ($lunshu!='' )
  	{
    	$lunshu_exist=1;
  	} 
   

?>
    
<?php if ($s_exist==1) {?>    
<table width="95%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="20%" height="27" align="center" bgcolor="#CCCCCC">单项选择题</td>
    <td width="80%" bgcolor="#CCCCCC">&nbsp;</td>
  </tr>
  <tr>
    <td height="27" align="center" bgcolor="#FFFFFF">&nbsp;</td>
    <td bgcolor="#FFFFFF">&nbsp;</td>
  </tr>
 </table>
<?php }?> 
      


<?php 

    if ($s_exist==1) { 
    //-------------单项选择题-------------------------------------------------

    $sql="select  *  from  cang ";
	$sql=$sql."   where  stuid='".$read_student_id."'";
	$cang_juan_id=array();
	
	$k=0;
	$rs=$conn->execute($sql);
	while (!$rs->EOF)
	{
		
 	  $cang_juan_id=$rs->fields["juan_id"];
	  $read_s=trim($rs->fields["test_ssele"]);
  	  $read_d=trim($rs->fields["test_dsele"]);
  	  $read_t=trim($rs->fields["test_tiankong"]);
  	  $read_p=trim($rs->fields["test_panduan"]);
  	  $read_lunshu=trim($rs->fields["test_lunshu"]);
	  
	  //-------------------------------------------------
	  $sql=" select *  from fenlei where  id=".$cang_juan_id;
	  $rs2=$conn->execute($sql);
	  if (!$rs2->EOF)
	  {
		  $get_juan_name=$rs2->fields["exam_juan_name"];
	  }
	 
	  $sql="select  *  from  database_name  where  id= ";
	  $sql=$sql." (select database_id  from fenlei where  id=".$cang_juan_id;
	  $sql=$sql." ) ";
	  
	  $rs2=$conn->execute($sql);
	  if (!$rs2->EOF)
	  {
		  $get_database_name=$rs2->fields["database_name"];
	  }
	  
	  $rs2->close;
	  
	  //-----------------------------------
	  $get_s_list=array();
	  $get_d_list=array();
	  $get_t_list=array();
	  $get_p_list=array();
	  $get_lunshu_list=array();
	 	  
	  $get_s_list=explode("#",$read_s);   //数量是count();
	  $get_d_list=explode("#",$read_d);   
	  $get_t_list=explode("#",$read_t); 
	  $get_p_list=explode("#",$read_p); 
	  $get_lunshu_list=explode("#",$read_lunshu); 
	  
	  
	  $id_count=count($get_s_list);
	  $get_s_list=explode("#",$read_s);
	  
	  for($u=0;$u<$id_count-1;$u++)
	  { 
	   
	  	$sql="select * from ".$get_database_name;
	  	$sql=$sql."   where    id=".$get_s_list[$u];
      	$sql=$sql."  order by  id  asc";
				
      	$rs2=$conn->execute($sql);

      	if (!$rs2->EOF)
     	{

      		$tihao=$tihao+1;
      		$read_timu=$rs2->fields["题目"];
			
			$read_dbdb_id=$rs2->fields["id"];
      		$read_sele1=$objcode->uncodetxt_data($rs2->fields["选择项1"]);
      		$read_sele2=$objcode->uncodetxt_data($rs2->fields["选择项2"]);
      		$read_sele3=$objcode->uncodetxt_data($rs2->fields["选择项3"]);
      		$read_sele4=$objcode->uncodetxt_data($rs2->fields["选择项4"]);
	  		$read_sele1=iconv("gb2312","utf-8",$read_sele1); 
	  		$read_sele2=iconv("gb2312","utf-8",$read_sele2); 
	  		$read_sele3=iconv("gb2312","utf-8",$read_sele3); 
	  		$read_sele4=iconv("gb2312","utf-8",$read_sele4); 
      		$fen=$rs->fields["本题分数"];

      		if ($read_timu!='')
      		{
        			$read_timu=$objcode->uncodetxt_data($read_timu);
					$read_timu=iconv("gb2312","utf-8",$read_timu); 

        			$fenshu=0;
        			if ($rs2->fields["本题分数"]!='')
        			{
         				 $fenshu=$rs2->fields["本题分数"];
        			}
         			 else
        			{
         				 $fenshu=0;
        			} 

        			$read_timu=$read_timu."(".($fenshu)."分)";

      		} 


      		$read_an=trim($rs2->fields["正确答案"]);
      		if ($read_an!='')
      		{
       			$canswer=$objcode->uncodetxt_data($read_an);
				$canswer=iconv("gb2312","utf-8",$canswer); 
      		} 
     		 if (trim($canswer)=="1")
      		{
        		$canswer="A";
      		} 

     		 if (trim($canswer)=="2")
      		{
        		$canswer="B";
      		} 

      		if (trim($canswer)=="3")
      		{
       		 $canswer="C";
      		} 

      		if (trim($canswer)=="4")
      		{
        		$canswer="D";
      		} 

	 	}
		
		$rs2->close;

       
	  ?>
      <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td width="3%" height="39" bgcolor="#FFFFFF">&nbsp;</td>
          <td width="97%" bgcolor="#FFFFFF"><table width="98%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="14%" height="24" align="center" bgcolor="#fbfbfb"><font color="#0066FF">来源库名：</font></td>
                <td width="32%" bgcolor="#fbfbfb"><font color="#0066FF"><?php echo $get_database_name ?></font></td>
                <td width="16%" align="center" bgcolor="#fbfbfb"><font color="#0066FF">科目分类：</font></td>
                <td width="38%" bgcolor="#fbfbfb"><font color="#0066FF"><?php echo $get_juan_name ?></font></td>
              </tr>
          </table></td>
        </tr>
        <tr>
          <td height="219" colspan="2" valign="top" bgcolor="#FFFFFF"><table width=95%  border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
              <td width="86%" height=26 bgcolor=#FFFFFF><?       echo $tihao;?>
                .
                <?       echo $read_timu;?></td>
              <td width="14%" align="center" bgcolor=#FFFFCC>
              <a href="my_cang_shiti_undo.php?stuid=<?php echo $read_student_id; ?>&juan_id=<?php echo $cang_juan_id; ?>&id=<?php echo $read_dbdb_id; ?>&shititype=1">取消收藏</a>
              </td>
            </tr>
          </table>
            <table width=95%  border="0" align=center cellpadding="0" cellspacing="0" style=word-break:break-all bgcolor="#FFFFFF">
              <tr>
                <td height="25">&nbsp;</td>
                <td height=25><?     if ($canswer=="A"){?>
                  <font color="#FF0000">A.
                    <?    echo $read_sele1;?>
                  </font>
                  <?   }   else {?>
                  A.
                  <?         echo $read_sele1;?>
                  <?       } ?></td>
              </tr>
              <tr>
                <td height=25>&nbsp;</td>
                <td height=25><?       if ($canswer=="B")      {?>
                  <font color="#FF0000">B.
                    <?         echo $read_sele2;?>
                  </font>
                  <?       }        else      {
?>
                  B.
                  <?         echo $read_sele2;?>
                  <?       } ?></td>
              </tr>
              <tr>
                <td height=25>&nbsp;</td>
                <td height=25><?       if ($canswer=="C")
      {
?>
                  <font color="#FF0000">C.
                    <?         echo $read_sele3;?>
                  </font>
                  <?       }        else      {?>
                  C.
                  <?         echo $read_sele3;?>
                  <?       } ?></td>
              </tr>
              <tr>
                <td width=6% height=25>&nbsp;</td>
                <td width=94% height=25><?       if ($canswer=="D"){?>
                  <font color="#FF0000">D.
                    <?         echo $read_sele4;?>
                  </font>
                  <?       }        else      {
?>
                  D.
                  <?         echo $read_sele4;?>
                  <?       } ?></td>
              </tr>
            </table>
            <table width="95%"  border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
              <tr valign="middle">
                <td height="30"></td>
                <td></td>
                <td align="center">&nbsp;</td>
                <td></td>
                <td align="center" bgcolor="#FFFFFF" ></td>
              </tr>
              <tr valign="middle">
                <td width="17%" height="30" align="center" bgcolor="#FFFFFF"></td>
                <td width="25%" align="center" bgcolor="#FFFFFF"></td>
                <td width="27%" align="center"><span>正确答案：</span> <font color="#ff0000"><b> <u>
                  <?       echo $canswer;?>
                </u></b></font></td>
                <td width="18%"></td>
                <td width="13%" align="center" bgcolor="#FFFFFF" ></td>
              </tr>
              <tr valign="middle">
                <td height="30">&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td colspan="2"></td>
              </tr>
            </table>
            <table width="95%"  border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td height="26">&nbsp;</td>
              </tr>
            </table>
            <table width="95%"  border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td height="1" background="images/dot_line.gif"></td>
              </tr>
            </table></td>
        </tr>
      </table>
      <?php 
	
	 
	  }//第一条记录
	 	  
	  
	  $rs->MoveNext();
	} 

	$rs->close;

    
	}
	//-------------------------------------------------------------------------------------

?>
      
	  
	<?php if ($d_exist==1) {?>   
	  
      <table width="95%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="20%" height="27" align="center" bgcolor="#CCCCCC">多项选择题</td>
          <td width="80%" bgcolor="#CCCCCC">&nbsp;</td>
        </tr>
        <tr>
          <td height="27" align="center" bgcolor="#FFFFFF">&nbsp;</td>
          <td bgcolor="#FFFFFF">&nbsp;</td>
        </tr>
      </table>
    <?php } ?>  
      
      <?php 

    //------------多项选择题---------------------------------------------
	
	if ($d_exist==1) {

    $sql="select  *  from  cang ";
	$sql=$sql."   where  stuid='".$read_student_id."'";
	$cang_juan_id=array();
	
	$k=0;
	$rs=$conn->execute($sql);
	while (!$rs->EOF)
	{
		
 	  $cang_juan_id=$rs->fields["juan_id"];
	  $read_s=trim($rs->fields["test_ssele"]);
  	  $read_d=trim($rs->fields["test_dsele"]);
  	  $read_t=trim($rs->fields["test_tiankong"]);
  	  $read_p=trim($rs->fields["test_panduan"]);
  	  $read_lunshu=trim($rs->fields["test_lunshu"]);
	  
	  //-------------------------------------------------
	  $sql=" select *  from fenlei where  id=".$cang_juan_id;
	  $rs2=$conn->execute($sql);
	  if (!$rs2->EOF)
	  {
		  $get_juan_name=$rs2->fields["exam_juan_name"];
	  }
	  
	  $sql="select  *  from  database_name  where  id= ";
	  $sql=$sql." (select database_id  from fenlei where  id=".$cang_juan_id;
	  $sql=$sql." ) ";
	  
	  $rs2=$conn->execute($sql);
	  if (!$rs2->EOF)
	  {
		  $get_database_name=$rs2->fields["database_name"];
	  }
	 
	  
	  $rs2->close;
	  
	  //-----------------------------------
	  $get_s_list=array();
	  $get_d_list=array();
	  $get_t_list=array();
	  $get_p_list=array();
	  $get_lunshu_list=array();
	 	  
	  $get_s_list=explode("#",$read_s);   //数量是count();
	  $get_d_list=explode("#",$read_d);   
	  $get_t_list=explode("#",$read_t); 
	  $get_p_list=explode("#",$read_p); 
	  $get_lunshu_list=explode("#",$read_lunshu); 
	  
	  
	  $id_count=count($get_d_list);
	  $get_d_list=explode("#",$read_d);
		  
	  for($u=0;$u<$id_count-1;$u++)
	  { 
	   
	  	$sql="select * from ".$get_database_name;
	  	$sql=$sql."   where    id=".$get_d_list[$u];
      	$sql=$sql."  order by  id  asc";
				
      	$rs2=$conn->execute($sql);

      	if (!$rs2->EOF)
    	{


      		$tihao=$tihao+1;

      		$read_timu=$rs2->fields["题目"];
			
			$read_dbdb_id=$rs2->fields["id"];
	  
      		if ($read_timu!='')
      		{

        		$read_timu=$objcode->uncodetxt_data($read_timu);
				$read_timu=iconv("gb2312","utf-8",$read_timu); 

        		$fenshu=0;
        		if ($rs2->fields["本题分数"]!='')
        		{

         			 $fenshu=$rs2->fields["本题分数"];
        		}
          		else
        		{

          			$fenshu=0;
        		} 

        		$read_timu=$read_timu."(".($fenshu)."分)";

      		} 


      		$read_sele1=$rs2->fields["选择项1"];
      		if ($read_sele1!='')
      		{

        		$read_sele1=$objcode->uncodetxt_data($read_sele1);
				$read_sele1=iconv("gb2312","utf-8",$read_sele1); 
		
      		} 


      		$read_sele2=$rs2->fields["选择项2"];
      		if ($read_sele1!='')
      		{

       			 $read_sele2=$objcode->uncodetxt_data($read_sele2);
				 $read_sele2=iconv("gb2312","utf-8",$read_sele2); 
      		} 


      		$read_sele3=$rs2->fields["选择项3"];
      		if ($read_sele1!='')
      		{

       			 $read_sele3=$objcode->uncodetxt_data($read_sele3);
				$read_sele3=iconv("gb2312","utf-8",$read_sele3); 
      		} 


      		$read_sele4=$rs2->fields["选择项4"];
      		if ($read_sele1!='')
      		{

        		$read_sele4=$objcode->uncodetxt_data($read_sele4);
				$read_sele4=iconv("gb2312","utf-8",$read_sele4); 
      		} 

      		$get_images=$rs2->fields["images"];

      		if (($get_images!=''))
      		{

        		$images_flag=1;
     		 }
        	else
      		{

        		$images_flag=0;
      		} 



      		if (($uuan[$u+1]!='') || ($uuan[$u+1]!=""))
      		{

        		$user_answer=$uuan[$u+1];
      		}
        	else
      		{
        		$user_answer="未答";
      		} 


      		$read_an=trim($rs2->fields["正确答案"]);
      		if ($read_an!='')
      		{

        		$canswer=$objcode->uncodetxt_data($read_an);
				$canswer=iconv("gb2312","utf-8",$canswer); 
      		} 



      		$correct_answer="";

      		if (my_strpos($canswer,"1")>0)
      		{
        		$correct_answer=$correct_answer."A";
      		} 



      		if (my_strpos($canswer,"2")>0)
      		{
       			 $correct_answer=$correct_answer."B";
      		} 



      		if (my_strpos($canswer,"3")>0)
      		{
        		$correct_answer=$correct_answer."C";
      		} 


      		if (my_strpos($canswer,"4")>0)
      		{
        		$correct_answer=$correct_answer."D";
      		} 

		}
		
		$rs2->close;

      		
	  ?>
      <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td height="37" bgcolor="#FFFFFF"><table width="98%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td width="14%" height="24" align="center" bgcolor="#fafafa"><font color="#0066FF">来源库名：</font></td>
              <td width="37%" bgcolor="#fafafa"><font color="#0066FF"><?php echo $get_database_name ?></font></td>
              <td width="11%" align="center" bgcolor="#fafafa"><font color="#0066FF">科目分类：</font></td>
              <td width="38%" bgcolor="#fafafa"><font color="#0066FF"><?php echo $get_juan_name ?></font></td>
            </tr>
          </table></td>
        </tr>
        <tr>
          <td height="230" valign="top" bgcolor="#FFFFFF"><table width=95%  border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
              <td width="85%" height=26 bgcolor=#FFFFFF><?       echo $tihao;?>
                .
                <?       echo $read_timu;?></td>
              <td width="15%" align="center" bgcolor=#FFFFCC><a href="my_cang_shiti_undo.php?stuid=<?php echo $read_student_id; ?>&juan_id=<?php echo $cang_juan_id; ?>&id=<?php echo $read_dbdb_id; ?>&shititype=2">取消收藏</a></td>
            </tr>
          </table>
            <table width=95%  border=0 align=center cellpadding=0 cellspacing=0 style=word-break:break-all>
              <tr>
                <td height="25">&nbsp;</td>
                <td height=25><? 
                if (my_strpos($correct_answer,'A')>0)
                { 
              ?>
                  <FONT color="#FF0000"> A.
                    <?   echo $read_sele1;?>
                  </FONT>
                  <?   }
                else
                {
               ?>
                  A.
                  <?   echo $read_sele1;?>
                  <?  } ?></td>
              </tr>
              <tr>
                <td height=25></td>
                <td height=25><?    if (my_strpos($correct_answer,"B")>0)
               {
              ?>
                  <FONT color="#FF0000"> B.
                    <?         echo $read_sele2;?>
                  </FONT>
                  <?       }
        		else
      			{
				?>
                  B.
                  <?     echo $read_sele2;?>
                  <?       } ?></td>
              </tr>
              <tr>
                <td height=25></td>
                <td height=25><?       if (my_strpos($correct_answer,"C")>0)
      			{
			?>
                  <FONT color="#FF0000"> C.
                    <?         echo $read_sele3;?>
                  </FONT>
                  <?       }
        		else
      			{
				?>
                  C.
                  <?         echo $read_sele3;?>
                  <?   } ?></td>
              </tr>
              <tr>
                <td width=6% height=25>&nbsp;</td>
                <td width=94% height=25><?      if (my_strpos($correct_answer,"D")>0)
              {
             ?>
                  <FONT color="#FF0000"> D.
                    <?         echo $read_sele4;?>
                  </FONT>
                  <?       }
                else
               {
               ?>
                  D.
                  <?    echo $read_sele4;?>
                  <?       } ?></td>
              </tr>
            </table>
            <table width="95%"  border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
              <tr valign="middle">
                <td width="17%" height="30"><div align="center"> </div></td>
                <td width="25%"></td>
                <td width="17%" align="center"><span>正确答案：</span></td>
                <td width="41%"><font color="#ff0000"><b><u>
                  <?       echo $correct_answer;?>
                </u></b></font></td>
              </tr>
              <tr valign="middle">
                <td height="30">&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td></td>
              </tr>
            </table>
            <table width="95%"  border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td height="26">&nbsp;</td>
              </tr>
            </table>
            <table width="95%"  border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td height="1" background="images/dot_line.gif"></td>
              </tr>
            </table></td>
        </tr>
      </table>
      <?php 
	
	 
	  }//第一条记录
	 	  
	  
	  $rs->MoveNext();
	} 

	$rs->close;

	}
	
	//-------------------------------------------------------------------------------------

?>
      
 <?php if ($p_exist==1) {?>    
      <table width="95%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="20%" height="27" align="center" bgcolor="#CCCCCC">判断题</td>
          <td width="80%" bgcolor="#CCCCCC">&nbsp;</td>
        </tr>
        <tr>
          <td height="27" align="center" bgcolor="#FFFFFF">&nbsp;</td>
          <td bgcolor="#FFFFFF">&nbsp;</td>
        </tr>
      </table>
  <?php } ?>    
      
      
<?php 

    //------------判断---------------------------------------------
	
	if ($p_exist==1) { 

    $sql="select  *  from  cang ";
	$sql=$sql."   where  stuid='".$read_student_id."'";
	$cang_juan_id=array();
	
	$k=0;
	$rs=$conn->execute($sql);
	while (!$rs->EOF)
	{
		
 	  $cang_juan_id=$rs->fields["juan_id"];
	  $read_s=trim($rs->fields["test_ssele"]);
  	  $read_d=trim($rs->fields["test_dsele"]);
  	  $read_t=trim($rs->fields["test_tiankong"]);
  	  $read_p=trim($rs->fields["test_panduan"]);
  	  $read_lunshu=trim($rs->fields["test_lunshu"]);
	  
	  //-------------------------------------------------
	   $sql=" select *  from fenlei where  id=".$cang_juan_id;
	  $rs2=$conn->execute($sql);
	  if (!$rs2->EOF)
	  {
		  $get_juan_name=$rs2->fields["exam_juan_name"];
	  }
	  
	  $sql="select  *  from  database_name  where  id= ";
	  $sql=$sql." (select database_id  from fenlei where  id=".$cang_juan_id;
	  $sql=$sql." ) ";
	  
	  $rs2=$conn->execute($sql);
	  if (!$rs2->EOF)
	  {
		  $get_database_name=$rs2->fields["database_name"];
	  }
	 
	  
	  $rs2->close;
	  
	  //-----------------------------------
	  $get_s_list=array();
	  $get_d_list=array();
	  $get_t_list=array();
	  $get_p_list=array();
	  $get_lunshu_list=array();
	 	  
	  $get_s_list=explode("#",$read_s);   //数量是count();
	  $get_d_list=explode("#",$read_d);   
	  $get_t_list=explode("#",$read_t); 
	  $get_p_list=explode("#",$read_p); 
	  $get_lunshu_list=explode("#",$read_lunshu); 
	  
	  
	  $id_count=count($get_p_list);
	  $get_p_list=explode("#",$read_p);
	  
	  
	  for($u=0;$u<$id_count-1;$u++)
	  { 
	   
	  	$sql="select * from ".$get_database_name;
	  	$sql=$sql."   where    id=".$get_p_list[$u];
      	$sql=$sql."  order by  id  asc";
				
      	$rs2=$conn->execute($sql);

      	 if (!$rs2->EOF)
    	{


      		$tihao=$tihao+1;
			$read_an=trim($rs2->fields["正确答案"]);
			
			$read_dbdb_id=$rs2->fields["id"];
			
      		if ($read_an!='')
      		{

       		 	$canswer=$objcode->uncodetxt_data($read_an);
				$canswer=iconv("gb2312","utf-8",$canswer); 
      		} 


      		$get_stu_an=trim($uuan[$www]);

      		if ($get_stu_an=="1")
      		{
       			 $display_stu_an="正确";
      		} 
			if ($get_stu_an=="0")
      		{
       			 $display_stu_an="错误";
     		} 
      		if ($get_stu_an=="9")
      		{
        		$display_stu_an="未答";
      		} 

			 if (trim($canswer)=="1")
      		{
       		 $display_correct="正确";
      		} 
      		if (trim($canswer)=="0")
      		{
      		  $display_correct="错误";
      		} 


      		$read_timu=$rs2->fields["题目"];
      		if ($read_timu!='')
      		{

       			 $read_timu=$objcode->uncodetxt_data($read_timu);
				 $read_timu=iconv("gb2312","utf-8",$read_timu); 

        		$fenshu=0;
        		if ($rs2->fields["本题分数"]!='')
        		{

          			$fenshu=$rs2->fields["本题分数"];
       			 }
          		else
        		{

         		 $fenshu=0;
        		} 

        		$read_timu=$read_timu."(".($fenshu)."分)";

      		} 




		  	$get_images=$rs2->fields["images"];

      		if (($get_images!=''))
      		{

        		$images_flag=1;
      		}
        	else
      		{

        		$images_flag=0;
      		} 

      		$rs2->close;

		}
?>
      <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td height="35" bgcolor="#FFFFFF"><table width="98%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td width="14%" height="24" align="center" bgcolor="#fafafa"><font color="#0066FF">来源库名：</font></td>
              <td width="37%" bgcolor="#fafafa"><font color="#0066FF"><?php echo $get_database_name ?></font></td>
              <td width="11%" align="center" bgcolor="#fafafa"><font color="#0066FF">科目分类：</font></td>
              <td width="38%" bgcolor="#fafafa"><font color="#0066FF"><?php echo $get_juan_name ?></font></td>
            </tr>
          </table></td>
        </tr>
        <tr>
          <td height="219" valign="top" bgcolor="#FFFFFF"><table width=95%  border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
              <td width="85%" height=26 bgcolor=#FFFFFF><?   echo $tihao;?>
                .
                <?       echo $read_timu;?></td>
              <td width="15%" align="center" bgcolor=#FFFFCC><a href="my_cang_shiti_undo.php?stuid=<?php echo $read_student_id; ?>&juan_id=<?php echo $cang_juan_id; ?>&id=<?php echo $read_dbdb_id; ?>&shititype=4">取消收藏</a></td>
            </tr>
          </table>
            <table width="95%"  border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td height="19">&nbsp;</td>
                <td valign="middle">&nbsp;</td>
                <td align="center">&nbsp;</td>
                <td>&nbsp;</td>
                <td valign="middle">&nbsp;</td>
              </tr>
              <tr>
                <td width="17%" height="34">&nbsp;</td>
                <td width="26%" valign="middle"></td>
                <td width="27%" align="center">正确答案：<font color="#FF0000"><b><?php echo $display_correct; ?></b></font></td>
                <td width="20%"></td>
                <td width="10%" valign="middle">&nbsp;</td>
              </tr>
              <tr>
                <td height="34">&nbsp;</td>
                <td valign="middle">&nbsp;</td>
                <td align="center">&nbsp;</td>
                <td></td>
                <td valign="middle">&nbsp;</td>
              </tr>
            </table>
            <table width="95%"  border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td height="26">&nbsp;</td>
              </tr>
            </table>
            <table width="95%"  border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td height="1" background="images/dot_line.gif"></td>
              </tr>
            </table></td>
        </tr>
      </table>
      <?php 
	
	 
	  }//第一条记录
	 	  
	  
	  $rs->MoveNext();
	} 

	$rs->close;


	}
	

?>
    
  <?php if ($t_exist==1) {?>     
    
      <table width="95%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="20%" height="27" align="center" bgcolor="#CCCCCC">填空题</td>
          <td width="80%" bgcolor="#CCCCCC">&nbsp;</td>
        </tr>
        <tr>
          <td height="27" align="center" bgcolor="#FFFFFF">&nbsp;</td>
          <td bgcolor="#FFFFFF">&nbsp;</td>
        </tr>
      </table>
  <?php } ?>    
      
      
<?php 

    //------------填空------------------------------------------
	
	if ($t_exist==1) {  

    $sql="select  *  from  cang ";
	$sql=$sql."   where  stuid='".$read_student_id."'";
	$cang_juan_id=array();
	
	$k=0;
	$rs=$conn->execute($sql);
	while (!$rs->EOF)
	{
		
 	  $cang_juan_id=$rs->fields["juan_id"];
	  $read_s=trim($rs->fields["test_ssele"]);
  	  $read_d=trim($rs->fields["test_dsele"]);
  	  $read_t=trim($rs->fields["test_tiankong"]);
  	  $read_p=trim($rs->fields["test_panduan"]);
  	  $read_lunshu=trim($rs->fields["test_lunshu"]);
	  
	  //-------------------------------------------------
	  $sql=" select *  from fenlei where  id=".$cang_juan_id;
	  $rs2=$conn->execute($sql);
	  if (!$rs2->EOF)
	  {
		  $get_juan_name=$rs2->fields["exam_juan_name"];
	  }
	  
	  $sql="select  *  from  database_name  where  id= ";
	  $sql=$sql." (select database_id  from fenlei where  id=".$cang_juan_id;
	  $sql=$sql." ) ";
	  
	  $rs2=$conn->execute($sql);
	  if (!$rs2->EOF)
	  {
		  $get_database_name=$rs2->fields["database_name"];
	  }
	 
	  
	  $rs2->close;
	  
	  //-----------------------------------
	  $get_s_list=array();
	  $get_d_list=array();
	  $get_t_list=array();
	  $get_p_list=array();
	  $get_lunshu_list=array();
	 	  
	  $get_s_list=explode("#",$read_s);   //数量是count();
	  $get_d_list=explode("#",$read_d);   
	  $get_t_list=explode("#",$read_t); 
	  $get_p_list=explode("#",$read_p); 
	  $get_lunshu_list=explode("#",$read_lunshu); 
	  
	  
	  $id_count=count($get_t_list);
	  $get_t_list=explode("#",$read_t);
	  
	
	  for($u=0;$u<$id_count-1;$u++)
	  { 
	   
	  	$sql="select * from ".$get_database_name;
	  	$sql=$sql."   where    id=".$get_t_list[$u];
      	$sql=$sql."  order by  id  asc";
				
      	$rs2=$conn->execute($sql);

      	if (!$rs2->EOF)
    	{

      		$tihao=$tihao+1;
			
			$read_dbdb_id=$rs2->fields["id"];
			
      		$canswer=$objcode->uncodetxt_data(trim($rs2->fields["正确答案"]));
	  		$canswer=iconv("gb2312","utf-8",$canswer);  
	  
      		$ti_mu=$objcode->uncodetxt_data($rs2->fields["题目"]);
	  		$ti_mu=iconv("gb2312","utf-8",$ti_mu); 
	  
      		$fen=$rs2->fields["本题分数"];

      		$stu_tiankong_answer=$uuan[$www];

      		$rs2->close;

		}
?>
      <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td height="34" bgcolor="#FFFFFF"><table width="98%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td width="14%" height="24" align="center" bgcolor="#fafafa"><font color="#0066FF">来源库名：</font></td>
              <td width="37%" bgcolor="#fafafa"><font color="#0066FF"><?php echo $get_database_name ?></font></td>
              <td width="11%" align="center" bgcolor="#fafafa"><font color="#0066FF">科目分类：</font></td>
              <td width="38%" bgcolor="#fafafa"><font color="#0066FF"><?php echo $get_juan_name ?></font></td>
            </tr>
          </table></td>
        </tr>
        <tr>
          <td height="219" valign="top" bgcolor="#FFFFFF"><table width=95%  border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
              <td width="83%" height=26 bgcolor=#FFFFFF><?   echo $tihao;?>
                .
                <?       echo $ti_mu;?></td>
              <td width="17%" align="center" bgcolor=#FFFFCC><a href="my_cang_shiti_undo.php?stuid=<?php echo $read_student_id; ?>&juan_id=<?php echo $cang_juan_id; ?>&id=<?php echo $read_dbdb_id; ?>&shititype=3">取消收藏</a></td>
            </tr>
          </table>
            <table width="95%"  border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td height="19">&nbsp;</td>
                <td valign="middle">&nbsp;</td>
                <td align="center">&nbsp;</td>
                <td width="32%">&nbsp;</td>
                <td width="10%" valign="middle">&nbsp;</td>
              </tr>
              <tr>
                <td width="17%" height="34">&nbsp;</td>
                <td width="26%" valign="middle"></td>
                <td width="15%" align="center">正确答案：</td>
                <td colspan="2"><font color="#FF0000"><b><?php echo $canswer; ?></b></font></td>
              </tr>
              <tr>
                <td height="34">&nbsp;</td>
                <td valign="middle">&nbsp;</td>
                <td align="center">&nbsp;</td>
                <td></td>
                <td valign="middle">&nbsp;</td>
              </tr>
            </table>
            <table width="95%"  border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td height="26">&nbsp;</td>
              </tr>
            </table>
            <table width="95%"  border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td height="1" background="images/dot_line.gif"></td>
              </tr>
            </table></td>
        </tr>
      </table>
      <?php 
	
	 
	  }//第一条记录
	 	  
	  
	  $rs->MoveNext();
	} 

	$rs->close;

	
	}
	
?>

    <?php if ($lunshu_exist==1) {?>  
      <table width="95%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="20%" height="27" align="center" bgcolor="#CCCCCC">论述题</td>
          <td width="80%" bgcolor="#CCCCCC">&nbsp;</td>
        </tr>
        <tr>
          <td height="27" align="center" bgcolor="#FFFFFF">&nbsp;</td>
          <td bgcolor="#FFFFFF">&nbsp;</td>
        </tr>
      </table>
      
      <?php } ?>
<?php 

    //------------论述------------------------------------------
	
	if ($lunshu_exist==1) {  

    $sql="select  *  from  cang ";
	$sql=$sql."   where  stuid='".$read_student_id."'";
	$cang_juan_id=array();
	
	$k=0;
	$rs=$conn->execute($sql);
	while (!$rs->EOF)
	{
		
 	  $cang_juan_id=$rs->fields["juan_id"];
	  $read_s=trim($rs->fields["test_ssele"]);
  	  $read_d=trim($rs->fields["test_dsele"]);
  	  $read_t=trim($rs->fields["test_tiankong"]);
  	  $read_p=trim($rs->fields["test_panduan"]);
  	  $read_lunshu=trim($rs->fields["test_lunshu"]);
	  
	  //-------------------------------------------------
	   $sql=" select *  from fenlei where  id=".$cang_juan_id;
	  $rs2=$conn->execute($sql);
	  if (!$rs2->EOF)
	  {
		  $get_juan_name=$rs2->fields["exam_juan_name"];
	  }
	  
	  $sql="select  *  from  database_name  where  id= ";
	  $sql=$sql." (select database_id  from fenlei where  id=".$cang_juan_id;
	  $sql=$sql." ) ";
	  
	  $rs2=$conn->execute($sql);
	  if (!$rs2->EOF)
	  {
		  $get_database_name=$rs2->fields["database_name"];
	  }
	 
	  
	  $rs2->close;
	  
	  //-----------------------------------
	  $get_s_list=array();
	  $get_d_list=array();
	  $get_t_list=array();
	  $get_p_list=array();
	  $get_lunshu_list=array();
	 	  
	  $get_s_list=explode("#",$read_s);   //数量是count();
	  $get_d_list=explode("#",$read_d);   
	  $get_t_list=explode("#",$read_t); 
	  $get_p_list=explode("#",$read_p); 
	  $get_lunshu_list=explode("#",$read_lunshu); 
	  
	  
	  $id_count=count($get_lunshu_list);
	  $get_lunshu_list=explode("#",$read_lunshu);
	  
	  
	  for($u=0;$u<$id_count-1;$u++)
	  { 
	   
	  	$sql="select * from ".$get_database_name;
	  	$sql=$sql."   where    id=".$get_lunshu_list[$u];
      	$sql=$sql."  order by  id  asc";
				
      	$rs2=$conn->execute($sql);

      	if (!$rs2->EOF)
    	{


      		$tihao=$tihao+1;
			
			$read_dbdb_id=$rs2->fields["id"];
			
      		$canswer=$objcode->uncodetxt_data(trim($rs2->fields["正确答案"]));
	  		$canswer=iconv("gb2312","utf-8",$canswer);  
	  
      		$ti_mu=$objcode->uncodetxt_data($rs2->fields["题目"]);
	  		$ti_mu=iconv("gb2312","utf-8",$ti_mu); 
	  
      		$fen=$rs2->fields["本题分数"];

      		$stu_tiankong_answer=$uuan[$www];

      		$rs2->close;

		}
		
		
		
?>
      <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td height="35" bgcolor="#FFFFFF"><table width="98%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td width="14%" height="24" align="center" bgcolor="#fafafa"><font color="#0066FF">来源库名：</font></td>
              <td width="37%" bgcolor="#fafafa"><font color="#0066FF"><?php echo $get_database_name ?></font></td>
              <td width="11%" align="center" bgcolor="#fafafa"><font color="#0066FF">科目分类：</font></td>
              <td width="38%" bgcolor="#fafafa"><font color="#0066FF"><?php echo $get_juan_name ?></font></td>
            </tr>
          </table></td>
        </tr>
        <tr>
          <td height="219" valign="top" bgcolor="#FFFFFF"><table width="95%"  border="0" align="center" cellpadding="0" cellspacing="0" style="word-break:break-all;">
            <tr>
              <td height=18 colspan="2"></td>
            </tr>
            <tr>
              <td width="82%" height=31><?     echo $tihao;?>
                .
                <?   echo $ti_mu;?>
                (本题分数:
                <?  echo $fen;?>
                )</td>
              <td width="18%" align="center" bgcolor="#FFFFCC"><a href="my_cang_shiti_undo.php?stuid=<?php echo $read_student_id; ?>&juan_id=<?php echo $cang_juan_id; ?>&id=<?php echo $read_dbdb_id; ?>&shititype=5">取消收藏</a></td>
            </tr>
            <tr>
              <td height=79 colspan="2"><font color=#FF0000><b></b></font>
                <table width=95%  border=1 align=center cellpadding=0 cellspacing=0 bordercolordark=#FFFFFF bordercolorlight=#eeeeee>
                  <tr>
                    <td height="59"><table width=95%  border=0 align=center cellpadding=0 cellspacing=0 bordercolordark=#FFFFFF  bordercolorlight=#E8E8E8>
                      <tr>
                        <td height=28><div align=left>正确答案：</div></td>
                      </tr>
                      <tr>
                        <td height=26><div align=left><font color=#FF0000><b>
                          <?       echo $canswer;?>
                        </b></font></div></td>
                      </tr>
                    </table></td>
                  </tr>
                </table></td>
            </tr>
            <tr>
              <td height=26 colspan="2"></td>
            </tr>
            <tr>
              <td height=18 colspan="2"></td>
            </tr>
          </table>
            <table width="95%"  border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td height="26">&nbsp;</td>
              </tr>
            </table>
            <table width="95%"  border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td height="1" background="images/dot_line.gif"></td>
              </tr>
            </table></td>
        </tr>
      </table>
      <?php 
	
	 
	  }//第一条记录
	 	  
	  
	  $rs->MoveNext();
	} 

	$rs->close;
	
	$con->close;

	}

?></td>
  </tr>
</table>
<table width="800"  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="46" align="center" bgcolor="#FFFFFF"><div align="center"><a href="index.php">返回首页</a></div></td>
  </tr>
  <tr>
    <td height="46" align="center" bgcolor="#FFFFFF">&nbsp;</td>
  </tr>
</table>
<table width="800"  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="53" align="center" bgcolor="#999999">&nbsp;</td>
  </tr>
</table>
</body>
</html>




<? 


$conn->close;

$objcode=null;


?>
   
 


