New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
question answer basic system completed #4
Conversation
|
||
class PlayAreaController extends Controller | ||
{ | ||
public function showQuestion() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename method to just show
. Keep things simple.
routes/web.php
Outdated
@@ -19,4 +19,7 @@ | |||
Route::get('/google/callback', 'Auth\GoogleLoginController@handleProviderCallback')->middleware('guest'); | |||
Route::post('/logout', 'Auth\LoginController@logout')->middleware('guest'); | |||
|
|||
Route::get('/playarea', 'PlayAreaController@showQuestion')->middleware('auth'); | |||
Route::post('/submitanswer', 'PlayAreaController@evaluateAnswer')->middleware('auth'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change this uri to /playarea
only and change the corresponding form.
return view('playarea', compact('question')); | ||
} | ||
|
||
public function evaluateAnswer(Request $request) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here, method name evaluateAnswer
is very verbose and very specific about what this method does, this should be something generic.
We may not be just evaluating, we would be incrementing user's level, and award some score, and maybe something more in future.
So, for now, just rename it to postAnswer
, this doesn't suggest we are essentially evaluating user's answer. This suggests a broader action i.e. posting answer, you maybe doing ten different things when someone postsAnswer.
resources/views/playarea.blade.php
Outdated
@endif | ||
|
||
@if (Session::has('status')) | ||
{{ Session::get('status') }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enclose this in a <p>
tag atleast.
No description provided.