Skip to content

Commit

Permalink
Added lecture page and slowly removing stale Coursera links
Browse files Browse the repository at this point in the history
  • Loading branch information
kisonecat committed Jun 28, 2013
1 parent 95ca75e commit 1d82cc3
Show file tree
Hide file tree
Showing 9 changed files with 224 additions and 9 deletions.
5 changes: 3 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ gem "oauth-plugin", "~> 0.4.0"

gem 'twitter-bootstrap-rails'
gem 'less-rails'
gem 'newrelic_rpm'
# gem 'newrelic_rpm'

# use Devise for login
gem 'devise'
gem 'omniauth'
gem 'omniauth-oauth'
# gem 'omniauth-google-oauth2'

# use Nokogiri to parse the exercise files
gem 'nokogiri'
Expand All @@ -35,7 +36,7 @@ group :test do
end

group :staging, :production do
gem 'libv8'
# gem 'libv8'
gem 'piwik_analytics', '~> 1.0.1'
end

Expand Down
2 changes: 2 additions & 0 deletions app/assets/javascripts/utils/answer-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -1580,6 +1580,8 @@ Khan.answerTypes = $.extend(Khan.answerTypes, {
guess_expression = MathFunction.parse(guess);
}

console.log(guess_expression.tex());

var x = guess_expression.variables()[0];
if (x == undefined)
x = 'x';
Expand Down
5 changes: 5 additions & 0 deletions app/controllers/lectures_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class LecturesController < ApplicationController
def index
@youtube = Youtube
end
end
2 changes: 2 additions & 0 deletions app/helpers/lectures_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
module LecturesHelper
end
205 changes: 205 additions & 0 deletions app/models/youtube.rb

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions app/views/exercises/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
<% else %>
<div class="alert">
<button type="button" class="close" data-dismiss="alert">&times;</button>
<strong>Login!</strong> To do the practice exercises, you must first <%= link_to 'sign in to Coursera', user_omniauth_authorize_path(:coursera) %>.
<strong>Login!</strong> To do the practice exercises, you must first <%= link_to 'sign into your account', user_omniauth_authorize_path(:coursera) %>.
</div>
<% end %>

<% current_week = 15 %>
<% current_week = 16 %>

<div class="accordion" id="accordion">
<% for week in @exercises_by_weeks.keys.sort.reverse %>
<% for week in @exercises_by_weeks.keys.sort %>
<% if week <= current_week %>
<div class="accordion-group">
<div class="accordion-heading">
Expand Down
2 changes: 1 addition & 1 deletion app/views/handouts/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ all great things, this is no easy task.</p>
</div>
<div class="active item"><a href="/textbook/mooculus.pdf"><img src="/images/textbook-2.png" class="img-rounded"/></a>
<div class="carousel-caption">
<h4>Week 15</h4>
<h4>Complete</h4>
<p>The complete Calculus One book is now available.</p>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/views/home/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<% if not user_signed_in? %>
<div class="bigverb"><a href="https://www.coursera.org/course/calc1">Enroll <span class="bignoun">in the course</span></a></div>
<% end %>
<div class="bigverb"><a href="https://class.coursera.org/calc1-001/lecture/index">Watch <span class="bignoun">the lectures</span></a></div>
<div class="bigverb"><a href="/lectures">Watch <span class="bignoun">the lectures</span></a></div>
<div class="bigverb"><a href="/handouts">Read <span class="bignoun">the textbook</span></a></div>
<div class="bigverb"><a href="/exercises">Do <span class="bignoun">the problems</span></a></div>
<% if user_signed_in? %>
Expand Down
4 changes: 2 additions & 2 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
<a class="brand" href="/"><%=raw html_logo %></a>
<div class="nav-collapse">
<ul class="nav">
<li><a href="https://class.coursera.org/calc1-001/lecture/index"><i class="icon-film"></i> Lectures</a></li>
<li class="<%= 'active' if params[:controller] == 'lectures' %>"><%= link_to raw("<i class='icon-film'></i> Lectures"), lectures_path %></li>
<li class="<%= 'active' if params[:controller] == 'handouts' %>"><%= link_to raw("<i class='icon-book'></i> Textbook"), handouts_path %></li>
<li class="<%= 'active' if params[:controller] == 'exercises' && params[:action] != "progress" %>"><%= link_to raw("<i class='icon-pencil'></i> Exercises"), exercises_path %></li>
<% if user_signed_in? %>
<li class="<%= 'active' if params[:controller] == 'explorations' && params[:action] != "progress" %>"><%= link_to raw("<i class='icon-truck'></i> Explorations"), :controller => "explorations", :action => "index" %></li>
<li><a href="https://class.coursera.org/calc1-001/forum/index"><i class="icon-comments"></i> Forum</a></li>
<li><a href="http://piazza.com/osu/other/math1151"><i class="icon-comments"></i> Forum</a></li>
<% end %>
</ul>
<ul class="nav pull-right">
Expand Down

0 comments on commit 1d82cc3

Please sign in to comment.