public function removeTestResultsByUserIds($userIds)
 {
     global $ilDB, $lng;
     require_once 'Modules/Test/classes/class.ilTestParticipantData.php';
     $participantData = new ilTestParticipantData($ilDB, $lng);
     $participantData->setUserIds($userIds);
     $participantData->load($this->getTestId());
     $IN_userIds = $ilDB->in('usr_id', $participantData->getUserIds(), false, 'integer');
     $ilDB->manipulateF("DELETE FROM usr_pref WHERE {$IN_userIds} AND keyword = %s", array('text'), array("tst_password_" . $this->getTestId()));
     if (count($participantData->getActiveIds())) {
         $this->removeTestResultsByActiveIds($participantData->getActiveIds());
     }
 }
Beispiel #2
0
 /**
  * Deletes the selected user data for the test object
  *
  * Deletes the selected user data for the test object
  *
  * @access    public
  */
 function confirmDeleteSelectedUserDataObject()
 {
     global $ilDB, $lng;
     require_once 'Modules/Test/classes/class.ilTestParticipantData.php';
     $participantData = new ilTestParticipantData($ilDB, $lng);
     if ($this->object->getFixedParticipants()) {
         $participantData->setUserIds($_POST["chbUser"]);
     } else {
         $participantData->setActiveIds($_POST["chbUser"]);
     }
     $participantData->load($this->object->getTestId());
     /* @var ilTestLP $testLP */
     require_once 'Services/Object/classes/class.ilObjectLP.php';
     $testLP = ilObjectLP::getInstance($this->object->getId());
     $testLP->resetLPDataForUserIds($participantData->getUserIds(), false);
     $this->object->removeTestActives($participantData->getActiveIds());
     #$this->object->removeSelectedTestResults($active_ids);
     // Update lp status
     #include_once './Services/Tracking/classes/class.ilLPStatusWrapper.php';
     #ilLPStatusWrapper::_refreshStatus($this->object->getId());
     ilUtil::sendSuccess($this->lng->txt("tst_selected_user_data_deleted"), true);
     $this->ctrl->redirect($this, "participants");
 }