1<?php 2/* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */ 3 4/** 5* This class represents a random test input property in a property form. 6* 7* @author Helmut Schottmüller <ilias@aurealis.de> 8* @version $Id$ 9* @ingroup ModulesTest 10*/ 11class ilRandomTestData 12{ 13 protected $data = array(); 14 15 /** 16 * Constructor 17 * 18 * @param string $a_count Question count 19 * @param string $a_qpl Questionpool id 20 */ 21 public function __construct($a_count = "", $a_qpl = "") 22 { 23 $this->data = array('count' => $a_count, 'qpl' => $a_qpl); 24 } 25 26 public function __get($property) 27 { 28 switch ($property) { 29 case 'count': 30 if ((strlen($this->data[$property]) == 0) || (!is_numeric($this->data[$property]))) { 31 return 0; 32 } 33 return $this->data[$property]; 34 break; 35 case 'qpl': 36 return $this->data[$property]; 37 break; 38 default: 39 return null; 40 break; 41 } 42 } 43 44 public function __set($property, $value) 45 { 46 switch ($property) { 47 case 'count': 48 case 'qpl': 49 $this->data[$property] = $value; 50 break; 51 default: 52 break; 53 } 54 } 55} 56