public static function getUnscored(User $user, FormDefinition $form)
 {
     try {
         $unscored = new Collection();
         $submissions = $form->submissions()->where('status', 'Judging')->get();
         foreach ($submissions as $submission) {
             if ($submission->scores()->where('user_id', $user->id)->get()->count() == 0) {
                 $unscored->push($submission);
             }
         }
         return $unscored;
     } catch (\Exception $e) {
         return new Collection();
     }
 }
 public function updateStatus(FormDefinition $form, Request $request)
 {
     $this->validate($request, ['status' => 'required|in:Drafting,Scheduled,Accepting,Reviewing,Scored,Archived']);
     if ($form->submissions()->get()->count() > 0 && ($request->input("status") == "Drafting" || $request->input("status") == "Scheduled")) {
         flash()->overlay("This form already has submissions.  It is not possible to change to Draft or Scheduled status at this point, as these would permit modifying the form definition, and that would corrupt all submissions", "Status Change Failed");
     }
     if ($form->status == "Archived") {
         flash()->overlay("It is not possible to modify the status of an archived form.", "Status Change Failed");
     } else {
         try {
             $form->status = $request->input("status");
             $form->save();
             flash()->overlay("The form status has been updated.", "Status Changed");
         } catch (\Exception $e) {
             flash()->overlay("The status cannot be changed due to a technical problem.", "Status Change Failed");
         }
     }
     return redirect(action('FormDefinitionController@show', compact('form')));
 }