Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • autolab-project/m3/Autolab
  • autolab-project/m4/Autolab
2 results
Show changes
Commits on Source (7)
Showing
with 182 additions and 34 deletions
# This file is a template, and might need editing before it works on your project.
# Official language image. Look for the different tagged releases at:
# https://hub.docker.com/r/library/ruby/tags/
image: "ruby:2.2"
# Pick zero or more services to be used on all builds.
# Only needed when using a docker container to run your tests in.
# Check out: http://docs.gitlab.com/ce/ci/docker/using_docker_images.html#what-is-a-service
services:
- mysql:5.7
- redis:latest
variables:
MYSQL_DATABASE: autolab_test
MYSQL_ROOT_PASSWORD: SuperStrongPassword?
# Cache gems in between builds
cache:
key: one-key-to-rule-them-all
paths:
- vendor/ruby
# This is a basic example for a gem or script which doesn't use
# services such as redis or postgres
before_script:
- date
- ruby -v # Print out ruby version for debugging
# Uncomment next line if your rails app needs a JS runtime:
# - apt-get update -q && apt-get install nodejs -yqq
- gem install bundler -v 1.17.3 --no-ri --no-rdoc # Bundler is not installed with the image
- bundle install -j $(nproc) --path vendor # Install dependencies into ./vendor/ruby
- AUTOLAB=`pwd`; echo $AUTOLAB;
- cd $AUTOLAB
- cp config/initializers/devise.rb.template config/initializers/devise.rb
- cp config/database.gitlab.yml config/database.yml
- cp config/school.yml.template config/school.yml
- cp config/autogradeConfig.rb.template config/autogradeConfig.rb
- mkdir attachments/ tmp/
- bundle install -j $(nproc) --path vendor
# rspec:
# script:
# - rspec spec
rails:
variables:
# DATABASE_URL: "postgresql://postgres:postgres@postgres:5432/$POSTGRES_DB"
RAILS_ENV: test
RESTFUL_HOST: lynx-dev.encs.vancouver.wsu.edu
RESTFUL_PORT: 8610
RESTFUL_KEY: test
script:
- curl $RESTFUL_HOST:$RESTFUL_PORT
- bundle exec rails generate devise:install --skip --quiet
- bundle exec rake db:create --trace
- bundle exec rake db:setup --trace
- bundle exec rake db:migrate --trace
- bundle exec rake autolab:populate
- bundle exec rspec ./spec/features/ ./spec/api/v1/
......@@ -4,6 +4,9 @@ assets:clean[keep]
assets:clobber
assets:environment
assets:precompile
autolab:depopulate[name]
autolab:populate[name]
autolab:update_autograders
cache_digests:dependencies
cache_digests:nested_dependencies
db:create
......@@ -31,6 +34,7 @@ rails:update
routes
secret
spec
spec:api
spec:controllers
spec:features
spec:helpers
......
......@@ -127,5 +127,7 @@ gem 'prawn', '0.13.0'
# LDAP Lookup
gem 'net-ldap'
gem 'sprockets-rails', '2.3.3'
# markdown interpretation
gem 'redcarpet'
......@@ -224,6 +224,7 @@ GEM
rainbow (2.2.1)
rake (12.0.0)
rdoc (4.3.0)
redcarpet (3.4.0)
ref (2.0.0)
responders (2.3.0)
railties (>= 4.2.0, < 5.1)
......@@ -348,6 +349,7 @@ DEPENDENCIES
rack-test
rails (= 4.2.1)
rake (>= 10.3.2)
redcarpet
rspec-rails
rubocop
rubyzip
......@@ -365,4 +367,4 @@ DEPENDENCIES
yard
BUNDLED WITH
1.15.4
1.17.3
......@@ -8,24 +8,14 @@ Autolab also provides other services that instructors expect in a course managem
Since 2010, Autolab has had a transformative impact on education at CMU. Each semester, it is used by about 5,000 CMU students in courses in Pittsburgh, Silicon Valley, Qatar, and Rwanda. In Fall, 2014, we are releasing Autolab as an open-source system, where it will be available to schools all over the world, and hopefully have the same impact it's had at CMU.
<p>
<a href="https://autolab-slack.herokuapp.com" style="float:left">
<img src="http://svgshare.com/i/2Rm.svg" width="170px" height="44px">
</a>
<a href="https://autolab.github.io/docs/" style="float:left">
<img src="https://svgshare.com/i/B4h.svg" width="170px" height="44px">
</a>
</p>
[![Build Status](https://travis-ci.org/autolab/Autolab.svg)](https://travis-ci.org/autolab/Autolab)
## Washington State University Vancouver ##
This repository is a fork of the Autolab project maintained by Students at WSUV. It is used by a small number of classes currently as we test and further develop features which are important to us.
## Installation
We released new documentation! Check it out [here](https://autolab.github.io/docs).
CMU Documentation can be found [here](https://autolab.github.io/docs).
*TODO:* This should reference our install script. when it is complete instead of the above
## Testing
......@@ -54,12 +44,17 @@ After setting up the test environment, simply run spec by:
bundle exec rake spec
```
## Contributing
## Build Status
We encourage you to contribute to Autolab! Please check out the
[Contributing to Autolab Guide](https://github.com/autolab/Autolab/blob/master/CONTRIBUTING.md) for guidelines about how to proceed. [Join us!](http://contributors.autolabproject.org)
|Branch | | |
|---|:---:|:---:|
Dev | [![pipeline status](https://gitlab.encs.vancouver.wsu.edu/autolab-project/m3/Autolab/badges/dev/pipeline.svg)](https://gitlab.encs.vancouver.wsu.edu/autolab-project/m3/Autolab/commits/dev) | [![coverage report](http://gitlab.encs.vancouver.wsu.edu/autolab-project/m3/Autolab/badges/dev/coverage.svg)](https://gitlab.encs.vancouver.wsu.edu/autolab-project/m3/Autolab/commits/dev)
Master | [![pipeline status](https://gitlab.encs.vancouver.wsu.edu/autolab-project/m3/Autolab/badges/master/pipeline.svg)](https://gitlab.encs.vancouver.wsu.edu/autolab-project/m3/Autolab/commits/master) | [![coverage report](https://gitlab.encs.vancouver.wsu.edu/autolab-project/m3/Autolab/badges/master/coverage.svg)](https://gitlab.encs.vancouver.wsu.edu/autolab-project/m3/Autolab/commits/master)
## Contributing
We encourage you to contribute to Autolab! Please check out the
[WSUV Git WorkFlow](https://gitlab.encs.vancouver.wsu.edu/autolab-project/m3/Autolab/wikis/Git-Work-Flow)
## License
......@@ -67,4 +62,7 @@ Autolab is released under the [Apache License 2.0](http://opensource.org/license
## Using Autolab
Please feel free to use Autolab at your school/organization. If you run into any problems, you can reach the core developers at `autolab-dev@andrew.cmu.edu` and we would be happy to help. On a case by case basis, we also provide servers for free. (Especially if you are an NGO or small high-school classroom)
Please feel free to use Autolab at your school/organization. If you run into any problems, you can reach Scott Wallace at `wallaces@wsu.edu` and he would be happy to help.
## FAQ
If you havn't found what you need here, please see our [FAQ](https://gitlab.encs.vancouver.wsu.edu/autolab-project/m3/Autolab/wikis/Frequently-Asked-Questions)
......@@ -1148,6 +1148,25 @@ div.center {
background-color: rgba(140,0,0,0.95) !important;
}
/* Terminal output in assessment feedback */
.terminal {
background-color: #000;
color: #ccc;
font-family: monospace;
font-size: 16px;
font-weight: bold;
padding: 8px;
text-align: left;
}
.terminal span.k { color: #222; }
.terminal span.r { color: #b00; }
.terminal span.g { color: #090; }
.terminal span.y { color: #a80; }
.terminal span.b { color: #04b; }
.terminal span.m { color: #b0a; }
.terminal span.c { color: #09c; }
.terminal span.w { color: #fff; }
.drag-drop-handin {
height: 120px;
......
......@@ -7,6 +7,7 @@ require "yaml"
class AssessmentsController < ApplicationController
include ActiveSupport::Callbacks
include ActionView::Helpers::TextHelper # for simple_format
rescue_from ActionView::MissingTemplate do |exception|
redirect_to("/home/error_404")
......@@ -511,6 +512,25 @@ class AssessmentsController < ApplicationController
if Archive.archive? @submission.handin_file_path
@files = Archive.get_files @submission.handin_file_path
end
autograder = Autograder.find_by_assessment_id(@assessment.id)
if autograder.autograde_output.eql? "ansi"
# any alterations to the feedback seen can be done here
@score.feedback = simple_format(@score.feedback)
# substitute ANSI color codes with styled HTML span tags
@score.feedback.gsub!(/\[0m/) {"</span>"}
@score.feedback.gsub!(/\[([0-9]{2})m/) {
"<span class=\"#{{
# mapping from ANSI codes (30-37) to span classes
"30" => "k", "31" => "r", "32" => "g", "33" => "y",
"34" => "b", "35" => "m", "36" => "c", "37" => "w"
}[$1]}\">"
}
elsif autograder.autograde_output.eql? "markdown"
#Apply markdown code here
markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML)
@score.feedback = markdown.render(@score.feedback)
end
end
action_auth_level :reload, :instructor
......
......@@ -11,6 +11,7 @@ class AutogradersController < ApplicationController
@autograder = Autograder.new do |a|
a.assessment_id = @assessment.id
a.autograde_timeout = 180
a.autograde_output = "raw"
a.autograde_image = "autograding_image"
a.release_score = true
end
......@@ -81,6 +82,6 @@ private
end
def autograder_params
params[:autograder].permit(:autograde_timeout, :autograde_image, :release_score)
params[:autograder].permit(:autograde_timeout, :autograde_output, :autograde_image, :release_score)
end
end
##
# Extensions can be for a finite amount of time or infinite.
#
require 'Base64'
require 'base64'
class ExtensionsController < ApplicationController
# inherited from ApplicationController
......
......@@ -7,6 +7,11 @@ class UsersController < ApplicationController
redirect_to("/home/error_404")
end
def cumulative_grace_days_used
return User.cumulative_grace_days_used
end
# GET /users
action_auth_level :index, :student
def index
......
......@@ -134,6 +134,7 @@ module AssessmentAutogradeCore
end,
"output_file" => output_file,
"timeout" => @autograde_prop.autograde_timeout,
"autograde_output" => @autograde_prop.autograde_output,
"callback_url" => callback_url,
"jobName" => job_name }.to_json
begin
......
......@@ -506,6 +506,9 @@ private
props.delete(old)
end
props["general"]["category_name"] ||= "General"
if props.key?("autograder")
props["autograder"]["autograde_output"] ||= "raw"
end
end
include AssessmentAssociationCache
......
......@@ -226,7 +226,7 @@ class AssessmentUserDatum < ActiveRecord::Base
protected
def cumulative_grace_days_used
def self.cumulative_grace_days_used
grace_days_used + cumulative_grace_days_used_before
end
......
......@@ -9,12 +9,13 @@ class Autograder < ActiveRecord::Base
# extremely short timeout values cause the backend to throw system errors
validates :autograde_timeout, numericality: { greater_than: 10, less_than: 900 }
validates :autograde_image, :autograde_timeout, presence: true
validates :autograde_output, inclusion: { in: %w(raw ansi markdown)}, presence: true
validates :autograde_image, :autograde_timeout, :autograde_output, presence: true
validates :autograde_image, length: { maximum: 64 }
after_save -> { assessment.dump_yaml }
SERIALIZABLE = Set.new %w(autograde_image autograde_timeout release_score)
SERIALIZABLE = Set.new %w(autograde_image autograde_timeout autograde_output release_score)
def serialize
Utilities.serializable attributes, SERIALIZABLE
end
......
......@@ -37,7 +37,7 @@
</div>
<br>
<table class="highlight bordered"">
<table class="highlight bordered">
<thead>
<tr>
......@@ -72,7 +72,6 @@
<% if @scores[submission.id] and @scores[submission.id][problem.id] and @scores[submission.id][problem.id][:released] == 1 then
score = @scores[submission.id][problem.id]
if score[:feedback] then %>
<%= link_to (score[:score].to_f.round(1).to_s), {action: :viewFeedback,
submission_id: submission.id,
feedback: problem.id} %>
......
......@@ -2,10 +2,24 @@
<%= "#{@assessment.display_name} - #{@score.problem.name}" %>
(<%=@score.submission.course_user_datum.user.email %>)
</h2>
<pre>
<%= @score.feedback %>
Score for this problem: <%= @score.score.to_f().round(1) %>
<%= autograder = Autograder.find_by_assessment_id(@assessment.id) %>
<% if autograder.autograde_output.eql? 'ansi' %>
<div class="terminal">
<%= @score.feedback.html_safe %>
</div>
<% elsif autograder.autograde_output.eql? 'markdown' %>
<div class="markdown">
<%= @score.feedback.html_safe %>
</div>
<%else %>
<div class="raw">
<%= @score.feedback %>
</div>
<% end %>
Score for this problem: <%= @score.score.to_f().round(1) %>
Graded by: <%= if @score.grader && @score.grader.user then @score.grader.user.email end %>
</pre>
......@@ -21,7 +35,7 @@ Yes, feedback if per problem but we show all annotations for this submission any
<% @submission.annotations.each do |annotation| %>
<li>
<%= link_to annotation.as_text, [:view, @course, @assessment, @submission, header_position: annotation.position] %>
<%
<%
# if the submission is an archive, use filename in archive; otherwise, use submission filename
filename = @files && annotation.position ? Archive.get_nth_filename(@files, annotation.position) : @submission.filename
%>
......
......@@ -31,6 +31,15 @@
</p>
<%= f.text_field :autograde_timeout, display_name: "Timeout",
help_text: "Timeout for autograding jobs (secs)" %>
<p class="control-label">
<b>Output Format</b>
</p>
<%= f.select :autograde_output, options_for_select([%w(Raw raw) ,%w(Ansi ansi) ,%w(Markdown markdown)], @autograder.autograde_output) %>
<p class="help-block">
Select a format for the autograder to output
</p>
<%= f.check_box :release_score, display_name: "Release Scores?",
help_text: "Check to release autograded scores to students immediately after autograding (strongly recommended)." %>
......
test:
host: mysql
adapter: mysql2
database: autolab_test
pool: 5
username: root
password: ''
password: SuperStrongPassword?
database: autolab_test
socket: /var/run/mysqld/mysqld.sock
host: localhost
pool: 5
reconnect: true
class AddOutputFormatToAutograders < ActiveRecord::Migration
def change
add_column :autograders, :output_format, :integer
end
end
class RenameOutputFormatToAutogradeOutputInAutograders < ActiveRecord::Migration
def change
rename_column :autograders, :output_format, :autograde_output
end
end