summaryrefslogtreecommitdiff
path: root/lib/sampling/peer_review.html.erb
blob: a0b9c4d448657214a50218279b0d36fbed980d55 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<% if @feedbacks_missing.include? @user %>
	<script type="text/javascript">
		function score_peers() {
			var list = $('ol#peer_review_boxes');
			for(var i=0, var len=list.length; i < len; i++) {
				if ( i == len-1) {
					comma = "";
				}
				$('peer_review').value +=  $('ol#peer_review_boxes:eq(' + i + ')').text() + comma;
			}
		}
	</script>
	<input type="hidden" id="peer_review" name="peer_review" value="" />
	<ol id="peer_review_boxes" class="sortable">
		<% @team.users.reject{|u|u==@user}.each do |user| %><li>
		  	<%= user.user_name %>
			<br>
			<%# TODO: display more statistics %>
		</li><% end %>
	</ol>
	<input type="submit" value="Submit peer evaluation", onsubmit="score_peers()") >
<% else %>
	<p>Still waiting for peer feedback from the following users:
		<ul><% @feedbacks_missing.each do |user| %>
			<li><%= link_to user %></li>
		<% end %></ul>
	</p>
<% end %>