/**
  * @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);
 }
Пример #5
0
 /**
  * Handle CommentText for Documents.
  *
  * @param Drop $drop drop
  *
  * @return notationCommentTextDocuments
  */
 public function getChoiceTextForDocuments(Drop $drop)
 {
     $notationChoiceTextDocuments = array();
     $dropzone = $drop->getDropzone();
     foreach ($drop->getDocuments() as $document) {
         $documentId = $document->getId();
         // Ajout pour avoir la notation.
         $notations = $this->em->getRepository('InnovaCollecticielBundle:Notation')->findBy(array('document' => $documentId, 'dropzone' => $dropzone->getId()));
         // Nombre de notation pour le document et pour le dropzone
         $countExistNotation = count($notations);
         if ($countExistNotation == 0) {
             $notationCommentTextDocuments[$documentId] = '';
         } else {
             // Parcours des commentaires des documents sélectionnés
             foreach ($notations as $notation) {
                 if (strlen($notation->getCommentText()) == 0) {
                     $notationCommentTextDocuments[$documentId] = '';
                 } else {
                     $notationCommentTextDocuments[$documentId] = $notation->getCommentText();
                 }
             }
         }
     }
     return $notationChoiceTextDocuments;
 }