* * @author Organisation: Queen's University * @author Unit: School of Medicine * @author Developer: Matt Simpson <*****@*****.**> * @copyright Copyright 2010 Queen's University. All Rights Reserved. * */ if (!defined("PARENT_INCLUDED") || !defined("IN_PUBLIC_QUIZZES")) { exit; } elseif (!isset($_SESSION["isAuthorized"]) || !$_SESSION["isAuthorized"]) { header("Location: " . ENTRADA_URL); exit; } if ($RECORD_ID) { if ($QUIZ_TYPE == "event") { $quiz = Models_Quiz_Attached_Event::fetchRowByID($RECORD_ID); } else { $quiz = Models_Quiz_Attached_CommunityPage::fetchRowByID($RECORD_ID); } $quiz_record = $quiz->toArray(); if ($quiz_record) { if ($QUIZ_TYPE == "event") { $query = "\tSELECT e.*, c.`organisation_id`\n\t\t\t\t\t\tFROM `events` e\n\t\t\t\t\t\tJOIN `courses` c\n\t\t\t\t\t\tON e.`course_id` = c.`course_id`\n\t\t\t\t\t\tWHERE e.`event_id` = " . $db->qstr($quiz_record["content_id"]); $result = $db->GetRow($query); $BREADCRUMB[] = array("url" => ENTRADA_URL . "/events?id=" . $quiz_record["content_id"], "title" => limit_chars($quiz_record["content_title"], 32)); } else { $BREADCRUMB[] = array("url" => ENTRADA_URL . "/community" . $quiz_record["community_url"] . ":" . $quiz_record["page_url"], "title" => limit_chars($quiz_record["content_title"], 32)); } $BREADCRUMB[] = array("url" => ENTRADA_URL . "/" . $MODULE . "?section=attempt" . (isset($QUIZ_TYPE) && $QUIZ_TYPE == "community_page" ? "&community=true" : "") . "&id=" . $RECORD_ID, "title" => limit_chars($quiz_record["quiz_title"], 32)); if ($result && $ENTRADA_ACL->amIAllowed(new EventResource($quiz_record["content_id"], $result['course_id'], $result['organisation_id']), 'read')) { /**
<?php } else { ?> <a href="<?php echo ENTRADA_URL; ?> /admin/<?php echo $MODULE; ?> ?section=attach&id=<?php echo $RECORD_ID; ?> " class="btn btn-success pull-right"><i class="icon-plus-sign icon-white"></i> Attach To Learning Event</a> <div class="clear" style="margin-bottom: 15px"></div> <?php $event_attached_quizzes = Models_Quiz_Attached_Event::fetchAllByQuizID($RECORD_ID); if ($event_attached_quizzes) { ?> <table class="tableList" cellspacing="0" summary="List of Learning Events"> <colgroup> <col class="modified" /> <col class="date" /> <col class="title" /> <col class="title" /> <col class="completed" /> </colgroup> <thead> <tr> <td class="modified"> </td> <td class="date sortedDESC" style="border-left: 1px solid #999999"><div class="noLink">Date & Time</div></td> <td class="title">Event Title</td>
$PROCESSED["event_ids"][] = $tmp_input; } } } } } } $quiz_types_record = array(); $quiz_types = Models_Quiz_QuizType::fetchAllRecords(); if ($quiz_types) { foreach ($quiz_types as $quiz_type) { $quiz_types_record[$quiz_type->getQuizTypeID()] = array("quiztype_title" => $quiz_type->getQuizTypeTitle(), "quiztype_description" => $quiz_type->getQuizTypeDescription(), "quiztype_order" => $quiz_type->getQuizTypeOrder()); } } $existing_event_relationship = array(); $attached_events = Models_Quiz_Attached_Event::fetchAllByQuizID($RECORD_ID); if ($attached_events) { foreach ($attached_events as $attached_event) { $existing_event_relationship[] = $attached_event->getEventID(); } } $default_event_start = 0; $default_event_finish = 0; $selected_learning_events = array(); if (count($PROCESSED["event_ids"]) > 0) { $query = "SELECT * FROM `events` WHERE `event_id` IN (" . implode(", ", $PROCESSED["event_ids"]) . ")"; $results = $db->Execute($query); if ($results) { foreach ($results as $result) { $selected_learning_events[$result["event_id"]] = array("event_title" => $result["event_title"], "event_start" => $result["event_start"], "event_finish" => $result["event_finish"], "event_duration" => $result["event_duration"]); if (!$default_event_start || $result["event_start"] < $default_event_start) {