engrade 1.1.2 → 1.2.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 +4 -4
- data/lib/engrade.rb +13 -8
- data/lib/engrade/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: 0c1ec0680d76ecf417ed7e627b4aea6afadc3aa8
|
4
|
+
data.tar.gz: 1e466ce74f85fc3ce665fa8dc13ab5bc404bde64
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a8d97b4a9ac7cb391c01660c66f0167079a6a1ab4c5a093f4c7e47f98db9a1b0fffd63e4ba8061ddde857258b7bea253b5db8b7e400c0ab0be48c84f98385962
|
7
|
+
data.tar.gz: fd9ad6b5653f6a2f71cb19acf3561e357ab47183ab9c72afc61de12ae0ede050c71f0f4eceae8c4f3ae68af730554525fdbd4614ba8dda3149efe8716ed778df
|
data/lib/engrade.rb
CHANGED
@@ -77,7 +77,7 @@ module Engrade
|
|
77
77
|
# can be filtered by calling with the :only or :except and :type (3=active, 2=archived,
|
78
78
|
# 1=trashed) option.
|
79
79
|
def self.classes(options={})
|
80
|
-
|
80
|
+
filter_classes teacher_classes, options
|
81
81
|
end
|
82
82
|
|
83
83
|
|
@@ -87,7 +87,7 @@ module Engrade
|
|
87
87
|
# assignments can be filtered by calling with the additional :only or :except
|
88
88
|
# option
|
89
89
|
def self.assignments(classes, options={})
|
90
|
-
|
90
|
+
filter_assignments all_assignments(classes), options
|
91
91
|
end
|
92
92
|
|
93
93
|
|
@@ -109,12 +109,17 @@ module Engrade
|
|
109
109
|
# HELPER METHODS #
|
110
110
|
##################
|
111
111
|
|
112
|
-
def self.
|
113
|
-
|
114
|
-
|
115
|
-
array.select! { |
|
116
|
-
array.
|
117
|
-
array
|
112
|
+
def self.filter_classes(array=[], options={})
|
113
|
+
array.select! { |cl| cl.name.match options[:only]} if options[:only]
|
114
|
+
array.reject! { |cl| cl.name.match options[:except]} if options[:except]
|
115
|
+
array.select! { |cl| cl.folder == options[:type] } if options[:type]
|
116
|
+
array.select! { |cl| cl.syr == options[:syr] } if options[:syr]
|
117
|
+
array
|
118
|
+
end
|
119
|
+
|
120
|
+
def self.filter_assignments(array=[], options={})
|
121
|
+
array.select! { |assn| assn.title.match options[:only]} if options[:only]
|
122
|
+
array.reject! { |assn| assn.title.match options[:except]} if options[:except]
|
118
123
|
array
|
119
124
|
end
|
120
125
|
|
data/lib/engrade/version.rb
CHANGED