title: How to manage Examination Questions from a database in laravel?
body: <p>Please am trying to create an online examination platform in PHP/Laravel. I have the questions and answers stored in the database. i have been able to retrieve all Question and answer using <code>foreach</code>. How can I display  one question/answer at a time for the student to solve. Something like a <strong><em>Next button</em></strong> after the first Question. The is my controller code:</p>
  
  <pre><code>public function showQuestions($course_code, $course_semester)
  {
      $course = Course::find($course_code);
  
      $courseQuestion = DB::table('courses')
          -&gt;select('*')
          -&gt;join('questions', 'courses.course_code', 'questions.subject_code')
          -&gt;where('course_code','=', $course_code)
          -&gt;where('course_semester','=',$course_semester)
          -&gt;get();
  
      return view('all-question-page',[
          'display' =&gt; $courseQuestion,
          'course' =&gt; $course
      ]);
  }
  
  </code></pre>
  
  <p>in my blade file, I used <strong><em>foreach</em></strong> which basically displays all questions and answers and its even disallowing me to select answers for different question because it has a same ```field type name````.  I want to display the Question One by One or any best possible way i can do this. I need assistance</p>