Exemplo n.º 1
0
function delete(QuestionBank $obj)
{
    $output = array('code' => '000', 'message' => 'Something gone wrong. Please try again', 'type' => 'danger');
    if ($obj->delete($_REQUEST['id'])) {
        $output = array('code' => '200', 'message' => 'Exam deleted successfully.', 'type' => 'success');
    }
    return $output;
}
Exemplo n.º 2
0
    $types_used = module_utils::paper_types($module, false, $mysqli);
}
foreach ($types_used as $type => $no_papers) {
    $url = '../paper/type.php?module=' . $module . '&type=' . $type;
    echo "<div class=\"f2\"><div class=\"f_icon\"><a href=\"{$url}\"><img src=\"../artwork/yellow_folder.png\" alt=\"Folder\" /></a></div><div class=\"f_details\"><a href=\"{$url}\">" . Paper_utils::type_to_name($type, $string) . "</a><br /><span class=\"grey\">" . number_format($no_papers) . " " . strtolower($string['papers']) . "</span></div></div>\n";
}
echo "<br clear=\"left\">\n";
echo "<div class=\"f2\"><div class=\"f_icon\"><a href=\"../paper/search.php?module={$module}\"><img src=\"../artwork/search_48.png\" alt=\"Folder\" /></a></div><div class=\"f_details\"><a href=\"../paper/search.php?module={$module}\">" . $string['search'] . "</a><br /><span class=\"grey\">" . $string['forpapers'] . "</span></div></div>\n";
if ($module != 0) {
    // Don't want new papers created from the Unassigned folder.
    echo "<div class=\"f2\"><div class=\"f_icon\"><a href=\"\" onclick=\"newPaper({$module}); return false;\"><img src=\"../artwork/new_paper_48.png\" alt=\"" . $string['newpaper'] . "\" /></a></div><div class=\"f_details\"><a href=\"\" onclick=\"newPaper({$module}); return false;\">" . $string['newpaper'] . "</a></div></div>\n";
}
// Question bank section
echo "<br clear=\"left\">\n";
echo "<div class=\"subsect_table\" style=\"clear:both\"><div class=\"subsect_title\"><nobr>" . $string['questionbank'] . "</nobr></div><div class=\"subsect_hr\"><hr noshade=\"noshade\" /></div></div>\n";
$qbank = new QuestionBank($module, $module_details['moduleid'], $string, $notice, $mysqli);
$qbank->get_categories('all');
$stats = $qbank->get_stats('all');
$question_no = 0;
foreach ($stats as $stat_name => $stat_no) {
    $question_no += $stat_no;
}
echo "<div class=\"f2\"><div class=\"f_icon\"><a href=\"../question/list.php?type=all&module={$module}\"><img src=\"../artwork/yellow_folder.png\" alt=\"Folder\" /></a></div><div class=\"f_details\"><a href=\"../question/list.php?type=all&module={$module}\">" . $string['allquestions'] . "</a><br /><span class=\"grey\">" . number_format($question_no) . " " . strtolower($string['questions']) . "</span></div></div>\n";
$bank_types = array($string['bykeyword'] => '../question/bank.php?type=keyword&module=' . $module, $string['byquestiontype'] => '../question/bank.php?type=type&module=' . $module, $string['bystatus'] => '../question/bank.php?type=status&module=' . $module, $string['bybloom'] => '../question/bank.php?type=bloom&module=' . $module, $string['byperformance'] => '../question/bank.php?type=performance&module=' . $module);
if (strpos($module_details['checklist'], 'mapping') !== false) {
    $bank_types[$string['byobjective']] = '../question/bank.php?type=objective&module=' . $module;
}
foreach ($bank_types as $type_name => $url) {
    echo "<div class=\"f2\"><div class=\"f_icon\"><a href=\"{$url}\"><img src=\"../artwork/yellow_folder.png\" alt=\"Folder\" /></a></div><div class=\"f_details\"><a href=\"{$url}\">" . $type_name . "</a></div></div>\n";
}
echo "<br clear=\"left\">\n";
Exemplo n.º 3
0
					<div ng-show="type=='code'">Not Required</div>
					<div ng-show="type=='mcq'">
						<table class="table table-responsive table-striped">
							<tr ng-repeat="option in options">
								<td><input type="radio" class="form-control" name="ans" value="{{$index}}" ng-model="option.isAns"></td>
								<td>
									<div class="input-group">
										<input type="text" placeholder="Option {{$index+1}}" class="form-control" name="option" value="" ng-model="option.option">
										<span class="input-group-btn">
											<button class="btn btn-danger" type="button" ng-click="removeOption($index)"><span class="fa fa-times"></span></button>
										</span>
									</div>
								</td>
							</tr>
						</table>
						<button class="btn btn-info" type="button" ng-click="addOption()"><span class="fa fa-plus"></span>&nbsp;&nbsp; Add option</button>
					</div>
				</div>
			</div>
		</form>
	</div>
</div>
<div class = "q-<?php 
echo $id;
?>
-data hidden">
    <?php 
$obj = new QuestionBank();
echo json_encode($obj->getQList(array('question', 'type', 'id'), $id));
?>
</div>
Exemplo n.º 4
0
	<script>
	$(document).ready(function() {
		$("#lesson-menu").click(function() {
			$(".lesson-menu").toggle();
		});
	});
	</script>
</head>
<body>

<?php 
require_once "settings.php";
require_once "db_auth.php";
require_once "QuestionBank.php";
$qbank = new QuestionBank();
if (isset($_GET['reset'])) {
    $qbank->reset();
}
$qbank->fetchLessons();
$qbank->init();
?>

<div class="site-wrapper">

<header class="site-header">
	<div id="site-title"><?php 
echo SITE_TITLE;
?>
</div>
Exemplo n.º 5
0
* @version 1.0
* @copyright Copyright (c) 2014 The University of Nottingham
* @package
*/
require '../include/staff_auth.inc';
require '../include/errors.inc';
require_once '../classes/dateutils.class.php';
require_once '../classes/paperutils.class.php';
require_once '../classes/paperproperties.class.php';
require_once '../classes/mappingutils.class.php';
require_once '../include/mapping.inc';
require_once '../classes/questionbank.class.php';
$q_id = check_var('q_id', 'GET', true, false, true);
if (isset($_GET['type']) and $_GET['type'] == 'objective') {
    $module_code = module_utils::get_moduleid_from_id($_GET['module'], $mysqli);
    $qbank = new QuestionBank($_GET['module'], $module_code, $string, $notice, $mysqli);
    $map_outcomes = true;
} else {
    $map_outcomes = false;
}
if (!isset($_POST['submit'])) {
    ?>
<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <meta http-equiv="content-type" content="text/html;charset=<?php 
    echo $configObject->get('cfg_page_charset');
    ?>
" />
  
Exemplo n.º 6
0
 function delete($id)
 {
     $qb = new QuestionBank();
     return $qb->deleteQBByCourseId($id) && $this->db->deleteRow($this->table, "id='{$id}'");
 }
Exemplo n.º 7
0
    $module_details['active'] = 1;
} else {
    $module_details = module_utils::get_full_details_by_ID($module, $mysqli);
}
if ($module != 0 and strpos($module_details['checklist'], 'mapping') === false and $_GET['type'] == 'objective') {
    $msg = sprintf($string['furtherassistance'], $configObject->get('support_email'), $configObject->get('support_email'));
    $notice->display_notice_and_exit($mysqli, $string['pagenotfound'], $msg, $string['pagenotfound'], '../artwork/page_not_found.png', '#C00000', true, true);
}
if (!$module_details) {
    $msg = sprintf($string['furtherassistance'], $configObject->get('support_email'), $configObject->get('support_email'));
    $notice->display_notice_and_exit($mysqli, $string['pagenotfound'], $msg, $string['pagenotfound'], '../artwork/page_not_found.png', '#C00000', true, true);
} elseif ($module_details['active'] == 0) {
    $msg = sprintf($string['furtherassistance'], $configObject->get('support_email'), $configObject->get('support_email'));
    $notice->display_notice_and_exit($mysqli, $string['pagenotfound'], $msg, $string['pagenotfound'], '../artwork/page_not_found.png', '#C00000', true, true);
}
$qbank = new QuestionBank($module, $module_details['moduleid'], $string, $notice, $mysqli);
$_SESSION['nav_page'] = $_SERVER['SCRIPT_NAME'];
$_SESSION['nav_query'] = $_SERVER['QUERY_STRING'];
?>
<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <meta http-equiv="content-type" content="text/html;charset=<?php 
echo $configObject->get('cfg_page_charset');
?>
" />

  <title><?php 
echo $string['questionbank'] . ' ' . $configObject->get('cfg_install_type');
?>
Exemplo n.º 8
0
<?php

$obj = new QuestionBank();
$course = new Course();
$course_list = $course->getList(array('id', 'course_name'));
?>
<div class="container" ng-element-ready = "createTable()">
	<div class="row">
		<a href="manage-question" ng-hide="create" ng-click="create = true" class="btn btn-primary btn-lg fx-fade-up fx-dur-0">Create Question Bank</a>
		<a href="manage-question" ng-show="create" ng-click="create = false" class="btn btn-primary btn-lg fx-fade-up fx-dur-0">Back</a>
	</div>
	<div class="row">
		<div ng-hide="create">
			<table class="table table-bordered table-bordered" id="qb_table">
				<thead>
					<tr>
						<th>#</th><th>Name</th><th>Course</th><th></th>
					</tr>
				</thead>
				<tbody>
					<tr ng-repeat="qb in qbs">
		                <td>{{$index+1}}</td>
		                <td>{{qb.name}}</td>
		                <td>{{qb.course_name}}</td>
		                <td>
		                	<a href="add-question/{{qb.id}}" class="btn btn-primary" data-toggle="tooltip" title="Add questions"><span class="fa fa-plus"></span></a>
		                	<a href="#" class="btn btn-info" data-toggle="tooltip" title="Edit exam info"><span class="fa fa-edit"></span></a>
		                	<a href="manage-question" class="btn btn-danger delete" data-toggle="tooltip" title="Delete Question Bank" ng-click="delete($event, qb.id)"><span class="fa fa-times"></span></a>
		                </td>
	            	</tr>
				</tbody>