forked from expertiza/expertiza
/
_participant_charts.html.erb
107 lines (89 loc) · 2.88 KB
/
_participant_charts.html.erb
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<% if has_team_and_metareview?[:true_num] == 2 %>
<!--100 = 19 + 8 * 9 + 9-->
<% namecolwidth = 19 %>
<% colwidth = 9 %>
<% elsif has_team_and_metareview?[:true_num] == 1 %>
<!--100 = 16 + 6 * 12 + 12-->
<% namecolwidth = 16 %>
<% colwidth = 12 %>
<% else %>
<!--100 = 16 + 4 * 18 + 18-->
<% namecolwidth = 10 %>
<% colwidth = 18 %>
<% end %>
<a href="#" name='score-chartLink' onClick="toggleElement('score-chart', 'stats');return false;">hide stats</a>
<TR style ="background-color: white;" id='score-chart'>
<th style="text-align:center;" WIDTH="<%= namecolwidth %>%">
Stats
</th>
<th style="text-align:center;" COLSPAN="2" WIDTH="<%= colwidth*2 %>%">
<img src="<%= @grades_bar_charts[:review] %>" >
<div class="circle" id="review-circle">
</div>
</th>
<% if has_team_and_metareview?[:has_metareview] %>
<th style="text-align:center;" COLSPAN="2" WIDTH="<%= colwidth*2 %>%">
<img src="<%= @grades_bar_charts[:metareview] %>" >
<div class="circle" id="metareview-circle">
</div>
</th>
<% end %>
<th style="text-align:center;" COLSPAN="2" WIDTH="<%= colwidth*2 %>%">
<img src="<%= @grades_bar_charts[:feedback] %>" >
<div class="circle" id="feedback-circle">
</div>
</th>
<% if has_team_and_metareview?[:has_team] %>
<th style="text-align:center;" COLSPAN="2" WIDTH="<%= colwidth*2 %>%">
<% if @assignment.show_teammate_reviews == true %>
<img src="<%= @grades_bar_charts[:teammate] %>" >
<div class="circle" id="teammate-circle">
<% else %>
Not shown
<% end %>
</div>
</th>
<% end %>
<th style="text-align:center;" WIDTH="<%= colwidth %>%">
<div class="circle" id="final-circle">
</div>
</th>
</TR>
<script type="text/javascript">
<% ['review', 'metareview', 'feedback', 'teammate'].each do |type| %>
<% if @pscore[type.to_sym] && @pscore[type.to_sym][:scores][:avg]%>
<% if type == 'teammate' && @assignment.show_teammate_reviews == true %>
var myCircle = Circles.create({
id: '<%= "#{type}-circle" %>',
radius: 25,
value: <%= @pscore[type.to_sym][:scores][:avg].to_i %>,
maxValue: 100,
width: 7,
text: '<%=@pscore[type.to_sym][:scores][:avg].to_i%>',
colors: ['#FFEB99', '#FFCC00'],
duration: 700,
textClass: 'circles-text'
});
<%end%>
<%end%>
<%end%>
var myCircle = Circles.create({
id: 'final-circle',
radius: 35,
value: <%= @pscore[:total_score].to_i %>,
maxValue: 100,
width: 15,
text: '<%=@pscore[:total_score].to_i==-1? "N/A":@pscore[:total_score].to_i%>',
colors: ['#FFEB99', '#FFCC00'],
duration: 700,
textClass: 'circles-final'
});
</script>
<style>
.circles-text{
font-size: 12px !important;
}
.circles-final{
font-size: 16px !important;
}
</style>