Skip to content

Commit

Permalink
Autolab Release 2.0.6 (#868)
Browse files Browse the repository at this point in the history
  • Loading branch information
Aatish Nayak authored Apr 28, 2017
1 parent 01333ea commit 3b159b8
Show file tree
Hide file tree
Showing 11 changed files with 114 additions and 148 deletions.
42 changes: 28 additions & 14 deletions app/assets/stylesheets/style.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,12 @@ div.main-header img {
}

/* Custom Form Styling */
form#edit_editCourse {
margin-top: 80px;
}

.input-field{
padding-bottom: 4vh !important;
padding-bottom: 3vh !important;
}

.input-field label{
Expand All @@ -162,6 +166,11 @@ input:not([type]):disabled, input[type=text]:disabled, input[type=password]:disa
color: #666;
}

input[type=text], input[type=email]{
color: black;
font-weight: 400;
}

.tabs{
overflow-x: hidden;
}
Expand All @@ -171,7 +180,12 @@ input:not([type]):disabled, input[type=text]:disabled, input[type=password]:disa
}

.checkbox-input{
margin-bottom: 5vh;
// margin-bottom: 5vh;
margin-top: 2vh;
}

.btn-primary{
//margin-top:3vh;
}


Expand Down Expand Up @@ -399,7 +413,7 @@ div#footer .right {
div#footer a {
display: inline-block;
padding: 12px;
color: $autolab-highlight-gray;
color: #666;
}

div#footer div.fb-like.fb_iframe_widget {
Expand Down Expand Up @@ -725,9 +739,9 @@ body.autolab {
}
}

input[type="text"],
input[type="email"],
input[type="password"], {
input[type=text],
input[type=email],
input[type=password], {
/*border: none;*/
height: auto;
margin-top: 0.8rem;
Expand All @@ -737,19 +751,19 @@ input[type="password"], {
box-shadow: 0 1px 0 0 #CCC;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus {
input[type=text]:focus,
input[type=email]:focus,
input[type=password]:focus {
/*border: 1px solid rgba(133, 0, 0, 1);*/
outline: none;
}

input[type="checkbox"] {
input[type=checkbox] {
// For spacing between this and an adjacent label
margin-right: 10px;
}

input[type="search"] {
input[type=search] {
border-bottom: 1px #CCC;
box-shadow: 0 1px 0 0 #CCC;
}
Expand Down Expand Up @@ -795,17 +809,17 @@ textarea {
}

label.active {
font-size: inherit;
font-size: 20px;
}
}

input[type=text] {
input[type=text], input[type=email] {
box-sizing: border-box;
margin-bottom: 10px;
}

.help-block {
color: #4e4e4e;
color: black;
font-size: 15px;
margin-left: 8px;
margin-top: 2px;
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/assessment/autograde.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def regradeBatch
redirect_to([@course, @assessment, :submissions]) && return
elsif job < 0 # autograding failed
failed_jobs += 1
failed_list += "#{@submission.filename}: autograding error.<br>"
failed_list += "#{submission.filename}: autograding error.<br>"
end
else
failed_jobs += 1
Expand Down Expand Up @@ -119,7 +119,7 @@ def regradeAll
redirect_to([@course, @assessment, :submissions]) && return
elsif job < 0 # autograding failed
failed_jobs += 1
failed_list += "#{@submission.filename}: autograding error.<br>"
failed_list += "#{submission.filename}: autograding error.<br>"
end
else
failed_jobs += 1
Expand Down
2 changes: 1 addition & 1 deletion app/form_builders/form_builder_with_date_time_input.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# custom datetimepicker. In reality, it's goal is to wrap common form builder
# methods in Bootstrap boilerplate code.
class FormBuilderWithDateTimeInput < ActionView::Helpers::FormBuilder
%w(text_field text_area).each do |method_name|
%w(text_field text_area email_field).each do |method_name|
# retain access to default textfield, etc. helpers
alias_method "vanilla_#{method_name}", method_name

Expand Down
5 changes: 2 additions & 3 deletions app/views/assessments/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@

<div class="col l6">
<%= f.text_field :display_name,
help_text: "Name that will be displayed on the course home page. E.g.,
'Malloc Lab'" %>
help_text: "Name that will be displayed on the course home page.", placeholder: "Malloc Lab" %>


<div class="form-group">
<div class="input-field">
<%= f.label :category_name, { :class=>"control-label" } %>
<%= f.collection_select :category_name, @course.assessment_categories, :to_s, :to_s, {selected: @assessment.category_name} %>
<p>or</p>
Expand Down
42 changes: 42 additions & 0 deletions app/views/course_user_data/_fields.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<%= f.fields_for :user, cud.user do |u| %>
<%= u.email_field :email, disabled: true, placeholder: "[email protected]" %>

<%= u.text_field :first_name, disabled: true, placeholder: "John" %>
<%= u.text_field :last_name, disabled: true, placeholder: "Doe" %>

<% end %>

<%= f.text_field :nickname, help_text: "Anonymizing nickname to display on the public scoreboards", placeholder: "batman" %>

<%= isDisabled = false
if [email protected]? then
isDisabled = true
end
f.text_field :lecture, help_text: "The lecture number", placeholder: "15213", disabled: isDisabled %>

<%= isDisabled = false
if [email protected]? then
isDisabled = true
end
f.text_field :section, help_text: "A course assistant can see the gradebook and bulk-release grades for their assigned lecture and section.", placeholder: "A", disabled: isDisabled %>

<% if @cud.instructor? then %>

<tr>
<th>Course average tweak:</th>
<td>
<%= f.fields_for :tweak, cud.tweak do |t| %>
<%= t.text_field :value, size: 18, value: "0", placeholder: "0"%>
<%= t.select :kind, options_for_select({"points" => "points", "%" => "percent"}, :selected => (cud.tweak ? cud.tweak.kind : "points")) %>
<% end %>
</td>
<td class="smallText">A tweak is a positive or negative value that adjusts the student's course average.<br>Ex: A tweak of 5 points would increase the student's course average by 5 points. </td>
</tr>

<%= f.check_box :dropped, help_text: "Dropping a student from a course prevents them from handing in submissions or downloading assessments. Additionally they do not appear in any gradebook. None of their account information or submissions are deleted." %>

<%= f.check_box :instructor, help_text: "Instructors have full read/write access to the course." %>

<%= f.check_box :course_assistant, help_text: "Course assistants can assign scores to problems and nothing else." %>

<% end %>
59 changes: 7 additions & 52 deletions app/views/course_user_data/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<% @title = "Editing Account Details for " + @editCUD.user.email %>
<% @title = "Editing Enrollment for " + @editCUD.user.full_name %>

<% content_for :javascripts do %>
<script type="application/javascript">
Expand Down Expand Up @@ -32,7 +32,10 @@
</script>
<% end %>

<%= form_for @editCUD, url: course_course_user_datum_path(@course, @editCUD) do |f| %>
<br>
<h2>Editing <%= @editCUD.user.full_name %>'s Enrollment in <%= @course.display_name %></h2>

<%= form_for @editCUD, url: course_course_user_datum_path(@course, @editCUD), builder: FormBuilderWithDateTimeInput do |f| %>
<% if @editCUD.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@editCUD.errors.count, "error") %>
Expand All @@ -46,57 +49,9 @@
</div>
<% end %>

<table width=70% class="verticalTable" >
<tr><th>Course</th><td><%= @editCUD.course.display_name %></td></tr>

<%= f.fields_for :user, @editCUD.user do |u| %>
<tr><th>First name: </th><td><%= u.text_field :first_name %></td></tr>
<tr><th>Last name: </th><td><%= u.text_field :last_name %></td></tr>
<tr><th>Email: </th><td><%= u.text_field :email %></td></tr>
<% end %>

<tr><th>Nickname: </th><td><%= f.text_field :nickname %></td>
<td class="smallText">Anonymizing nickname to display on the public scoreboards</td> </tr>

<tr><th>School</th><td><%= @editCUD.user.school or "N/A" %></td>
<td class="smallText">Ex: SCS/CIT</td></tr>

<tr><th>Major</th><td><%= @editCUD.user.major or "N/A"%></td>
<td class="smallText">Ex: CS/ECE</td></tr>

<tr><th>Year</th><td><%= @editCUD.user.year or "N/A" %></td>
<td class="smallText">Ex: 3</td></tr>

<tr><th>Lecture</th><td><%= if @cud.instructor? then f.text_field :lecture else @editCUD.lecture end %></td>
<td class="smallText">Ex: 15213/18213</td></tr>

<tr><th>Section</th><td><%= if (@cud.instructor?) or (@editCUD.course.name == "15213-s11") then f.text_field :section else @editCUD.section end%></td>
<td class="smallText">Ex: C<% if @cud.instructor? %>. A course assistant can see the gradebook and bulk-release grades for their assigned <em>lecture and section</em>.<% end %></td></tr>

<% if @cud.instructor? then %>

<tr>
<th>Course average tweak:</th>
<td>
<%= f.fields_for :tweak, @editCUD.tweak do |t| %>
<%= t.text_field :value, :size => 18 %>
<%= t.select :kind, options_for_select({"points" => "points", "%" => "percent"}, :selected => (@editCUD.tweak ? @editCUD.tweak.kind : "points")) %>
<% end %>
</td>btn primary handin-btn
<td class="smallText">A tweak is a positive or negative value that adjusts the student's course average.<br>Ex: A tweak of 5 points would increase the student's course average by 5 points. </td>
</tr>

<tr><th>Dropped?</th><td><%= f.check_box :dropped %><label for="course_user_datum_dropped"></label></td>
<td class="smallText">Dropping a student from a course prevents them from handing in submissions or downloading assessments. Additionally they do not appear in any gradebook. None of their account information or submissions are deleted.</td></tr>

<tr><th>Instructor?</th><td><%= f.check_box :instructor %><label for="course_user_datum_instructor"></label></td>
<td class="smallText">Instructors have full read/write access to the course. </td></tr>

<tr><th>Course assistant?</th><td><%= f.check_box :course_assistant %><label for="course_user_datum_course_assistant"></label></td>
<td class="smallText">Course assistants can assign scores to problems and nothing else.</td></tr>
<% end %>
<br><br>
<%= render partial: "fields", locals: {f: f, cud: @editCUD} %>

</table>
<br>
<br>
<input id="user_submit" name="commit" type="submit" class="btn primary" value="Save Changes" onclick="formvalidation(this.parentNode); return false;">
Expand Down
67 changes: 12 additions & 55 deletions app/views/course_user_data/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<% content_for :javascripts do %>
<script type="application/javascript">
$("#user-lookup").on('click', userLookup);
$("#course_user_datum_user_attributes_email").on('blur', userLookup)
$("#course_user_datum_user_attributes_email").on('change', userLookup);
$("#course_user_datum_user_attributes_email").on('input', userLookup);
/**
* this AJAX function does an LDAP lookup on the partially-entered user email.
**/
Expand All @@ -12,7 +12,7 @@
if (!data) {
$('#course_user_datum_user_attributes_first_name').prop('disabled', false);
$('#course_user_datum_user_attributes_last_name').prop('disabled', false);
$('#course_user_datum_user_attributes_first_name').focus();
// $('#course_user_datum_user_attributes_first_name').focus();
$('#course_user_datum_user_attributes_first_name').val("");
$('#course_user_datum_user_attributes_last_name').val("");
return;
Expand All @@ -22,16 +22,20 @@
$('#course_user_datum_user_attributes_first_name').prop('disabled', true);
$('#course_user_datum_user_attributes_last_name').val(data.last_name);
$('#course_user_datum_user_attributes_last_name').prop('disabled', true);
$('#course_user_datum_nickname').focus();
// $('#course_user_datum_nickname').focus();
}
});
}
</script>
<% end %>

<h2>Add New User to Course</h2>
<div class=redText> * Indicates a required field</div>
<%= form_for @newCUD, url: course_course_user_data_path do |f| %>
<% @title="Enroll User" %>

<h2>Enroll User in <%= @course.display_name %></h2>

<br>

<%= form_for @newCUD, url: course_course_user_data_path, builder: FormBuilderWithDateTimeInput do |f| %>

<% if @newCUD.errors.any? %>
<div id="error_explanation">
Expand All @@ -46,55 +50,8 @@
</div>
<% end %>

<table width=70% class="verticalTable" >
<tr><th>Course</th><td><%= @course.display_name %></td></tr>

<%= f.fields_for :user, @newCUD.user do |u| %>
<tr><th>User Email: <a class=redText>*</a></th><td><%= u.email_field :email %></td>
<td><a id="user-lookup">User Lookup</a>
<i class='smallText'> <b>(Enter email, then click this link to fill in user info from records)</b></i></td></tr>

<tr><th>First Name <a class=redText>*</a></th><td><%= u.text_field :first_name %></td>
<td class="smallText"></td></tr>
<tr><th>Last Name <a class=redText>*</a></th><td><%= u.text_field :last_name %></td>
<td class="smallText"></td></tr>

<% end %>

<tr><th>Nickname: </th><td><%= f.text_field :nickname %></td>
<td class="smallText">Anonymizing nickname to display on the public scoreboards</td> </tr>

<tr><th>Lecture</th><td><%= if @cud.instructor? then f.text_field :lecture else @newCUD.lecture end %></td>
<td class="smallText">Ex: 15213/18213</td></tr>

<tr><th>Section</th><td><%= if (@cud.instructor?) or (@newCUD.course.name == "15213-s11") then f.text_field :section else @newCUD.section end%></td>
<td class="smallText">Ex: C<% if @cud.instructor? %>. A course assistant can see the gradebook and bulk-release grades for their assigned <em>lecture and section</em>.<% end %></td></tr>

<% if @cud.instructor? then %>

<tr>
<th>Course average tweak:</th>
<td>
<%= f.fields_for :tweak, @newCUD.tweak do |t| %>
<%= t.text_field :value, :size => 18, :value => "0" %>
<%= t.select :kind, options_for_select({"points" => "points", "%" => "percent"}, :selected => (@newCUD.tweak ? @newCUD.tweak.kind : "points")) %>
<% end %>
</td>
<td class="smallText">A tweak is a positive or negative value that adjusts the student's course average.<br>Ex: A tweak of 5 points would increase the student's course average by 5 points. </td>
</tr>

<tr><th>Dropped?</th><td><%= f.check_box :dropped %><label for="course_user_datum_dropped"></label></td>
<td class="smallText">Dropping a student from a course prevents them from handing in submissions or downloading assessments. Additionally they do not appear in any gradebook. None of their account information or submissions are deleted.</td></tr>

<tr><th>Instructor?</th><td><%= f.check_box :instructor %><label for="course_user_datum_instructor"></label></td>
<td class="smallText">Instructors have full read/write access to the course. </td></tr>

<tr><th>Course assistant?</th><td><%= f.check_box :course_assistant %><label for="course_user_datum_course_assistant"></label></td>
<td class="smallText">Course assistants can assign scores to problems and nothing else.</td></tr>
<% end %>

<%= render partial: "fields", locals: {f: f, cud: @newCUD} %>

</table>
<br>
<input id="user_submit" class="btn primary"name="commit" type="submit" value="Save Changes" onclick="formvalidation(this.parentNode); return false;">

Expand Down
7 changes: 0 additions & 7 deletions app/views/courses/_courseFields.html.erb
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
<%= stylesheet_link_tag "https://unpkg.com/flatpickr/dist/flatpickr.min.css" %>

<% content_for :javascripts do %>
<%= javascript_include_tag "https://unpkg.com/flatpickr" %>
<% end %>

<%= f.text_field :name,
help_text: "The course ID used in URLs and DB keys. This field must be unique
and URL-able. Typically includes the course number and semester. Examples:
Expand All @@ -26,7 +20,6 @@

<%= f.score_adjustment_input :late_penalty, optional: true, help_text: "The penalty applied to late submissions after a student runs out of grace days. It represents an amount of points or a percentage of the total score removed per day, and must be a non-negative number. This field can be overriden on a per-assessment basis.", placeholder: "E.g. 15%" %>


<%= f.text_field :version_threshold, help_text: "If a submission's version is greater than this threshold, it is
penalized according to the version penalty. If set to -1, no submissions are penalized. This is required, but can be overridden on a per-assessment basis.", placeholder: "E.g. 10" %>

Expand Down
2 changes: 1 addition & 1 deletion app/views/courses/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@


<div class="row">
<div class="col l6">
<div class="">
<%= render :partial=>"courseFields", :locals=>{:f=>f, :course=>@course} %>
</div>
</div>
Expand Down
Loading

0 comments on commit 3b159b8

Please sign in to comment.