quiz_proctor_engine 1.0.1 → 1.1.0

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: 159c86a077323d72457bca8016c0be931e7b8a6e
4
- data.tar.gz: 766e001bce19b34d08f72a11d3f11026d89d8dc9
3
+ metadata.gz: 9fcfacb4142d7ae94aa452d12a421ff4b7315bab
4
+ data.tar.gz: 62d9fccbe88dd939892ebadb8dc5f8219c075288
5
5
  SHA512:
6
- metadata.gz: 4b68c79e60b879e008715274e7b077bef11e92dc7f62deddb1617c0e53c4e9fdec1527bcf489a3b51bc74bbaf2c5c7201cbf7ff56989269f2908c68b1b280a94
7
- data.tar.gz: 36fe5c182502b4933abf9bb84365fbd71160b4d65573395f008d4f4eb00c760dbc64532bab2be7d37a3f6590f8f52d1a0f45f666475329f7f9b5f2fe819c3bfc
6
+ metadata.gz: 197372384432ec2e90c131bb5de1144435b52e50063a32cfb26f24aa652d50c1aa861a11cb488bab6980bfbcebcfc339e5493fc465105a0ac4654f54ab93ef03
7
+ data.tar.gz: 91ca88407371c3eeb34f0a9c60ba678c225af7ce3292d4b33629c0b80c37252ab110c0d61ad0cfc70ce5bfc1c3ef00394c8efe0e80fcde113fdf046c978fcf3f
@@ -0,0 +1,29 @@
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::BypassAccessCode
17
+ extend ActiveSupport::Concern
18
+ included do
19
+ before_action :bypass_access_code
20
+ end
21
+
22
+ private
23
+
24
+ def bypass_access_code
25
+ if session[:is_proctored]
26
+ params[:access_code] = session[:proctor_access_code]
27
+ end
28
+ end
29
+ end
@@ -37,13 +37,14 @@ class ProctoredExamsController < ApplicationController
37
37
  headers: headers,
38
38
  # verify: false,
39
39
  )
40
-
41
40
  if quiz.parsed_response["error"].present?
42
41
  flash[:error] = quiz.parsed_response["error"]
43
42
  redirect_to proctored_exams_path
44
43
  else
44
+ quiz = quiz.parsed_response
45
45
  session[:is_proctored] = true
46
- redirect_to course_quiz_take_path quiz.parsed_response["course_id"], quiz.parsed_response["exam_id"]
46
+ session[:proctor_access_code] = quiz["proctor_access_code"]
47
+ redirect_to course_quiz_take_path quiz["quiz"]["course_id"], quiz["quiz"]["exam_id"]
47
48
  end
48
49
  end
49
50
  end
@@ -17,4 +17,5 @@ ActiveSupport.on_load(:action_controller) do
17
17
  include Concerns::Whitelist
18
18
  include Concerns::ProctorQuizzes
19
19
  include Concerns::CatchProctoredExams
20
+ include Concerns::BypassAccessCode
20
21
  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.1".freeze
17
+ VERSION = "1.1.0".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.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - dittonjs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-03 00:00:00.000000000 Z
11
+ date: 2017-03-16 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/bypass_access_code.rb
37
38
  - app/controllers/concerns/catch_proctored_exams.rb
38
39
  - app/controllers/concerns/proctor_quizzes.rb
39
40
  - app/controllers/concerns/validate_signature.rb