diff --git a/app/assets/images/logo_large.png b/app/assets/images/logo_large.png index 9b919e3..3465067 100644 Binary files a/app/assets/images/logo_large.png and b/app/assets/images/logo_large.png differ diff --git a/app/assets/images/logo_large@2x.png b/app/assets/images/logo_large@2x.png index b7fc91d..d6d8b3c 100644 Binary files a/app/assets/images/logo_large@2x.png and b/app/assets/images/logo_large@2x.png differ diff --git a/app/assets/javascripts/learning_targets.js.coffee b/app/assets/javascripts/concepts.js.coffee similarity index 100% rename from app/assets/javascripts/learning_targets.js.coffee rename to app/assets/javascripts/concepts.js.coffee diff --git a/app/assets/stylesheets/learning_targets.css.scss b/app/assets/stylesheets/concepts.css.scss similarity index 100% rename from app/assets/stylesheets/learning_targets.css.scss rename to app/assets/stylesheets/concepts.css.scss diff --git a/app/assets/stylesheets/output.gif b/app/assets/stylesheets/output.gif index c9031b9..2f7efc1 100644 Binary files a/app/assets/stylesheets/output.gif and b/app/assets/stylesheets/output.gif differ diff --git a/app/assets/stylesheets/units.css.scss b/app/assets/stylesheets/units.css.scss index bf27037..f386119 100644 --- a/app/assets/stylesheets/units.css.scss +++ b/app/assets/stylesheets/units.css.scss @@ -2,6 +2,6 @@ // They will automatically be included in application.css. // You can use Sass (SCSS) here: http://sass-lang.com/ -.lt-heading{ +.concept-heading{ line-height: 200%; } \ No newline at end of file diff --git a/app/controllers/learning_targets_controller.rb b/app/controllers/concepts_controller.rb similarity index 53% rename from app/controllers/learning_targets_controller.rb rename to app/controllers/concepts_controller.rb index 6c29df5..7bda84c 100644 --- a/app/controllers/learning_targets_controller.rb +++ b/app/controllers/concepts_controller.rb @@ -1,44 +1,44 @@ -class LearningTargetsController < ApplicationController +class ConceptsController < ApplicationController def new - @lt = LearningTarget.new + @concept = Concept.new end def create - @lt = current_unit.learning_targets.build(lt_params) - if @lt.save + @concept = current_unit.concepts.build(concept_params) + if @concept.save redirect_to root_path end end def show - @lt = LearningTarget.find(params[:id]) + @concept = Concept.find(params[:id]) end - def lt_params - params.require(:learning_target).permit(:description) + def concept_params + params.require(:concept).permit(:description) end def new_progress enrollment = Enrollment.where("student_id = ? AND course_id = ?", - current_student.id, @lt.unit.course.id).first + current_student.id, @concept.unit.course.id).first progress = LearningTargetProgress.new(enrollment_id: enrollment.id, - learning_target_id: @lt.id) + concept_id: @concept.id) - redirect_to @lt if progress.save + redirect_to @concept if progress.save end def modify_level - @lt = LearningTarget.find(params[:lt_id]) + @concept = Concept.find(params[:concept_id]) if student_signed_in? enrollment = Enrollment.where("student_id = ? AND course_id = ?", - current_student.id, @lt.unit.course.id).first + current_student.id, @concept.unit.course.id).first - progress = LearningTargetProgress.where("learning_target_id = ? AND + progress = LearningTargetProgress.where("concept_id= ? AND enrollment_id = ?", - @lt.id,enrollment.id).first + @concept.id,enrollment.id).first comment = Comment.create(content: params[:comment], commenter_name: current_student.full_name) @@ -46,11 +46,11 @@ def modify_level elsif teacher_signed_in? enrollment = Enrollment.where("student_id = ? AND course_id = ?", - params[:student_id], @lt.unit.course.id).first + params[:student_id], @concept.unit.course.id).first - progress = LearningTargetProgress.where("learning_target_id = ? AND + progress = LearningTargetProgress.where("concept_id= ? AND enrollment_id = ?", - @lt.id,enrollment.id).first + @concept.id,enrollment.id).first comment = Comment.create(content: params[:comment], commenter_name: current_teacher.full_name) @@ -59,7 +59,7 @@ def modify_level progress.add_comment(comment) progress.change_level(params[:level]) - redirect_to @lt if progress.save + redirect_to @concept if progress.save end helper_method :new_progress diff --git a/app/controllers/units_controller.rb b/app/controllers/units_controller.rb index ec71846..e5ce179 100644 --- a/app/controllers/units_controller.rb +++ b/app/controllers/units_controller.rb @@ -8,10 +8,10 @@ def show @unit = Unit.find(params[:id]) end - def add_lt - @lt = LearningTarget.new(unit_id: params[:current_unit], description: params[:lt_desc], number: params[:lt_number]) + def add_concept + @concept = Concept.new(unit_id: params[:current_unit], description: params[:concept_desc], number: params[:concept_number]) - @lt.save + @concept.save redirect_to unit_path(params[:current_unit]) end diff --git a/app/helpers/concepts_helper.rb b/app/helpers/concepts_helper.rb new file mode 100644 index 0000000..80a4dd1 --- /dev/null +++ b/app/helpers/concepts_helper.rb @@ -0,0 +1,2 @@ +module ConceptsHelper +end diff --git a/app/helpers/learning_targets_helper.rb b/app/helpers/learning_targets_helper.rb deleted file mode 100644 index 0aab562..0000000 --- a/app/helpers/learning_targets_helper.rb +++ /dev/null @@ -1,2 +0,0 @@ -module LearningTargetsHelper -end diff --git a/app/models/learning_target.rb b/app/models/concept.rb similarity index 80% rename from app/models/learning_target.rb rename to app/models/concept.rb index e1e7b88..d979f91 100644 --- a/app/models/learning_target.rb +++ b/app/models/concept.rb @@ -1,4 +1,4 @@ -class LearningTarget < ActiveRecord::Base +class Concept < ActiveRecord::Base belongs_to :unit has_many :learning_target_progresses, dependent: :destroy diff --git a/app/models/learning_target_progress.rb b/app/models/learning_target_progress.rb index dee4cb2..e35953a 100644 --- a/app/models/learning_target_progress.rb +++ b/app/models/learning_target_progress.rb @@ -5,7 +5,7 @@ class LearningTargetProgress < ActiveRecord::Base after_initialize :init belongs_to :enrollment - belongs_to :learning_target + belongs_to :concept has_many :comments validates_presence_of :level diff --git a/app/models/task.rb b/app/models/task.rb index e9d9d80..8f2affe 100644 --- a/app/models/task.rb +++ b/app/models/task.rb @@ -1,6 +1,6 @@ class Task < ActiveRecord::Base - belongs_to :learning_target + belongs_to :concept validates_presence_of :status, :content end diff --git a/app/models/unit.rb b/app/models/unit.rb index 20e66cc..c101a20 100644 --- a/app/models/unit.rb +++ b/app/models/unit.rb @@ -1,7 +1,7 @@ class Unit < ActiveRecord::Base belongs_to :course - has_many :learning_targets + has_many :concepts validates_presence_of :name, :number end diff --git a/app/views/learning_targets/_modify_level_form.html.erb b/app/views/concepts/_modify_level_form.html.erb similarity index 86% rename from app/views/learning_targets/_modify_level_form.html.erb rename to app/views/concepts/_modify_level_form.html.erb index 0295550..6fb1f73 100644 --- a/app/views/learning_targets/_modify_level_form.html.erb +++ b/app/views/concepts/_modify_level_form.html.erb @@ -1,4 +1,4 @@ -<%= form_tag learning_targets_modify_level_path, id:"levelForm", +<%= form_tag concepts_modify_level_path, id:"levelForm", method: 'post' do%>
@@ -10,7 +10,7 @@ <%= select_tag :level, options_for_select([1,2,3,4]), class: "form-control" %> - <%= hidden_field_tag 'lt_id', params[:id] %> + <%= hidden_field_tag 'concept_id', params[:id] %> <%= hidden_field_tag 'student_id', params[:student_id]%>
<%= button_tag "Change Level", @@ -30,4 +30,4 @@ $('#levelButton').click(function() { $('#levelForm').submit(); } }); - \ No newline at end of file + diff --git a/app/views/learning_targets/_modify_level_modal.html.erb b/app/views/concepts/_modify_level_modal.html.erb similarity index 100% rename from app/views/learning_targets/_modify_level_modal.html.erb rename to app/views/concepts/_modify_level_modal.html.erb diff --git a/app/views/learning_targets/_student.html.erb b/app/views/concepts/_student.html.erb similarity index 100% rename from app/views/learning_targets/_student.html.erb rename to app/views/concepts/_student.html.erb diff --git a/app/views/concepts/_student_progress.html.erb b/app/views/concepts/_student_progress.html.erb new file mode 100644 index 0000000..6b3b057 --- /dev/null +++ b/app/views/concepts/_student_progress.html.erb @@ -0,0 +1,21 @@ + + <% if current_student.current_progress(@concept.unit.course).nil? %> + <% new_progress %> + <% else %> + <%= current_student.current_progress(@concept.unit.course).level%> + + <%= current_student.current_progress(@concept.unit.course).comments.last.content if !current_student.current_progress(@concept.unit.course).comments.last.nil? %> + + + <%= current_student.current_progress(@concept.unit.course). + comments.last.commenter_name if !current_student.current_progress( + @concept.unit.course).comments.last.nil? %> + + <% end %> + + <%= link_to "Change Level", '#levelModal', + :class => "btn btn-primary btn-sm changebutton", + :data => { :toggle => "modal" }, + :id => current_student.id %> + + \ No newline at end of file diff --git a/app/views/learning_targets/_teacher.html.erb b/app/views/concepts/_teacher.html.erb similarity index 87% rename from app/views/learning_targets/_teacher.html.erb rename to app/views/concepts/_teacher.html.erb index ca090eb..ae8ddc3 100644 --- a/app/views/learning_targets/_teacher.html.erb +++ b/app/views/concepts/_teacher.html.erb @@ -6,7 +6,7 @@ Commented By Level Up? - <% if @lt.unit.course.enrollments.empty? %> + <% if @concept.unit.course.enrollments.empty? %>
There are currently no students enrolled. diff --git a/app/views/learning_targets/_teacher_progress.html.erb b/app/views/concepts/_teacher_progress.html.erb similarity index 91% rename from app/views/learning_targets/_teacher_progress.html.erb rename to app/views/concepts/_teacher_progress.html.erb index ff51b70..0ac20f5 100644 --- a/app/views/learning_targets/_teacher_progress.html.erb +++ b/app/views/concepts/_teacher_progress.html.erb @@ -1,4 +1,4 @@ -<% @lt.unit.course.enrollments.each do |e| %> +<% @concept.unit.course.enrollments.each do |e| %> <% e.learning_target_progresses.each do |p| %> > <%= e.student.full_name %> diff --git a/app/views/learning_targets/show.html.erb b/app/views/concepts/show.html.erb similarity index 53% rename from app/views/learning_targets/show.html.erb rename to app/views/concepts/show.html.erb index d58380b..ae510dc 100644 --- a/app/views/learning_targets/show.html.erb +++ b/app/views/concepts/show.html.erb @@ -1,11 +1,11 @@ -<% provide(:title, "LT #{ @lt.number }") %> +<% provide(:title, "Concept #{ @concept.number }") %> <%= render 'modify_level_modal' %> diff --git a/app/views/learning_targets/_student_progress.html.erb b/app/views/learning_targets/_student_progress.html.erb deleted file mode 100644 index 0e18555..0000000 --- a/app/views/learning_targets/_student_progress.html.erb +++ /dev/null @@ -1,21 +0,0 @@ - - <% if current_student.current_progress(@lt.unit.course).nil? %> - <% new_progress %> - <% else %> - <%= current_student.current_progress(@lt.unit.course).level%> - - <%= current_student.current_progress(@lt.unit.course).comments.last.content if !current_student.current_progress(@lt.unit.course).comments.last.nil? %> - - - <%= current_student.current_progress(@lt.unit.course). - comments.last.commenter_name if !current_student.current_progress( - @lt.unit.course).comments.last.nil? %> - - <% end %> - - <%= link_to "Change Level", '#levelModal', - :class => "btn btn-primary btn-sm changebutton", - :data => { :toggle => "modal" }, - :id => current_student.id %> - - \ No newline at end of file diff --git a/app/views/teachers/_concept_form.html.erb b/app/views/teachers/_concept_form.html.erb new file mode 100644 index 0000000..d1db5db --- /dev/null +++ b/app/views/teachers/_concept_form.html.erb @@ -0,0 +1,19 @@ +<%= form_tag units_add_concept_path, method: 'post' do %> +
+
+ <%= label_tag :concept_number %> + <%= text_field_tag :concept_number, nil, + class: "form-control", + placeholder: "Concept Number"%>
+ + <%= label_tag :concept_description %> + <%= text_area_tag :concept_desc, nil, + class: "form-control", + rows: "5", + placeholder: "Concept Description" %>
+ <%= hidden_field_tag :current_unit, @unit.id %> + +
+ <%= submit_tag "Add Concept", class: "btn btn-default" %> +
+<% end %> diff --git a/app/views/teachers/_lt_modal.html.erb b/app/views/teachers/_concept_modal.html.erb similarity index 64% rename from app/views/teachers/_lt_modal.html.erb rename to app/views/teachers/_concept_modal.html.erb index a6d9956..9fd1774 100644 --- a/app/views/teachers/_lt_modal.html.erb +++ b/app/views/teachers/_concept_modal.html.erb @@ -1,13 +1,13 @@ - diff --git a/app/views/teachers/_lt_form.html.erb b/app/views/teachers/_lt_form.html.erb deleted file mode 100644 index cc6eead..0000000 --- a/app/views/teachers/_lt_form.html.erb +++ /dev/null @@ -1,19 +0,0 @@ -<%= form_tag units_add_lt_path, method: 'post' do %> -
-
- <%= label_tag :learning_target_number %> - <%= text_field_tag :lt_number, nil, - class: "form-control", - placeholder: "Learning Target Number"%>
- - <%= label_tag :learning_target_description %> - <%= text_area_tag :lt_desc, nil, - class: "form-control", - rows: "5", - placeholder: "Learning Target Description" %>
- <%= hidden_field_tag :current_unit, @unit.id %> - -
- <%= submit_tag "Add Learning Target", class: "btn btn-default" %> -
-<% end %> diff --git a/app/views/units/_concept_list.html.erb b/app/views/units/_concept_list.html.erb new file mode 100644 index 0000000..69a044e --- /dev/null +++ b/app/views/units/_concept_list.html.erb @@ -0,0 +1,25 @@ +
+
Concepts + <% if teacher_signed_in? %> + + + + <% end %> +
+ + + + + + + <% @unit.concepts.each do |concept| %> + + + + + + <% end %> +
ConceptDescriptionView more
<%= concept.number %><%= concept.description %><%= link_to "View more", concept %>
+
diff --git a/app/views/units/_learning_target_list.html.erb b/app/views/units/_learning_target_list.html.erb deleted file mode 100644 index 4d0d0a7..0000000 --- a/app/views/units/_learning_target_list.html.erb +++ /dev/null @@ -1,23 +0,0 @@ -
-
Learning Targets - <% if teacher_signed_in? %> - - - - <% end %> -
- - - - - - - <% @unit.learning_targets.each do |lt| %> - - - - - - <% end %> -
LTDescriptionView more
<%= lt.number %><%= lt.description %><%= link_to "View more", lt %>
-
diff --git a/app/views/units/_student_view.html.erb b/app/views/units/_student_view.html.erb index 5702a2b..63d02b8 100644 --- a/app/views/units/_student_view.html.erb +++ b/app/views/units/_student_view.html.erb @@ -1 +1 @@ -<%= render 'learning_target_list' %> +<%= render 'concept_list' %> diff --git a/app/views/units/_teacher_view.html.erb b/app/views/units/_teacher_view.html.erb index 3de2a3d..50b9e3c 100644 --- a/app/views/units/_teacher_view.html.erb +++ b/app/views/units/_teacher_view.html.erb @@ -1,15 +1,19 @@ -
- <% if @unit.learning_targets.first.nil? %> +
+ + <% if @unit.concepts.first.nil? %> +
- Would you like to add a learning target for <%= @unit.name %>? + Would you like to add a + concept for <%= @unit.name %>?
- - <% else %> - + + <% else %> +
- <%= render 'learning_target_list' %> + <%= render 'concept_list' %>
- - <% end %> + + <% end %> +
diff --git a/app/views/units/show.html.erb b/app/views/units/show.html.erb index 3e6b146..cdc74bb 100644 --- a/app/views/units/show.html.erb +++ b/app/views/units/show.html.erb @@ -1,6 +1,6 @@ <% provide(:title, @unit.name) %> -<%= render 'teachers/lt_modal' %> +<%= render 'teachers/concept_modal' %>