Ejemplo n.º 1
0
 public function home()
 {
     //Session::put('1','');
     Session::put('counter', 0);
     $answers = questions::all();
     return view('test.test', compact('answers'));
 }
Ejemplo n.º 2
0
 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);
 }