/**
  * @param Dropzone  $dropzone
  * @param Criterion $criterion
  */
 public function __construct(Dropzone $dropzone, Criterion $criterion)
 {
     $details = array('dropzone' => array('id' => $dropzone->getId()), 'criterion' => array('id' => $criterion->getId(), 'instruction' => $criterion->getInstruction()));
     parent::__construct($dropzone->getResourceNode(), $details);
 }
예제 #2
0
 /**
  * @DI\Observe("copy_innova_collecticiel")
  *
  * @param CopyResourceEvent $event
  */
 public function onCopy(CopyResourceEvent $event)
 {
     $em = $this->container->get('doctrine.orm.entity_manager');
     /** @var Dropzone $resource */
     $resource = $event->getResource();
     $newDropzone = new Dropzone();
     $newDropzone->setName($resource->getName());
     $newDropzone->setAllowCommentInCorrection($resource->getAllowCommentInCorrection());
     $newDropzone->setAllowRichText($resource->getAllowRichText());
     $newDropzone->setAllowUpload($resource->getAllowUpload());
     $newDropzone->setAllowUrl($resource->getAllowUrl());
     $newDropzone->setAllowWorkspaceResource($resource->getAllowWorkspaceResource());
     $newDropzone->setDisplayNotationMessageToLearners($resource->getDisplayNotationMessageToLearners());
     $newDropzone->setDisplayNotationToLearners($resource->getDisplayNotationToLearners());
     $newDropzone->setEditionState($resource->getEditionState());
     $newDropzone->setEndAllowDrop($resource->getEndAllowDrop());
     $newDropzone->setEndReview($resource->getEndReview());
     $newDropzone->setExpectedTotalCorrection($resource->getExpectedTotalCorrection());
     $newDropzone->setInstruction($resource->getInstruction());
     $newDropzone->setManualPlanning($resource->getManualPlanning());
     $newDropzone->setManualState($resource->getManualState());
     $newDropzone->setMinimumScoreToPass($resource->getMinimumScoreToPass());
     $newDropzone->setPeerReview($resource->getPeerReview());
     $newDropzone->setStartAllowDrop($resource->getStartAllowDrop());
     $newDropzone->setStartReview($resource->getStartReview());
     $newDropzone->setTotalCriteriaColumn($resource->getTotalCriteriaColumn());
     $oldCriteria = $resource->getPeerReviewCriteria();
     foreach ($oldCriteria as $oldCriterion) {
         $newCriterion = new Criterion();
         $newCriterion->setInstruction($oldCriterion->getInstruction());
         $newDropzone->addCriterion($newCriterion);
     }
     $em->persist($newDropzone);
     $event->setCopy($newDropzone);
     $event->stopPropagation();
 }
예제 #3
0
 /**
  * Add criterion
  *
  * @param  \Innova\CollecticielBundle\Entity\Criterion $criterion
  * @return Dropzone
  */
 public function addCriterion(Criterion $criterion)
 {
     $criterion->setDropzone($this);
     $this->peerReviewCriteria[] = $criterion;
     return $this;
 }
 /**
  * @param Dropzone  $dropzone
  * @param mixed     $dropzoneChangeSet
  * @param Criterion $criterion
  * @param mixed     $criterionChangeSet
  */
 public function __construct(Dropzone $dropzone, $dropzoneChangeSet, Criterion $criterion, $criterionChangeSet)
 {
     $details = array('dropzone' => array('id' => $dropzone->getId(), 'changeSet' => $dropzoneChangeSet), 'criterion' => array('id' => $criterion->getId(), 'changeSet' => $criterionChangeSet));
     parent::__construct($dropzone->getResourceNode(), $details);
 }