Class: Course::VirtualClassroomsController

Inherits:
ComponentController show all
Defined in:
app/controllers/course/virtual_classrooms_controller.rb

Instance Method Summary collapse

Methods included from ApplicationSignInCallbacksConcern

#sign_in

Methods included from ApplicationPaginationConcern

#page_param

Methods included from ApplicationAnnouncementsConcern

#global_announcements, #unread_global_announcements

Methods included from ApplicationInstanceUserConcern

#current_instance_user

Methods included from ApplicationUserTimeZoneConcern

#set_time_zone

Methods included from ApplicationUserConcern

#handle_access_denied, #publicly_accessible?

Methods included from ApplicationComponentsConcern

#handle_component_not_found

Instance Method Details

:nodoc:


8
9
10
11
12
13
14
15
16
17
# File 'app/controllers/course/virtual_classrooms_controller.rb', line 8

def access_link #:nodoc:
  @braincert_api_service = Course::VirtualClassroom::BraincertApiService.new(
    @virtual_classroom, @settings
  )
  respond_to do |format|
    format.json do
      render_access_link
    end
  end
end

#createObject

:nodoc:


51
52
53
54
55
56
57
58
# File 'app/controllers/course/virtual_classrooms_controller.rb', line 51

def create #:nodoc:
  if @virtual_classroom.save
    redirect_to course_virtual_classrooms_path(current_course),
                success: t('.success', title: @virtual_classroom.title)
  else
    render 'new'
  end
end

#destroyObject

:nodoc:


71
72
73
74
75
76
77
78
79
# File 'app/controllers/course/virtual_classrooms_controller.rb', line 71

def destroy #:nodoc:
  if @virtual_classroom.destroy
    redirect_to course_virtual_classrooms_path(current_course),
                success: t('.success', title: @virtual_classroom.title)
  else
    redirect_to course_virtual_classrooms_path(current_course),
                danger: t('.failure', error: @virtual_classroom.errors.full_messages.to_sentence)
  end
end

#editObject

:nodoc:


60
# File 'app/controllers/course/virtual_classrooms_controller.rb', line 60

def edit; end

#indexObject

:nodoc:


43
44
45
# File 'app/controllers/course/virtual_classrooms_controller.rb', line 43

def index #:nodoc:
  @virtual_classrooms = @virtual_classrooms.includes(:creator).sorted_by_date.page(page_param)
end

#newObject

:nodoc:


49
# File 'app/controllers/course/virtual_classrooms_controller.rb', line 49

def new; end

:nodoc:


31
32
33
34
35
36
37
38
39
40
41
# File 'app/controllers/course/virtual_classrooms_controller.rb', line 31

def recorded_video_link #:nodoc:
  authorize! :access_recorded_videos, current_course
  @braincert_api_service = Course::VirtualClassroom::BraincertApiService.new(
    nil, @settings
  )
  respond_to do |format|
    format.json do
      render_video_link
    end
  end
end

#recorded_videosObject

:nodoc:


19
20
21
22
23
24
25
26
27
28
29
# File 'app/controllers/course/virtual_classrooms_controller.rb', line 19

def recorded_videos #:nodoc:
  authorize! :manage, @virtual_classroom
  @braincert_api_service = Course::VirtualClassroom::BraincertApiService.new(
    @virtual_classroom, @settings
  )
  respond_to do |format|
    format.json do
      render json: @braincert_api_service.fetch_recorded_videos
    end
  end
end

#showObject

:nodoc:


47
# File 'app/controllers/course/virtual_classrooms_controller.rb', line 47

def show; end

#updateObject

:nodoc:


62
63
64
65
66
67
68
69
# File 'app/controllers/course/virtual_classrooms_controller.rb', line 62

def update #:nodoc:
  if @virtual_classroom.update_attributes(virtual_classroom_params)
    redirect_to course_virtual_classrooms_path(current_course),
                success: t('.success', title: @virtual_classroom.title)
  else
    render 'edit'
  end
end