How to use testMake method of variable class

Best Atoum code snippet using variable.testMake

test_make.php

Source:test_make.php Github

copy

Full Screen

1<?php2/* This file is part of testMaker.3testMaker is free software; you can redistribute it and/or modify4it under the terms of version 2 of the GNU General Public License as5published by the Free Software Foundation.6testMaker is distributed in the hope that it will be useful,7but WITHOUT ANY WARRANTY; without even the implied warranty of8MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the9GNU General Public License for more details.10You should have received a copy of the GNU General Public License11along with this program. If not, see <http://www.gnu.org/licenses/>. */12/**13 * Include the test wrapper class14 */15require_once(CORE.'types/Test.php');16require_once(CORE.'types/TestMake.php');17require_once('portal/FrontendPage.php');18/**19 * Test accomplishment20 *21 * Default action: {@link doShowTest()}22 *23 * @package Portal24 */25if(!defined("ANSWER_SKIPPED"))26define("ANSWER_SKIPPED", 98);27if(!defined("ANSWER_TIMEOUT"))28define("ANSWER_TIMEOUT", 99);29class TestMakePage extends FrontendPage30{31 public $defaultAction = 'show_test';32 private $testMake = NULL;33 private $templateDir;34 private $block = NULL;35 private $debugOutput = array();36 /**37 * Constructor: behaviour should be selfexplaining. In the future the constructor38 * should never be invoked directly.39 *40 * @param string Page name41 */42 function TestMakePage($pageName)43 {44 parent::Page($pageName);45 $this->testMake = new TestMake();46 $this->templateDir = ROOT."upload/item_templates/";47 }48 /**49 * Loads the test document frame template and initializes it50 *51 * Basically, this does the following:52 * <code>53 * $this->tpl->loadTemplateFile("TestFrame.html");54 * </code>55 */56 function loadDocumentFrame($cookieId, $checkSecurity = TRUE)57 {58 $this->tpl->loadTemplateFile("TestFrame.html");59 $this->tpl->setVariable("cookieId", $cookieId);60 61 if ($checkSecurity) {62 // if the user isn't logged in, display error page63 if ($this->block && !$this->block->isPublic()) $this->checkAllowed('invalid', true, NULL);64 }65 if ($this->actionName == "preview")66 $this->tpl->hideBlock('autotester');67 else68 $this->tpl->touchBlock('autotester');69 }70 /**71 * Starts test run:72 */73 function doStartTest()74 {75 $password = post("password", NULL);76 $tmpWorkingPath = get('test_path', get('test-path'));77 $testId = NULL;78 $subTestId = NULL;79 $workingPath = str_replace("-", "_", $tmpWorkingPath);80 if (!WorkingPath::verify($workingPath)) {81 $GLOBALS['MSG_HANDLER']->addMsg('pages.link_invalid', MSG_RESULT_NEG);82 redirectTo('test_listing');83 } else84 {85 $testId = WorkingPath::getTestId($workingPath);86 $subTestId = WorkingPath::getSubtestId($workingPath);87 }88 // check if a test with given id exists and user has permission for it89 if(!BlockList::checkTestId($testId, NULL)){ 90 if ($GLOBALS["BLOCK_LIST"]->existsBlock($testId) && !$_SESSION['userId']) 91 $_SESSION['direct_test'] = $tmpWorkingPath; //only if test at least exists and no user logged in92 93 redirectTo('test_listing');94 } 95 $test = new Test($testId);96 if($test->getShowSubtests() && $subTestId === false)97 {98 redirectTo('test_listing', array('action' => 'subtest_view', 'test_run' => -1, 'test_id' => $testId)); 99 }100 $tan = isset($_SESSION['tan']) ? $_SESSION['tan'] : NULL;101 switch (get('source')) {102 case 'portal':103 $accessType = 'portal';104 break;105 case 'preview':106 $accessType = 'preview';107 break;108 default:109 $accessType = 'direct';110 }111 $id = $this->testMake->startTest($accessType, $password, $subTestId, $tan, $testId, $workingPath);112 redirectTo("test_make", array("action" => "bounce_to_test", "id" => $id));113 }114 function doContinueTest()115 {116 $workingPath = get('test_path');117 $subTestId = WorkingPath::getSubtestId($workingPath);118 $testRunId = get('test_run', NULL);119 $id = $this->testMake->continueTest($subTestId, $testRunId);120 redirectTo("test_make", array("action" => "bounce_to_test", "id" => $id));121 }122 /**123 *124 */125 function doBounceToTest()126 {127 header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");128 header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");129 header("Cache-Control: no-store, no-cache, must-revalidate");130 header("Cache-Control: post-check=0, pre-check=0", false);131 header("Pragma: no-cache");132 $this->tpl->loadTemplateFile("Bouncer.html");133 if(isset($_SERVER['HTTP_USER_AGENT']) && strpos($_SERVER['HTTP_USER_AGENT'], "Opera") === false) $this->tpl->setVariable("show_message", "none");134 else $this->tpl->setVariable("show_message", "block");135 $this->tpl->setVariable("target_link", linkTo("test_make", array("id" => get("id"), "tan" => get("tan"), "resume_messages" => "true"), FALSE, TRUE));136 $this->tpl->show();137 }138 function doProcessAnswer()139 {140 $id = get('id', NULL);141 $itemIds = explode("_", post("item_id"));142 $blockId = post('block_id', NULL);143 $answers = post('answer', array());144 $timeout = post('timeout', false);145 $duration = post('duration', 0);146 if ($_SERVER["REQUEST_METHOD"] == "GET" || !$_POST ) {147 redirectTo("test_make", array("id" => $id, "resume_messages" => "true"));148 return;149 }150 if (!isset($_POST['block_id'])) {151 $GLOBALS["MSG_HANDLER"]->addMsg('pages.test.no_block_id', MSG_RESULT_NEG);152 redirectTo("test_make", array("id" => $id, "resume_messages" => "true"));153 return;154 }155 if (isset($_POST['send_feedback_email']))156 {157 $this->sendFeedbackEmail();158 } else159 {160 $this->testMake->processAnswer($answers, $blockId, $duration, $id, $itemIds, $timeout);161 redirectTo("test_make", array("action" => "bounce_to_test", "id" => $id));162 }163 }164 function doSkipBlock()165 {166 $id = get("id");167 $this->testMake->initRunningTest($id);168 $testRun = $this->testMake->getTestRun();169 $testId = $testRun->getTestId();170 $blockId = post("block_id");171 $this->testSession["skip_block"] = array(172 "do_skip" => !post("cancel"),173 "block_id" => post("block_id"),174 "subtest_id" => $_SESSION['RUNNING_TESTS'][$id]['displayingBlockId'],175 );176 177 // let the test run know that the block was skipped178 $block = $GLOBALS['BLOCK_LIST']->getBlockById($blockId);179 180 //get all Ids of the testruns in that the user have alredy answered this block 181 if ($this->testSession["skip_block"]["do_skip"]) {182 $TestRundIds = $testRun->testRunList->getSourceRunsForSkipping($GLOBALS["PORTAL"]->getUserId(), $block, $testId);183 //get the latest test run id184 sort($TestRundIds, SORT_NUMERIC);185 $LastTestRunId = end($TestRundIds);186 }187 require_once(CORE."types/TestSelector.php");188 $selector = new TestSelector($block);189 $numberItemsInBlock = $selector->countItems($blockId);190 if ($this->testSession["skip_block"]["do_skip"])191 {192 $testRun->setStep($testRun->getStep() + $numberItemsInBlock);193 $testRun->setTestRunBlockStep($testRun->getTestRunBlockStep() + $numberItemsInBlock);194 }195 $_SESSION['RUNNING_TESTS'][$id]["skip_block"] = $this->testSession["skip_block"];196 $_SESSION['RUNNING_TESTS'][$id]["skipable_blocks"][] = $this->testSession["skip_block"]["block_id"];197 redirectTo("test_make", array("id" => $id));198 }199 /**200 * Display a item/feedback/info page in a test environment201 */202 function doShowTest()203 {204 205 $id = get("id");206 $this->testMake->initRunningTest($id);207 if($this->testMake->getTestRun() === NULL) 208 {209 $GLOBALS['MSG_HANDLER']->addMsg("pages.testmake.test_run_not_found", MSG_RESULT_NEG);210 redirectTo("test_listing");211 }212 else 213 {214 $time = time();215 $items = "notFound";216 while ($items == "notFound") {217 $items = $this->testMake->getTestRun()->getNextItems($id);218 if (time()-$time > 45)219 redirectTo("test_make", array("action" => "show_test", "id" => $id));220 }221 // save current item ids in the session (for doProcessAnswers)222 $_SESSION['current_items'] = array();223 if($items)224 {225 if(!@$items["special"]) // Don't save'em when block will be skipped226 {227 foreach($items as $item)228 {229 $_SESSION['current_items'][] = array("id" => $item->getId(), "type" => get_class($item));230 }231 }232 }233 }234 235 if (@$items["special"])236 {237 if ($items["type"] == "confirm_block_skip") 238 {239 $this->tpl->loadTemplateFile("TestMakeConfirmBlockSkip.html");240 $this->tpl->setVariable("id", $id);241 $this->tpl->setVariable("block_id", $items["block_id"]);242 $this->tpl->setVariable("block_title", $items["block_title"]);243 $this->tpl->setVariable("other_block_title", $items["other_test_title"]);244 $body = $this->tpl->get();245 $this->loadDocumentFrame(NULL, FALSE);246 $this->tpl->setVariable("style", $this->getStyle($this->testMake->getTestRun()->getTestId(), $this->testMake->getTestRun()->getTestPath()));247 $this->tpl->setVariable("body", $body);248 $this->tpl->show();249 }250 else251 {252 trigger_error("Unknown special type <b>".htmlentities($items["type"])."</b>", E_USER_ERROR);253 return;254 }255 }256 else257 {258 $redirect = $this->testMake->redirectOnFinish($items);259 $this->_createTestPage($items, $id, $redirect); // id als 4ter Parameter ermöglicht Vorschau-Navigation, ist aber noch buggy260 }261 }262 /**263 * Display a item page only for preview264 */265 function doPreview()266 {267 $working_path = get("working_path");268 269 $item_id = get("item_id");270 $ids = explode("_", trim($working_path, '_'));271 $blocks = array();272 $id = $ids[1];273 $this->id = $id;274 $blocks[] = $GLOBALS["BLOCK_LIST"]->getBlockById($id);275 276 //Set language to test language277 $_SESSION['languageOld'] = $_SESSION['language'];278 $_SESSION['language'] = $blocks[0]->getLanguage();279 280 for($i = 2; $i < count($ids); $i++)281 {282 $blocks[] = $blocks[count($blocks) - 1]->getChildById($ids[$i]);283 }284 $parent = end($blocks);285 $item = $parent->getTreeChildById($item_id);286 $redirect = array("item", array("working_path" => $working_path, "item_id" => $item_id, "reset_lang" => 1));287 $this->_createTestPage(array($item), $id, $redirect, $id);288 }289 function inflateTemplateName($file)290 {291 if (! isset($this->inflatedTemplateNames[$file]))292 {293 $class = preg_replace("/\\.[^\\.]*$/", "", $file);294 $variant = "";295 if (preg_match("/^([^_]+)_(.+)$/", $class, $match)) {296 $class = $match[1];297 $variant = $match[2];298 }299 $this->inflatedTemplateNames[$file] = array($file, $class, $variant);300 }301 return $this->inflatedTemplateNames[$file];302 }303 304 /**305 *Send an email with the feedback to the user306 */ 307 308 function sendFeedbackEmail()309 {310 $id = get("id");311 $this->testMake->initRunningTest($id);312 if (!defined("SYSTEM_MAIL"))313 {314 $GLOBALS['MSG_HANDLER']->addMsg("pages.testmake.no_system_mail_address", MSG_RESULT_NEG);315 redirectTo("test_make", array("action" => "bounce_to_test", "id" => $id));316 }317 if($this->testMake->getTestRun() === NULL) $items = NULL;318 // restore the current items from the session319 else320 {321 $items = array();322 foreach($_SESSION['current_items'] as $index => $itemData)323 {324 $type = $itemData['type'];325 if ($type != "FeedbackPage") require_once(ROOT . "upload/items/" . $type . ".php");326 $items[] = new $itemData['type']($itemData['id']);327 }328 }329 $email = "";330 $tan = isset($_SESSION['tan']) ? $_SESSION['tan'] : NULL;331 if($tan)332 {333 require_once(CORE.'types/TANCollection.php');334 $tanCollection = new TANCollection($this->testMake->getTestRun()->getTestId());335 $email = $tanCollection->getEmailByTestRun($this->testMake->getTestRun()->getId());336 } else337 {338 $userID = $_SESSION['userId'];339 require_once(CORE.'types/UserList.php');340 $userList = new UserList();341 $user = $userList->getUserById($userID);342 $email = $user->get('email');343 }344 // Compose and send email345 libLoad("email::Composer");346 libLoad("utilities::validator");347 if(!Validator::validateText($email, "email"))348 {349 $GLOBALS["MSG_HANDLER"]->addMsg('pages.testmake.invalid_feedback_email_adress', MSG_RESULT_NEG);350 redirectTo("test_make", array("id" => $id));351 }352 353 $mail = new EmailComposer();354 //create the feedback for the testrun355 require_once(CORE."types/FeedbackGenerator.php");356 $this->tpl->loadTemplateFile("FeedbackEmail.html");357 foreach ($items as $key => $item)358 {359 if (is_a($item, "FeedbackPage"))360 {361 // Get the relevant feedback paragraphs362 $feedback = new FeedbackGenerator($item->getParent(), $this->testMake->getTestRun());363 $feedback->setPage($item);364 $paragraphs = $feedback->getParagraphs();365 $imageCounter = 0;366 foreach ($paragraphs as $para) {367 // Handle feedback graphs368 $mixed = $feedback->expandText($para->getContents(), array(NULL, '_getOutput'), array('request_binary' => true));369 if(is_array($mixed))370 {371 foreach($mixed[1] as $image)372 {373 $contentID = $mail->addHtmlAttachmentFromMemory($image, "image/png", 'img'.$imageCounter.'.png');374 $text = preg_replace("/\[\[graph\]\]/", '<img src="cid:'.$contentID.'">', $mixed[0], 1);375 unset($contentID);376 }377 } else $text = $mixed;378 $this->tpl->setVariable("para", $text);379 $this->tpl->parse("paragraphs");380 } 381 }382 }383 $testId = $this->testMake->getTestRun()->getTestId();384 require_once(CORE.'types/Test.php');385 $test = new Test($testId);386 $title = $test->getTitle();387 $this->tpl->setVariable("title", $title);388 $this->tpl->setVariable("date", date("d.m.Y"));389 $this->tpl->setVariable("time", date("G:i"));390 391 // Add testMaker logo392 $contentID = $mail->addHtmlAttachment(PORTAL.'images/tm-logo-xs.png', 'image/png', 'logo.png');393 $this->tpl->setVariable("logo", "cid:$contentID");394 $mail->setSubject("testMaker Feedback ".date("d.m.Y"));395 $html = $this->tpl->get();396 $mail->setHTMLMessage($html);397 $mail->setFrom(SYSTEM_MAIL);398 $mail->addRecipient($email);399 $mail->sendMail();400 redirectTo("test_make", array("action" => "bounce_to_test", "id" => $id));401 }402 /**403 * Helper function, create test pages404 *405 * @param mixed Items to display406 * @param integer Test id407 * @param mixed Parameters for redirect link408 */409 function _createTestPage($items, $id, $redirect, $testId = NULL)410 {411 $body = "";412 $align = "";413 $this->testSession = &$_SESSION["RUNNING_TESTS"][$id];414 if (isset($_SESSION['RUNNING_TESTS'][$id]['displayingBlockId']))415 $displayingBlockId = $_SESSION['RUNNING_TESTS'][$id]['displayingBlockId'];416 // Get parent block417 $this->block = $items[0]->getParent();418 if ($itemblock = strtolower($this->block->getBlockType()) == 3)419 {420 $defaultSettings = array(421 'align' => $this->block->getDefaultTemplateAlign(),422 'cols' => $this->block->getDefaultTemplateCols(),423 );424 }425 // Get old Answers if exists426 $oldAnswers = array();427 $missingAnswers = array();428 if (isset($_SESSION['oldAnswers']))429 {430 $oldAnswers = $_SESSION['oldAnswers'];431 }432 if (isset($_SESSION['missingAnswers']))433 {434 $missingAnswers = $_SESSION['missingAnswers'];435 }436 $displayItems = '';437 $lastItem = "";438 $lastItemType = "";439 foreach ($items as $key => $item)440 {441 if (is_a($item, "InfoPage"))442 {443 $this->tpl->loadTemplateFile("InfoPage.html");444 $this->tpl->setVariable("info", $item->getContent());445 }446 elseif (is_a($item, "FeedbackPage"))447 {448 require_once(CORE."types/FeedbackGenerator.php");449 $feedback = new FeedbackGenerator($item->getParent(), $this->testMake->getTestRun());450 $feedback->setPage($item);451 $paragraphs = $feedback->getParagraphs();452 453 // Check for users email adress454 $email = "";455 $tan = isset($_SESSION['tan']) ? $_SESSION['tan'] : NULL;456 if($tan)457 {458 require_once(CORE.'types/TANCollection.php');459 $tanCollection = new TANCollection($this->testMake->getTestRun()->getTestId());460 $email = $tanCollection->getEmailByTestRun($this->testMake->getTestRun()->getId());461 } else462 {463 $userID = $_SESSION['userId'];464 if($userID)465 {466 require_once(CORE.'types/UserList.php');467 $userList = new UserList();468 $user = $userList->getUserById($userID);469 $email = $user->get('email');470 }471 }472 473 $this->tpl->loadTemplateFile("FeedbackPage.html");474 foreach ($paragraphs as $para) {475 $text = $para->getContents();476 //if no email exits, don't show the email butten in the testpage477 if ($email == "") 478 $text = str_replace('{feedback_mail:}', '', $text);479 $text = $feedback->expandText($text);480 $this->tpl->setVariable("para", $text);481 $this->tpl->parse("paragraphs");482 }483 $feedbackPages = $this->block->getTreeChildren();484 $lastPage = $feedbackPages[count($feedbackPages)-1];485 486 487 488 //if($email != "" && $this->block->getShowInSummary()) $this->tpl->touchBlock('send_feedback_email');489 $db = $GLOBALS['dao']->getConnection();490 $query = "SELECT form_filled FROM ".DB_PREFIX."tans WHERE access_key = ?";491 $result = $db->query($query, array($tan));492 $result = $result->fetchRow();493 if(($item->getId() == $lastPage->getId()) && ($this->block->isCertEnabled()))494 {495 $this->tpl->setVariable('test_run_id', $this->testMake->getTestRun()->getId());496 $this->tpl->setVariable('feedback_block_id', $this->block->getId());497 $this->tpl->touchBlock('certificate');498 }499 }500 elseif (is_a($item, "Item"))501 {502 if (!$key)503 {504 $this->tpl->loadTemplateFile("ItemPage.html");505 $this->tpl->touchBlock($testId ? "submit_preview" : "submit_live");506 $this->tpl->setGlobalVariable("max_time", $item->getMaxTime());507 $this->tpl->setGlobalVariable("min_time", $item->getMinTime());508 $align = $item->getTemplateAlign() ? $item->getTemplateAlign() : $defaultSettings['align'];509 510 if ($this->block->getIntroduction())511 {512 $intro_label = $this->block->getIntroLabel() == "" ? "Information" : $this->block->getIntroLabel();513 $this->tpl->setVariable('intro_label', $intro_label);514 $this->tpl->setVariable('introduction', $this->block->getIntroduction());515 516 // check if current block is the same as last one517 if (isset($_SESSION['lastUsedBlock']) && $_SESSION['lastUsedBlock'] == $this->block->getId() && $this->block->isIntroFirstOnly())518 {519 $hideIntro = true; // hide, if block is same as last one and firstonly is set520 } 521 else {522 $hideIntro = false;523 }524 525 if ($this->block->isHiddenIntro()) { //hide intro, show hidden-intro (button)526 if($this->block->isIntroFirstOnly() && !$hideIntro) { //but if firstonly was checked: show full intro, only hide 527 if ($this->block->getIntroPos()) {528 $this->tpl->hideBlock('down_view_intro');529 $this->tpl->touchBlock('up_view_intro');530 }531 else {532 $this->tpl->hideBlock('up_view_intro');533 $this->tpl->touchBlock('down_view_intro');534 }535 $this->tpl->hideBlock('up_view_hidden_intro');536 $this->tpl->hideBlock('down_view_hidden_intro');537 } 538 else {539 if ($this->block->getIntroPos()) {540 $this->tpl->hideBlock('down_view_hidden_intro');541 $this->tpl->touchBlock('up_view_hidden_intro');542 }543 else {544 $this->tpl->hideBlock('up_view_hidden_intro');545 $this->tpl->touchBlock('down_view_hidden_intro');546 }547 $this->tpl->hideBlock('up_view_intro');548 $this->tpl->hideBlock('down_view_intro');549 }550 }551 else { // hide hidden-intro (button), either show intro or not.552 $this->tpl->hideBlock('up_view_hidden_intro');553 $this->tpl->hideBlock('down_view_hidden_intro');554 555 if (!$hideIntro) { // show intro556 if ($this->block->getIntroPos()) {557 $this->tpl->touchBlock('up_view_intro');558 $this->tpl->hideBlock('down_view_intro');559 }560 else {561 $this->tpl->touchBlock('down_view_intro');562 $this->tpl->hideBlock('up_view_intro');563 }564 }565 else { //hide everything (intro and hide button)566 $this->tpl->hideBlock('up_view_hidden_intro');567 $this->tpl->hideBlock('down_view_hidden_intro');568 $this->tpl->hideBlock('up_view_intro');569 $this->tpl->hideBlock('down_view_intro');570 }571 572 }573 }574 575 $_SESSION['lastUsedBlock'] = $this->block->getId(); //store current block id 576 577 }578 579 //If you have more than one Item per page, the matrix item (McsaHeaderItem) must be displayed in a special way.580 if (($lastItemType != "McsaHeaderItem") && ($item->getType() == "McsaHeaderItem"))581 {582 $beginHeader = true;583 }584 elseif (($lastItemType == "McsaHeaderItem") && (Item::compareAnswers($lastItem, $item) == false)) {585 $beginHeader = true;586 }587 else588 $beginHeader = false;589 590 $lastItem = $item;591 $lastItemType = $item->getType();592 593 if (isset($items[$key + 1])) {594 if (($items[$key + 1]->getType() != "McsaHeaderItem") && ($item->getType() == "McsaHeaderItem")) {595 $displayItems .= trim($item->parseTemplate($key, count($items), $oldAnswers, $missingAnswers, $beginHeader, true));596 }597 else {598 $closeTable = (Item::compareAnswers($item, $items[$key+1]) == false);599 $displayItems .= trim($item->parseTemplate($key, count($items), $oldAnswers, $missingAnswers, $beginHeader, $closeTable));600 }601 }602 else {603 $displayItems .= trim($item->parseTemplate($key, count($items), $oldAnswers, $missingAnswers, $beginHeader));604 }605 606 if ($key == count($items)-1)607 {608 $this->tpl->setVariable("item", $displayItems);609 }610 if(($item->getMinTime() != 0) || ($item->getMaxTime() != 0)) {611 $this->tpl->touchBlock('time_bar');612 } else {613 $this->tpl->hideBlock('time_bar');614 }615 $parent = $item->getParent();616 if ($parent->getMaxTime() && ! $item->getMaxTime() && get('action') != 'preview')617 {618 $blockTime = (isset($this->testSession['block_time'][$parent->getId()]) ? $this->testSession['block_time'][$parent->getId()] : $parent->getMaxTime());619 $this->tpl->setGlobalVariable('max_time', $blockTime);620 $this->tpl->setGlobalVariable('is_block_time', 'true');621 $this->tpl->touchBlock('time_bar');622 }623 else624 {625 $this->tpl->setVariable('is_block_time', 'false');626 }627 }628 else629 {630 $this->tpl->loadTemplateFile("UnhandledPage.html");631 $this->tpl->setVariable("item_type", get_class($item));632 }633 }634 $this->tpl->setVariable("id", $id);635 $this->tpl->setVariable("session_id", session_id());636 $this->tpl->setVariable("item_id", implode('_', $this->_returnIds($items)));637 $this->tpl->setGlobalVariable("block_id", $this->block->getId());638 $cookieId = "testMakerRun".$id."Block".$this->block->getId()."Item".$item->getId();639 $testWrapper = new Test($testId ? $testId : $this->testMake->getTestRun()->getTestId());640 $test = $testWrapper->getBlock();641 642 $this->tpl->setGlobalVariable("test_title", $testWrapper->getTitle());643 $body = $this->tpl->get();644 $checkSecurity = isset($_SESSION['accessType']) ? ($_SESSION['accessType'] != 'password') : true;645 $this->loadDocumentFrame($cookieId, $checkSecurity);646 $this->tpl->setGlobalVariable("cookieId", $cookieId);647 648 if ($itemblock)649 {650 if (count($items) > 1) $align = $defaultSettings['align'];651 if ($align == 'v')652 {653 $this->tpl->touchBlock('vertical');654 }655 else656 {657 $this->tpl->touchBlock('horizontal');658 }659 }660 if ((! empty($_SESSION["RUNNING_TESTS"][$id]["showAbortLink"]) && $this->tpl->blockExists("abort_link")) || $testId) {661 //Construct breadcrumb trail662 $titles = array();663 $titles[] = $item->getTitle();664 $parent = $item->getParent();665 666 while (isset($parent)) {667 $titles[] = $parent->getTitle();668 $parent = $parent->getParents();669 @$parent = $parent[0];670 }671 672 foreach (array_reverse($titles) as $title) {673 $this->tpl->setVariable("breadcrumb", $title);674 $this->tpl->parse("breadcrumb");675 }676 677 $this->tpl->setVariable("abort_link", linkTo($redirect[0], $redirect[1]));678 $this->tpl->touchBlock("abort_link");679 }680 if (isset($this->testRun) && $this->testRun->getAccessType() == "preview") {681 foreach ($this->debugOutput as $debugEntry) {682 $this->tpl->setVariable("debug_entry", $debugEntry );683 $this->tpl->parse("debug_entry");684 }685 }686 // Include check for $ids[1].687 if ($this->testMake->getTestRun() !== NULL) {688 $ids = explode("_", trim($this->testMake->getTestRun()->getTestPath(), '_'));689 if (isset($ids[1])) {690 $tmpId = $ids[1];691 } else {692 $tmpId = $this->testMake->getTestRun()->getDisplayingBlockId();693 }694 $block = $GLOBALS['BLOCK_LIST']->getBlockById($tmpId);695 $progressBar = $block->getShowProgressBar();696 $pauseButton = $block->getShowPauseButton();697 $media_connect_id = $block->getLogo();698 }699 if (! $testId && $progressBar) {700 $progress = 0;701 if($test->getShowSubtests())702 {703 $trBlock = $this->testMake->getTestRun()->getTestRunBlockBySubtest($displayingBlockId);704 $progress = $trBlock->getProgress();705 }706 else $progress = $this->testMake->getTestRun()->getProgress();707 $this->tpl->setVariable("progress", $progress);708 $this->tpl->touchBlock("progress_bar");709 if ($this->block->isItemBlock() && $this->block->isAdaptiveItemBlock()) {710 $this->tpl->touchBlock("progress_bar_adaptive");711 }712 }713 if (!$GLOBALS["PORTAL"]->getUser()->get('id') == 0 && (!$testId && (($pauseButton == 1) || ($pauseButton == 2 && ($this->block->isFeedbackBlock() || $this->block->isInfoBlock()))))) {714 $this->tpl->setVariable("test_run_id", $this->testMake->getTestRun()->getId());715 716 $this->tpl->setVariable("test_id", $testWrapper->getId()); 717 $this->tpl->setVariable("test_title", $testWrapper->getTitle());718 $this->tpl->setVariable("progressp", $progress);719 $this->tpl->touchBlock("continue_later_button");720 721 $this->tpl->parse("pause_button");722 }723 else724 $this->tpl->hideBlock("continue_later_button");725 $parent = $GLOBALS['BLOCK_LIST']->findParentInTest($this->block->getId(), $test->getId());726 if ($parent != 0)727 $testStyle = $this->getStyle($parent);728 else...

Full Screen

Full Screen

tan_login.php

Source:tan_login.php Github

copy

Full Screen

1<?php2/* This file is part of testMaker.3testMaker is free software; you can redistribute it and/or modify4it under the terms of version 2 of the GNU General Public License as5published by the Free Software Foundation.6testMaker is distributed in the hope that it will be useful,7but WITHOUT ANY WARRANTY; without even the implied warranty of8MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the9GNU General Public License for more details.10You should have received a copy of the GNU General Public License11along with this program. If not, see <http://www.gnu.org/licenses/>. */12/**13 * @package Portal14 */15require_once('portal/FrontendPage.php');16/**17 * Test accomplishment18 *19 * Default action: {@link doUseTan()}20 *...

Full Screen

Full Screen

testMake

Using AI Code Generation

copy

Full Screen

1$var = new variable();2$var->testMake();3$var = new variable();4$var->testMake();5$var = new variable();6$var->testMake();7$var = new variable();8$var->testMake();9$var = new variable();10$var->testMake();11$var = new variable();12$var->testMake();13$var = new variable();14$var->testMake();15$var = new variable();16$var->testMake();17$var = new variable();18$var->testMake();19$var = new variable();20$var->testMake();21$var = new variable();22$var->testMake();23$var = new variable();24$var->testMake();25$var = new variable();26$var->testMake();27$var = new variable();28$var->testMake();29$var = new variable();30$var->testMake();31$var = new variable();32$var->testMake();33$var = new variable();34$var->testMake();

Full Screen

Full Screen

testMake

Using AI Code Generation

copy

Full Screen

1$var = new variable();2$var->testMake();3$var = new variable();4$var->testMake();5$var = new variable();6$var->testMake();7$var = new variable();8$var->testMake();9$var = new variable();10$var->testMake();11include("2.php");12$var->testMake();13$var = new variable();14$var->testMake();15$var = new variable();16$var->testMake();17$var = new variable();18$var->testMake();19$var = new variable();20$var->testMake();

Full Screen

Full Screen

testMake

Using AI Code Generation

copy

Full Screen

1require_once('variable.php');2$var = new variable();3$var->testMake();4require_once('variable.php');5$var = new variable();6$var->testMake();7require_once('variable.php');8$var = new variable();9$var->testMake();10require_once('variable.php');11$var = new variable();12$var->testMake();13require_once('variable.php');14$var = new variable();15$var->testMake();16require_once('variable.php');17$var = new variable();18$var->testMake();19require_once('variable.php');20$var = new variable();21$var->testMake();22require_once('variable.php');23$var = new variable();24$var->testMake();25require_once('variable.php');26$var = new variable();27$var->testMake();28require_once('variable.php');29$var = new variable();30$var->testMake();31require_once('variable.php');32$var = new variable();33$var->testMake();34require_once('variable.php');35$var = new variable();36$var->testMake();37require_once('variable.php');38$var = new variable();39$var->testMake();40require_once('variable.php');41$var = new variable();42$var->testMake();

Full Screen

Full Screen

testMake

Using AI Code Generation

copy

Full Screen

1include 'variable.php';2$var = new variable();3$var->testMake();4include 'variable.php';5$var = new variable();6$var->testMake();7{8 public function testMake()9 {10 $var = 5;11 echo $var;12 }13}

Full Screen

Full Screen

testMake

Using AI Code Generation

copy

Full Screen

1$var = new variable;2$var->testMake('test');3$var = new variable;4$var->testMake('test');5$var = new variable;6$var->testMake('test');

Full Screen

Full Screen

testMake

Using AI Code Generation

copy

Full Screen

1include "class.php";2$var = new variable();3$var->testMake();4class variable{5 private $var;6 function __construct($var){7 $this->var = $var;8 }9 function testMake(){10 echo $this->var;11 }12}13include "class.php";14$var = new variable("test");15$var->testMake();16class variable{17 private $var;18 function __construct($var){19 $this->var = $var;20 }21 function testMake(){22 echo $this->var;23 }24}25include "class.php";26$var = new variable("test");27$var->testMake();

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful