exercise_submit_modal.php 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562
  1. <?php
  2. /* For licensing terms, see /dokeos_license.txt */
  3. $language_file=array('exercice');
  4. include_once('../inc/global.inc.php');
  5. include api_get_path(INCLUDE_PATH) . 'reduced_header.inc.php';
  6. include_once(api_get_path(LIBRARY_PATH).'geometry.lib.php');
  7. $dbg_local = 0;
  8. // answer types
  9. define('UNIQUE_ANSWER', 1);
  10. define('MULTIPLE_ANSWER', 2);
  11. define('FILL_IN_BLANKS', 3);
  12. define('MATCHING', 4);
  13. define('FREE_ANSWER', 5);
  14. define('HOT_SPOT', 6);
  15. define('HOT_SPOT_ORDER', 7);
  16. define('HOT_SPOT_DELINEATION', 8);
  17. require_once('exercise.class.php');
  18. require_once('question.class.php');
  19. require_once('answer.class.php');
  20. require_once('exercise.lib.php');
  21. if (empty ($exerciseResult)) {
  22. $exerciseResult = $_SESSION['exerciseResult'];
  23. }
  24. if (empty($exerciseResultCoordinates)) {
  25. //$exerciseResultCoordinates = $_REQUEST['exerciseResultCoordinates'];
  26. }
  27. if (empty($origin)) {
  28. $origin = Security::remove_XSS($_REQUEST['origin']);
  29. }
  30. $_SESSION['hotspot_coord']=array();
  31. $newquestionList= $_SESSION['newquestionList'];
  32. $questionList = $_SESSION['questionList'];
  33. $exerciseId = intval($_GET['exerciseId']);
  34. $exerciseType = intval($_GET['exerciseType']);
  35. $questionNum = intval($_GET['questionnum']);
  36. $nbrQuestions = intval($_GET['nbrQuestions']);
  37. //round-up the coordinates
  38. $coords = explode('/',$_GET['hotspot']);
  39. $user_array = '';
  40. if (is_array($coords) && count($coords)>0){
  41. foreach ($coords as $coord) {
  42. list($x,$y) = explode(';',$coord);
  43. $user_array .= round($x).';'.round($y).'/';
  44. }
  45. }
  46. $user_array = substr($user_array,0,-1);
  47. if (isset( $_GET['choice'])){
  48. $choice_value = intval($_GET['choice']);
  49. }
  50. // getting the options by js
  51. if (empty($choice_value)) {
  52. echo '<script type="text/javascript">'."
  53. // this works for only radio buttons
  54. var f= self.parent.window.document.frm_exercise;
  55. var choice_js='';
  56. var hotspot = new Array();
  57. var hotspotcoord = new Array();
  58. var counter=0;
  59. for( var i = 0; i < f.elements.length; i++ )
  60. {
  61. if (f.elements[i].type=='radio' && f.elements[i].checked)
  62. {
  63. //alert( f.elements[i].name);
  64. choice_js = f.elements[i].value;
  65. counter ++;
  66. }
  67. if (f.elements[i].type=='hidden' )
  68. {
  69. name = f.elements[i].name;
  70. if (name.substr(0,7)=='hotspot')
  71. hotspot.push(f.elements[i].value);
  72. if (name.substr(0,20)=='hotspot_coordinates')
  73. hotspotcoord.push(f.elements[i].value);
  74. //hotspot = f.elements[i].value;
  75. }
  76. }
  77. if (counter==0)
  78. {
  79. choice_js=-1; // this is an error
  80. }
  81. //alert(choice_js);
  82. ";
  83. echo 'window.location.href = "exercise_submit_modal.php?hotspotcoord="+ hotspotcoord + "&hotspot="+ hotspot + "&choice="+ choice_js + "&exerciseId='.$exerciseId.'&questionnum='.$questionNum.'&exerciseType='.$exerciseType.'&origin='.$origin.'&gradebook='.$gradebook.'";</script>';
  84. }
  85. $choice=array();
  86. $questionid= $questionList[$questionNum];
  87. // $choice_value => value of the user selection
  88. $choice[$questionid]=$choice_value;
  89. // initializing
  90. if(!is_array($exerciseResult))
  91. {
  92. $exerciseResult=array();
  93. }
  94. // if the user has answered at least one question
  95. if(is_array($choice)) {
  96. if($exerciseType == 1) {
  97. // $exerciseResult receives the content of the form.
  98. // Each choice of the student is stored into the array $choice
  99. $exerciseResult=$choice;
  100. } else {
  101. // gets the question ID from $choice. It is the key of the array
  102. list($key)=array_keys($choice);
  103. // if the user didn't already answer this question
  104. if(!isset($exerciseResult[$key])) {
  105. // stores the user answer into the array
  106. $exerciseResult[$key]=$choice[$key];
  107. }
  108. }
  109. }
  110. // the script "exercise_result.php" will take the variable $exerciseResult from the session
  111. api_session_register('exerciseResult');
  112. api_session_register('exerciseResultCoordinates');
  113. /*
  114. // if it is the last question (only for a sequential exercise)
  115. if($questionNum >= $nbrQuestions)
  116. {
  117. if($debug>0){echo str_repeat('&nbsp;',0).'Redirecting to exercise_result.php - Remove debug option to let this happen'."<br />\n";}
  118. // goes to the script that will show the result of the exercise
  119. // header("Location: exercise_result.php?origin=$origin&learnpath_id=$learnpath_id&learnpath_item_id=$learnpath_item_id");
  120. // echo 'location result';
  121. }*/
  122. // gets the student choice for this question
  123. //print_r($choice); echo "<br>";
  124. // creates a temporary Question object
  125. if (in_array($questionid,$questionList))
  126. {
  127. $objQuestionTmp = Question :: read($questionid);
  128. $questionName=$objQuestionTmp->selectTitle();
  129. $questionDescription=$objQuestionTmp->selectDescription();
  130. $questionWeighting=$objQuestionTmp->selectWeighting();
  131. $answerType=$objQuestionTmp->selectType();
  132. $quesId =$objQuestionTmp->selectId(); //added by priya saini
  133. }
  134. $objAnswerTmp=new Answer($questionid);
  135. $nbrAnswers=$objAnswerTmp->selectNbrAnswers();
  136. //echo 'answe_type '.$answerType;echo '<br />';
  137. if($answerType == FREE_ANSWER)
  138. $nbrAnswers = 1;
  139. $choice=$exerciseResult[$questionid];
  140. $destination=array();
  141. $comment='';
  142. $next=1;
  143. $_SESSION['hotspot_coord']=array();
  144. $_SESSION['hotspot_dest']=array();
  145. $overlap_color=$missing_color=$excess_color=false;
  146. $organs_at_risk_hit=0;
  147. if (!empty($choice_value))
  148. {
  149. for($answerId=1;$answerId <= $nbrAnswers;$answerId++) {
  150. $answer=$objAnswerTmp->selectAnswer($answerId);
  151. $answerComment=$objAnswerTmp->selectComment($answerId);
  152. $answerDestination=$objAnswerTmp->selectDestination($answerId);
  153. $answerCorrect=$objAnswerTmp->isCorrect($answerId);
  154. $answerWeighting=$objAnswerTmp->selectWeighting($answerId);
  155. //delineation
  156. $delineation_cord=$objAnswerTmp->selectHotspotCoordinates(1);
  157. $answer_delineation_destination=$objAnswerTmp->selectDestination(1);
  158. if ($dbg_local>0) { error_log(__LINE__.' answerId: '.$answerId.'('.$answerType.') - user delineation_cord: '.$delineation_cord.' - $answer_delineation_destination: '.$answer_delineation_destination,0);}
  159. switch($answerType) {
  160. // for unique answer
  161. case UNIQUE_ANSWER :
  162. $studentChoice=($choice_value == $answerId)?1:0;
  163. if($studentChoice) {
  164. $questionScore+=$answerWeighting;
  165. $totalScore+=$answerWeighting;
  166. $newquestionList[]=$questionid;
  167. }
  168. break;
  169. case HOT_SPOT_DELINEATION : $studentChoice=$choice[$answerId];
  170. if($studentChoice) {
  171. $questionScore+=$answerWeighting;
  172. $totalScore+=$answerWeighting;
  173. $newquestionList[]=$questionid;
  174. }
  175. if ($answerId===1) {
  176. $_SESSION['hotspot_coord'][1]=$delineation_cord;
  177. $_SESSION['hotspot_dest'][1]=$answer_delineation_destination;
  178. }
  179. break;
  180. }
  181. if($answerType != MATCHING || $answerCorrect)
  182. {
  183. if($answerType == UNIQUE_ANSWER || $answerType == MULTIPLE_ANSWER)
  184. {
  185. //display_unique_or_multiple_answer($answerType, $studentChoice, $answer, $answerComment, $answerCorrect);
  186. //echo $questionScore;
  187. if ($studentChoice)
  188. {
  189. $destination=$answerDestination;
  190. $comment=$answerComment;
  191. }
  192. }
  193. elseif($answerType == HOT_SPOT_DELINEATION)
  194. {
  195. if ($next)
  196. {
  197. if ($dbg_local>0) { error_log(__LINE__.' - next',0);}
  198. $tbl_track_e_hotspot = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_HOTSPOT);
  199. // Save into db
  200. $sql = "INSERT INTO $tbl_track_e_hotspot (hotspot_user_id, hotspot_course_code, hotspot_exe_id, hotspot_question_id, hotspot_answer_id, hotspot_correct, hotspot_coordinate )
  201. VALUES ('".Database::escape_string($_user['user_id'])."', '".Database::escape_string($_course['id'])."', '".Database::escape_string($exeId)."', '".Database::escape_string($questionId)."', '".Database::escape_string($answerId)."', '".Database::escape_string($studentChoice)."', '".Database::escape_string($user_array)."')";
  202. $result = Database::query($sql,__FILE__,__LINE__);
  203. $user_answer = $user_array;
  204. //$_SESSION['exerciseResultCoordinates'][$questionId]=$exerciseResultCoordinates;
  205. // we compare only the delineation not the other points
  206. $answer_question = $_SESSION['hotspot_coord'][1];
  207. $answerDestination = $_SESSION['hotspot_dest'][1];
  208. $poly_user = convert_coordinates($user_answer,'/');
  209. $poly_answer = convert_coordinates($answer_question,'|');
  210. $max_coord = poly_get_max($poly_user,$poly_answer);
  211. $poly_user_compiled = poly_compile($poly_user,$max_coord);
  212. $poly_answer_compiled = poly_compile($poly_answer,$max_coord);
  213. $poly_results = poly_result($poly_answer_compiled,$poly_user_compiled,$max_coord);
  214. $overlap = $poly_results['both'];
  215. $poly_answer_area = $poly_results['s1'];
  216. $poly_user_area = $poly_results['s2'];
  217. $missing = $poly_results['s1Only'];
  218. $excess = $poly_results['s2Only'];
  219. //$overlap = round(polygons_overlap($poly_answer,$poly_user)); //this is an area in pixels
  220. if ($dbg_local>0) { error_log(__LINE__.' - Polygons results are '.print_r($poly_results,1),0);}
  221. if ($overlap < 1) {
  222. //shortcut to avoid complicated calculations
  223. $final_overlap = 0;
  224. $final_missing = 100;
  225. $final_excess = 100;
  226. } else {
  227. // the final overlap is the percentage of the initial polygon that is overlapped by the user's polygon
  228. $final_overlap = round(((float)$overlap / (float)$poly_answer_area)*100);
  229. if ($dbg_local>1) { error_log(__LINE__.' - Final overlap is '.$final_overlap,0);}
  230. // the final missing area is the percentage of the initial polygon that is not overlapped by the user's polygon
  231. $final_missing = 100 - $final_overlap;
  232. if ($dbg_local>1) { error_log(__LINE__.' - Final missing is '.$final_missing,0);}
  233. // the final excess area is the percentage of the initial polygon's size that is covered by the user's polygon outside of the initial polygon
  234. $final_excess = round((((float)$poly_user_area-(float)$overlap)/(float)$poly_answer_area)*100);
  235. if ($dbg_local>1) { error_log(__LINE__.' - Final excess is '.$final_excess,0);}
  236. }
  237. $destination_items= explode('@@', $answerDestination);
  238. $threadhold_total = $destination_items[0];
  239. $threadhold_items=explode(';',$threadhold_total);
  240. $threadhold1 = $threadhold_items[0]; // overlap
  241. $threadhold2 = $threadhold_items[1]; // excess
  242. $threadhold3 = $threadhold_items[2]; //missing
  243. // if is delineation
  244. if ($answerId===1)
  245. {
  246. //setting colors
  247. if ($final_overlap>=$threadhold1)
  248. {
  249. $overlap_color=true; //echo 'a';
  250. }
  251. //echo $excess.'-'.$threadhold2;
  252. if ($final_excess<=$threadhold2)
  253. {
  254. $excess_color=true; //echo 'b';
  255. }
  256. //echo '--------'.$missing.'-'.$threadhold3;
  257. if ($final_missing<=$threadhold3)
  258. {
  259. $missing_color=true; //echo 'c';
  260. }
  261. // if pass
  262. if ($final_overlap>=$threadhold1 && $final_missing<=$threadhold2 && $final_excess<=$threadhold3)
  263. {
  264. $next=1; //go to the oars
  265. $result_comment=get_lang('Acceptable');
  266. }
  267. else
  268. {
  269. $next=0;
  270. $result_comment=get_lang('Unacceptable');
  271. $comment=$answerDestination=$objAnswerTmp->selectComment(1);
  272. $answerDestination=$objAnswerTmp->selectDestination(1);
  273. $destination_items= explode('@@', $answerDestination);
  274. $try_hotspot=$destination_items[1];
  275. $lp_hotspot=$destination_items[2];
  276. $select_question_hotspot=$destination_items[3];
  277. $url_hotspot=$destination_items[4];
  278. //echo 'show the feedback';
  279. }
  280. }
  281. elseif($answerId>1)
  282. {
  283. if ($objAnswerTmp->selectHotspotType($answerId) == 'noerror') {
  284. if ($dbg_local>0) { error_log(__LINE__.' - answerId is of type noerror',0);}
  285. //type no error shouldn't be treated
  286. $next = 1;
  287. continue;
  288. }
  289. if ($dbg_local>0) { error_log(__LINE__.' - answerId is >1 so we\'re probably in OAR',0);}
  290. //check the intersection between the oar and the user
  291. //echo 'user'; print_r($x_user_list); print_r($y_user_list);
  292. //echo 'official';print_r($x_list);print_r($y_list);
  293. //$result = get_intersection_data($x_list,$y_list,$x_user_list,$y_user_list);
  294. $inter= $result['success'];
  295. //$delineation_cord=$objAnswerTmp->selectHotspotCoordinates($answerId);
  296. $delineation_cord=$objAnswerTmp->selectHotspotCoordinates($answerId);
  297. $poly_answer = convert_coordinates($delineation_cord,'|');
  298. $max_coord = poly_get_max($poly_user,$poly_answer);
  299. $poly_answer_compiled = poly_compile($poly_answer,$max_coord);
  300. $overlap = poly_touch($poly_user_compiled, $poly_answer_compiled,$max_coord);
  301. if ($overlap == false) {
  302. //all good, no overlap
  303. $next = 1;
  304. continue;
  305. } else {
  306. if ($dbg_local>0) { error_log(__LINE__.' - Overlap is '.$overlap.': OAR hit',0);}
  307. $organs_at_risk_hit++;
  308. //show the feedback
  309. $next=0;
  310. $comment=$answerDestination=$objAnswerTmp->selectComment($answerId);
  311. $answerDestination=$objAnswerTmp->selectDestination($answerId);
  312. $destination_items= explode('@@', $answerDestination);
  313. $try_hotspot=$destination_items[1];
  314. $lp_hotspot=$destination_items[2];
  315. $select_question_hotspot=$destination_items[3];
  316. $url_hotspot=$destination_items[4];
  317. }
  318. }
  319. }
  320. else
  321. { // the first delineation feedback
  322. if ($dbg_local>0) { error_log(__LINE__.' first',0);}
  323. //we send the error
  324. }
  325. }
  326. }
  327. }
  328. if ($overlap_color) {
  329. $overlap_color='green';
  330. } else {
  331. $overlap_color='red';
  332. }
  333. if ($missing_color) {
  334. $missing_color='green';
  335. } else {
  336. $missing_color='red';
  337. }
  338. if ($excess_color) {
  339. $excess_color='green';
  340. } else {
  341. $excess_color='red';
  342. }
  343. $table_resume='<table class="data_table" >
  344. <tr class="row_odd" >
  345. <td></td>
  346. <td ><b>'.get_lang('Required').'</b></td>
  347. <td><b>'.get_lang('YourAnswer').'</b></td>
  348. </tr>
  349. <tr class="row_even">
  350. <td><b>'.get_lang('Overlap').'</b></td>
  351. <td>'.get_lang('Min').' '.$threadhold1.'</td>
  352. <td><div style="color:'.$overlap_color.'">'.$final_overlap.'</div></td>
  353. </tr>
  354. <tr class="row_even">
  355. <td><b>'.get_lang('Missing').'</b></td>
  356. <td>'.get_lang('Max').' '.$threadhold3.'</td>
  357. <td><div style="color:'.$missing_color.'">'.$final_missing.'</div></td>
  358. </tr>
  359. <tr>
  360. <td><b>'.get_lang('Excess').'</b></td>
  361. <td>'.get_lang('Max').' '.$threadhold2.'</td>
  362. <td><div style="color:'.$excess_color.'">'.$final_excess.'</div></td>
  363. </tr>
  364. </table>';
  365. }
  366. $_SESSION['newquestionList']=$newquestionList;
  367. if ($choice_value==-1) {
  368. $links. '<a href="#" onclick="self.parent.tb_remove();">'.get_lang('ChooseAnAnswer').'</a>';
  369. }
  370. if ($answerType!= HOT_SPOT_DELINEATION)
  371. {
  372. $item_list=explode('@@',$destination);
  373. //print_R($item_list);
  374. $try = $item_list[0];
  375. $lp = $item_list[1];
  376. $destinationid= $item_list[2];
  377. $url=$item_list[3];
  378. $table_resume='';
  379. }
  380. else
  381. {
  382. if ($next==0) {
  383. $try = $try_hotspot;
  384. $lp = $lp_hotspot;
  385. $destinationid= $select_question_hotspot;
  386. $url=$url_hotspot;
  387. } else {
  388. //show if no error
  389. //echo 'no error';
  390. $comment=$answerComment=$objAnswerTmp->selectComment($nbrAnswers);
  391. $answerDestination=$objAnswerTmp->selectDestination($nbrAnswers);
  392. //we send the error
  393. $destination_items= explode('@@', $answerDestination);
  394. $try=$destination_items[1];
  395. $lp=$destination_items[2];
  396. $destinationid=$destination_items[3];
  397. $url=$destination_items[4];
  398. }
  399. }
  400. //$pre_list_destination=explode(';',$list_dest);
  401. /*
  402. $destination_list=array();
  403. foreach($pre_list_destination as $value)
  404. {
  405. if ($value!='')
  406. $destination_list[]=$value;
  407. }*/
  408. //echo '<pre>';print_r($destination);
  409. $links='';
  410. // the link to retry the question
  411. if ($try==1)
  412. {
  413. $num_value_array= (array_keys($questionList, $questionid));
  414. $links.= Display :: return_icon('reload.gif', '', array ('style' => 'padding-left:0px;padding-right:5px;')).'<a onclick="SendEx('.$num_value_array[0].');" href="#">'.get_lang('TryAgain').'</a><br /><br />';
  415. }
  416. // the link to theory (a learning path)
  417. if (!empty($lp))
  418. {
  419. $lp_url= api_get_path(WEB_CODE_PATH).'newscorm/lp_controller.php?'.api_get_cidreq().'&action=view&lp_id='.$lp;
  420. require_once('../newscorm/learnpathList.class.php');
  421. $list = new LearnpathList(api_get_user_id());
  422. $flat_list = $list->get_flat_list();
  423. $links.= Display :: return_icon('theory.gif', '', array ('style' => 'padding-left:0px;padding-right:5px;')).'<a target="_blank" href="'.$lp_url.'">'.get_lang('SeeTheory').'</a><br />';
  424. }
  425. $links.='<br />';
  426. // the link to an external website or link
  427. if (!empty($url)) {
  428. $links.= Display :: return_icon('link.gif', '', array ('style' => 'padding-left:0px;padding-right:5px;')).'<a target="_blank" href="'.$url.'">'.get_lang('VisitUrl').'</a><br /><br />';
  429. }
  430. // the link to finish the test
  431. if ($destinationid==-1)
  432. {
  433. $links.= Display :: return_icon('finish.gif', '', array ('style' => 'width:22px; height:22px; padding-left:0px;padding-right:5px;')).'<a onclick="SendEx(-1);" href="#">'.get_lang('EndActivity').'</a><br /><br />';
  434. }
  435. // the link to other question
  436. else
  437. {
  438. if (in_array($destinationid,$questionList))
  439. {
  440. $objQuestionTmp = Question :: read($destinationid);
  441. $questionName=$objQuestionTmp->selectTitle();
  442. $num_value_array= (array_keys($questionList, $destinationid));
  443. $links.= Display :: return_icon('quiz.gif', '', array ('style' => 'padding-left:0px;padding-right:5px;')).'<a onclick="SendEx('.$num_value_array[0].');" href="#">'.get_lang('GoToQuestion').' '.$num_value_array[0].'</a><br /><br />';
  444. }
  445. }
  446. echo '<script> function SendEx(num)
  447. {
  448. if (num==-1)
  449. {
  450. self.parent.window.location.href = "exercise_result.php?origin='.$origin.'";
  451. self.parent.tb_remove();
  452. }
  453. else
  454. {
  455. self.parent.window.location.href = "exercice_submit.php?tryagain=1&exerciseId='.$exerciseId.'&questionNum="+num+"&exerciseType='.$exerciseType.'&origin='.$origin.'";
  456. self.parent.tb_remove();
  457. }
  458. }
  459. </script>';
  460. api_protect_course_script();
  461. if ($links!='')
  462. {
  463. echo '<div id="ModalContent" style="padding-bottom:30px;padding-top:10px;padding-left:20px;padding-right:20px;">
  464. <a onclick="self.parent.tb_remove();" href="#" style="float:right; margin-top:-10px;" id="exercise_close_link">'.get_lang('Close').'</a>
  465. <h1><div style="color:#333;">'.get_lang('Feedback').'</div></h1>
  466. <p style="text-align:center">';
  467. if ($answerType == HOT_SPOT_DELINEATION)
  468. {
  469. $message='<p>'.get_lang('YourDelineation').'</p>';
  470. $message.=$table_resume;
  471. $message.='<br />'.get_lang('ResultIs').' '.$result_comment.'<br />';
  472. if ($organs_at_risk_hit>0)
  473. $message.='<p><b>'.get_lang('OARHit').'</b></p>';
  474. $message.='<p>'.$comment.'</p>';
  475. echo $message;
  476. }
  477. else
  478. {
  479. echo '<p>'.$comment.'</p>';
  480. }
  481. echo '<h3>'.$links.'</h3>';
  482. //echo '<a onclick="self.parent.tb_remove();" href="#" style="float:right;">'.get_lang('Close').'</a>';
  483. echo '</div>';
  484. $_SESSION['hot_spot_result']=$message;
  485. } else {
  486. $questionNum++;
  487. echo '<script>
  488. self.parent.window.location.href = "exercice_submit.php?exerciseId='.$exerciseId.'&questionNum='.$questionNum.'&exerciseType='.$exerciseType.'&origin='.$origin.'";
  489. //self.parent.tb_remove();
  490. </script>';
  491. }
  492. ?>