<!DOCTYPE html> <!-- To change this license header, choose License Headers in Project Properties. To change this template file, choose Tools | Templates and open the template in the editor. --> <?php include '../backend/lib/authlib.php'; include '../backend/lib/StringLib.php'; include '../backend/lib/EnumLib.php'; require_once '../backend/config.inc.php'; $enumlib = new EnumLib(); $authlib = new authlib(); $stringlib = new StringLib(); if (isset($_REQUEST['logout'])) { setcookie('uneeoscetoken', "", -3600); //do redirect in Java? print "<script>window.location.assign('{$CFG->wwwroot}{$CFG->basedir}login.php');</script>"; exit; } if (isset($_COOKIE['uneeoscetoken'])) { $token = $_COOKIE['uneeoscetoken']; $authresult = ''; $stringlib = new StringLib(); $loggedinuserdata = new SimpleXMLElement($authlib->getDetailsByToken($token)); if (strlen($loggedinuserdata->error) > 1) { setcookie('uneeoscetoken', "", -3600); header("Location: {$CFG->wwwroot}{$CFG->basedir}login.php"); exit; } } else {
include '../../backend/lib/EnumLib.php'; include '../../backend/lib/Mobile_Detect.php'; require_once '../../backend/config.inc.php'; if (isset($_REQUEST['logout'])) { setcookie('uneeoscetoken', "", -3600); //do redirect in Java? print "<script>window.location.assign('./login.php');</script>"; //header("Location: ./login.php"); exit; } if (isset($_COOKIE['uneeoscetoken'])) { $token = $_COOKIE['uneeoscetoken']; $authlib = new authlib(); $authresult = ''; $stringlib = new StringLib(); $enumlib = new EnumLib(); $loggedinuserdata = new SimpleXMLElement($authlib->getDetailsByToken($token)); if (strlen($loggedinuserdata->error) > 1) { // print_r($loggedinuserdata); setcookie('uneeoscetoken', "", -3600); header("Location: ./login.php"); exit; } } else { header("Location: ./login.php"); exit; } $mobiledetect = new Mobile_Detect(); $CFG->site_root = realpath(dirname(__FILE__)); $headerStr = "<div class='header-wrapper' style=''>\n <div style='position:absolute; left:10px; top:10px'><a href='javascript:window.location.assign(\"{$CFG->wwwroot}{$CFG->basedir}index.php?logout\");' >Log Out</a></div>"; if ($CFG->wwwroot == "https://srm-itd01/") {
<!DOCTYPE html> <!-- To change this license header, choose License Headers in Project Properties. To change this template file, choose Tools | Templates and open the template in the editor. --> <?php include '../../backend/lib/authlib.php'; include '../../backend/lib/StringLib.php'; include '../../backend/lib/EnumLib.php'; include '../../backend/lib/ReportsLib.php'; require_once '../../backend/config.inc.php'; $enumlib = new EnumLib(); $authlib = new authlib(); $stringlib = new StringLib(); $reportlib = new ReportsLib(); if (isset($_REQUEST['logout'])) { setcookie('uneeoscetoken', "", -3600); //do redirect in Java? print "<script>window.location.assign('{$CFG->wwwroot}{$CFG->basedir}login.php');</script>"; exit; } if (isset($_COOKIE['uneeoscetoken'])) { $token = $_COOKIE['uneeoscetoken']; $authresult = ''; $stringlib = new StringLib(); $loggedinuserdata = new SimpleXMLElement($authlib->getDetailsByToken($token)); if (strlen($loggedinuserdata->error) > 1) { setcookie('uneeoscetoken', "", -3600); header("Location: {$CFG->wwwroot}{$CFG->basedir}login.php"); exit;
// check token $token = $_COOKIE['uneeoscetoken']; $formid = $_REQUEST['id']; $authlib = new authlib(); $authresult = ''; // checking token $loggedinuserdata = new SimpleXMLElement($authlib->getDetailsByToken($token)); if (strlen($loggedinuserdata->error) > 1) { // print_r($loggedinuserdata); //$headerStr = $loggedinuserdata->name; header("Location: ../index.php"); exit; } // getting form definition $titleStr = ''; $enumlib = new EnumLib(); $formdef = simplexml_load_string($enumlib->getExamInstanceQuestionsByID($formid)); $titleStr = $formdef->overview->data->instance->name; $scaleXML = simplexml_load_string($enumlib->getCriteriaScaleItems($formdef->overview->data->instance->scale_id)); $formtable = "<table style='width:100%' id='assessment_form_table'><tr style='background-color:#F3F3F3;'><th style='width:20%'>Assessment item</th><th colspan='{$scaleXML->count()}' style='width:40%'>Quality of Performance</th><th>Comments</th></tr>"; $count = 1; $i = 0; $questionArr = "["; foreach ($formdef->questiondata->question as $question) { switch ($question->type) { case '0': $formtable .= "<tr id='qrow_{$question->id}' style='background-color:rgba(255, 200, 200, 1)'><td><span >{$count}) {$question->text}</span></td>"; $i = 0; foreach ($scaleXML->item as $item) { $formtable .= "<td><input type='radio' name='choice_id_{$question->id}' id='choice_id_{$question->id}_{$i}' value='{$item->value}' data-iconpos='left' data-theme='e' needs_comment='{$item->needs_comment}' onclick='markQuestion({$question->id})'/><label for='choice_id_{$question->id}_{$i}'>{$item->short_description}</label></td>"; $i++;
$mobiledetect = new Mobile_Detect(); $CFG->site_root = realpath(dirname(__FILE__)); $headerStr = "<div class='header-wrapper' style=''>\n <div style='position:absolute; left:10px; top:10px'><a href='javascript:window.location.assign(\"{$CFG->wwwroot}{$CFG->basedir}index.php?logout\");' >Log Out</a></div>"; if ($CFG->wwwroot == "https://srm-itd01/") { $headerStr .= "DEV: {$CFG->sysname} " . ($CFG->istrainingsite ? ' (TRAINING)' : '') . " </span><br/>"; } else { $headerStr .= "PROD: {$CFG->sysname} " . ($CFG->istrainingsite ? ' (TRAINING)' : '') . "</span><br/>"; } $headerStr .= " <span id='user_feedback' style='width: 80%'>"; $headerStr .= $loggedinuserdata->name . "</span></div>"; // list users here // generate the student table and action buttons $from = isset($_REQUEST['from']) ? $_REQUEST['from'] : 0; $increment = 10; $searchstr = isset($_REQUEST['searchstr']) ? $_REQUEST['searchstr'] : null; $enumlib = new EnumLib(); $userdata = simplexml_load_string($enumlib->getStudents($increment, $from, $searchstr)); $listTableStr = "<table><tr><th>{$stringlib->get_string('participant_num')}</th><th>{$stringlib->get_string('participant_fname')}</th><th>{$stringlib->get_string('participant_lname')}</th><th>{$stringlib->get_string('participant_photo')}</th><th>Delete</th></tr>"; foreach ($userdata->student as $student) { $listTableStr .= "<tr><td><a href='#' onclick='edit_student({$student->id});'>{$student->studentnum}</a></td><td>{$student->fname}</td><td>{$student->lname}</td><td><img src='{$CFG->serviceURL}?action=showstudentimage&studentid={$student->id}&getbig=false&token={$token}'></td>"; $listTableStr .= "<td><input type='image' src='{$CFG->wwwroot}{$CFG->basedir}/icons/gtk-cancel.png' BORDER='0' style='vertical-align: text-bottom;' onclick='delete_student({$student->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>'; $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 > $userdata->count ? 'disabled="disabled"' : '') . '>Next ' . $increment . '</button>'; $buttonStr .= '<button id="last" style="float: left" ' . ($from + $increment > $userdata->count ? 'disabled="disabled"' : '') . ' onclick="goLast()">Last</button><br/></div>'; $buttonStr .= "<div>{$stringlib->get_string('participants_count')}:{$userdata->count}</div>"; // $menuStr = '<div style="display:table; width:100%"><div style="display:table-row; width:100%">'; $menuStr = "";
public function findUnusedStudentsForFormAsExcel($form_ID) { // get the data $enumlib = new EnumLib(); $dataXML = simplexml_load_string($enumlib->findStudentsForForm($form_ID, "")); // make a new Excel sheet $phpexcelObj = new PHPExcel(); $phpexcelObj->createSheet(); // put some headings in $phpexcelObj->getActiveSheet()->setCellValue('A1', "Student Number"); $phpexcelObj->getActiveSheet()->getStyle('A1')->getFont()->setBold(true); $phpexcelObj->getActiveSheet()->setCellValue('B1', "Student name"); $phpexcelObj->getActiveSheet()->getStyle('B1')->getFont()->setBold(true); // format a bit $phpexcelObj->getActiveSheet()->getColumnDimension('B')->setAutoSize(true); $phpexcelObj->getActiveSheet()->getColumnDimension('C')->setAutoSize(true); $phpexcelObj->getActiveSheet()->getColumnDimension('D')->setAutoSize(true); $phpexcelObj->getActiveSheet()->getColumnDimension('E')->setAutoSize(true); $phpexcelObj->getActiveSheet()->getColumnDimension('F')->setAutoSize(true); $phpexcelObj->getActiveSheet()->getColumnDimension('G')->setAutoSize(true); $phpexcelObj->getActiveSheet()->getColumnDimension('H')->setAutoSize(true); $phpexcelObj->getActiveSheet()->getColumnDimension('I')->setAutoSize(true); for ($i = 0; $i < count($dataXML->student); $i++) { $phpexcelObj->getActiveSheet()->setCellValue('A' . ($i + 2), $dataXML->student[$i]->studentnum); $phpexcelObj->getActiveSheet()->setCellValue('B' . ($i + 2), $dataXML->student[$i]->fname . ' ' . $dataXML->student[$i]->lname); } return $phpexcelObj; }
include '../../../backend/lib/EnumLib.php'; include '../../../backend/lib/Mobile_Detect.php'; require_once '../../../backend/config.inc.php'; if (isset($_REQUEST['logout'])) { setcookie('uneeoscetoken', "", -3600); //do redirect in Java? print "<script>window.location.assign('./login.php');</script>"; //header("Location: ./login.php"); exit; } if (isset($_COOKIE['uneeoscetoken'])) { $token = $_COOKIE['uneeoscetoken']; $authlib = new authlib(); $authresult = ''; $stringlib = new StringLib(); $enumlib = new EnumLib(); $loggedinuserdata = new SimpleXMLElement($authlib->getDetailsByToken($token)); if (strlen($loggedinuserdata->error) > 1) { // print_r($loggedinuserdata); setcookie('uneeoscetoken', "", -3600); header("Location: ./login.php"); exit; } } else { header("Location: ./login.php"); exit; } $mobiledetect = new Mobile_Detect(); $CFG->site_root = realpath(dirname(__FILE__)); $headerStr = "<div class='header-wrapper' style=''>\n <div style='position:absolute; left:10px; top:10px'><a href='javascript:window.location.assign(\"{$CFG->wwwroot}{$CFG->basedir}index.php?logout\");' >Log Out</a></div>"; if ($CFG->wwwroot == "https://srm-itd01/") {
$overview = simplexml_load_string($enumlib->getExamInstanceOverviewByID($_REQUEST['exam_ID'])); $reportslib = new ReportsLib(); $phpexcelObj = $reportslib->getSummaryReportAsExcel($_REQUEST['exam_ID']); header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'); header('Content-Disposition: attachment;filename="OSCE Summary for ' . $overview->instance->name . '.xlsx"'); header('Cache-Control: max-age=0'); $objWriter = new PHPExcel_Writer_Excel2007($phpexcelObj); $objWriter->save('php://output'); break; case 'getreportforallformsasexcel': include 'lib/EnumLib.php'; include 'lib/PHPExcel.php'; include 'lib/ReportsLib.php'; $reportslib = new ReportsLib(); // print('yo'); $enumlib = new EnumLib(); $overview = simplexml_load_string($enumlib->getExamInstanceOverviewByID($_REQUEST['exam_ID'])); $phpexcelObj = $reportslib->getFullReportAsExcel($_REQUEST['exam_ID']); header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'); header('Content-Disposition: attachment;filename="OSCE Analysis report for ' . $overview->instance->name . '.xlsx"'); header('Cache-Control: max-age=0'); $objWriter = new PHPExcel_Writer_Excel2007($phpexcelObj); $objWriter->save('php://output'); break; case 'getallreportsforsessionaspdf': include 'lib/EnumLib.php'; include 'lib/mpdf60/mpdf.php'; include 'lib/ReportsLib.php'; include 'lib/StringLib.php'; $reportslib = new ReportsLib(); $reportslib->getAllReportsForStudentsAsPDF($_REQUEST['exam_ID']);
/** * DEPRECATED- this seemed like a good idea at the time, but we're now doing it using CSV lists * Associates students with an exam instance ID by cohort * @global type $CFG * @param type $id * @param type $studentID The ID of the student to associate * @return XML-formatted string containing details of the student, or an error if the insert query fails */ public function associateStudentsWithInstanceByCohort($id, $cohortID) { global $CFG; $conn = mysqli_connect($CFG->db, $CFG->dbuser, $CFG->dbuserpass, $CFG->schema) or die('<data><error>failed connecting to database</error><detail>' . mysqli_error($conn) . '</detail></data>'); // get all students belonging to a cohort $query = "SELECT ID FROM students WHERE cohort = {$cohortID};"; $result = mysqli_query($conn, $query) or die('<data><error>lookup query failed</error><detail>' . mysqli_error($conn) . $query . '</detail></data>'); while ($row = mysqli_fetch_array($result)) { // check to see we're not doubling up $checkQuery = "SELECT * FROM student_exam_instance_link WHERE students_ID = {$row['ID']} AND exam_instances_ID = {$id}"; $checkresult = mysqli_query($conn, $checkQuery) or die('<data><error>check query failed</error><detail>' . mysqli_error($conn) . $checkQuery . '</detail></data>'); // print("result count:".mysqli_num_rows($checkresult)); if (mysqli_num_rows($checkresult) == 0) { // print('inserting...'); $query = "INSERT INTO {$CFG->schema}.student_exam_instance_link (exam_instances_ID, students_ID) \n VALUES({$id}, {$row['ID']});"; $result2 = mysqli_query($conn, $query) or die('<data><error>insert query failed</error><detail>' . mysqli_error($conn) . $query . '</detail></data>'); } } if (mysqli_insert_id($conn) > 0) { // return all just added $enumlib = new EnumLib(); return $enumlib->getStudentsByCohortIDAssociatedWithInstance($id, $cohortID); } else { return '<data><error>associateStudentsWithInstanceByCohort operation failed</error><detail>' . mysqli_error($conn) . '</detail></data>'; } // return "<data><id>$returnStr</id></data>"; }
/** * Sends an email to all students assessed in a session, containing a PDF of their assessment results (but not global comments or overall assessment) * @global type $CFG * @param type $sessionID * @param type $includeComments * @return string an XML-formatted string containing the success and failure count of the operation */ public function sendMail($sessionID, $showOverallResult = false) { // getExamEmailStemByID global $CFG; $reportsLib = new ReportsLib(); $stringlib = new StringLib(); $enumlib = new EnumLib(); $failcount = 0; $successcount = 0; $i = 0; $length = 0; //$conn = mysqli_connect($CFG->db, $CFG->dbuser, $CFG->dbuserpass, $CFG->schema) or die('<data><error>failed connecting to database</error><detail>' . mysqli_error($conn) . '</detail></data>'); try { $conn = new PDO("mysql:host={$CFG->db};dbname={$CFG->schema}", $CFG->dbuser, $CFG->dbuserpass); } catch (PDOException $e) { die('<data><error>failed connecting to database</error><detail>' . $e->getMessage() . '</detail></data>'); } // get count $countquery = "SELECT count(*) as count FROM student_exam_sessions a WHERE a.form_ID = :sessionID"; $stmt = $conn->prepare($countquery); $stmt->bindValue(':sessionID', $sessionID, PDO::PARAM_INT); $stmt->execute() or die('<data><error>sendMail count query failed</error><detail>' . $stmt->errorInfo() . '</detail></data>'); while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) { $linecount = $row['count']; } $stmt->closeCursor(); $query = "SELECT a.ID, a.student_id, (SELECT email from students WHERE ID = a.student_id) as email, (SELECT CONCAT(fname, ' ', lname) as studentname from students WHERE ID = a.student_id) as studentname FROM student_exam_sessions a WHERE a.form_ID = :sessionID"; $stmt = $conn->prepare($query); $stmt->bindValue(':sessionID', $sessionID, PDO::PARAM_INT); //$result = mysqli_query($conn, $query) or die('<data><error>select query failed</error><detail>' . mysqli_error($conn) . $query . '</detail></data>'); $stmt->execute() or die('<data><error>sendMail query failed</error><detail>' . $stmt->errorCode() . '</detail></data>'); while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) { $stemXML = simplexml_load_string($enumlib->getExamEmailStemByID($sessionID)); $mail = new PHPMailer(); $mail->SetFrom("*****@*****.**", "eOSCE System"); $mail->Body = "Dear {$row['studentname']}<br/>" . $stemXML->text; $mail->IsHTML(true); $mail->Subject = 'OSCE Feedback'; if ($CFG->sendemailtoonlyoneperson) { $to = $CFG->sendemailtoonlyonepersonrecipient; } else { $to = $row['email']; } ////$row['email']; $mail->AddAddress($to); //ob_start(); $pdf = $reportsLib->getReportForStudentSessionAsPDFForEmail($row['ID'], $showOverallResult); //$body = ob_get_contents(); // the pdf data. //ob_end_clean(); $mail->AddStringAttachment($pdf, "report.pdf"); if (!$mail->Send()) { $this->doLog($sessionID, $row['student_id'], $mail->ErrorInfo); $failcount++; //echo "Mailer Error: " . $mail->ErrorInfo; } else { $this->doLog($sessionID, $row['student_id'], 'true'); $successcount++; } // set a progress variable as event // ob_start(); $i++; echo round($i / $linecount * 100) . "%,"; ob_flush(); flush(); //ob_end_clean(); } $enumlib = new EnumLib(); $logresults = $enumlib->getFeedbackSummary($sessionID); return "<data><status>done</status><logresults><successcount>{$successcount}</successcount><failcount>{$failcount}</failcount><totalcount>" . ($failcount + $successcount) . "</totalcount></logresults></data>"; }
if ($authlib->user_has_capability($loggedinuserdata->userID, $authlib::roles_print_word_exam)) { $listTableStr .= "<td><input type='image' src='{$CFG->wwwroot}{$CFG->basedir}/icons/Gnome-Printer-32.png' BORDER='0' style='vertical-align: text-bottom;' onclick='makeOutputChoice({$instance->id}); return false;'/></td>"; } else { $listTableStr .= "<td><input type='image' src='{$CFG->wwwroot}{$CFG->basedir}/icons/Gnome-Printer-32.png' BORDER='0' style='vertical-align: text-bottom;' onclick='window.open(\"{$CFG->serviceURL}?action=getprintableassessmentformaspdf&exam_ID={$instance->id}&token={$token}\",\"_blank\"); return false;'/></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>'; $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 > $examdata->count ? 'disabled="disabled"' : '') . '>Next ' . $increment . '</button>'; $buttonStr .= '<button id="last" style="float: left" ' . ($from + $increment > $examdata->count ? 'disabled="disabled"' : '') . ' onclick="goLast()">Last</button><br/></div>'; $buttonStr .= "<div> {$stringlib->get_string('osce_sessions_count')}: {$examdata->count}</div>"; $enumLib = new EnumLib(); $unitsXML = simplexml_load_string($enumLib->getUnitsLookup()); $unitsStr = ''; foreach ($unitsXML->option as $value) { $unitsStr .= "<option value='{$value->ID}'>{$value->description}</option>"; } $usersXML = simplexml_load_string($enumLib->getUsers('')); $usersStr = ''; foreach ($usersXML->user as $value) { $usersStr .= "<option value='{$value->id}'>{$value->name}({$value->username})</option>"; } $criteriaScalesXML = simplexml_load_string($enumLib->getCriteriaTypesLookup()); $scalesStr = ""; foreach ($criteriaScalesXML->item as $value) { $scalesStr .= "<option value='{$value->id}'>{$value->description}</option>"; }
$examActionStr .= "<br/><button onclick='startApp()' class='actionbut'>Start UNE eOSCE app</button><p/>"; $examActionStr .= "Don't have the app?<br/><a href='https://geo.itunes.apple.com/au/app/une-eosce/id930335514?mt=8&uo=6' target='itunes_store' style='display:inline-block;overflow:hidden;background:url(http://linkmaker.itunes.apple.com/images/badges/en-us/badge_appstore-lrg.png) no-repeat;width:165px;height:40px;@media only screen{background-image:url(http://linkmaker.itunes.apple.com/images/badges/en-us/badge_appstore-lrg.svg);}'></a>"; } else { $enumlib = new EnumLib(); $availableExams = simplexml_load_string($enumlib->getExamsForAssessor($loggedinuserdata->userID)); if ($availableExams->instance->count() > 0) { $examActionStr .= "<h3>{$stringlib->get_string('assessor_available_examinations')}</h3>"; foreach ($availableExams->instance as $instance) { $examActionStr .= "<button onclick='window.location=\"app/?id={$instance->id}\"' class='actionbut'>{$instance->name}</button><p/>"; } } } } // show an overview of running assessments if permitted if ($authlib->user_has_capability($loggedinuserdata->userID, $authlib::roles_view_assessments)) { $enumlib = new EnumLib(); $availableExams = simplexml_load_string($enumlib->getActiveExamInstances()); if ($availableExams->instance->count() > 0) { $examActionStr .= "<h3>{$stringlib->get_string('running_examinations')}</h3>"; foreach ($availableExams->instance as $instance) { $examActionStr .= "<table id='active_sessions_table'></table>"; } } else { $examActionStr .= "<p/>No examinations running"; } } $menuStr = ""; $adminStr = ""; // build a menu if ($authlib->user_has_capability($loggedinuserdata->userID, $authlib::roles_view_assessments) || $authlib->user_has_capability($loggedinuserdata->userID, $authlib::roles_view_reports)) { $menuStr .= "<li class='showing'><label class='tree-toggle nav-header'>Examination Management</label><ul class='nav nav-list tree'>";
$questiondata = simplexml_load_string($enumlib->getQuestionsForSession($_REQUEST['id'])); // is this locked? $locked = strval($instanceData->instance[0]->finalised) == 'true'; // exam active? $active = strval($instanceData->instance[0]->active) == 'true'; // is it in practice mode? $practicing = strval($instanceData->instance[0]->practicing) == 'true'; // is the currently logged on user an admin or the owner? $isowner = strval($loggedinuserdata->userID) == strval($instanceData->instance[0]->owner_id) || $authlib->user_has_capability($loggedinuserdata->userID, $authlib::roles_finalise_other_assessment); $listTableStr = "<table id='questionstbl'><thead><tr><th style='width:50px;'>Reorder</th>\n <th>Edit</th>\n <th>{$stringlib->get_string('assessment_item_list_type')}<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('item_type_help_string')}\"); return false;'/></th><th>{$stringlib->get_string('assessment_item_list_text')}</th><th>{$stringlib->get_string('assessment_item_list_remove')}</th></tr></thead><tbody>"; foreach ($questiondata->question as $question) { $listTableStr .= "<tr class='sortablerow' entryid='{$question->id}'><td class='draghandle'><img src='{$CFG->wwwroot}{$CFG->basedir}/icons/object-flip-vertical.png'/></td>\n <td class='editimg'>\n <input type='image' src='{$CFG->wwwroot}{$CFG->basedir}/icons/gtk-edit.png' BORDER='0' style='vertical-align: middle; display:table-cell' onclick='edit_question_popup(\"{$question->id}\"); return false;'/></td>\n <td>" . ($question->type == '1' ? 'Yes' : 'No') . "</td>\n <td>{$question->text}</td>\n \n "; $listTableStr .= "<td class='deletehandle'><input type='image' src='{$CFG->wwwroot}{$CFG->basedir}/icons/gtk-cancel.png' BORDER='0' style='vertical-align: text-bottom;' onclick='delete_question({$question->id}); return false;'/></td></tr>"; } $listTableStr .= "</tbody></table>"; $enumLib = new EnumLib(); $unitsXML = simplexml_load_string($enumLib->getUnitsLookup()); $unitsStr = ''; foreach ($unitsXML->option as $value) { $unitsStr .= "<option value='{$value->ID}'>{$value->description}</option>"; } $usersXML = simplexml_load_string($enumLib->getUsers('')); $usersStr = ''; foreach ($usersXML->user as $value) { $usersStr .= "<option value='{$value->id}'>{$value->name}({$value->username})</option>"; } $criteriaScalesXML = simplexml_load_string($enumLib->getCriteriaTypesLookup()); $scalesStr = ""; foreach ($criteriaScalesXML->item as $value) { $scalesStr .= "<option value='{$value->id}'>{$value->description}</option>"; }