sraas 0.3.4 → 0.3.5

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: 7d02773f5dd65d5723e444724def74c947e2ad5a
4
- data.tar.gz: '091f64813b9be2a2fea790024463c33f81da589f'
3
+ metadata.gz: 04e2a061b4cdfc6378864b64bbe43b4f7c38a503
4
+ data.tar.gz: e5b8475878438125b31275225845b2d132a0e22c
5
5
  SHA512:
6
- metadata.gz: 9bb33ca625e067b239156da13fe3c6f990aad186db75e723713c758168d74cc47516c0f55838ba49c2e3b014a62ee47309a2b19e62a1e5813d67b9497c8f07b9
7
- data.tar.gz: e898a1ff817608869bd4959066963939a8b58f6a01b595371b0776dd95bca84c6bb798a76797839ba80b0c19ee86236796635e4c4dbb9863d27bb0864f0a4819
6
+ metadata.gz: 41a76b49c20c79ef51f286798d24c56d079bdabfcb04624c8ff25f6bf9e3c5e2c306f449e22195f36dd77d1fb141b68b8066ae9ed6d3e06f98a4a9309605d352
7
+ data.tar.gz: 7aa0b857bd52afc94e25f99c8a7ddbeea42bb78b2bccde0ac549040a15de9e0edba67802adcf00f0cc07ffc21ba749cf848b792ad982e7b2fb38a68b2048279f
data/lib/sraas.rb CHANGED
@@ -50,6 +50,12 @@ module Sraas
50
50
  JSON.parse(api_resource(:get, "#{template_decks_endpoint}/#{id}"))
51
51
  end
52
52
 
53
+ # This returns sum of the field in template_card grouped by lesson.
54
+ def sum_template_cards_field_group_by_lesson(template_deck_id:, field:, kind: nil, lesson: nil)
55
+ payload = {field: field, kind: kind, lesson: lesson}
56
+ JSON.parse(api_resource(:get, "#{template_decks_endpoint}/#{template_deck_id}/sum_field_group_by_lesson", payload))
57
+ end
58
+
53
59
  # This returns template cards "index" json
54
60
  # if limit is > 100, do paging here.
55
61
  def template_cards(template_deck_id, offset: 0, limit: 100)
@@ -121,6 +127,10 @@ module Sraas
121
127
  "#{configuration.url}/template_cards"
122
128
  end
123
129
 
130
+ def consumer_stats_endpoint
131
+ "#{configuration.url}/consumer_stats"
132
+ end
133
+
124
134
  def api_resource(http_method, url, payload = {})
125
135
  RestClient::Request
126
136
  .execute(
@@ -166,6 +166,11 @@ module Sraas
166
166
  data.code == 200
167
167
  end
168
168
 
169
+ # return consumer's progress including review results, review_accuracy
170
+ def progress
171
+ parse_json { get("#{Sraas.consumer_stats_endpoint}/#{self.consumer_uuid}") }
172
+ end
173
+
169
174
  # This is a public method to provide to views parsing JSON in JavaScript
170
175
  def consumer_url
171
176
  "#{Sraas.consumers_endpoint}/#{self.consumer_uuid}"
data/lib/sraas/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Sraas
2
- VERSION = '0.3.4'
2
+ VERSION = '0.3.5'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sraas
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Siegel