public function __construct(ilDB $db, ilObjTest $testOBJ)
 {
     $this->db = $db;
     $this->testOBJ = $testOBJ;
     $this->skillQuestionAssignmentList = new ilTestSkillQuestionAssignmentList($this->db);
     $this->skillQuestionAssignmentList->setTestId($this->testOBJ->getTestId());
     $this->skillLevelThresholdList = new ilTestSkillLevelThresholdList($this->db);
     $this->skillLevelThresholdList->setTestId($this->testOBJ->getTestId());
     $this->questions = array();
     $this->maxPointsByQuestion = array();
 }
Пример #2
0
 /**
  * Clone object
  *
  * @access public
  * @param int ref id of parent container
  * @param int copy id
  * @return object new test object
  */
 public function cloneObject($a_target_id, $a_copy_id = 0)
 {
     global $ilLog, $tree, $ilDB, $ilPluginAdmin;
     $this->loadFromDb();
     // Copy settings
     /** @var $newObj ilObjTest */
     $newObj = parent::cloneObject($a_target_id, $a_copy_id);
     $this->cloneMetaData($newObj);
     $newObj->setAnonymity($this->getAnonymity());
     $newObj->setAnswerFeedback($this->getAnswerFeedback());
     $newObj->setAnswerFeedbackPoints($this->getAnswerFeedbackPoints());
     $newObj->setAuthor($this->getAuthor());
     $newObj->setLimitUsersEnabled($this->isLimitUsersEnabled());
     $newObj->setAllowedUsers($this->getAllowedUsers());
     $newObj->setAllowedUsersTimeGap($this->getAllowedUsersTimeGap());
     $newObj->setCountSystem($this->getCountSystem());
     $newObj->setECTSFX($this->getECTSFX());
     $newObj->setECTSGrades($this->getECTSGrades());
     $newObj->setECTSOutput($this->getECTSOutput());
     $newObj->setEnableProcessingTime($this->getEnableProcessingTime());
     $newObj->setEndingTimeEnabled($this->isEndingTimeEnabled());
     $newObj->setEndingTime($this->getEndingTime());
     $newObj->setFixedParticipants($this->getFixedParticipants());
     $newObj->setInstantFeedbackSolution($this->getInstantFeedbackSolution());
     $newObj->setIntroductionEnabled($this->isIntroductionEnabled());
     $newObj->setIntroduction($this->getIntroduction());
     $newObj->setFinalStatement($this->getFinalStatement());
     $newObj->setShowInfo($this->getShowInfo());
     $newObj->setForceJS($this->getForceJS());
     $newObj->setCustomStyle($this->getCustomStyle());
     $newObj->setKiosk($this->getKiosk());
     $newObj->setShowFinalStatement($this->getShowFinalStatement());
     $newObj->setListOfQuestionsSettings($this->getListOfQuestionsSettings());
     $newObj->setMCScoring($this->getMCScoring());
     $newObj->setMailNotification($this->getMailNotification());
     $newObj->setMailNotificationType($this->getMailNotificationType());
     $newObj->setNrOfTries($this->getNrOfTries());
     $newObj->setPassScoring($this->getPassScoring());
     $newObj->setPasswordEnabled($this->isPasswordEnabled());
     $newObj->setPassword($this->getPassword());
     $newObj->setProcessingTime($this->getProcessingTime());
     $newObj->setQuestionSetType($this->getQuestionSetType());
     $newObj->setReportingDate($this->getReportingDate());
     $newObj->setResetProcessingTime($this->getResetProcessingTime());
     $newObj->setResultsPresentation($this->getResultsPresentation());
     $newObj->setScoreCutting($this->getScoreCutting());
     $newObj->setScoreReporting($this->getScoreReporting());
     $newObj->setSequenceSettings($this->getSequenceSettings());
     $newObj->setShowCancel($this->getShowCancel());
     $newObj->setShowMarker($this->getShowMarker());
     $newObj->setShuffleQuestions($this->getShuffleQuestions());
     $newObj->setStartingTimeEnabled($this->isStartingTimeEnabled());
     $newObj->setStartingTime($this->getStartingTime());
     $newObj->setTitleOutput($this->getTitleOutput());
     $newObj->setUsePreviousAnswers($this->getUsePreviousAnswers());
     $newObj->setRedirectionMode($this->getRedirectionMode());
     $newObj->setRedirectionUrl($this->getRedirectionUrl());
     $newObj->setCertificateVisibility($this->getCertificateVisibility());
     $newObj->mark_schema = clone $this->mark_schema;
     $newObj->setEnabledViewMode($this->getEnabledViewMode());
     $newObj->setTemplate($this->getTemplate());
     $newObj->setPoolUsage($this->getPoolUsage());
     $newObj->setPrintBestSolutionWithResult($this->isBestSolutionPrintedWithResult());
     $newObj->setShowExamIdInTestPassEnabled($this->isShowExamIdInTestPassEnabled());
     $newObj->setShowExamIdInTestResultsEnabled($this->isShowExamIdInTestResultsEnabled());
     $newObj->setEnableExamView($this->getEnableExamview());
     $newObj->setShowExamViewHtml($this->getShowExamviewHtml());
     $newObj->setShowExamViewPdf($this->getShowExamviewPdf());
     $newObj->setEnableArchiving($this->getEnableArchiving());
     $newObj->setSignSubmission($this->getSignSubmission());
     $newObj->setCharSelectorAvailability((int) $this->getCharSelectorAvailability());
     $newObj->setCharSelectorDefinition($this->getCharSelectorDefinition());
     $newObj->setSkillServiceEnabled($this->isSkillServiceEnabled());
     $newObj->setResultFilterTaxIds($this->getResultFilterTaxIds());
     $newObj->setInstantFeedbackAnswerFixationEnabled($this->isInstantFeedbackAnswerFixationEnabled());
     $newObj->saveToDb();
     // clone certificate
     include_once "./Services/Certificate/classes/class.ilCertificate.php";
     include_once "./Modules/Test/classes/class.ilTestCertificateAdapter.php";
     $cert = new ilCertificate(new ilTestCertificateAdapter($this));
     $newcert = new ilCertificate(new ilTestCertificateAdapter($newObj));
     $cert->cloneCertificate($newcert);
     require_once 'Modules/Test/classes/class.ilTestQuestionSetConfigFactory.php';
     $testQuestionSetConfigFactory = new ilTestQuestionSetConfigFactory($tree, $ilDB, $ilPluginAdmin, $this);
     $testQuestionSetConfigFactory->getQuestionSetConfig()->cloneQuestionSetRelatedData($newObj);
     require_once 'Modules/Test/classes/class.ilTestSkillLevelThresholdList.php';
     $skillLevelThresholdList = new ilTestSkillLevelThresholdList($ilDB);
     $skillLevelThresholdList->setTestId($this->getTestId());
     $skillLevelThresholdList->loadFromDb();
     $skillLevelThresholdList->cloneListForTest($newObj->getTestId());
     $newObj->saveToDb();
     $newObj->updateMetaData();
     // #14467
     return $newObj;
 }
 private function buildSkillLevelThresholdList()
 {
     require_once 'Modules/Test/classes/class.ilTestSkillLevelThresholdList.php';
     $thresholdList = new ilTestSkillLevelThresholdList($this->db);
     $thresholdList->setTestId($this->testOBJ->getTestId());
     return $thresholdList;
 }