Ejemplo n.º 1
0
 /**
  * Responds to request to GET /answer/edit/{question_id}
  */
 public function getAnswerEdit($answer_id)
 {
     $answer = Answer::with('question.quiz')->find($answer_id);
     if (is_null($answer)) {
         \Session::flash('flash_message', 'Answer not found.');
         return redirect('/edit/quizzes');
     }
     return view('edit.answer')->with('answer', $answer);
 }
Ejemplo n.º 2
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     //
     $answers = Answer::with(['User'])->get();
     return $answers;
 }