quiz_proctor_engine 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 436bd8a18e6647b1a5d51932fb2d899e2ccf761d
4
- data.tar.gz: 90d8936b7653480d9559e5841fa89d5277ac8829
3
+ metadata.gz: 159c86a077323d72457bca8016c0be931e7b8a6e
4
+ data.tar.gz: 766e001bce19b34d08f72a11d3f11026d89d8dc9
5
5
  SHA512:
6
- metadata.gz: 48abd011519befb89306f68913f08fd6d4b97911667cc827ad0dd170b68555f398fc21442c210e9ccfa097b615d3b2994d5e5e4ef355826c5c7ed213f81fa8f6
7
- data.tar.gz: 91c857f2f44a1bcaebcc42320f93c594c8d155a5db88fc2807675cc05dfffbf50235d740926f68879f12915b3142f5f31532705d59d01136515eac3d654dd376
6
+ metadata.gz: 4b68c79e60b879e008715274e7b077bef11e92dc7f62deddb1617c0e53c4e9fdec1527bcf489a3b51bc74bbaf2c5c7201cbf7ff56989269f2908c68b1b280a94
7
+ data.tar.gz: 36fe5c182502b4933abf9bb84365fbd71160b4d65573395f008d4f4eb00c760dbc64532bab2be7d37a3f6590f8f52d1a0f45f666475329f7f9b5f2fe819c3bfc
data/Rakefile CHANGED
@@ -27,5 +27,4 @@ Rake::TestTask.new(:test) do |t|
27
27
  t.verbose = false
28
28
  end
29
29
 
30
-
31
30
  task default: :test
@@ -0,0 +1,37 @@
1
+ # Copyright (C) 2017 Atomic Jolt
2
+
3
+ # This program is free software: you can redistribute it and/or modify
4
+ # it under the terms of the GNU Affero General Public License as published by
5
+ # the Free Software Foundation, either version 3 of the License, or
6
+ # (at your option) any later version.
7
+
8
+ # This program is distributed in the hope that it will be useful,
9
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
+ # GNU Affero General Public License for more details.
12
+
13
+ # You should have received a copy of the GNU Affero General Public License
14
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
15
+
16
+ module Concerns::CatchProctoredExams
17
+ extend ActiveSupport::Concern
18
+ included do
19
+ before_action :redirect_if_isolated
20
+ before_action :isolate_exams
21
+ end
22
+
23
+ private
24
+
25
+ def redirect_if_isolated
26
+ if @current_user && params[:controller] != "proctored_exams" && session[:isolate_exams]
27
+ session[:isolate_exams] = false
28
+ redirect_to proctored_exams_path
29
+ end
30
+ end
31
+
32
+ def isolate_exams
33
+ if !@current_user && params[:controller] == "proctored_exams"
34
+ session[:isolate_exams] = true
35
+ end
36
+ end
37
+ end
@@ -16,8 +16,8 @@
16
16
  require "httparty"
17
17
 
18
18
  class ProctoredExamsController < ApplicationController
19
-
20
19
  layout "borderless_lti"
20
+ before_action :require_user
21
21
 
22
22
  def show; end
23
23
 
@@ -16,4 +16,5 @@
16
16
  ActiveSupport.on_load(:action_controller) do
17
17
  include Concerns::Whitelist
18
18
  include Concerns::ProctorQuizzes
19
+ include Concerns::CatchProctoredExams
19
20
  end
@@ -14,5 +14,5 @@
14
14
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
15
15
 
16
16
  module QuizProctorEngine
17
- VERSION = "1.0.0".freeze
17
+ VERSION = "1.0.1".freeze
18
18
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quiz_proctor_engine
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - dittonjs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-24 00:00:00.000000000 Z
11
+ date: 2017-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -34,6 +34,7 @@ extra_rdoc_files: []
34
34
  files:
35
35
  - LICENSE
36
36
  - Rakefile
37
+ - app/controllers/concerns/catch_proctored_exams.rb
37
38
  - app/controllers/concerns/proctor_quizzes.rb
38
39
  - app/controllers/concerns/validate_signature.rb
39
40
  - app/controllers/concerns/whitelist.rb