• Main Page
  • Related Pages
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

assessment/test.php

Go to the documentation of this file.
00001 <?php
00002 /*
00003         +-----------------------------------------------------------------------------+
00004         | ILIAS open source                                                           |
00005         +-----------------------------------------------------------------------------+
00006         | Copyright (c) 1998-2001 ILIAS open source, University of Cologne            |
00007         |                                                                             |
00008         | This program is free software; you can redistribute it and/or               |
00009         | modify it under the terms of the GNU General Public License                 |
00010         | as published by the Free Software Foundation; either version 2              |
00011         | of the License, or (at your option) any later version.                      |
00012         |                                                                             |
00013         | This program is distributed in the hope that it will be useful,             |
00014         | but WITHOUT ANY WARRANTY; without even the implied warranty of              |
00015         | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               |
00016         | GNU General Public License for more details.                                |
00017         |                                                                             |
00018         | You should have received a copy of the GNU General Public License           |
00019         | along with this program; if not, write to the Free Software                 |
00020         | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. |
00021         +-----------------------------------------------------------------------------+
00022 */
00023 
00024 
00033 /*define("ILIAS_MODULE", "assessment");
00034 chdir("..");
00035 require_once "./include/inc.header.php";
00036 
00037 // for security
00038 unset($id);
00039 
00040 //determine call mode for object classes
00041 //TODO: don't use same var $id for both
00042 if (isset($_GET["obj_id"]))
00043 {
00044         $call_by_reference = false;
00045         $id = $_GET["obj_id"];
00046 }
00047 else
00048 {
00049         $call_by_reference = true;
00050         $id = $_GET["ref_id"];
00051 }
00052 
00053 // exit if no valid ID was given
00054 if (!isset($_GET["ref_id"]))
00055 {
00056         $ilias->raiseError("No valid ID given! Action aborted", $this->ilias->error_obj->MESSAGE);
00057 }
00058 
00059 // PAYMENT STUFF
00060 // check if object is purchased
00061 include_once './payment/classes/class.ilPaymentObject.php';
00062 include_once './classes/class.ilSearch.php';
00063 
00064 if(!ilPaymentObject::_hasAccess($_GET['ref_id']))
00065 {
00066         ilUtil::redirect('../payment/start_purchase.php?ref_id='.$_GET['ref_id']);
00067 }
00068 if(!ilSearch::_checkParentConditions($_GET['ref_id']))
00069 {
00070         $ilias->error_obj->raiseError($lng->txt('access_denied'),$ilias->error_obj->WARNING);
00071 }
00072 
00073 
00074 
00075 if (!isset($_GET["type"]))
00076 {
00077         if ($call_by_reference)
00078         {
00079                 $obj = $ilias->obj_factory->getInstanceByRefId($_GET["ref_id"]);
00080         }
00081         else
00082         {
00083                 $obj = $ilias->obj_factory->getInstanceByObjId($_GET["obj_id"]);
00084         }
00085 
00086         $_GET["type"] = $obj->getType();
00087 }
00088 
00089 // determine command
00090 if (($cmd = $_GET["cmd"]) == "gateway")
00091 {
00092         // surpress warning if POST is not set
00093         @$cmd = key($_POST["cmd"]);
00094 
00095 }
00096 
00097 if (empty($cmd)) // if no cmd is given default to first property
00098 {
00099         $cmd = $_GET["cmd"] = $objDefinition->getFirstProperty($_GET["type"]);
00100 }
00101 
00102 if ($_GET["cmd"] == "post")
00103 {
00104         $cmd = key($_POST["cmd"]);
00105         unset($_GET["cmd"]);
00106 }
00107 
00108 // determine object type
00109 if ($_POST["new_type"] && (($cmd == "create") || ($cmd == "import")))
00110 {
00111         $obj_type = $_POST["new_type"];
00112 }
00113 elseif ($_GET["new_type"])
00114 {
00115         $obj_type = $_GET["new_type"];
00116 }
00117 else
00118 {
00119         $obj_type = $_GET["type"];
00120 }
00121 $chapter_id = $_GET["chapter_id"];
00122 // call gui object method
00123 $method = $cmd."Object";
00124 $class_name = $objDefinition->getClassName($obj_type);
00125 $module = $objDefinition->getModule($obj_type);
00126 $module_dir = ($module == "")
00127         ? ""
00128         : $module."/";
00129 
00130 $class_constr = "ilObj".$class_name."GUI";
00131 require_once("./".$module_dir."classes/class.ilObj".$class_name."GUI.php");
00132 //arlon added
00133 if($chapter_id!="")
00134 {
00135         require_once("./assessment/classes/class.ilObjTestGUI.php");
00136         switch ($_GET["cmd"]) 
00137         {
00138                 case "run":
00139                 case "eval_a":
00140                 case "eval_stat":
00141                         $prepare_output = false;
00142                         break;
00143                 default:
00144                         $prepare_output = true;
00145                         break;
00146         }
00147         //arlon modified
00148         $obj = new ilObjTestGUI($data,$id,$call_by_reference,$prepare_output,$chapter_id);
00149         //if($_GET["sequence"]!="")
00150         //{
00151         //      $obj->questionbrowser();
00152         //}
00153         //else
00154         //{
00155                 $obj->runObject();
00156         //}
00157 }
00158 else
00159 {
00160         //Arlon added
00161         if(DEVMODE)
00162         {
00163         }
00164         require_once("./".$module_dir."classes/class.ilObj".$class_name."GUI.php");
00165         //echo $class_constr.":".$method;
00166         switch ($_GET["cmd"]) 
00167         {
00168                 case "run":
00169                 case "eval_a":
00170                 case "eval_stat":
00171                         $prepare_output = false;
00172                         break;
00173                 default:
00174                         $prepare_output = true;
00175                         break;
00176         }
00177         $obj = new $class_constr($data, $id, $call_by_reference, $prepare_output,$chapter_id);
00178         $obj->$method();
00179 }
00180 $tpl->show();
00181 ?>
00182 */
00183 define("ILIAS_MODULE", "assessment");
00184 chdir("..");
00185 require_once "./include/inc.header.php";
00186 require_once "./assessment/classes/class.ilObjTestGUI.php";
00187 
00188 unset($id);
00189 
00190 //determine call mode for object classes
00191 //TODO: don't use same var $id for both
00192 if ($_GET["obj_id"] > 0)
00193 {
00194         $call_by_reference = false;
00195         $id = $_GET["obj_id"];
00196 }
00197 else
00198 {
00199         $call_by_reference = true;
00200         $id = $_GET["ref_id"];
00201 }
00202 
00203 // exit if no valid ID was given
00204 if (!isset($_GET["ref_id"]))
00205 {
00206         $ilias->raiseError("No valid ID given! Action aborted", $this->ilias->error_obj->MESSAGE);
00207 }
00208 
00209 switch ($_GET["cmd"]) 
00210 {
00211         case "run":
00212                 $prepare_output = false;
00213                 break;
00214         default:
00215                 $prepare_output = true;
00216                 break;
00217 }
00218 $ilCtrl->setTargetScript("test.php");
00219 $ilCtrl->getCallStructure("ilobjtestgui");
00220 $tst_gui =& new ilObjTestGUI("", $_GET["ref_id"], true, $prepare_output);
00221 $ilCtrl->forwardCommand($tst_gui);
00222 
00223 $tpl->show();
00224 ?>

Generated on Fri Dec 13 2013 09:06:33 for ILIAS Release_3_4_x_branch .rev 46804 by  doxygen 1.7.1