limesurvey 0.0.2 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 812145d7d633281617846793695f4543dabe786c
4
- data.tar.gz: 1b2e4c3bd9751527d067d3f34dafa5688802acaa
3
+ metadata.gz: e6971122f994b7544c3373bf8dafc0fcb8f0decb
4
+ data.tar.gz: 95140c358e4363ba543c54576b3064f11cffc2d7
5
5
  SHA512:
6
- metadata.gz: 36fdd7e88c18466d1fde5d717e60edf180306994035a3ee51ed0feabf02bbe4dd17663d1d6562fac87ede30b378df82c1fabcc1555152e6dc33c86ea4791369d
7
- data.tar.gz: 405df88ff6b3f0f23b0ddd6c1b731c847c187e5e543d71b9e14870612817edc9c3ebe892b1f4ab7061af1ad5582c9502e9974a08a05d97fa22cb313b37a1248f
6
+ metadata.gz: b25686ab6c681f81fd793a2317226e61d0d140c708036e0ab8adae958875e6bededbb10403c5d138bf643c1ca4ad00d671b358669ddcdf2acb15f9e718bb0936
7
+ data.tar.gz: 2071f788f64b5528bca49d91909556ec9c519e6d7c72d78dd15447cd9fb8378df97f0622cca8e312efd65fae8bf6bba58907334128179d3280d415cbdfd6620e
data/README.md CHANGED
@@ -21,16 +21,39 @@ Or install it yourself as:
21
21
 
22
22
  $ gem install limesurvey
23
23
 
24
- ## Usage
25
-
26
24
  Add to your environment development.rb and production.rb if you have separate servers. Otherwise, you can add
27
25
  to your environment.rb. Make sure that you have the JSON RPC enabled on the LimeSurvey site.
28
26
 
29
27
  LIMESURVEY_USERNAME = "username"
30
28
  LIMESURVEY_PASSWORD = "password"
31
29
 
30
+
32
31
  Change the url and protocol to match your settings.
33
32
 
34
33
  LIMESURVEY_API_URL = "http://url/index.php?r=admin/remotecontrol"
35
- LIMESURVEY_SSO_URL = "http://url/index.php?r=admin/authentication/sa/login"
36
- LIMESURVEY_SUR_URL = "http://url/index.php?r=survey/index/sid"
34
+ LIMESURVEY_API = Limesurvey::API.new(LIMESURVEY_API_URL)
35
+
36
+ ## Usage
37
+
38
+ session_key = LIMESURVEY_API.get_session_key(limesurvey_username,limesurvey_password)
39
+
40
+ ## Example Helpers
41
+ def limesurvey_get_participant_properties(sid, tid, property)
42
+ #@lime_survey_api = LimeSurvey::API.new(LIMESURVEY_API_URL)
43
+ #@session_key = @lime_survey_api.get_session_key(LIMESURVEY_USERNAME,LIMESURVEY_PASSWORD)
44
+
45
+ participant = LIMESURVEY_API.get_participant_properties(LIMESURVEY_API_SESSION_KEY, sid, tid, [property])
46
+ #@lime_survey_api.release_session_key(@session_key)
47
+ response = JSON.parse(participant.to_json)
48
+ return response[property]
49
+ end
50
+
51
+ def get_limesurvey_title(surveys, sid)
52
+ surveys.each do |item|
53
+ survey = JSON.parse(item.to_json)
54
+ if sid == survey["sid"]
55
+ return survey["surveyls_title"]
56
+
57
+ end
58
+ end
59
+ end
@@ -1,5 +1,6 @@
1
1
  require "limesurvey/version"
2
2
  require "net/http"
3
+ require 'json'
3
4
  module Limesurvey
4
5
  class API
5
6
  def initialize(service_url)
@@ -23,12 +24,4 @@ module Limesurvey
23
24
  end
24
25
 
25
26
  class JSONRPCError < RuntimeError; end
26
-
27
- def get_session_key
28
- Limesurvey::API.new
29
- end
30
-
31
- def release_session_key(session_key)
32
-
33
- end
34
27
  end
@@ -1,3 +1,3 @@
1
1
  module Limesurvey
2
- VERSION = "0.0.2"
2
+ VERSION = "1.0.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: limesurvey
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - kobaltz
@@ -51,7 +51,6 @@ files:
51
51
  - README.md
52
52
  - Rakefile
53
53
  - lib/limesurvey.rb
54
- - lib/limesurvey/init.rb
55
54
  - lib/limesurvey/version.rb
56
55
  - limesurvey.gemspec
57
56
  homepage: ''
File without changes