/
manage.html.erb
executable file
·121 lines (118 loc) · 5.09 KB
/
manage.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
<% @title = "Course Admin" %>
<% content_for :stylesheets do %>
<%= stylesheet_link_tag "student_gradebook" %>
<% end %>
<% content_for :javascripts do %>
<script>
function toggleAria(id) {
var expanded = document.getElementById(id).getAttribute("aria-expanded");
if (expanded == "true") {
expanded = "false"
} else {
expanded = "true"
}
document.getElementById(id).setAttribute("aria-expanded", expanded);
}
$(document).ready(function() {
$('.collapsible').collapsible();
})
</script>
<% end %>
<div class="row">
<div class="col s12 m12">
<h2>Manage Course</h2>
<hr>
</div>
</div>
<div class="row">
<div class="col s12 m4">
<ul class="collapsible" data-collapsible="accordion">
<li class="collapsible-menu-link active" id="admin-course" aria-role="button" aria-expanded="true" onclick="toggleAria('admin-course')" onkeydown="toggleAria('admin-course')">
<div class="collapsible-header active"><h5>Admin Course</h5></div>
<div class="collapsible-body">
<ul class="options">
<li><%= link_to "Course settings", [:edit, @course],
{ title: "Modify the properties for this course" } %></li>
<li><%= link_to "Manage students", [:users, @course],
{ title: "Create, modify, and delete user accounts" } %></li>
<li><%= link_to "Install assessment", [:install_assessment, @course, :assessments],
{ title: "Create an assessment from scratch or install one from an existing directory" } %></li>
<li><%= link_to "Send bulk email", [:email, @course],
{ title: "Send an email to everyone in the class" } %></li>
<li><%= link_to "Manage course attachments", [@course, :attachments],
{ title: "Distribute files to your students" } %></li>
<li><%= link_to "Manage announcements", [@course, :announcements],
{ title: "Manage announcements via banners on either front page or all pages (persistent)." } %></li>
<li><%= link_to "Manage schedulers", [@course, :schedulers],
{ title: "Set and update scheduler for log submissions. (Advanced feature)"} %></li>
<li><%= link_to "Act as user", [:sudo, @course, @cud],
{ title: "Temporarily become another user" } %></li>
<li><%= link_to "Run Moss cheat checker", [:moss, @course],
{ title: "Use the Stanford Moss server to detect copying" } %></li>
<li class="collection-item red-text danger-bottom no-hover"><h4>Danger Zone</h4></li>
<li class="danger-side"><%= link_to "Release all grades", [:bulk_release, @course, @cud, :gradebook],
{ title: "Release all grades for all assessments", data: {confirm: "Are you sure you want to release all grades?"}} %></li>
<li class="danger-side danger-bottom"><%= link_to "Reload course config file", [:reload, @course],
{ title: "Do this each time your modify the course.rb file", data: {confirm: "Are you sure you want to reload the course config file?"}}%></li>
</ul>
</div>
</li>
</ul>
<% if @cud.user.administrator? then %>
<ul class="collapsible" data-collapsible="accordion" id="admin-autolab" aria-role="button" aria-expanded="false" onclick="toggleAria('admin-autolab')" onkeydown="toggleAria('admin-autolab')">
<li class="collapsible-menu-link">
<div class="collapsible-header"><h5>Admin Autolab</h5></div>
<div class="collapsible-body">
<ul class="options">
<li><%= link_to 'Create new course', new_course_path,
{:title=>"Create a new course"} %></li>
<li><%= link_to raw('<span class="button">Manage users</span>'),
users_path %></li>
</ul>
</div>
</li>
</ul>
<% end %>
</div>
<div class="col s12 m8">
<div class="category">
<table class="stats-table">
<colgroup>
<col class="asmt_names"></col>
<col class="gdu"></col>
<col class="gdu"></col>
<col class="gdu"></col>
<col class="gdu"></col>
<col class="gdu"></col>
</colgroup>
<thead>
<tr class="header">
<th></th>
<th>Mean</th>
<th>Median</th>
<th>Std. Dev.</th>
<th>Min</th>
<th>Max</th>
</tr>
</thead>
<tbody>
<% @course_stats.each do |name, stats| %>
<tr>
<td>
<% # TODO: RESTORE LINKS %>
<%= name %>
<% # TODO: BAD! FIX! %>
<% # name.end_with?(' Average') ? name : (link_to name, { :controller => name }, :class => :asmt_link) %>
</td>
<td><%= stats[:mean] %></td>
<td><%= stats[:median] %></td>
<td><%= stats[:stddev] %></td>
<td><%= stats[:min] %></td>
<td><%= stats[:max] %></td>
</tr>
<% end %>
</tbody>
</table>
</div>
</div>
</div>