\Comproso\Framework\ModelsItem

Item Model class.

This is a laravel Model providing the structure for Comproso Test Items.

Summary

Methods
Properties
Constants
page()
element()
results()
implement()
generate()
proceed()
finish()
No public properties found
No constants found
No protected methods found
$table
$guarded
$hidden
N/A
No private methods found
No private properties found
N/A

Properties

$table

$table : 

Define used database table.

@var string $table name of the database table associated with the Item model.

Type

$guarded

$guarded : array

Whitelisting of properties.

This variable allows to define properties that are more openly accessible.

Type

array — names of whitelisted properties. @see Laravel framework Eloquent.

$hidden

$hidden : 

Blacklisting for JSON transfer.

@var array $hidden names of blacklisted properties.

Type

Methods

page()

page() : object

Relation to Test Pages.

An item can be only associated with a single Page.

Returns

object —

related Page

@see Laravel framework Eloquent.

element()

element() : object

Relation to Test Elements.

An item can be only associated with a single Element. Elements are represented in an agnostic way.

Returns

object —

related Element

@see Laravel framework Eloquent.

results()

results() : object

Relation to Test Results.

Every Result (row) can only be associated with one Item.

Returns

object —

related Results.

@todo verify if this representation is adequate.

implement()

implement(array|null  $data) 

Passing item implementation to Element.

This function passes the implementation of a specific Item to an Element or Item Type.

Parameters

array|null $data

a data row that includes all available information for a specific item extracted from a raw Test representation.

@return boolean fail or success.

generate()

generate(array|object|null  $cache) 

Item generation.

To provide a secured layer between a full item representation and a presented Item, a new (temporary) Item is generated containing only necessary information for presentation.

Parameters

array|object|null $cache

provides available cached information of an Item.

@return object $item.

proceed()

proceed(array|object|null  $cache = null) 

Proceeding an item.

Uses the test taker's response to provide data and proceed the Item response or results. Therefore, the proceeding is passed to the Element/item type.

Parameters

array|object|null $cache

provides available cached information of an Item.

@return mixed proceeding results.

finish()

finish() : void

Element finish hook.

This hook is called if the Item/Element presentation is about to be finished. For instance, it could be used to clear a cache.