ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
ilAssQuestionHintsOrderingClipboard Class Reference
+ Collaboration diagram for ilAssQuestionHintsOrderingClipboard:

Public Member Functions

 __construct (assQuestion $questionOBJ)
 Constructor. More...
 
 resetStored ()
 resets the clipboard by ensuring no hint is stored More...
 
 setStored ($hintId)
 sets the passed hint id, so relating hint is deemed to be cut to clipboard More...
 
 getStored ()
 returns the hint id currently stored in clipboard More...
 
 isStored ($hintId)
 returns the fact wether the hint relating to the passed hint id is stored in clipboard or not More...
 
 hasStored ()
 returns the fact wether any hint is stored in clipboard currently or not More...
 

Private Attributes

 $questionId = null
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilAssQuestionHintsOrderingClipboard::__construct ( assQuestion  $questionOBJ)

Constructor.

public

Parameters
assQuestion$questionOBJ

Definition at line 44 of file class.ilAssQuestionHintsOrderingClipboard.php.

References $questionId, ilSession\get(), assQuestion\getId(), and ilSession\set().

45  {
46  $this->questionId = $questionOBJ->getId();
47 
48  $class = ilSession::get(__CLASS__);
49  if ($class == null) {
50  ilSession::set(__CLASS__, array());
51  }
52 
53  if (!isset($class[$this->questionId])) {
54  $class[$this->questionId] = null;
55  ilSession::set(__CLASS__, $class);
56  }
57  }
static get(string $a_var)
static set(string $a_var, $a_val)
Set a value.
+ Here is the call graph for this function:

Member Function Documentation

◆ getStored()

ilAssQuestionHintsOrderingClipboard::getStored ( )

returns the hint id currently stored in clipboard

public

Returns
integer $hintId

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

References $questionId, and ilSession\get().

93  : int
94  {
95  $class = ilSession::get(__CLASS__);
96  return $class[$this->questionId];
97  }
static get(string $a_var)
+ Here is the call graph for this function:

◆ hasStored()

ilAssQuestionHintsOrderingClipboard::hasStored ( )

returns the fact wether any hint is stored in clipboard currently or not

public

Returns
boolean $hasStored

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

References ilSession\get().

123  : bool
124  {
125  $class = ilSession::get(__CLASS__);
126  if ($class[$this->questionId] !== null) {
127  return true;
128  }
129 
130  return false;
131  }
static get(string $a_var)
+ Here is the call graph for this function:

◆ isStored()

ilAssQuestionHintsOrderingClipboard::isStored (   $hintId)

returns the fact wether the hint relating to the passed hint id is stored in clipboard or not

public

Parameters
integer$hintId
Returns
boolean $isStored

Definition at line 107 of file class.ilAssQuestionHintsOrderingClipboard.php.

References ilSession\get().

107  : bool
108  {
109  $class = ilSession::get(__CLASS__);
110  if ($class[$this->questionId] === $hintId) {
111  return true;
112  }
113 
114  return false;
115  }
static get(string $a_var)
+ Here is the call graph for this function:

◆ resetStored()

ilAssQuestionHintsOrderingClipboard::resetStored ( )

resets the clipboard by ensuring no hint is stored

public

Definition at line 64 of file class.ilAssQuestionHintsOrderingClipboard.php.

References ilSession\get(), and ilSession\set().

64  : void
65  {
66  $class = ilSession::get(__CLASS__);
67  unset($class[$this->questionId]);
68  ilSession::set(__CLASS__, $class);
69  //$_SESSION[__CLASS__][$this->questionId] = null;
70  }
static get(string $a_var)
static set(string $a_var, $a_val)
Set a value.
+ Here is the call graph for this function:

◆ setStored()

ilAssQuestionHintsOrderingClipboard::setStored (   $hintId)

sets the passed hint id, so relating hint is deemed to be cut to clipboard

public

Parameters
integer$hintId

Definition at line 79 of file class.ilAssQuestionHintsOrderingClipboard.php.

References $questionId, ilSession\get(), and ilSession\set().

79  : void
80  {
81  $class = ilSession::get(__CLASS__);
82  $class[$this->questionId] = $hintId;
83  ilSession::set(__CLASS__, $class);
84  //$_SESSION[__CLASS__][$this->questionId] = $hintId;
85  }
static get(string $a_var)
static set(string $a_var, $a_val)
Set a value.
+ Here is the call graph for this function:

Field Documentation

◆ $questionId

ilAssQuestionHintsOrderingClipboard::$questionId = null
private

Definition at line 36 of file class.ilAssQuestionHintsOrderingClipboard.php.

Referenced by __construct(), getStored(), and setStored().


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