Пример #1
0
    }
    if ($authlib->user_has_capability($loggedinuserdata->userID, $authlib::roles_view_assessments)) {
        $menuStr .= "<li><div style='vertical-align: middle; display:table;'>" . "<div style='display:table-cell; vertical-align:middle'><input type='image' src='{$CFG->wwwroot}{$CFG->basedir}icons/dialog-question.png' BORDER='0'  onclick='showHelp(\"{$stringlib->get_string('osce_archive_help')}\"); return false;'/></div>" . "<div style='float:left;display:table-cell; vertical-align:middle'>";
        $menuStr .= $patharr[$i - 1] == 'archive' ? "<span class='currentmenulocation'>{$stringlib->get_string('eosce_archive')}</span>" : "<a href='javascript:window.location.assign(\"{$CFG->wwwroot}{$CFG->basedir}archive/\")'>{$stringlib->get_string('eosce_archive')}</a>";
        $menuStr .= "</div></div></li>";
    }
    $menuStr .= "</ul><li>";
}
$from = isset($_REQUEST['from']) ? $_REQUEST['from'] : 0;
$datefrom = isset($_REQUEST['datefrom']) ? $_REQUEST['datefrom'] : 0;
$dateto = isset($_REQUEST['dateto']) ? $_REQUEST['dateto'] : 0;
$increment = 100;
// get completed examinations
$listTableStr = "";
//<button id='refreshbut' onclick='location.reload(true)'>Refresh</button>";
$completedExams = simplexml_load_string($enumlib->getCompletedExamInstances($increment, $from, $datefrom, $dateto));
if ($completedExams->count > 0) {
    $listTableStr .= "<table><tr><th>{$stringlib->get_string('osce_session_completed_date')}</th><th>{$stringlib->get_string('osce_session')}</th><th>Enrolled student count</th><th>Completed examinations</th><th>Remaining</th></tr>";
    foreach ($completedExams->instance as $instance) {
        $listTableStr .= "<tr><td> {$instance->exam_endtimestamp}</td><td><a href='detail/index.php?id={$instance->id}'>{$instance->name}</a></td><td>{$instance->enrolmentcount}</td><td>{$instance->completedcount}</td><td><a href='javascript:void(0)' onclick='showMissingStudents({$instance->id});'>{$instance->remainingcount}</a></td></tr>";
    }
    $listTableStr .= "</table>";
    $buttonStr = '<div id="nav_div" style="float: left">';
    $buttonStr .= '<button id="first" style="float: left" ' . ($from == 0 ? 'disabled="disabled"' : '') . '  onclick="goFirst()">First</button>';
    $buttonStr .= '<button id="prev" onclick="goPrev()" style="float: left" ' . ($from == 0 ? 'disabled="disabled"' : '') . '>Prev ' . $increment . '</button>';
    $buttonStr .= '<button id="next" onclick="goNext()" style="float: left" ' . ($from + $increment > $completedExams->count ? 'disabled="disabled"' : '') . '>Next ' . $increment . '</button>';
    $buttonStr .= '<button id="last" style="float: left" ' . ($from + $increment > $completedExams->count ? 'disabled="disabled"' : '') . ' onclick="goLast()">Last</button><br/></div>';
    $buttonStr .= "<div>{$stringlib->get_string('osce_sessions_count')}:{$completedExams->count}</div>";
} else {
    //$listTableStr = '<hr/><h3>There are no finished exam results</h3>';
    $listTableStr = '<hr/>';