public function store(Request $request, $user_id = null)
 {
     $this->dispatch(new PracticeSessionStarted(Auth::user()));
     $practice_session = PracticeSession::create(['user_id' => $user_id, 'started_at' => date('Y-m-d H:i:s')]);
     if ($practice_session) {
         $practiceSessionToolbox = new PracticeSessionToolbox($user_id, $practice_session->id);
         $sessionMaterial = $practiceSessionToolbox->getSessionMaterial();
         if (!$sessionMaterial) {
             return $this->respondNotFound('Unable to start session. Make sure you have facts with questions! Call!');
         }
         $material_id = PracticeMaterial::create($sessionMaterial)->id;
         $sessionMaterial['material_id'] = $material_id;
         return $this->respond(['data' => [$sessionMaterial]]);
     }
 }
 /**
  * @param array $tags
  * @param $user_id
  * @param $session_id
  * @param $material_id
  * @internal param Request $request
  * @return bool|mixed
  */
 protected function getMaterialForNextQuestion($tags = null, $user_id, $session_id, $material_id)
 {
     $practiceSessionToolbox = new PracticeSessionToolbox($user_id, $session_id);
     $tags = json_decode($tags);
     $sessionMaterial = $practiceSessionToolbox->getSessionMaterial($tags);
     // Material id
     $material_id = PracticeMaterial::create($sessionMaterial)->id;
     $sessionMaterial['material_id'] = $material_id;
     return $sessionMaterial;
 }