}
    $table2->data[] = array("{$cssting} : " . $report_data);
} else {
    if (!($scorm = $DB->get_record("scorm", array("id" => $scormfull->threshold)))) {
        error(get_string('Courses_have_been_changed', 'scormfull'));
    }
    $table2->data[] = array("{$scrom_name} : " . $scorm->name);
    $sql = "SELECT COUNT(*) as count \n                FROM  {$CFG->prefix}scorm_scoes sss\n               \tWHERE sss.scorm = {$scormfull->threshold}\n\t\tAND sss.scormtype = 'sco'";
    $sco_count = 0;
    $get_countarray = $DB->get_records_sql($sql);
    foreach ($get_countarray as $value) {
        $sco_count = $value->count;
    }
    $user_grades_array = get_quiz_grades($quiz->id);
    $get_user = usersdata($course->id, $perpage * $page, $perpage);
    $usercount = count(usersdata($course->id));
    foreach ($get_user as $key => $value) {
        $getvalue = 0;
        $sql = "SELECT st.id,st.userid,st.scormid,st.scoid,st.attempt,st.element,st.value,st.timemodified\n                        FROM {$CFG->prefix}scorm_scoes_track st\n                        WHERE st.scormid ={$scormfull->threshold} and ( value='completed' or value='suspend')  and st.userid={$key}  group by st.scoid";
        $getqudata = $DB->get_records_sql($sql);
        $calculation_results = calculateInteTime(integrate_log($scormfull, $key));
        if (!empty($getqudata)) {
            $getvalue = round(count($getqudata) / $sco_count, 2);
        }
        $setjudg = get_string('starnopass', 'scormfull');
        if ($getvalue >= (int) $scormfull->thresholdvalue / 100) {
            $setjudg = get_string('strpass', 'scormfull');
            $setjudg = !$scormfull->report_add ? get_string('strpass', 'scormfull') : ($calculation_results >= $scormfull->report_value ? get_string('strpass', 'scormfull') : get_string('starnopass', 'scormfull'));
        }
        $table->data[] = array("<a href=\"{$CFG->wwwroot}/user/view.php?id={$key}&amp;course={$course->id}\">" . "{$value}</a><br />", $setjudg, !empty($user_grades_array[$key]) ? $user_grades_array[$key]->grade : $not_been_exam, !empty($user_grades_array[$key]) ? $user_grades_array[$key]->grade >= $scormfull->quid_score ? get_string('strpass', 'scormfull') : get_string('starnopass', 'scormfull') : "-");
    }
$reportformat = optional_param('menureportformat', 'showashtml', PARAM_ALPHA);
//ini number
$selectedcategory = $categoryID;
$selectedcourse = $courseID;
$selecteduser = $userID;
$selecteddate = $dateform;
$selectedformat = $reportformat;
//make function for get content
$categories = categoriesdata();
if ($categoryID) {
    $courses = coursesdata($categoryID);
} else {
    $courses = array();
}
if ($courseID) {
    $users = usersdata($courseID);
} else {
    $users = array();
}
$dateforms = dateformsdata();
$reportformats = reportformatsdata();
echo "<form action=\"{$CFG->wwwroot}/blocks/report_module/reportcourse/index.php\" method=\"post\">\n";
echo html_writer::select($categories, "category", $selectedcategory, get_string('selectCourseCategoryDot4', 'block_report_module'));
echo html_writer::select($courses, "course", $selectedcourse, get_string('selectCourseNameDot4', 'block_report_module'));
echo html_writer::select($users, "user", $selecteduser, get_string('allParticular4', 'block_report_module'));
echo html_writer::select($dateforms, "date", $selecteddate, get_string('alldate4', 'block_report_module'));
echo html_writer::select($reportformats, 'reportformat', $selectedformat, false);
echo '<input type="button" value="' . get_string('downloadCourseReportInformaiton4', 'block_report_module') . '" id="sentCourseInfoButton" />' . "\n";
//for jquery
//echo '<input type="submit" value="下載課程報表資訊" />'."\n";
echo '</form>' . "\n";