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 +4 -4
- data/lib/sraas.rb +10 -0
- data/lib/sraas/consumer.rb +5 -0
- data/lib/sraas/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 04e2a061b4cdfc6378864b64bbe43b4f7c38a503
|
4
|
+
data.tar.gz: e5b8475878438125b31275225845b2d132a0e22c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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(
|
data/lib/sraas/consumer.rb
CHANGED
@@ -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