/**
  * @param \_OurBrand_\Quiz\Domain\Model\Exercises\MatchPictureInPictureExercise $exercise
  * @return void
  */
 public function updateAction($exercise)
 {
     if ($this->request->hasArgument('draggableShapeData')) {
         $shapes = array();
         foreach ($this->request->getArgument('draggableShapeData') as $shape) {
             // Insert the image resource in the array
             $shape['imageObj'] = $this->persistenceManager->getObjectByIdentifier($shape['uuid'], '\\_OurBrand_\\Quiz\\Domain\\Model\\ImageResource');
             $shapes[] = $shape;
         }
         $exercise->addShapesFromArray($shapes);
     }
     if ($this->request->hasArgument('mainImage')) {
         $imageObj = $this->persistenceManager->getObjectByIdentifier($this->request->getArgument('mainImage'), '\\_OurBrand_\\Quiz\\Domain\\Model\\ImageResource');
         if ($imageObj !== null) {
             $exercise->addMainImage($imageObj);
         }
     }
     if ($this->request->hasArgument('quiz')) {
         $this->updateQuizBeforeUpdatingExercise($exercise->getQuiz(), $this->request->getArgument('quiz'));
     }
     if (!$this->request->hasArgument('json')) {
         $this->forward('update', 'exercise', null, array('exercise' => $exercise));
     }
     $this->forward('updateSilent', 'exercise', null, array('exercise' => $exercise, 'json' => $this->request->getArgument('json')));
 }