/**
  * @param \Innova\CollecticielBundle\Entity\Dropzone $dropzone
  * @param \Innova\CollecticielBundle\Entity\Drop     $drop
  *
  * @internal param \Innova\CollecticielBundle\Event\Log\Wiki $wiki
  * @internal param \Innova\CollecticielBundle\Event\Log\Section $section
  * @internal param \Innova\CollecticielBundle\Event\Log\Contribution $contribution
  */
 public function __construct(Dropzone $dropzone, Drop $drop)
 {
     $this->dropzone = $dropzone;
     $this->drop = $drop;
     $this->details = array('drop' => $drop, 'dropGrade' => $drop->getCalculatedGrade(), 'resultMax' => 20, 'dropzoneId' => $dropzone->getId(), 'dropId' => $drop->getId());
     parent::__construct($dropzone->getResourceNode(), $this->details);
 }
 /**
  * @param Wiki $wiki
  * @param Section $section
  * @param Contribution $contribution
  */
 public function __construct(Dropzone $dropzone, Drop $drop, Correction $correction, $roleManager)
 {
     $this->dropzone = $dropzone;
     $this->role_manager = $roleManager;
     $this->details = array('report' => array('drop' => $drop, 'correction' => $correction, 'report_comment' => $correction->getReportComment(), 'dropzoneId' => $dropzone->getId(), 'dropId' => $drop->getId(), 'correctionId' => $correction->getId()));
     parent::__construct($dropzone->getResourceNode(), $this->details);
 }
 /**
  * @param Dropzone $dropzone
  * @param Drop     $drop
  * @param Document $document
  */
 public function __construct(Dropzone $dropzone, Drop $drop, Document $document)
 {
     $documentsDetails = array();
     foreach ($drop->getDocuments() as $document) {
         $documentsDetails[] = $document->toArray();
     }
     $details = array('dropzone' => array('id' => $dropzone->getId()), 'drop' => array('id' => $drop->getId(), 'documents' => $documentsDetails), 'document' => $document->toArray());
     parent::__construct($dropzone->getResourceNode(), $details);
 }
 /**
  * @param Dropzone $dropzone
  * @param Drop     $drop
  * @param string   $grade
  */
 public function __construct(Dropzone $dropzone, Drop $drop, $grade)
 {
     $documentsDetails = array();
     foreach ($drop->getDocuments() as $document) {
         $documentsDetails[] = $document->toArray();
     }
     $details = array('dropzone' => array('id' => $dropzone->getId()), 'drop' => array('id' => $drop->getId(), 'documents' => $documentsDetails, 'owner' => array('id' => $drop->getUser()->getId(), 'lastName' => $drop->getUser()->getLastName(), 'firstName' => $drop->getUser()->getFirstName(), 'username' => $drop->getUser()->getUsername())), 'result' => $grade, 'resultMax' => 20);
     parent::__construct($dropzone->getResourceNode(), $details);
 }
 /**
  * @param Dropzone   $dropzone
  * @param Drop       $drop
  * @param Correction $correction
  */
 public function __construct(Dropzone $dropzone, Drop $drop, Correction $correction)
 {
     $documentsDetails = array();
     foreach ($drop->getDocuments() as $document) {
         $documentsDetails[] = $document->toArray();
     }
     $details = array('dropzone' => array('id' => $dropzone->getId()), 'drop' => array('id' => $drop->getId(), 'documents' => $documentsDetails, 'owner' => array('id' => $drop->getUser()->getId(), 'lastName' => $drop->getUser()->getLastName(), 'firstName' => $drop->getUser()->getFirstName(), 'username' => $drop->getUser()->getUsername())), 'correction' => $correction->toArray(false));
     parent::__construct($dropzone->getResourceNode(), $details);
 }
 /**
  * @param Dropzone $dropzone
  * @param Drop $drop
  * @param $roleManager
  */
 public function __construct(Dropzone $dropzone, Drop $drop, $roleManager)
 {
     $this->dropzone = $dropzone;
     $this->role_manager = $roleManager;
     $documentsDetails = array();
     foreach ($drop->getDocuments() as $document) {
         $documentsDetails[] = $document->toArray();
     }
     $details = array('dropzone' => array('id' => $dropzone->getId()), 'drop' => array('id' => $drop->getId(), 'documents' => $documentsDetails));
     parent::__construct($dropzone->getResourceNode(), $details);
 }
 /**
  * @ParamConverter("gradingNotation", class="InnovaCollecticielBundle:GradingNotation", options={"id" = "gradingNotationId"})
  * @ParamConverter("document", class="InnovaCollecticielBundle:Document", options={"id" = "documentId"})
  * @ParamConverter("dropzone", class="InnovaCollecticielBundle:Dropzone", options={"id" = "dropzoneId"})
  * @Template()
  */
 public function renderChoiceTextAction(GradingNotation $gradingNotation, Document $document, Dropzone $dropzone)
 {
     $choiceText = '';
     // Appel pour accés base
     $em = $this->getDoctrine()->getManager();
     // Ajout pour avoir si la notation a été transmise ou pas.
     $notationArray = $em->getRepository('InnovaCollecticielBundle:Notation')->findBy(['document' => $document->getId(), 'dropzone' => $dropzone->getId()]);
     // Nombre de notation pour le document et pour le dropzone
     $countNotation = count($notationArray);
     if ($countNotation !== 0) {
         $choiceTextArray = $em->getRepository('InnovaCollecticielBundle:ChoiceNotation')->getChoiceTextForCriteriaAndNotation($gradingNotation, $notationArray[0]);
         if (!empty($choiceTextArray)) {
             // Récupération de la valeur du texte
             $choiceText = $choiceTextArray[0]->getChoiceText();
         }
     }
     return ['value' => $choiceText];
 }
 /**
  * @param Dropzone $dropzone
  * @param Drop $drop
  */
 public function __construct(Dropzone $dropzone, Drop $drop)
 {
     $details = array('dropzone' => array('id' => $dropzone->getId()), 'drop' => array('id' => $drop->getId()));
     parent::__construct($dropzone->getResourceNode(), $details);
 }
 /**
  * @param Dropzone $dropzone
  * @param Drop     $drop
  * @param Document $document
  */
 public function __construct(Dropzone $dropzone, Drop $drop, Document $document)
 {
     $details = array('dropzone' => array('id' => $dropzone->getId()), 'drop' => array('id' => $drop->getId(), 'owner' => array('id' => $drop->getUser()->getId(), 'lastName' => $drop->getUser()->getLastName(), 'firstName' => $drop->getUser()->getFirstName(), 'username' => $drop->getUser()->getUsername())), 'document' => $document->toArray());
     parent::__construct($dropzone->getResourceNode(), $details);
 }
 /**
  * @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);
 }
 private function addCorrectionCount(Dropzone $dropzone, $users)
 {
     $correctionRepo = $this->getDoctrine()->getManager()->getRepository('InnovaCollecticielBundle:Correction');
     $dropRepo = $this->getDoctrine()->getManager()->getRepository('InnovaCollecticielBundle:Drop');
     $response = array();
     foreach ($users as $user) {
         $responseItem = array();
         $responseItem['userId'] = $user->getId();
         $corrections = $correctionRepo->getByDropzoneUser($dropzone->getId(), $user->getId());
         $isUnlockedDrop = $dropRepo->isUnlockedDrop($dropzone->getId(), $user->getId());
         $count = count($corrections);
         $responseItem['correction_count'] = $count;
         $finishedCount = 0;
         $reportsCount = 0;
         $deniedCount = 0;
         foreach ($corrections as $correction) {
             if ($correction->getCorrectionDenied()) {
                 $deniedCount++;
             }
             if ($correction->getReporter()) {
                 $reportsCount++;
             }
             if ($correction->getFinished()) {
                 $finishedCount++;
             }
         }
         //$dropCount = count($dropRepo->getDropIdsByUser($dropzone->getId(),$user->getId()));
         //$responseItem['userDropCount']= $dropCount;
         $responseItem['correction_deniedCount'] = $deniedCount;
         $responseItem['correction_reportCount'] = $reportsCount;
         $responseItem['correction_finishedCount'] = $finishedCount;
         $responseItem['drop_isUnlocked'] = $isUnlockedDrop;
         $response[$user->getId()] = $responseItem;
     }
     return $response;
 }
 /**
  * @param Dropzone    $dropzone
  * @param mixed       $dropzoneChangeSet
  * @param CommentRead $comment_read
  */
 public function __construct(Dropzone $dropzone, $dropzoneChangeSet, CommentRead $comment_read)
 {
     $details = array('dropzone' => array('id' => $dropzone->getId(), 'changeSet' => $dropzoneChangeSet), 'comment_read' => array('id' => $comment_read->getId(), 'comment' => $comment_read->getComment(), 'user' => $comment_read->getUser()));
     parent::__construct($dropzone->getResourceNode(), $details);
 }
 /**
  * @param Dropzone $dropzone
  * @param array    $changeSet
  */
 public function __construct(Dropzone $dropzone, $changeSet)
 {
     $details = array('dropzone' => array('id' => $dropzone->getId(), 'changeSet' => $changeSet));
     parent::__construct($dropzone->getResourceNode(), $details);
 }