Class: Kaltura::KalturaQuizService

Inherits:
KalturaServiceBase show all
Defined in:
lib/kaltura_plugins/kaltura_quiz_client_plugin.rb

Overview

Allows user to handle quizzes

Instance Attribute Summary

Attributes inherited from KalturaServiceBase

#client

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ KalturaQuizService

Returns a new instance of KalturaQuizService.



273
274
275
# File 'lib/kaltura_plugins/kaltura_quiz_client_plugin.rb', line 273

def initialize(client)
	super(client)
end

Instance Method Details

#add(entry_id, quiz) ⇒ Object

Allows to add a quiz to an entry



279
280
281
282
283
284
285
286
287
288
# File 'lib/kaltura_plugins/kaltura_quiz_client_plugin.rb', line 279

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) ⇒ Object

Allows to get a quiz



305
306
307
308
309
310
311
312
313
# File 'lib/kaltura_plugins/kaltura_quiz_client_plugin.rb', line 305

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) ⇒ Object

sends a with an api request for pdf from quiz object



342
343
344
345
346
347
348
349
350
351
# File 'lib/kaltura_plugins/kaltura_quiz_client_plugin.rb', line 342

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) ⇒ Object

List quiz objects by filter and pager



317
318
319
320
321
322
323
324
325
326
# File 'lib/kaltura_plugins/kaltura_quiz_client_plugin.rb', line 317

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) ⇒ Object

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



332
333
334
335
336
337
338
# File 'lib/kaltura_plugins/kaltura_quiz_client_plugin.rb', line 332

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) ⇒ Object

Allows to update a quiz



292
293
294
295
296
297
298
299
300
301
# File 'lib/kaltura_plugins/kaltura_quiz_client_plugin.rb', line 292

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