コード例 #1
0
 /**
  * tests initialization
  */
 public function setUp()
 {
     \common_ext_ExtensionsManager::singleton()->getExtensionById('taoTestTaker');
     TaoPhpUnitTestRunner::initTest();
     $this->subjectsService = TestTakerService::singleton();
     $this->testCenterService = TestCenterService::singleton();
 }
コード例 #2
0
 /**
  * constructor: initialize the service and the default data
  *
  * @return Subjects
  */
 public function __construct()
 {
     parent::__construct();
     // the service is initialized by default
     $this->service = TestTakerService::singleton();
     $this->defaultData();
 }
コード例 #3
0
 /**
  * @depends testInstantiateClass
  * @depends testInstantiateSubClass
  * @param \core_kernel_classes_Resource $instance
  */
 public function testDeleteInstance($instance1, $instance2)
 {
     $this->assertTrue($this->subjectsService->deleteSubject($instance1));
     $this->assertFalse($instance1->exists());
     $this->assertTrue($this->subjectsService->deleteSubject($instance2));
     $this->assertFalse($instance2->exists());
 }
コード例 #4
0
 /**
  * gets the users of a group
  * 
  * @param string $groupUri
  * @return array resources of users
  */
 public function getUsers($groupUri)
 {
     $subjectClass = TestTakerService::singleton()->getRootClass();
     $users = $subjectClass->searchInstances(array(self::PROPERTY_MEMBERS_URI => $groupUri), array('recursive' => true, 'like' => false));
     return $users;
 }
コード例 #5
0
 /**
  * tests initialization
  */
 public function setUp()
 {
     TaoPhpUnitTestRunner::initTest();
     $this->subjectsService = TestTakerService::singleton();
     $this->groupsService = GroupsService::singleton();
 }
コード例 #6
0
    die;
}
foreach ($todefine as $contant => $value) {
    define($contant, $value);
}
$params = $argv;
array_shift($params);
$totalTtNum = isset($params[0]) ? $params[0] : 500;
$ttByProctor = isset($params[1]) && is_numeric($params[1]) && $params[1] !== 0 ? $params[1] : 20;
$totalProctorNum = $totalTtNum / $ttByProctor;
$totalProctorNum = $totalProctorNum < 1 ? 1 : $totalProctorNum;
$testTakerCrudService = oat\taoTestTaker\models\CrudService::singleton();
$userService = \tao_models_classes_UserService::singleton();
$testCenterService = \oat\taoProctoring\model\TestCenterService::singleton();
$proctorManagementService = \oat\taoProctoring\model\ProctorManagementService::singleton();
$testTakerService = \oat\taoTestTaker\models\TestTakerService::singleton();
$userClass = new \core_kernel_classes_Class(CLASS_TAO_USER);
//create delivery
$tests = [];
$testClazz = new core_kernel_classes_Class(TAO_TEST_CLASS);
foreach ($testClazz->getInstances(true) as $instance) {
    $tests[$instance->getUri()] = $instance->getLabel();
}
$testUris = array_keys($tests);
if (!empty($testUris)) {
    $i = 0;
    $delivery = null;
    $deliveryClass = new \core_kernel_classes_Class('http://www.tao.lu/Ontologies/TAODelivery.rdf#AssembledDelivery');
    while (is_null($delivery) && $i < count($testUris)) {
        $test = new core_kernel_classes_Resource($testUris[$i]);
        $label = __("Delivery of %s", $test->getLabel());