public function start() { $x = leaderboard::where('user_id', session('user_id'))->select('round_id')->first(); $x = $x['round_id']; return redirect(url('/round/' . $x)); }
public function nextround(Request $request, $id) { if ($id > $this->mxround) { return 'Congrats !! you have completed the quiz'; } $rans = roundans::where('round_id', $id)->first(); $ans = $request->input('ansr'); $utoken = session('user_id'); if (strcasecmp($rans['answer'], $ans) == 0) { $id++; leaderboard::where('user_id', $utoken)->update(['round_id' => $id]); return redirect(url('/round/' . $id)); } else { return redirect(url('/round/' . $id)); } }