ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 ($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 11 of file class.ilAssQuestionPreviewSettings.php.

Constructor & Destructor Documentation

◆ __construct()

ilAssQuestionPreviewSettings::__construct (   $contextRefId)

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

References $contextRefId.

29  {
30  $this->contextRefId = $contextRefId;
31  }

Member Function Documentation

◆ getContextRefId()

ilAssQuestionPreviewSettings::getContextRefId ( )

◆ init()

ilAssQuestionPreviewSettings::init ( )

◆ initSettingsFromPostParameters()

ilAssQuestionPreviewSettings::initSettingsFromPostParameters ( )
private

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

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

Referenced by init().

63  {
64  // get from post or from toolbar instance if possible
65 
66  $this->setGenericFeedbackEnabled(true);
67  $this->setSpecificFeedbackEnabled(true);
68  $this->setHintProvidingEnabled(true);
69  $this->setBestSolutionEnabled(true);
70  $this->setReachedPointsEnabled(true);
71  }
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 49 of file class.ilAssQuestionPreviewSettings.php.

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

Referenced by init().

50  {
51  /* @var ilObjTest $testOBJ */
52  $testOBJ = ilObjectFactory::getInstanceByRefId($this->contextRefId);
53  $testOBJ->loadFromDb();
54 
55  $this->setGenericFeedbackEnabled($testOBJ->getGenericAnswerFeedback());
56  $this->setSpecificFeedbackEnabled($testOBJ->getSpecificAnswerFeedback());
57  $this->setHintProvidingEnabled($testOBJ->isOfferingQuestionHintsEnabled());
58  $this->setBestSolutionEnabled($testOBJ->getInstantFeedbackSolution());
59  $this->setReachedPointsEnabled($testOBJ->getAnswerFeedbackPoints());
60  }
setReachedPointsEnabled(bool $reachedPointsEnabled)
static getInstanceByRefId($a_ref_id, $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 134 of file class.ilAssQuestionPreviewSettings.php.

References $bestSolutionEnabled.

Referenced by isInstantFeedbackNavigationRequired().

+ Here is the caller graph for this function:

◆ isGenericFeedbackEnabled()

ilAssQuestionPreviewSettings::isGenericFeedbackEnabled ( )

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

References $genericFeedbackEnabled.

Referenced by isInstantFeedbackNavigationRequired().

+ Here is the caller graph for this function:

◆ isHintProvidingEnabled()

ilAssQuestionPreviewSettings::isHintProvidingEnabled ( )

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

References $hintProvidingEnabled.

Referenced by isHintProvidingNavigationRequired().

+ Here is the caller graph for this function:

◆ isHintProvidingNavigationRequired()

ilAssQuestionPreviewSettings::isHintProvidingNavigationRequired ( )

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

References isHintProvidingEnabled().

157  {
158  return $this->isHintProvidingEnabled();
159  }
+ Here is the call graph for this function:

◆ isInstantFeedbackNavigationRequired()

ilAssQuestionPreviewSettings::isInstantFeedbackNavigationRequired ( )

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

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

140  {
141  if ($this->isGenericFeedbackEnabled()) {
142  return true;
143  }
144 
145  if ($this->isSpecificFeedbackEnabled()) {
146  return true;
147  }
148 
149  if ($this->isBestSolutionEnabled()) {
150  return true;
151  }
152 
153  return false;
154  }
+ Here is the call graph for this function:

◆ isReachedPointsEnabled()

ilAssQuestionPreviewSettings::isReachedPointsEnabled ( )
Returns
bool

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

References $reachedPointsEnabled.

◆ isSpecificFeedbackEnabled()

ilAssQuestionPreviewSettings::isSpecificFeedbackEnabled ( )

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

References $specificFeedbackEnabled.

Referenced by isInstantFeedbackNavigationRequired().

+ Here is the caller graph for this function:

◆ isTestRefId()

ilAssQuestionPreviewSettings::isTestRefId ( )

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

References ilObject\_lookupType().

Referenced by init().

43  {
44  $objectType = ilObject::_lookupType($this->contextRefId, true);
45 
46  return $objectType == 'tst';
47  }
static _lookupType($a_id, $a_reference=false)
lookup object type
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setBestSolutionEnabled()

ilAssQuestionPreviewSettings::setBestSolutionEnabled (   $bestSolutionEnabled)

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

References $bestSolutionEnabled.

Referenced by initSettingsFromPostParameters(), and initSettingsWithTestObject().

130  {
131  $this->bestSolutionEnabled = $bestSolutionEnabled;
132  }
+ Here is the caller graph for this function:

◆ setContextRefId()

ilAssQuestionPreviewSettings::setContextRefId (   $contextRefId)

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

References $contextRefId.

74  {
75  $this->contextRefId = $contextRefId;
76  }

◆ setGenericFeedbackEnabled()

ilAssQuestionPreviewSettings::setGenericFeedbackEnabled (   $genericFeedbackEnabled)

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

References $genericFeedbackEnabled.

Referenced by initSettingsFromPostParameters(), and initSettingsWithTestObject().

100  {
101  $this->genericFeedbackEnabled = $genericFeedbackEnabled;
102  }
+ Here is the caller graph for this function:

◆ setHintProvidingEnabled()

ilAssQuestionPreviewSettings::setHintProvidingEnabled (   $hintProvidingEnabled)

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

References $hintProvidingEnabled.

Referenced by initSettingsFromPostParameters(), and initSettingsWithTestObject().

120  {
121  $this->hintProvidingEnabled = $hintProvidingEnabled;
122  }
+ Here is the caller graph for this function:

◆ setReachedPointsEnabled()

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

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

References $reachedPointsEnabled.

Referenced by initSettingsFromPostParameters(), and initSettingsWithTestObject().

95  {
96  $this->reachedPointsEnabled = $reachedPointsEnabled;
97  }
+ Here is the caller graph for this function:

◆ setSpecificFeedbackEnabled()

ilAssQuestionPreviewSettings::setSpecificFeedbackEnabled (   $specificFeedbackEnabled)

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

References $specificFeedbackEnabled.

Referenced by initSettingsFromPostParameters(), and initSettingsWithTestObject().

110  {
111  $this->specificFeedbackEnabled = $specificFeedbackEnabled;
112  }
+ 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: