/**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(CreateRequest $request, $format_id)
 {
     $this->question->fill($request->all());
     $this->question->order = $this->format->orderNewQuestion();
     $this->format->questions()->save($this->question);
     $answers = $request->get('answers');
     $newAnswers = [];
     foreach ($answers as $answer) {
         array_push($newAnswers, new Answer($answer));
     }
     $this->question->answers()->saveMany($newAnswers);
     Flash::info('Pregunta  Guardada correctamente');
     return redirect()->route('formats.observations.show', $this->format->id);
 }
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(CreateRequest $request, $protocol_id)
 {
     $this->question->fill($request->all());
     $this->protocol->questions()->save($this->question);
     $answers = $request->get('answers');
     $answers[$request->get('answers_correct')]['correct'] = 1;
     $newAnswers = [];
     foreach ($answers as $answer) {
         array_push($newAnswers, new Answer($answer));
     }
     $this->question->answers()->saveMany($newAnswers);
     Flash::info('Pregunta  Guardada correctamente');
     return redirect()->route('protocols.show', $this->protocol->id);
 }