ILIAS  trunk Revision v11.0_alpha-2662-g519ff7d528f
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.

References $contextRefId.

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

Member Function Documentation

◆ getContextRefId()

ilAssQuestionPreviewSettings::getContextRefId ( )

◆ init()

ilAssQuestionPreviewSettings::init ( )

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

References initSettingsFromPostParameters(), initSettingsWithTestObject(), and isTestRefId().

+ Here is the call graph for this function:

◆ initSettingsFromPostParameters()

ilAssQuestionPreviewSettings::initSettingsFromPostParameters ( )
private

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

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

Referenced by init().

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)
+ 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.

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

Referenced by init().

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  }
setReachedPointsEnabled(bool $reachedPointsEnabled)
static getInstanceByRefId(int $ref_id, bool $stop_on_error=true)
get an instance of an Ilias object by reference id
+ 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.

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

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  }
+ 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.

References ilObject\_lookupType().

Referenced by init().

51  : bool
52  {
53  $objectType = ilObject::_lookupType($this->contextRefId, true);
54 
55  return $objectType == 'tst';
56  }
static _lookupType(int $id, bool $reference=false)
+ 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.

References $bestSolutionEnabled.

Referenced by initSettingsFromPostParameters(), and initSettingsWithTestObject().

126  : void
127  {
128  $this->bestSolutionEnabled = $bestSolutionEnabled;
129  }
+ Here is the caller graph for this function:

◆ setContextRefId()

ilAssQuestionPreviewSettings::setContextRefId (   $contextRefId)

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

References $contextRefId.

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

◆ setGenericFeedbackEnabled()

ilAssQuestionPreviewSettings::setGenericFeedbackEnabled (   $genericFeedbackEnabled)

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

References $genericFeedbackEnabled.

Referenced by initSettingsFromPostParameters(), and initSettingsWithTestObject().

106  : void
107  {
108  $this->genericFeedbackEnabled = $genericFeedbackEnabled;
109  }
+ 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.

References $reachedPointsEnabled.

Referenced by initSettingsFromPostParameters(), and initSettingsWithTestObject().

101  : void
102  {
103  $this->reachedPointsEnabled = $reachedPointsEnabled;
104  }
+ Here is the caller graph for this function:

◆ setSpecificFeedbackEnabled()

ilAssQuestionPreviewSettings::setSpecificFeedbackEnabled (   $specificFeedbackEnabled)

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

References $specificFeedbackEnabled.

Referenced by initSettingsFromPostParameters(), and initSettingsWithTestObject().

116  : void
117  {
118  $this->specificFeedbackEnabled = $specificFeedbackEnabled;
119  }
+ 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: