예제 #1
0
파일: Utils.php 프로젝트: kukogit/omegaup
 static function DeleteClarificationsFromProblem($problem_id)
 {
     self::ConnectToDB();
     // Get clarifications
     $clarifications = ClarificationsDAO::getAll();
     // Delete those who belong to problem_id
     foreach ($clarifications as $c) {
         if ($c->getProblemId() == $problem_id) {
             try {
                 ClarificationsDAO::delete($c);
             } catch (ApiException $e) {
                 var_dump($e->getArrayMessage());
                 throw $e;
             }
         }
     }
     self::cleanup();
 }