@@ -27,7 +27,7 @@ |
||
| 27 | 27 | $filter["rated"]=isset($all_data["rated"]) ? $all_data["rated"] : null; |
| 28 | 28 | $filter["anticheated"]=isset($all_data["anticheated"]) ? $all_data["anticheated"] : null; |
| 29 | 29 | $filter["practice"]=isset($all_data["practice"]) ? $all_data["practice"] : null; |
| 30 | - $return_list=$contestModel->list($filter,Auth::check()?Auth::user()->id:0); |
|
| 30 | + $return_list=$contestModel->list($filter, Auth::check() ?Auth::user()->id : 0); |
|
| 31 | 31 | $featured=$contestModel->featured(); |
| 32 | 32 | if (is_null($return_list)) { |
| 33 | 33 | if (isset($all_data["page"]) && $all_data["page"]>1) { |
@@ -106,8 +106,8 @@ discard block |
||
| 106 | 106 | ]; |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | - $editor_left_width = $accountModel->getExtra(Auth::user()->id, 'editor_left_width'); |
|
| 110 | - if(empty($editor_left_width)) $editor_left_width='40'; |
|
| 109 | + $editor_left_width=$accountModel->getExtra(Auth::user()->id, 'editor_left_width'); |
|
| 110 | + if (empty($editor_left_width)) $editor_left_width='40'; |
|
| 111 | 111 | |
| 112 | 112 | return view('contest.board.editor', [ |
| 113 | 113 | 'page_title'=>"Problem Detail", |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | ]); |
| 266 | 266 | } |
| 267 | 267 | |
| 268 | - public function analysis($cid){ |
|
| 268 | + public function analysis($cid) { |
|
| 269 | 269 | $contestModel=new ContestModel(); |
| 270 | 270 | $clearance=$contestModel->judgeClearance($cid, Auth::user()->id); |
| 271 | 271 | if (!$clearance) { |
@@ -84,9 +84,9 @@ |
||
| 84 | 84 | $installed_timestamp=intval($info["compiler_timestamp"]); |
| 85 | 85 | } |
| 86 | 86 | $latest_timestamp=$installed_timestamp; |
| 87 | - $ConpilerConfig = glob(babel_path("Extension/$ocode/compiler/*.*")); |
|
| 87 | + $ConpilerConfig=glob(babel_path("Extension/$ocode/compiler/*.*")); |
|
| 88 | 88 | foreach ($ConpilerConfig as $file) { |
| 89 | - if (intval(basename($file)) > $installed_timestamp) { |
|
| 89 | + if (intval(basename($file))>$installed_timestamp) { |
|
| 90 | 90 | try { |
| 91 | 91 | $this->commitCompiler($file, json_decode(file_get_contents($file), true)); |
| 92 | 92 | $latest_timestamp=intval(basename($file)); |
@@ -39,8 +39,8 @@ discard block |
||
| 39 | 39 | //writing database |
| 40 | 40 | $this->transactionDB(); |
| 41 | 41 | |
| 42 | - }catch(Throwable $e){ |
|
| 43 | - if ($e->getMessage()!==""){ |
|
| 42 | + } catch (Throwable $e) { |
|
| 43 | + if ($e->getMessage()!=="") { |
|
| 44 | 44 | $this->command->line("\n <bg=red;fg=white> {$e->getMessage()} </>\n"); |
| 45 | 45 | } |
| 46 | 46 | } |
@@ -59,12 +59,12 @@ discard block |
||
| 59 | 59 | public function __construct($class) |
| 60 | 60 | { |
| 61 | 61 | $this->command=$class; |
| 62 | - $this->versionParser = new VersionConstraintParser(); |
|
| 62 | + $this->versionParser=new VersionConstraintParser(); |
|
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | private function parseVersion() |
| 66 | 66 | { |
| 67 | - if(empty($this->babelConfig)){ |
|
| 67 | + if (empty($this->babelConfig)) { |
|
| 68 | 68 | throw new Exception('Missing babel.json Config file.'); |
| 69 | 69 | } |
| 70 | 70 | |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | |
| 135 | 135 | DB::commit(); |
| 136 | 136 | |
| 137 | - }catch(Throwable $e){ |
|
| 137 | + } catch (Throwable $e) { |
|
| 138 | 138 | DB::rollback(); |
| 139 | 139 | if ($e->getMessage()!=="") { |
| 140 | 140 | $this->command->line("\n <bg=red;fg=white> {$e->getMessage()} </>\n"); |
@@ -413,7 +413,7 @@ discard block |
||
| 413 | 413 | ->where(['verdict'=>'Waiting']) |
| 414 | 414 | ->get() |
| 415 | 415 | ->all(); |
| 416 | - foreach($ret as &$r){ |
|
| 416 | + foreach ($ret as &$r) { |
|
| 417 | 417 | $r["ocode"]=DB::table("oj")->where(["oid"=>$r["oid"]])->first()["ocode"]; |
| 418 | 418 | } |
| 419 | 419 | return $ret; |
@@ -431,15 +431,15 @@ discard block |
||
| 431 | 431 | if (isset($sub['verdict'])) { |
| 432 | 432 | $sub["color"]=$this->colorScheme[$sub['verdict']]; |
| 433 | 433 | } |
| 434 | - $result = DB::table($this->tableName)->where(['sid'=>$sid])->update($sub); |
|
| 435 | - $contestModel = new ContestModel(); |
|
| 436 | - $submission_info = DB::table($this->tableName) -> where(['sid'=>$sid]) -> get() -> first(); |
|
| 437 | - if ($result==1 && $submission_info['cid'] && $contestModel->isContestRunning($submission_info['cid'])){ |
|
| 438 | - $sub['pid'] = $submission_info['pid']; |
|
| 439 | - $sub['uid'] = $submission_info['uid']; |
|
| 440 | - $sub['cid'] = $submission_info['cid']; |
|
| 441 | - $sub['sid'] = $sid; |
|
| 442 | - $contestModel->updateContestRankTable($submission_info['cid'],$sub); |
|
| 434 | + $result=DB::table($this->tableName)->where(['sid'=>$sid])->update($sub); |
|
| 435 | + $contestModel=new ContestModel(); |
|
| 436 | + $submission_info=DB::table($this->tableName) -> where(['sid'=>$sid]) -> get() -> first(); |
|
| 437 | + if ($result==1 && $submission_info['cid'] && $contestModel->isContestRunning($submission_info['cid'])) { |
|
| 438 | + $sub['pid']=$submission_info['pid']; |
|
| 439 | + $sub['uid']=$submission_info['uid']; |
|
| 440 | + $sub['cid']=$submission_info['cid']; |
|
| 441 | + $sub['sid']=$sid; |
|
| 442 | + $contestModel->updateContestRankTable($submission_info['cid'], $sub); |
|
| 443 | 443 | } |
| 444 | 444 | return $result; |
| 445 | 445 | } |
@@ -510,15 +510,15 @@ discard block |
||
| 510 | 510 | 'desc' |
| 511 | 511 | ); |
| 512 | 512 | |
| 513 | - if($filter["pcode"]){ |
|
| 513 | + if ($filter["pcode"]) { |
|
| 514 | 514 | $paginator=$paginator->where(["pcode"=>$filter["pcode"]]); |
| 515 | 515 | } |
| 516 | 516 | |
| 517 | - if($filter["result"]){ |
|
| 517 | + if ($filter["result"]) { |
|
| 518 | 518 | $paginator=$paginator->where(["verdict"=>$filter["result"]]); |
| 519 | 519 | } |
| 520 | 520 | |
| 521 | - if($filter["account"]){ |
|
| 521 | + if ($filter["account"]) { |
|
| 522 | 522 | $paginator=$paginator->where(["name"=>$filter["account"]]); |
| 523 | 523 | } |
| 524 | 524 | |