ILIAS  release_8 Revision v8.24
ilAssQuestionPreviewSettings Class Reference
+ Collaboration diagram for ilAssQuestionPreviewSettings:

Public Member Functions

 __construct ($contextRefId)
 
 init ()
 
 isTestRefId ()
 
 setContextRefId ($contextRefId)
 
 getContextRefId ()
 
 isReachedPointsEnabled ()
 
 setReachedPointsEnabled (bool $reachedPointsEnabled)
 
 setGenericFeedbackEnabled ($genericFeedbackEnabled)
 
 isGenericFeedbackEnabled ()
 
 setSpecificFeedbackEnabled ($specificFeedbackEnabled)
 
 isSpecificFeedbackEnabled ()
 
 setHintProvidingEnabled (bool $hintProvidingEnabled)
 
 isHintProvidingEnabled ()
 
 setBestSolutionEnabled ($bestSolutionEnabled)
 
 isBestSolutionEnabled ()
 
 isInstantFeedbackNavigationRequired ()
 
 isHintProvidingNavigationRequired ()
 

Protected Attributes

 $reachedPointsEnabled = false
 

Private Member Functions

 initSettingsWithTestObject ()
 
 initSettingsFromPostParameters ()
 

Private Attributes

 $contextRefId = null
 
 $genericFeedbackEnabled = false
 
 $specificFeedbackEnabled = false
 
 $hintProvidingEnabled = false
 
 $bestSolutionEnabled = false
 

Detailed Description

Definition at line 25 of file class.ilAssQuestionPreviewSettings.php.

Constructor & Destructor Documentation

◆ __construct()

ilAssQuestionPreviewSettings::__construct (   $contextRefId)

Definition at line 42 of file class.ilAssQuestionPreviewSettings.php.

43 {
44 $this->contextRefId = $contextRefId;
45 }

References $contextRefId.

Member Function Documentation

◆ getContextRefId()

ilAssQuestionPreviewSettings::getContextRefId ( )

Definition at line 92 of file class.ilAssQuestionPreviewSettings.php.

93 {
95 }

References $contextRefId.

◆ init()

ilAssQuestionPreviewSettings::init ( )

◆ initSettingsFromPostParameters()

ilAssQuestionPreviewSettings::initSettingsFromPostParameters ( )
private

Definition at line 76 of file class.ilAssQuestionPreviewSettings.php.

76 : void
77 {
78 // get from post or from toolbar instance if possible
79
80 $this->setGenericFeedbackEnabled(true);
81 $this->setSpecificFeedbackEnabled(true);
82 $this->setHintProvidingEnabled(true);
83 $this->setBestSolutionEnabled(true);
84 $this->setReachedPointsEnabled(true);
85 }
setHintProvidingEnabled(bool $hintProvidingEnabled)
setReachedPointsEnabled(bool $reachedPointsEnabled)

References setBestSolutionEnabled(), setGenericFeedbackEnabled(), setHintProvidingEnabled(), setReachedPointsEnabled(), and setSpecificFeedbackEnabled().

Referenced by init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initSettingsWithTestObject()

ilAssQuestionPreviewSettings::initSettingsWithTestObject ( )
private

Definition at line 63 of file class.ilAssQuestionPreviewSettings.php.

63 : void
64 {
65 /* @var ilObjTest $testOBJ */
66 $testOBJ = ilObjectFactory::getInstanceByRefId($this->contextRefId);
67 $testOBJ->loadFromDb();
68
69 $this->setGenericFeedbackEnabled($testOBJ->getGenericAnswerFeedback());
70 $this->setSpecificFeedbackEnabled($testOBJ->getSpecificAnswerFeedback());
71 $this->setHintProvidingEnabled($testOBJ->isOfferingQuestionHintsEnabled());
72 $this->setBestSolutionEnabled($testOBJ->getInstantFeedbackSolution());
73 $this->setReachedPointsEnabled($testOBJ->getAnswerFeedbackPoints());
74 }
static getInstanceByRefId(int $ref_id, bool $stop_on_error=true)
get an instance of an Ilias object by reference id

References ilObjectFactory\getInstanceByRefId(), setBestSolutionEnabled(), setGenericFeedbackEnabled(), setHintProvidingEnabled(), setReachedPointsEnabled(), and setSpecificFeedbackEnabled().

Referenced by init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isBestSolutionEnabled()

ilAssQuestionPreviewSettings::isBestSolutionEnabled ( )

Definition at line 148 of file class.ilAssQuestionPreviewSettings.php.

References $bestSolutionEnabled.

Referenced by isInstantFeedbackNavigationRequired().

+ Here is the caller graph for this function:

◆ isGenericFeedbackEnabled()

ilAssQuestionPreviewSettings::isGenericFeedbackEnabled ( )

Definition at line 118 of file class.ilAssQuestionPreviewSettings.php.

References $genericFeedbackEnabled.

Referenced by isInstantFeedbackNavigationRequired().

+ Here is the caller graph for this function:

◆ isHintProvidingEnabled()

ilAssQuestionPreviewSettings::isHintProvidingEnabled ( )

Definition at line 138 of file class.ilAssQuestionPreviewSettings.php.

References $hintProvidingEnabled.

Referenced by isHintProvidingNavigationRequired().

+ Here is the caller graph for this function:

◆ isHintProvidingNavigationRequired()

ilAssQuestionPreviewSettings::isHintProvidingNavigationRequired ( )

Definition at line 170 of file class.ilAssQuestionPreviewSettings.php.

170 : bool
171 {
172 return $this->isHintProvidingEnabled();
173 }

References isHintProvidingEnabled().

+ Here is the call graph for this function:

◆ isInstantFeedbackNavigationRequired()

ilAssQuestionPreviewSettings::isInstantFeedbackNavigationRequired ( )

Definition at line 153 of file class.ilAssQuestionPreviewSettings.php.

153 : bool
154 {
155 if ($this->isGenericFeedbackEnabled()) {
156 return true;
157 }
158
159 if ($this->isSpecificFeedbackEnabled()) {
160 return true;
161 }
162
163 if ($this->isBestSolutionEnabled()) {
164 return true;
165 }
166
167 return false;
168 }

References isBestSolutionEnabled(), isGenericFeedbackEnabled(), and isSpecificFeedbackEnabled().

+ Here is the call graph for this function:

◆ isReachedPointsEnabled()

ilAssQuestionPreviewSettings::isReachedPointsEnabled ( )
Returns
bool

Definition at line 100 of file class.ilAssQuestionPreviewSettings.php.

References $reachedPointsEnabled.

◆ isSpecificFeedbackEnabled()

ilAssQuestionPreviewSettings::isSpecificFeedbackEnabled ( )

Definition at line 128 of file class.ilAssQuestionPreviewSettings.php.

References $specificFeedbackEnabled.

Referenced by isInstantFeedbackNavigationRequired().

+ Here is the caller graph for this function:

◆ isTestRefId()

ilAssQuestionPreviewSettings::isTestRefId ( )

Definition at line 56 of file class.ilAssQuestionPreviewSettings.php.

56 : bool
57 {
58 $objectType = ilObject::_lookupType($this->contextRefId, true);
59
60 return $objectType == 'tst';
61 }
static _lookupType(int $id, bool $reference=false)

References ilObject\_lookupType().

Referenced by init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setBestSolutionEnabled()

ilAssQuestionPreviewSettings::setBestSolutionEnabled (   $bestSolutionEnabled)

Definition at line 143 of file class.ilAssQuestionPreviewSettings.php.

143 : void
144 {
145 $this->bestSolutionEnabled = $bestSolutionEnabled;
146 }

References $bestSolutionEnabled.

Referenced by initSettingsFromPostParameters(), and initSettingsWithTestObject().

+ Here is the caller graph for this function:

◆ setContextRefId()

ilAssQuestionPreviewSettings::setContextRefId (   $contextRefId)

Definition at line 87 of file class.ilAssQuestionPreviewSettings.php.

87 : void
88 {
89 $this->contextRefId = $contextRefId;
90 }

References $contextRefId.

◆ setGenericFeedbackEnabled()

ilAssQuestionPreviewSettings::setGenericFeedbackEnabled (   $genericFeedbackEnabled)

Definition at line 113 of file class.ilAssQuestionPreviewSettings.php.

113 : void
114 {
115 $this->genericFeedbackEnabled = $genericFeedbackEnabled;
116 }

References $genericFeedbackEnabled.

Referenced by initSettingsFromPostParameters(), and initSettingsWithTestObject().

+ Here is the caller graph for this function:

◆ setHintProvidingEnabled()

ilAssQuestionPreviewSettings::setHintProvidingEnabled ( bool  $hintProvidingEnabled)

Definition at line 133 of file class.ilAssQuestionPreviewSettings.php.

133 : void
134 {
135 $this->hintProvidingEnabled = $hintProvidingEnabled;
136 }

References $hintProvidingEnabled.

Referenced by initSettingsFromPostParameters(), and initSettingsWithTestObject().

+ Here is the caller graph for this function:

◆ setReachedPointsEnabled()

ilAssQuestionPreviewSettings::setReachedPointsEnabled ( bool  $reachedPointsEnabled)
Parameters
bool$reachedPointsEnabled

Definition at line 108 of file class.ilAssQuestionPreviewSettings.php.

108 : void
109 {
110 $this->reachedPointsEnabled = $reachedPointsEnabled;
111 }

References $reachedPointsEnabled.

Referenced by initSettingsFromPostParameters(), and initSettingsWithTestObject().

+ Here is the caller graph for this function:

◆ setSpecificFeedbackEnabled()

ilAssQuestionPreviewSettings::setSpecificFeedbackEnabled (   $specificFeedbackEnabled)

Definition at line 123 of file class.ilAssQuestionPreviewSettings.php.

123 : void
124 {
125 $this->specificFeedbackEnabled = $specificFeedbackEnabled;
126 }

References $specificFeedbackEnabled.

Referenced by initSettingsFromPostParameters(), and initSettingsWithTestObject().

+ Here is the caller graph for this function:

Field Documentation

◆ $bestSolutionEnabled

ilAssQuestionPreviewSettings::$bestSolutionEnabled = false
private

◆ $contextRefId

ilAssQuestionPreviewSettings::$contextRefId = null
private

◆ $genericFeedbackEnabled

ilAssQuestionPreviewSettings::$genericFeedbackEnabled = false
private

◆ $hintProvidingEnabled

ilAssQuestionPreviewSettings::$hintProvidingEnabled = false
private

◆ $reachedPointsEnabled

ilAssQuestionPreviewSettings::$reachedPointsEnabled = false
protected

◆ $specificFeedbackEnabled

ilAssQuestionPreviewSettings::$specificFeedbackEnabled = false
private

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