class Kaltura::KalturaQuizService

Allows user to handle quizzes

Public Class Methods

new(client) click to toggle source
Calls superclass method Kaltura::KalturaServiceBase::new
# File lib/kaltura_plugins/kaltura_quiz_client_plugin.rb, line 388
def initialize(client)
        super(client)
end

Public Instance Methods

add(entry_id, quiz) click to toggle source

Allows to add a quiz to an entry @return [KalturaQuiz]

# File lib/kaltura_plugins/kaltura_quiz_client_plugin.rb, line 394
def add(entry_id, quiz)
        kparams = {}
        client.add_param(kparams, 'entryId', entry_id)
        client.add_param(kparams, 'quiz', quiz)
        client.queue_service_action_call('quiz_quiz', 'add', 'KalturaQuiz', kparams)
        if (client.is_multirequest)
                return nil
        end
        return client.do_queue()
end
get(entry_id) click to toggle source

Allows to get a quiz @return [KalturaQuiz]

# File lib/kaltura_plugins/kaltura_quiz_client_plugin.rb, line 407
def get(entry_id)
        kparams = {}
        client.add_param(kparams, 'entryId', entry_id)
        client.queue_service_action_call('quiz_quiz', 'get', 'KalturaQuiz', kparams)
        if (client.is_multirequest)
                return nil
        end
        return client.do_queue()
end
get_url(entry_id, quiz_output_type) click to toggle source

sends a with an api request for pdf from quiz object @return [string]

# File lib/kaltura_plugins/kaltura_quiz_client_plugin.rb, line 419
def get_url(entry_id, quiz_output_type)
        kparams = {}
        client.add_param(kparams, 'entryId', entry_id)
        client.add_param(kparams, 'quizOutputType', quiz_output_type)
        client.queue_service_action_call('quiz_quiz', 'getUrl', 'string', kparams)
        if (client.is_multirequest)
                return nil
        end
        return client.do_queue()
end
list(filter=KalturaNotImplemented, pager=KalturaNotImplemented) click to toggle source

List quiz objects by filter and pager @return [KalturaQuizListResponse]

# File lib/kaltura_plugins/kaltura_quiz_client_plugin.rb, line 432
def list(filter=KalturaNotImplemented, pager=KalturaNotImplemented)
        kparams = {}
        client.add_param(kparams, 'filter', filter)
        client.add_param(kparams, 'pager', pager)
        client.queue_service_action_call('quiz_quiz', 'list', 'KalturaQuizListResponse', kparams)
        if (client.is_multirequest)
                return nil
        end
        return client.do_queue()
end
serve(entry_id, quiz_output_type) click to toggle source

creates a pdf from quiz object

The Output type defines the file format in which the quiz will be generated
Currently only PDF files are supported

@return [file]

# File lib/kaltura_plugins/kaltura_quiz_client_plugin.rb, line 447
def serve(entry_id, quiz_output_type)
        kparams = {}
        client.add_param(kparams, 'entryId', entry_id)
        client.add_param(kparams, 'quizOutputType', quiz_output_type)
        client.queue_service_action_call('quiz_quiz', 'serve', 'file', kparams)
        return client.get_serve_url()
end
update(entry_id, quiz) click to toggle source

Allows to update a quiz @return [KalturaQuiz]

# File lib/kaltura_plugins/kaltura_quiz_client_plugin.rb, line 457
def update(entry_id, quiz)
        kparams = {}
        client.add_param(kparams, 'entryId', entry_id)
        client.add_param(kparams, 'quiz', quiz)
        client.queue_service_action_call('quiz_quiz', 'update', 'KalturaQuiz', kparams)
        if (client.is_multirequest)
                return nil
        end
        return client.do_queue()
end