Beispiel #1
0
        <div class="ui hidden divider"></div>
        <a href="/problems" class="ui inverted download button">문제 목록</a>
        @if( ! Sentinel::check() )
          <a href="/login" class="ui inverted basic button">시작하기</a>
        @endif
      </div>
    </div>
  </div>
  <div class="ui stripe segment">
    <div class="ui four column center aligned divided relaxed stackable grid container">
      <div class="row">
        <div class="column">
          <div class="ui green segment">이 문제는 어때요?</div>
          <?php 
$randProblem = ProblemService::getOpenProblems();
$hasProblem = $randProblem->count() > 0;
if ($hasProblem) {
    $randProblem = $randProblem->random();
    $ac = $randProblem->problemStatisticses->first() ? $randProblem->problemStatisticses->first()->count : 0;
    $sc = $randProblem->total_submit;
} else {
    $ac = 0;
    $sc = 0;
}
$rate = number_format(StatisticsService::getRate($ac, $sc), 2);
?>
          @if( $hasProblem )
          <div class="ui card">
            @if( Sentinel::check() )
              {{-- 맞은 문제가 안나오고 전체 문제가 카운팅 되고 있음 --}}