forked from MarkUsProject/Markus
/
_table_row.html.erb
143 lines (140 loc) · 4.96 KB
/
_table_row.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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<% if grouping.non_rejected_student_memberships.size > 0 %>
<tr
<% if grouping.is_collected? %>
style="background-color: #90EE90"
<% end %>>
<td>
<input type="checkbox"
name="groupings[]"
class="ap_selectable"
id="grouping_<%= grouping.id %>"
value="<%= grouping.id %>" />
</td>
<td>
<% if !grouping.has_submission? %>
<% if Time.now >=
assignment.submission_rule.calculate_grouping_collection_time(grouping) %>
<%= link_to h(grouping.group.group_name),
collect_and_begin_grading_assignment_submission_path(
assignment.id,
grouping.id) %>
<% else %>
<%= h(grouping.group.group_name) %>
<% end %>
<% elsif !grouping.is_collected %>
<%= link_to h(grouping.group.group_name),
collect_and_begin_grading_assignment_submission_path(
assignment.id,
grouping.id) %>
<% elsif grouping.current_submission_used.remark_submitted? %>
<%= link_to h(grouping.group.group_name),
edit_assignment_submission_result_path(
assignment.id,
grouping.current_submission_used.id,
grouping.current_submission_used.remark_result) %>
<% else %>
<%= link_to h(grouping.group.group_name),
edit_assignment_submission_result_path(
assignment.id,
grouping.current_submission_used.id,
grouping.current_submission_used.result) %>
<% end %>
(<%= h(grouping.accepted_students.collect{ |student| student.user_name}.join(',')) %>)
<%='<span class="invalid">' + t(:invalid_grouping) + '</span>' if !grouping.is_valid? %>
</td>
<% if !@details.nil? %>
<% assignment.rubric_criteria.each do |criterion| %>
<td>
<% if grouping.has_submission? %>
<% mark = grouping.current_submission_used.result.marks.find_by_markable_id(criterion.id) %>
<% if mark.nil? || mark.mark.nil?%>
-
<% else %>
<%= mark.mark %>
<% end %>
<% else %>
-
<% end %>
</td>
<% end %>
<% else %>
<td>
<%= link_to h(grouping.group.repository_name),
repo_browser_assignment_submission_path(assignment,
grouping) %>
</td>
<td>
<% if !grouping.has_submission? %>
-
<% else %>
<%=h I18n.l(grouping.current_submission_used.revision_timestamp :format => :long_date) %>
<% end %>
</td>
<% end %>
<td class="marking_state">
<% if !grouping.has_submission? %>
<% if assignment.submission_rule.can_collect_now? %>
<%= image_tag('icons/shape_square.png',
:alt => I18n.t('marking_state.not_collected'),
:title => I18n.t('marking_state.not_collected')) %>
<% else %>
-
<% end %>
<% else %>
<% if !grouping.current_submission_used.has_result? %>
<%= image_tag('icons/pencil.png',
:alt => I18n.t('marking_state.in_progress'),
:title => I18n.t('marking_state.in_progress')) %>
<% else %>
<% if remark_in_progress(grouping.current_submission_used) %>
<%= image_tag('icons/double_exclamation.png',
:alt => I18n.t('marking_state.remark_requested'),
:title => I18n.t('marking_state.remark_requested')) %>
<% elsif grouping.current_submission_used.result.marking_state == Result::MARKING_STATES[:complete] %>
<% if !grouping.current_submission_used.result.released_to_students or remark_complete_but_unreleased(grouping.current_submission_used) %>
<%= image_tag('icons/accept.png',
:alt => I18n.t('marking_state.completed'),
:title => I18n.t('marking_state.completed')) %>
<% else %>
<%= image_tag('icons/email_go.png',
:alt => I18n.t('marking_state.released'),
:title => I18n.t('marking_state.released')) %>
<% end %>
<% else %>
<%= image_tag('icons/pencil.png',
:alt => I18n.t('marking_state.in_progress'),
:title => I18n.t('marking_state.in_progress')) %>
<% end %>
<% end %>
<% end %>
</td>
<td>
<%= h(grouping.grace_period_deduction_sum) %>
</td>
<td>
<% if !grouping.has_submission? %>
-
<% else %>
<% if !grouping.current_submission_used.has_result? %>
-
<% else %>
<% if grouping.current_submission_used.remark_submitted? %>
<%= h(grouping.current_submission_used.remark_result.total_mark) %>
<% else %>
<%= h(grouping.current_submission_used.result.total_mark) %>
<% end %>
<% end %>
<% end %>
</td>
<td>
<%= h(grouping.section) %>
</td>
<td>
<% if Time.now >= assignment.submission_rule.calculate_grouping_collection_time(grouping) %>
<%= image_tag('icons/tick.png') %>
<% else %>
<%= image_tag('icons/cross.png') %>
<% end %>
</td>
</tr>
<% end %>