forked from alaashafaee/Coolsoft-14
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request alaashafaee#546 from alaashafaee/C5_Mohab_468_Cont…
…est_Standings_5.25 Pull Request: C5_Mohab_468_Contest_Standings_5.25
- Loading branch information
Showing
16 changed files
with
405 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Place all the behaviors and hooks related to the matching controller here. | ||
# All this logic will automatically be available in application.js. | ||
# You can use CoffeeScript in this file: http://coffeescript.org/ |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
#countdown { | ||
width: 240px; | ||
height: 50px; | ||
} | ||
|
||
.solution-accepted { | ||
background: #A9F5A9; | ||
-webkit-border-radius: 10px; | ||
-moz-border-radius: 10px; | ||
border-radius: 10px; | ||
text-align: center | ||
} | ||
|
||
.wrong-answer { | ||
background: #F08080; | ||
-webkit-border-radius: 10px; | ||
-moz-border-radius: 10px; | ||
border-radius: 10px; | ||
text-align : center; | ||
} | ||
|
||
.contest_table { | ||
background: #f9f9f9; | ||
text-align: center; | ||
margin-top: 20px; | ||
} | ||
|
||
.contest_information h2 { | ||
width: 30%; | ||
margin: auto; | ||
} | ||
|
||
.contest_information { | ||
text-align : center !important; | ||
} | ||
|
||
.contest_information ul { | ||
list-style: none; | ||
border-bottom: 1px solid #A0A4A6; | ||
} | ||
|
||
.contest_information ul li { | ||
display: inline; | ||
padding: 20px; | ||
} | ||
|
||
.contest_note{ | ||
font-weight: bold; | ||
color: #75706B; | ||
} | ||
|
||
.box-example { | ||
width :50px; | ||
height: 20px; | ||
background-color: #BABABA; | ||
text-align: center; | ||
border-radius: 5px; | ||
float: left; | ||
font-weight: bold; | ||
} | ||
|
||
.box-note { | ||
float: left; | ||
margin-left: 5px; | ||
color: #75706B; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
module ContestHelper | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<center> | ||
<%= content_tag "div", id: "temp", data: {timer: @timer, del: @del} do %> | ||
<% end %> | ||
<h2><%= @message %></h2> | ||
<h4><%= @message %></h4> | ||
<div id="countdown" /> | ||
</center> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
<!-- Author : Mohab Ghanim --> | ||
<div class="contest_information"> | ||
<h2> Contest: <%= @contest.title %></h2> | ||
<h3><%= @contest.description %></h3> | ||
<h4><% if Time.now < @contest.end_time %> | ||
<% if Time.now < @contest.start_time %> | ||
Not started yet | ||
<% else %> | ||
<br> | ||
<%= render "contests/show_timer" %> | ||
<br> | ||
<%end%> | ||
<% else %> | ||
expired | ||
<p> Any new progress will not be saved </p> | ||
<% end %> | ||
</h4> | ||
<h5><% if Time.now < @contest.start_time %> | ||
Starts at | ||
<% else %> | ||
Started at | ||
<%end%> | ||
<%= @contest.start_time %> | ||
</h5> | ||
<h5>Ends at <%= @contest.end_time %></h5> | ||
<ul> | ||
<li><a href ="/contests/<%= @contest.id %>/registrants">Registrants</a></li> | ||
</ul> | ||
</div> | ||
<table class="table table-bordered contest_table"> | ||
<% rank = 0 %> | ||
<tr> | ||
<td> Rank </td> | ||
<td> Contestant </td> | ||
<% @contest.problems.each do |problem| %> | ||
<td> <a href ="/cproblems/<%= problem.id %>"><%= problem.title %></a></td> | ||
<% end %> | ||
</tr> | ||
<% if @contest.get_contest_standings.count != 0 %> | ||
<% @contest.get_contest_standings.each do |key, value| %> | ||
<tr> | ||
<td> | ||
<%= rank += 1 %> | ||
</td> | ||
<td> | ||
<%= link_to value[:record].student.name, | ||
controller: "/students", | ||
action: "show", | ||
id: value[:record].student.id %> | ||
</td> | ||
<% @contest.problems.each do |problem| %> | ||
<% trials = ContestProgress.where(contest_id: | ||
@contest.id, cproblem_id: problem.id, | ||
student_id: value[:record].student.id).take.trials %> | ||
<% if ContestProgress.where(contest_id: @contest.id , cproblem_id: problem.id, | ||
student_id: value[:record].student.id).take.status %> | ||
<% time_taken = ((ContestProgress.where(contest_id: @contest.id, | ||
cproblem_id: problem.id, student_id: value[:record].student.id). | ||
take.updated_at - Contest.find(@contest.id). | ||
start_time)/60).to_i %> | ||
<td class="solution-accepted"> <%= trials %>/<%=time_taken %> </td> | ||
<% else %> | ||
<td class="wrong-answer"> <%= trials %> /-- </td> | ||
<% end %> | ||
<% end %> | ||
</tr> | ||
<% end %> | ||
<% else %> | ||
<tr><td colspan=<%= @contest.problems.count + 2 %> ><h5> No solved problems yet </h5></td></tr> | ||
<% end %> | ||
</table> | ||
<div class="contest_note"> | ||
<div class="box-example"> | ||
X/Y | ||
</div> | ||
<div class="box-note"> | ||
X : number of trials until the first success, Y : submission time - contest start time | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.