class MediaWiktory::Wikipedia::Actions::Liststudents
Get
the usernames and other information for students enrolled in one or more courses.
Usage:
“`ruby api.liststudents.courseids(value).perform # returns string with raw output # or api.liststudents.courseids(value).response # returns output parsed and wrapped into Response
object “`
See {Base} for generic explanation of working with MediaWiki actions and {MediaWiktory::Wikipedia::Response} for working with action responses.
All action's parameters are documented as its public methods, see below.
Public Instance Methods
@private
# File lib/mediawiktory/wikipedia/actions/liststudents.rb, line 31 def _courseids(value) merge(courseids: value.to_s, replace: false) end
@private
# File lib/mediawiktory/wikipedia/actions/liststudents.rb, line 44 def _prop(value) defined?(super) && super || ["username", "id"].include?(value.to_s) && merge(prop: value.to_s) end
IDs of the courses.
@param values [Array<Integer>] @return [self]
# File lib/mediawiktory/wikipedia/actions/liststudents.rb, line 26 def courseids(*values) values.inject(self) { |res, val| res._courseids(val) } end
If given, the query will return usernames in CSV format, and it will return the articles assigned to those students.
@return [self]
# File lib/mediawiktory/wikipedia/actions/liststudents.rb, line 58 def csv() merge(csv: 'true') end
If given, the query will group students by course.
@return [self]
# File lib/mediawiktory/wikipedia/actions/liststudents.rb, line 51 def group() merge(group: 'true') end
Which property to get for each student:
@param value [String] One of “username” (The username of the student), “id” (The user ID of the student). @return [self]
# File lib/mediawiktory/wikipedia/actions/liststudents.rb, line 39 def prop(value) _prop(value) or fail ArgumentError, "Unknown value for prop: #{value}" end