public function listSpecialQuiz()
 {
     $quizzes = Specialquiz::all()->sortByDesc(function ($day) {
         return sprintf('%04d%02d%02d', $day->year, $day->month, $day->day);
     });
     foreach ($quizzes as $key => $quiz) {
         setlocale(LC_TIME, 'pt_PT.UTF-8');
         $quizzes[$key]->monthName = strftime("%B", mktime(0, 0, 0, $quiz->month, 10));
         if ($quiz->year < date('Y')) {
             $quizzes[$key]->past = true;
         } else {
             if ($quiz->year == date('Y') && $quiz->month < date('n')) {
                 $quizzes[$key]->past = true;
             } else {
                 if ($quiz->year == date('Y') && $quiz->month == date('n') && $quiz->day <= date('j')) {
                     $quizzes[$key]->past = true;
                 } else {
                     $quizzes[$key]->past = false;
                 }
             }
         }
     }
     return view('admin/listSpecialQuizzes')->with(['quizzes' => $quizzes]);
 }
 public function viewSpecialQuizzes()
 {
     $specialquizzes = Specialquiz::all()->sortByDesc(function ($quiz) {
         return sprintf('%04d%02d%02d', $quiz->year, $quiz->month, $quiz->day);
     });
     $count = 0;
     foreach ($specialquizzes as $key => $quiz) {
         setlocale(LC_TIME, 'pt_PT.UTF-8');
         $specialquizzes[$key]->monthName = strftime("%B", mktime(0, 0, 0, $quiz->month, 10));
         if ($quiz->year < date('Y')) {
             $specialquizzes[$key]->past = true;
             $count++;
         } else {
             if ($quiz->year == date('Y') && $quiz->month < date('n')) {
                 $specialquizzes[$key]->past = true;
                 $count++;
             } else {
                 if ($quiz->year == date('Y') && $quiz->month == date('n') && $quiz->day < date('j')) {
                     $specialquizzes[$key]->past = true;
                     $count++;
                 } else {
                     $specialquizzes[$key]->past = false;
                 }
             }
         }
     }
     $users = User::all();
     return view('specialquizzes')->with(['quizzes' => $specialquizzes, 'count' => $count, 'users' => $users]);
 }