<?php
include_once(_DIR_EXT.'/HTML/c_page_TXT.php');
class c_services_quiz_stats extends c_page_TXT
{

    function show(&$options=array())
    {  if ($_GET['quiz_id']) $quiz_id=$_GET['quiz_id'] ;
       if ($_POST['quiz_id']) $quiz_id=$_POST['quiz_id'] ;
       if (!$quiz_id) return ;

        ?>
        	<SCRIPT type="text/javascript" src="<?echo _PATH_TO_EXT?>/jquery/jquery-3.4.1.min.js" ></SCRIPT>
        	<SCRIPT type="text/javascript" src="<?echo _PATH_TO_EXT?>/jquery/jquery-migrate-1.2.1.min.js" ></SCRIPT>
        	<SCRIPT type="text/javascript" src="<?echo _PATH_TO_EXT?>/jquery/jquery-migrate-3.0.0.js" ></SCRIPT>
        	<SCRIPT type="text/javascript" src="/AddOns/fusioncharts-suite-xt/js/fusioncharts.js" ></SCRIPT>
        	<SCRIPT type="text/javascript" src="/AddOns/fusioncharts-suite-xt/js/fusioncharts.charts.js" ></SCRIPT>
        	<SCRIPT type="text/javascript" src="/AddOns/fusioncharts-suite-xt/js/themes/fusioncharts.theme.fint.js" ></SCRIPT>
            <link rel="stylesheet" type="text/css" href="/<?echo _CLASS_?>/style.css" charset="utf-8">
        <?
      //ob_start() ;
      //damp_array($_POST,1,-1) ;
      //damp_array($_GET,1,-1) ;
      $rec_quiz=QUIZ()->get_quiz_by_id($quiz_id) ;
      $rec_personal=PERSONAL()->get_personal_by_id($rec_quiz['personal_id'],['no_group'=>1]) ;

      //$question_ids=execSQL_line('select question_id from quiz_result where quiz_id='.$quiz_id) ;
      //$themes_ids=[] ;
      //if (_sizeof($question_ids)) $themes_ids=execSQL_line('select distinct(parent2) from quiz_questions where pkey in ('.implode(',',$question_ids).')') ;
      //damp_array($rec_quiz);
      ?><div style="padding-top:30px;"><?
      include_once('report_quiz_personal_rating_graf.php');
      //if (_sizeof($themes_ids)) $options['filter']['theme_id']=$themes_ids[0] ;
      $report1 = new report_quiz_personal_rating_graf($options);
      $report1->personal_id=$rec_quiz['personal_id'] ;
      $report1->personal_rec=$rec_personal ;
      $report1->title=$rec_personal['_IO'].', Ваши результаты контроля знаний:' ;
      $report1->view_panel_info=1;
      $report1->debug=($_GET['debug'])? 1:0;
      $report1->height_graf=600;
      $report1->view_as_HTML(['chart_elem_id'=>'test777']);
      ?><div id="test777"></div></div><?


      //$text=ob_get_clean() ;
      //echo $text ;
      //LOGS()->reg_log('c_services_quiz_stats','',['save_to_file'=>$text]) ;
    }
}
