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

_courseids(value) click to toggle source

@private

# File lib/mediawiktory/wikipedia/actions/liststudents.rb, line 31
def _courseids(value)
  merge(courseids: value.to_s, replace: false)
end
_prop(value) click to toggle source

@private

Calls superclass method
# 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
courseids(*values) click to toggle source

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
csv() click to toggle source

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
group() click to toggle source

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
prop(value) click to toggle source

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