ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 ()
 
 setBestSolutionEnabled ($bestSolutionEnabled)
 
 isBestSolutionEnabled ()
 
 isInstantFeedbackNavigationRequired ()
 

Protected Attributes

 $reachedPointsEnabled = false
 

Private Member Functions

 initSettingsWithTestObject ()
 
 initSettingsFromPostParameters ()
 

Private Attributes

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

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilAssQuestionPreviewSettings::__construct (   $contextRefId)

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

38 {
39 $this->contextRefId = $contextRefId;
40 }

References $contextRefId.

Member Function Documentation

◆ getContextRefId()

ilAssQuestionPreviewSettings::getContextRefId ( )

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

86 {
88 }

References $contextRefId.

◆ init()

ilAssQuestionPreviewSettings::init ( )

◆ initSettingsFromPostParameters()

ilAssQuestionPreviewSettings::initSettingsFromPostParameters ( )
private

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

70 : void
71 {
72 // get from post or from toolbar instance if possible
73
74 $this->setGenericFeedbackEnabled(true);
75 $this->setSpecificFeedbackEnabled(true);
76 $this->setBestSolutionEnabled(true);
77 $this->setReachedPointsEnabled(true);
78 }
setReachedPointsEnabled(bool $reachedPointsEnabled)

References setBestSolutionEnabled(), setGenericFeedbackEnabled(), 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 58 of file class.ilAssQuestionPreviewSettings.php.

58 : void
59 {
60 /* @var ilObjTest $testOBJ */
61 $testOBJ = ilObjectFactory::getInstanceByRefId($this->contextRefId);
62 $testOBJ->loadFromDb();
63
64 $this->setGenericFeedbackEnabled($testOBJ->getGenericAnswerFeedback());
65 $this->setSpecificFeedbackEnabled($testOBJ->getSpecificAnswerFeedback());
66 $this->setBestSolutionEnabled($testOBJ->getInstantFeedbackSolution());
67 $this->setReachedPointsEnabled($testOBJ->getAnswerFeedbackPoints());
68 }
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(), 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 131 of file class.ilAssQuestionPreviewSettings.php.

References $bestSolutionEnabled.

Referenced by isInstantFeedbackNavigationRequired().

+ Here is the caller graph for this function:

◆ isGenericFeedbackEnabled()

ilAssQuestionPreviewSettings::isGenericFeedbackEnabled ( )

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

References $genericFeedbackEnabled.

Referenced by isInstantFeedbackNavigationRequired().

+ Here is the caller graph for this function:

◆ isInstantFeedbackNavigationRequired()

ilAssQuestionPreviewSettings::isInstantFeedbackNavigationRequired ( )

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

136 : bool
137 {
138 if ($this->isGenericFeedbackEnabled()) {
139 return true;
140 }
141
142 if ($this->isSpecificFeedbackEnabled()) {
143 return true;
144 }
145
146 if ($this->isBestSolutionEnabled()) {
147 return true;
148 }
149
150 return false;
151 }

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

+ Here is the call graph for this function:

◆ isReachedPointsEnabled()

ilAssQuestionPreviewSettings::isReachedPointsEnabled ( )
Returns
bool

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

References $reachedPointsEnabled.

◆ isSpecificFeedbackEnabled()

ilAssQuestionPreviewSettings::isSpecificFeedbackEnabled ( )

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

References $specificFeedbackEnabled.

Referenced by isInstantFeedbackNavigationRequired().

+ Here is the caller graph for this function:

◆ isTestRefId()

ilAssQuestionPreviewSettings::isTestRefId ( )

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

51 : bool
52 {
53 $objectType = ilObject::_lookupType($this->contextRefId, true);
54
55 return $objectType == 'tst';
56 }
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 126 of file class.ilAssQuestionPreviewSettings.php.

126 : void
127 {
128 $this->bestSolutionEnabled = $bestSolutionEnabled;
129 }

References $bestSolutionEnabled.

Referenced by initSettingsFromPostParameters(), and initSettingsWithTestObject().

+ Here is the caller graph for this function:

◆ setContextRefId()

ilAssQuestionPreviewSettings::setContextRefId (   $contextRefId)

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

80 : void
81 {
82 $this->contextRefId = $contextRefId;
83 }

References $contextRefId.

◆ setGenericFeedbackEnabled()

ilAssQuestionPreviewSettings::setGenericFeedbackEnabled (   $genericFeedbackEnabled)

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

106 : void
107 {
108 $this->genericFeedbackEnabled = $genericFeedbackEnabled;
109 }

References $genericFeedbackEnabled.

Referenced by initSettingsFromPostParameters(), and initSettingsWithTestObject().

+ Here is the caller graph for this function:

◆ setReachedPointsEnabled()

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

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

101 : void
102 {
103 $this->reachedPointsEnabled = $reachedPointsEnabled;
104 }

References $reachedPointsEnabled.

Referenced by initSettingsFromPostParameters(), and initSettingsWithTestObject().

+ Here is the caller graph for this function:

◆ setSpecificFeedbackEnabled()

ilAssQuestionPreviewSettings::setSpecificFeedbackEnabled (   $specificFeedbackEnabled)

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

116 : void
117 {
118 $this->specificFeedbackEnabled = $specificFeedbackEnabled;
119 }

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

◆ $reachedPointsEnabled

ilAssQuestionPreviewSettings::$reachedPointsEnabled = false
protected

◆ $specificFeedbackEnabled

ilAssQuestionPreviewSettings::$specificFeedbackEnabled = false
private

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