forked from instructure/canvas-lms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_grading_standard.html.erb
233 lines (231 loc) · 11.7 KB
/
_grading_standard.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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
<%
# Copyright (C) 2011 - present Instructure, Inc.
#
# This file is part of Canvas.
#
# Canvas is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Software Foundation, version 3 of the License.
#
# Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
# details.
#
# You should have received a copy of the GNU Affero General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
%>
<% grading_standard ||= GradingStandard.default_instance %>
<div class="grading_standard" id="grading_standard_<%= grading_standard && grading_standard.id ? grading_standard.id : 'blank' %>">
<div class="display_grading_standard">
<div class="standard_title text-center">
<% if !read_only %>
<div style="float: right;" class="displaying links">
<a href="#"
class="find_grading_standard_link no-hover"
aria-label="<%= t('Find an Existing Grading Scheme') %>"
title="<%= t('Find an Existing Grading Scheme') %>">
<%= image_tag "find.png", :alt => t('find', "Find") %> <%= t('select_another_scheme','Select Another Scheme') %>
</a>
<a href="#"
title="<%= t('edit_scheme', 'Edit Grading Scheme') %>"
aria-label="<%= t('edit_scheme', 'Edit Grading Scheme') %>"
class="edit_grading_standard_link no-hover <%= 'read_only' if grading_standard && grading_standard.assessed_assignment? %>">
<i class="icon-edit standalone-icon"></i>
</a>
<a href="#"
title="<%= t('remove_scheme', 'Remove Grading Scheme') %>"
aria-label="<%= t('remove_scheme', 'Remove Grading Scheme') %>"
class="remove_grading_standard_link no-hover <%= 'read_only' unless grading_standard %>">
<i class="icon-end standalone-icon"></i>
</a>
</div>
<% end %>
<strong class="displaying title"><%= grading_standard.title %></strong>
<div class="editing_box">
<label for="grading_standard_title"><%= before_label('scheme_name', 'Scheme Name') %></label>
<input type="text"
id="grading_standard_title"
name="grading_standard[title]"
class="scheme_name"
value="<%= grading_standard.title %>"
style="width: 200px;"/>
</div>
</div>
<table style="width: 100%; margin-bottom: 20px;" class="grading_standard_data">
<caption class="screenreader-only">
<%= t("Current grading scheme for this assignment") %>
</caption>
<thead>
<tr>
<th id="name_header" style="text-align: left; padding-right: 10px; width: 25%;"><%= before_label('name', 'Name') %></th>
<th colspan="3" style="width: 75%;">
<div style="float: left; margin-left: 10px;"><%= before_label('range', 'Range') %></div>
<div class="clear"></div>
</th>
</tr>
</thead>
<tr class="insert_grading_standard" style="display: none; font-size: 0.7em; line-height: 0.6em;">
<td colspan="4">
<a href="#" class="insert_grading_standard_link"><%= t('insert_here', 'insert here') %></a>
</td>
</tr>
<% grading_standard.data.each_with_index do |row, idx| %>
<tr class="grading_standard_row">
<td style="width: 25%;">
<div class="editing_box">
<input type="text" class="standard_name" name="grading_standard[standard_data][scheme_<%= idx %>][name]" value="<%= row[0] %>" style="width: 100px;" aria-labelledby="name_header"/>
</div>
<div class="displaying name">
<%= row[0] %>
</div>
</td>
<td style="padding: 2px 5px; width: 25%;" class="max_score_cell" aria-label="<%= t('range_upper', 'Upper limit of range') %>">
<div class="editing_box" aria-hidden="true">
<span class="edit_max_score">
<% if idx == 0 %>
<%= I18n.n(100) %>
<% else %>
<%= I18n.n((grading_standard.data[idx - 1][1] * 100).round(2)) %>
<% end %>
</span>%
</div>
<div class="displaying">
<span class="max_score">
<% if idx == 0 %>
<%= I18n.n(100) %>
<% else %>
< <%= I18n.n((grading_standard.data[idx - 1][1] * 100).round(2)) %>
<% end %>
</span>%
</div>
</td>
<td style="padding: 2px 5px; width: 25%;">
<div class="editing_box">
<span style="padding-right: 5px;" aria-hidden="true"><%= t('range_of_numbers', '%{lower_number} to %{higher_number}', :lower_number => '', :higher_number => '') %></span>
<input
type="text"
class="standard_value"
title="<%= t('range_lower', 'Lower limit of range') %>"
aria-label="<%= t('range_lower', 'Lower limit of range') %>"
name="grading_standard[standard_data][scheme_<%= idx %>][value]"
value="<%= I18n.n(row[1] * 100) %>"
style="width: 37px;"/>%
</div>
<div class="displaying">
<span style="padding-right: 5px;"><%= t('range_of_numbers', '%{lower_number} to %{higher_number}', :lower_number => '', :higher_number => '') %></span>
<span class="min_score"><%= I18n.n((row[1] * 100).round(2)) %></span>%
</div>
</td>
<td class="editing_box" style="padding: 2px 5px 2px 15px; width: 25%;">
<a href="#" class="delete_row_link no-hover" tabindex="0" aria-label="<%= t('remove_row', 'Remove row')%>" title="<%= t('remove_row', 'Remove row')%>"><i class="icon-end standalone-icon"></i></a>
</td>
</tr>
<tr class="insert_grading_standard" style="display: none; font-size: 0.7em; line-height: 0.6em;">
<td colspan="4">
<a href="#" class="insert_grading_standard_link"><%= t('insert_here', 'insert here') %></a>
</td>
</tr>
<% end %>
<tr class="insert_grading_standard" style="display: none; font-size: 0.7em; line-height: 0.6em;">
<td colspan="4">
<a href="#" class="insert_grading_standard_link"><%= t('insert_here', 'insert here') %></a>
</td>
</tr>
<tr class="grading_standard_row blank" style="display: none;">
<td>
<div class="editing_box">
<input type="text" class="standard_name" name="grading_standard[standard_data][scheme_blank][name]" value="" style="width: 100px;"/>
</div>
<div class="displaying">
</div>
</td>
<td style="padding: 2px 5px;">
<div class="editing_box">
<span style="padding-right: 5px;"><%= t('range_of_numbers', '%{lower_number} to %{higher_number}', :lower_number => '', :higher_number => '') %></span>
<span class="edit_max_score"> </span>%
</div>
<div class="displaying">
<span style="padding-right: 5px;"><%= t('range_of_numbers', '%{lower_number} to %{higher_number}', :lower_number => '', :higher_number => '') %></span>
<span class="max_score"> </span>%
</div>
</td>
<td style="padding: 2px 5px;">
<div class="editing_box">
<input type="text" class="standard_value" name="grading_standard[standard_data][scheme_blank][value]" value="" style="width: 30px;"/>%
</div>
<div class="displaying">
<span class="min_score"> </span>%
</div>
</td>
<td class="editing_box" style="padding: 2px 5px 2px 15px;">
<a href="#" class="delete_row_link no-hover"><i class="icon-end standalone-icon"></i></a>
</td>
</tr>
</table>
<div class="displaying" style="text-align: right;">
<% if !read_only %>
<a href="<%= context_url(@context, :context_grading_standards_url) %>"><%= t('managing_grading_standards', 'manage grading schemes') %></a>
<% end %>
<button type="button" class="done_button btn"><%= t('buttons.done', 'Done') %></button>
</div>
<div class="editing_box form-actions">
<button type="button" class="btn cancel_button"><%= t('#buttons.cancel', 'Cancel') %></button>
<button type="button" class="btn btn-primary save_button"><%= t('buttons.save', 'Save') %></button>
</div>
</div>
<div style="display: none;" class="find_grading_standard">
<a href="<%= context_url(@context, :context_grading_standards_url) %>" rel="nofollow" class="grading_standards_url" style="display: none;"> </a>
<div class="loading_message" style="margin: 10px; text-align: center;">
<%= t('loading_grading_standards', 'Loading Grading Standards...') %>
</div>
<% css_bundle("side_tabs_table") %>
<table class="side_tabs_table grading_standards_holder" style="display: none;">
<tr>
<td class="left">
<ul class="grading_standards_select unstyled_list side_tabs">
<li class="grading_standard_select blank" style="display: none;">
<a href="#">
<span class="title"><%= t('some_standard', 'Some standard') %></span>
<span class="id" style="display: none;"> </span>
</a>
<div class="display_name" style="font-size: 0.8em;"><%= t('full_name', 'Full name, smaller text') %></div>
</li>
</ul>
</td>
<td class="right">
<div class="side_tabs_content grading_standards">
<div style="margin-bottom: 10px; display: none;" class="grading_standard_brief blank">
<span class="id" style="display: none;"> </span>
<div>
<div style="float: left;">
<a href="#" class="select_grading_standard_link"><b class="title"> </b></a>
<span class="user_name" style="padding-left: 10px; font-size: 0.8em; color: #888;">
</span>
</div>
<div class="clear"></div>
</div>
<div class="clear"></div>
<div style="margin-left: 30px;" class="details">
<table style="font-size: 0.8em;">
<tr class="details_row blank" style="display: none;">
<td class="name" style="padding-right: 20px;"> </td>
<td style="padding: 2px 5px;"><span class="value"> </span>%</td>
<td style="padding: 2px 5px;"><%= t('range_of_numbers', '%{lower_number} to %{higher_number}', :lower_number => '', :higher_number => '') %></td>
<td style="padding: 2px 5px;"><span class="next_value"> </span>%</td>
</tr>
</table>
</div>
<button type="button" class="btn select_grading_standard_link"><%= t('use_this_standard', 'Use This Grading Standard') %></button>
</div>
</div>
</td>
</tr>
</table>
<div style="margin-top: 5px; text-align: right"><a href="#" class="cancel_find_grading_standard_link"><%= t('#buttons.cancel', 'Cancel') %></a></div>
</div>
<a href="<%= context_url(((grading_standard.context || @context) rescue @context), :context_grading_standard_url, grading_standard ? grading_standard.id : "{{ id }}") rescue "#" %>" style="display: none;" class="update_grading_standard_url"> </a>
<textarea id="default_grading_standard_data" style="display: none;"><%= GradingStandard.default_grading_standard.to_json %></textarea>
</div>