Stud.IP  5.4
Instance Class Reference

Public Member Functions

 __construct (StructuralElement $root)
 
 getRoot ()
 
 getUnit ()
 
 getRange ()
 
 getRangeType ()
 
 getBlockTypes ()
 
 getContainerTypes ()
 
 setFavoriteBlockTypes (\User $user, array $favorites)
 
 getRootLayout ()
 
 setRootLayout (string $rootLayout)
 
 isValidRootLayout (string $rootLayout)
 
 getSequentialProgression ()
 
 setSequentialProgression (bool $isSequentialProgression)
 
 setEditingPermissionLevel (string $editingPermissionLevel)
 
 isValidEditingPermissionLevel (string $editingPermissionLevel)
 
 getShowFeedbackPopup ()
 
 setShowFeedbackPopup (bool $showFeedbackPopup)
 
 getShowFeedbackInContentbar ()
 
 setShowFeedbackInContentbar (bool $showFeedbackInContentbar)
 
 setCertificateSettings (array $certificateSettings)
 
 isValidCertificateSettings ($certificateSettings)
 
 setReminderSettings ($reminderSettings)
 
 isValidReminderSettings ($reminderSettings)
 
 setResetProgressSettings ($resetProgressSettings)
 
 isValidResetProgressSettings ($resetProgressSettings)
 
 getUsersBookmarks (\User $user)
 
 findAllStructuralElements ()
 
 findAllBlocks ()
 
 findAllBlocksGroupedByStructuralElementId (callable $formatter=null)
 

Static Public Member Functions

static existsForRange (\Range $range)
 
static findForRange (\Range $range)
 

Data Fields

const EDITING_PERMISSION_DOZENT = 'dozent'
 
const EDITING_PERMISSION_TUTOR = 'tutor'
 

Detailed Description

This class represents an instance of a courseware of a course or a user.

Author
Marcus Eibrink-Lunzenauer lunze.nosp@m.naue.nosp@m.r@ela.nosp@m.n-ev.nosp@m..de
Ron Lucke lucke.nosp@m.@ela.nosp@m.n-ev..nosp@m.de GPL2 or any later version
Since
Stud.IP 5.0

Constructor & Destructor Documentation

◆ __construct()

__construct ( StructuralElement  $root)

Create a new representation of a a courseware instance.

This model class purely represents and does not create anything. Its purpose is to have all things related to a single courseware instance in one place.

Parameters
StructuralElement$rootthe root of this courseware instance

Member Function Documentation

◆ existsForRange()

static existsForRange ( \Range  $range)
static
Parameters
\Range$range
Returns
?static

◆ findAllBlocks()

findAllBlocks ( )

◆ findAllBlocksGroupedByStructuralElementId()

findAllBlocksGroupedByStructuralElementId ( callable  $formatter = null)

Find all blocks of this instance and group them by their structural element's ID. You may specify your own $formatter instead of the default one which stores the blocks as instances of .

Parameters
?callable(array$row): mixed $formatter Provide your own callable if you need something else instead of full-blown instances of .
Returns
array all the (optionally formatted) blocks grouped by the IDs of the structural element containing that block.

◆ findAllStructuralElements()

findAllStructuralElements ( )

◆ findForRange()

static findForRange ( \Range  $range)
static
Parameters
\Range$range
Returns
?static

◆ getBlockTypes()

getBlockTypes ( )

Returns all associated block types registered to this courseware instance.

Returns
array a list of all associated block types

◆ getContainerTypes()

getContainerTypes ( )

Returns all associated container types registered to this courseware instance.

Returns
array a list of all associated block types

◆ getRange()

getRange ( )

Returns the range this courseware instance belongs to.

Returns
the range this courseware instance belongs to

◆ getRangeType()

getRangeType ( )

Returns the type of this courseware instance's range as coded in the root element.

Returns
string the type of this courseware instance's range

◆ getRoot()

getRoot ( )

Returns the root element of this courseware instance.

Returns
StructuralElement the root element of this courseware instance

◆ getRootLayout()

getRootLayout ( )

Returns which layout is set for root node of this coursware instance

Returns
string name of the layout

◆ getSequentialProgression()

getSequentialProgression ( )

Returns whether this courseware instance uses a sequential progression through the structural elements.

Returns
bool true if this courseware instance uses a sequential progression, false otherwise

◆ getShowFeedbackInContentbar()

getShowFeedbackInContentbar ( )

◆ getShowFeedbackPopup()

getShowFeedbackPopup ( )

◆ getUnit()

getUnit ( )

Returns the unit belonging to this courseware instance.

Returns
Unit the unit belonging this courseware instance

◆ getUsersBookmarks()

getUsersBookmarks ( \User  $user)

Returns all bookmarks of a user associated to this courseware instance.

Parameters
\User$userthe user for whom to find associated bookmarks for
Returns
array a list of the given user's bookmarks associated to this instance

◆ isValidCertificateSettings()

isValidCertificateSettings (   $certificateSettings)

Validates certificate settings.

Parameters
\JSONArrayObject$certificateSettingssettings for certificate creation
Returns
bool true if all given values are valid, false otherwise

◆ isValidEditingPermissionLevel()

isValidEditingPermissionLevel ( string  $editingPermissionLevel)

Validates a editing permission level.

Parameters
string$editingPermissionLevelthe editing permission level to validate
Returns
bool true if this editing permission level is valid, false otherwise

◆ isValidReminderSettings()

isValidReminderSettings (   $reminderSettings)

Validates reminder message settings.

Parameters
\JSONArrayObject$reminderSettingssettings for reminder mail sending
Returns
bool true if all given values are valid, false otherwise

◆ isValidResetProgressSettings()

isValidResetProgressSettings (   $resetProgressSettings)

Validates progress resetting settings.

Parameters
\JSONArrayObject$resetProgressSettingssettings for progress resetting
Returns
bool true if all given values are valid, false otherwise

◆ isValidRootLayout()

isValidRootLayout ( string  $rootLayout)

◆ setCertificateSettings()

setCertificateSettings ( array  $certificateSettings)

Sets the certificate settings for this courseware instance.

Parameters
array$certificateSettingsan array of parameters

◆ setEditingPermissionLevel()

setEditingPermissionLevel ( string  $editingPermissionLevel)

Sets the level needed to edit this courseware instance.

Parameters
string$editingPermissionLevelcan be either Instance::EDITING_PERMISSION_DOZENT or Instance::EDITING_PERMISSION_TUTOR

◆ setFavoriteBlockTypes()

setFavoriteBlockTypes ( \User  $user,
array  $favorites 
)

Sets a user's favorite block types for this courseware instance.

Parameters
\User$userthe user for whom the favorite block types will be set
array$favoritesthe list of favorite block types

◆ setReminderSettings()

setReminderSettings (   $reminderSettings)

Sets the reminder message settings this courseware instance.

Parameters
\JSONArrayObject$reminderSettingsan array of parameters

◆ setResetProgressSettings()

setResetProgressSettings (   $resetProgressSettings)

Sets the progress resetting settings this courseware instance.

Parameters
\JSONArrayObject$resetProgressSettingsan array of parameters

◆ setRootLayout()

setRootLayout ( string  $rootLayout)

Sets layout of the root node page of this courseware

Parameters
stringname of the layout

◆ setSequentialProgression()

setSequentialProgression ( bool  $isSequentialProgression)

Sets whether this courseware instance uses a sequential progression through the structural elements.

Parameters
bool$isSequentialProgressiontrue if this courseware instance uses a sequential progression

◆ setShowFeedbackInContentbar()

setShowFeedbackInContentbar ( bool  $showFeedbackInContentbar)

◆ setShowFeedbackPopup()

setShowFeedbackPopup ( bool  $showFeedbackPopup)

Field Documentation

◆ EDITING_PERMISSION_DOZENT

const EDITING_PERMISSION_DOZENT = 'dozent'

◆ EDITING_PERMISSION_TUTOR

const EDITING_PERMISSION_TUTOR = 'tutor'

The documentation for this class was generated from the following file: