-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:ASCTech/mooculus
- Loading branch information
Showing
64 changed files
with
6,340 additions
and
336 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,75 @@ | ||
class HomeController < ApplicationController | ||
def index | ||
end | ||
|
||
def about | ||
end | ||
|
||
def people | ||
@people = Array.new | ||
|
||
@people << { | ||
:name => 'Bart Snapp', | ||
:photo => 'bart-snapp', | ||
:description => 'Bart is at OSU.', | ||
:link => 'http://www.math.osu.edu/~snapp/', | ||
:email => '[email protected]' | ||
} | ||
|
||
@people << { | ||
:name => 'Jim Fowler', | ||
:photo => 'jim-fowler', | ||
:description => 'Jim is at OSU.', | ||
:link => 'http://www.math.osu.edu/~fowler/', | ||
:email => '[email protected]' | ||
} | ||
|
||
@people << { | ||
:name => 'Steven Gubkin', | ||
:photo => 'steve-gubkin', | ||
:description => 'Steve is at OSU.', | ||
:email => '[email protected]', | ||
:link => 'http://www.math.osu.edu/people/gubkin.1/view', | ||
} | ||
|
||
@people << { | ||
:name => 'Ryan Kowalick', | ||
:photo => 'ryan-kowalick', | ||
:description => 'Ryan Kowalick', | ||
:email => '[email protected]', | ||
:link => 'http://www.math.osu.edu/people/kowalick.1' | ||
} | ||
|
||
@people << { | ||
:name => 'Roman Holowinsky', | ||
:photo => 'roman-holowinsky', | ||
:description => 'Roman Holowinsky advises.', | ||
:email => '[email protected]', | ||
:link => 'http://www.math.osu.edu/~romanh/' | ||
} | ||
|
||
@people << { | ||
:name => 'Sean Corey', | ||
:photo => 'sean-corey', | ||
:description => 'Sean Corey', | ||
:email => '[email protected]', | ||
} | ||
|
||
@people << { | ||
:name => 'Isaac Smith', | ||
# :photo => 'isaac-smith', | ||
:description => 'Isaac is an undergraduate at Ohio State; he is a teaching assistant in this course.', | ||
:email => '[email protected]', | ||
} | ||
|
||
@people << { | ||
:name => 'Sean Collins', | ||
# :photo => 'sean-collins', | ||
:description => 'Sean is an undergraduate at Ohio State; he is a teaching assistant in this course.', | ||
:email => '[email protected]', | ||
} | ||
|
||
@people.shuffle! | ||
|
||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,22 @@ | ||
class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController | ||
def google_oauth2 | ||
# You need to implement the method below in your model (e.g. app/models/user.rb) | ||
@user = User.find_for_google_oauth2(request.env["omniauth.auth"], current_user) | ||
|
||
if @user.persisted? | ||
flash[:notice] = I18n.t "devise.omniauth_callbacks.success", :kind => "Google" | ||
sign_in_and_redirect @user, :event => :authentication | ||
else | ||
session["devise.google_data"] = request.env["omniauth.auth"] | ||
redirect_to new_user_registration_url | ||
end | ||
end | ||
def coursera | ||
@user = User.find_for_coursera(request.env["omniauth.auth"], current_user) | ||
|
||
if @user.persisted? | ||
flash[:notice] = I18n.t "devise.omniauth_callbacks.success", :kind => "Coursera" | ||
sign_in_and_redirect @user, :event => :authentication | ||
else | ||
session["devise.coursera_data"] = request.env["omniauth.auth"] | ||
redirect_to new_user_registration_url | ||
end | ||
end | ||
|
||
# This is necessary since Rails 3.0.4 | ||
# See https://github.com/intridea/omniauth/issues/185 | ||
# and http://www.arailsdemo.com/posts/44 | ||
protected | ||
def handle_unverified_request | ||
true | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
module ApplicationHelper | ||
def html_logo | ||
return '<span style="font-family: \'Open Sans\', sans-serif;"><span style="font-weight: 800;">mooc</span><span style="font-weight: 300;">ulus</span></span>' | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
class Exercise < ActiveRecord::Base | ||
attr_accessible :title, :description, :page, :problem_number | ||
has_many :scores, :dependent => :destroy | ||
has_many :problems, :dependent => :destroy | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
class Problem < ActiveRecord::Base | ||
belongs_to :exercise | ||
attr_accessible :name | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
class Score < ActiveRecord::Base | ||
attr_accessible :time_taken, :attempt_number, :complete, :count_hints, :seed, | ||
:attempt_content | ||
belongs_to :exercise | ||
belongs_to :problem | ||
belongs_to :user | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<img style="float: left; margin-right: 16pt; margin-left: 16pt; margin-bottom: 16pt;" src="/photos/<%= @person[:photo] %>-150.jpg"/> | ||
<h2><%= @person[:name] %></h2> | ||
<% unless @person[:email].nil? %> | ||
<span class="email"><a href="mailto:<%= @person[:email] %>"><%= @person[:email] %></a></span> | ||
<% end %> | ||
<% unless @person[:link].nil? %> | ||
<span class="url"><a href="<%= @person[:link] %>" rel="external"><%= @person[:link] %></a></span> | ||
<% end %> | ||
<p><%= @person[:description] %></p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<div class="row-fluid"> | ||
<div class="span12"></div> | ||
<h1>About <%=raw html_logo %></h1> | ||
<p><%=raw html_logo %> is an experiment in mathematics.</p> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<div class="row-fluid"> | ||
<div class="span12"> | ||
<h1>People</h1> | ||
<p><%=raw html_logo %> was produced by a bunch of people. Here are some of them.</p> | ||
</div> | ||
</div> | ||
<% people_per_row = 2 %> | ||
|
||
<% for i in 0..(@people.length / people_per_row) do %> | ||
<div class="row-fluid"> | ||
<% for j in 0...people_per_row do %> | ||
<% @person = @people[people_per_row*i + j] %> | ||
<div class="span<%= 12/people_per_row %>"> | ||
<% unless @person.nil? %> | ||
<%= render :partial => "person" %> | ||
<% end %> | ||
</div> | ||
<% end %> | ||
</div> | ||
<% end %> | ||
|
||
<div class="row-fluid"> | ||
<div class="span12"> | ||
<h1>Acknowledgments</h1> | ||
<p><%=raw html_logo %> could not have been produced without the generous support of the <a href="http://www.math.osu.edu/">mathematics department</a> at <a href="http://www.osu.edu/">The Ohio State University</a>.</p> | ||
|
||
<p>Uses <a href="http://twitter.github.com/bootstrap/" rel="external">Twitter’s bootstrap</a> and <a href="https://github.com/Khan/khan-exercises/" rel="external">Khan Academy’s exercise framework</a>. Built on <a href="http://rubyonrails.org/">Rails</a>.</p> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
Rails.application.config.middleware.use OmniAuth::Builder do | ||
provider :developer unless Rails.env.production? | ||
# provider :developer unless Rails.env.production? | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.