Exemple #1
0
    if ($authlib->user_has_capability($loggedinuserdata->userID, $authlib::roles_view_reports)) {
        $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('reports_help')}\"); return false;'/></div>" . "<div style='float:left;display:table-cell; vertical-align:middle'>";
        $menuStr .= $patharr[$i - 1] == 'reports' ? "<span class='currentmenulocation'>{$stringlib->get_string('reports_index_label')}</span>" : "<a href='javascript:window.location.assign(\"{$CFG->wwwroot}{$CFG->basedir}reports/\")'>{$stringlib->get_string('reports_index_label')}</a>";
    }
    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 = 20;
$examdata = simplexml_load_string($enumlib->getExamInstances($increment, $from, 'true'));
$listTableStr = "<table><tr><th>{$stringlib->get_string('osce_sessions')}</th>";
$listTableStr .= "   <th>{$stringlib->get_string('osce_session_unit')}</th>\n            <th>{$stringlib->get_string('osce_session_owner')}</th>\n                <th>{$stringlib->get_string('osce_session_date')}</th>";
// $listTableStr .= "<th>{$stringlib->get_string('osce_session_created_by')}</th>
$listTableStr .= "<th>Clone <input type='image' src='{$CFG->wwwroot}{$CFG->basedir}/icons/dialog-question.png' BORDER='0' style='vertical-align: middle; display:table-cell' onclick='showHelp(\"{$stringlib->get_string('archive_clone_help_string')}\"); return false;'/></th>" . ($authlib->user_has_capability($loggedinuserdata->userID, $authlib::roles_edit_assessments) ? "<th>Delete</th>" : "") . "</tr>";
foreach ($examdata->instance as $instance) {
    $listTableStr .= "<tr class='" . ($instance->active == 'true' ? 'active' : 'inactive') . "'>";
    $listTableStr .= "<td><input type='image' src='{$CFG->wwwroot}{$CFG->basedir}/icons/dialog-information.png' BORDER='0' style='vertical-align: text-bottom;' onclick='show_information(\"{$instance->description}\"); return false;'/>" . ($authlib->user_has_capability($loggedinuserdata->userID, $authlib::roles_edit_assessments) ? "<a href='view/index.php?id={$instance->id}'>{$instance->name}</a>" : $instance->name) . "</td>";
    $listTableStr .= "<td>{$instance->unit}</td>\n        <td>{$instance->owner}</td>\n        <td>{$instance->exam_starttimestamp}</td>";
    //        <td>{$instance->created_by}</td>
    $listTableStr .= "<td><input type='image' src='{$CFG->wwwroot}{$CFG->basedir}/icons/gtk-copy.png' BORDER='0' style='vertical-align: text-bottom;' onclick='clone_assessment({$instance->id}, \"{$instance->name}\"); return false;'/></td>";
    $listTableStr .= ($authlib->user_has_capability($loggedinuserdata->userID, $authlib::roles_edit_assessments) ? "<td><input type='image' src='{$CFG->wwwroot}{$CFG->basedir}/icons/gtk-cancel.png' BORDER='0' style='vertical-align: text-bottom;' onclick='delete_instance({$instance->id}); return false;'/></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>';
Exemple #2
0
     break;
     // make a new exam instance
 // make a new exam instance
 case 'newexaminstance':
     include 'lib/EnumLib.php';
     include 'lib/FormsLib.php';
     $formslib = new FormsLib();
     $returnStr = $formslib->newExamInstance($_REQUEST['instance_name'], $_REQUEST['instance_description'], $_REQUEST['unitid'], $_REQUEST['scaleid'], $_REQUEST['ownerID'], $_REQUEST['userID']);
     break;
     // list all exam instances
 // list all exam instances
 case 'listexaminstances':
     include 'lib/EnumLib.php';
     include 'lib/FormsLib.php';
     $enumLib = new EnumLib();
     $returnStr = $enumLib->getExamInstances($_REQUEST['count'], $_REQUEST['from']);
     break;
     // list exam instances available for an assessor
 // list exam instances available for an assessor
 case 'listexaminstancesforassessor':
     include 'lib/EnumLib.php';
     $enumLib = new EnumLib();
     $returnStr = $enumLib->getExamsForAssessor($_REQUEST['userid']);
     break;
     // list exam instances available for an assessor, with additional data for caching by the app
 // list exam instances available for an assessor, with additional data for caching by the app
 case 'listexaminstancesforassessorforapp':
     include 'lib/EnumLib.php';
     $enumLib = new EnumLib();
     $returnStr = $enumLib->getExamsForAssessorForApp($_REQUEST['userid']);
     break;