public function takedefaulttest() { // User is admin if (Auth::user()->privilege == 0) { $tests = test::all(); $data = array('title' => 'Test Records', 'tests' => $tests); return view('records/all')->with($data); } // Detemine if user has taken the test already // Go to 'results' page if (test::where('user_id', '=', Auth::user()->id)->count() == 1) { return $this->testinterp(); } $testquestion = questions::all(); $data = array('title' => 'Bar ON EQ I:S', 'testquestions' => $testquestion); return view('test/viewTest')->with($data); }