ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilAssQuestionHintRequestGUI Class Reference
+ Inheritance diagram for ilAssQuestionHintRequestGUI:
+ Collaboration diagram for ilAssQuestionHintRequestGUI:

Public Member Functions

 __construct ($parentGUI, $parentCMD, assQuestionGUI $questionGUI, $questionHintTracking)
 Constructor.
 executeCommand ()
 Execute Command.
 getHintPresentationLinkTarget ($hintId, $xmlStyle=true)
 returns the link target for hint request presentation
- Public Member Functions inherited from ilAssQuestionHintAbstractGUI
 __construct (assQuestionGUI $questionGUI)
 Constructor.

Data Fields

const CMD_SHOW_LIST = 'showList'
 command constants
const CMD_SHOW_HINT = 'showHint'
const CMD_CONFIRM_REQUEST = 'confirmRequest'
const CMD_PERFORM_REQUEST = 'performRequest'
const CMD_BACK_TO_QUESTION = 'backToQuestion'

Protected Attributes

 $parentGUI = null
 $parentCMD = null
 $questionHintTracking = null
- Protected Attributes inherited from ilAssQuestionHintAbstractGUI
 $questionGUI = null
 $questionOBJ = null

Private Member Functions

 showListCmd ()
 shows the list of allready requested hints
 showHintCmd ()
 shows an allready requested hint
 confirmRequestCmd ()
 shows a confirmation screen for a hint request
 performRequestCmd ()
 Performs a hint request and invokes the (re-)saving the question solution.
 backToQuestionCmd ()
 gateway command method to jump back to test session output
 populateContent ($content)
 populates the rendered questin hint relating output content to global template depending on possibly active kiosk mode
 isQuestionPreview ()

Detailed Description

Definition at line 18 of file class.ilAssQuestionHintRequestGUI.php.

Constructor & Destructor Documentation

ilAssQuestionHintRequestGUI::__construct (   $parentGUI,
  $parentCMD,
assQuestionGUI  $questionGUI,
  $questionHintTracking 
)

Constructor.

Definition at line 47 of file class.ilAssQuestionHintRequestGUI.php.

References $parentCMD, $parentGUI, and $questionHintTracking.

{
$this->parentGUI = $parentGUI;
$this->parentCMD = $parentCMD;
$this->questionHintTracking = $questionHintTracking;
parent::__construct($questionGUI);
}

Member Function Documentation

ilAssQuestionHintRequestGUI::backToQuestionCmd ( )
private

gateway command method to jump back to test session output

private ilCtrl $ilCtrl

Definition at line 248 of file class.ilAssQuestionHintRequestGUI.php.

References $ilCtrl.

{
global $ilCtrl;
$ilCtrl->redirect($this->parentGUI, $this->parentCMD);
}
ilAssQuestionHintRequestGUI::confirmRequestCmd ( )
private

shows a confirmation screen for a hint request

private ilCtrl $ilCtrl ilTemplate $tpl ilLanguage $lng

Definition at line 184 of file class.ilAssQuestionHintRequestGUI.php.

References $ilCtrl, $lng, $tpl, ilUtil\appendUrlParameterString(), CMD_BACK_TO_QUESTION, CMD_PERFORM_REQUEST, and populateContent().

{
global $ilCtrl, $tpl, $lng;
$nextRequestableHint = $this->questionHintTracking->getNextRequestableHint();
require_once 'Services/Utilities/classes/class.ilConfirmationGUI.php';
$confirmation = new ilConfirmationGUI();
$ilCtrl->getFormAction($this), "hintId={$nextRequestableHint->getId()}"
);
$confirmation->setFormAction($formAction);
$confirmation->setConfirm($lng->txt('tst_question_hints_confirm_request'), self::CMD_PERFORM_REQUEST);
$confirmation->setCancel($lng->txt('tst_question_hints_cancel_request'), self::CMD_BACK_TO_QUESTION);
$confirmation->setHeaderText(sprintf(
$lng->txt('tst_question_hints_request_confirmation'),
$nextRequestableHint->getIndex(),
$nextRequestableHint->getPoints()
));
$this->populateContent( $ilCtrl->getHtml($confirmation) );
}

+ Here is the call graph for this function:

ilAssQuestionHintRequestGUI::executeCommand ( )

Execute Command.

public ilCtrl $ilCtrl

Returns
mixed

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

References $cmd, $ilCtrl, $lng, and ilAssQuestionHintPageObjectCommandForwarder\PRESENTATION_MODE_REQUEST.

{
global $ilCtrl, $ilTabs, $lng;
$cmd = $ilCtrl->getCmd(self::CMD_SHOW_LIST);
$nextClass = $ilCtrl->getNextClass($this);
switch($nextClass)
{
case 'ilasshintpagegui':
require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintPageObjectCommandForwarder.php';
$forwarder = new ilAssQuestionHintPageObjectCommandForwarder($this->questionOBJ, $ilCtrl, $ilTabs, $lng);
$forwarder->forward();
break;
default:
$cmd .= 'Cmd';
return $this->$cmd();
break;
}
}
ilAssQuestionHintRequestGUI::getHintPresentationLinkTarget (   $hintId,
  $xmlStyle = true 
)

returns the link target for hint request presentation

ilCtrl $ilCtrl

Parameters
integer$hintId
boolean$xmlStyle
Returns
string $linkTarget

Definition at line 303 of file class.ilAssQuestionHintRequestGUI.php.

References $ilCtrl.

Referenced by performRequestCmd().

{
global $ilCtrl;
if( $this->questionOBJ->isAdditionalContentEditingModePageObject() )
{
$ilCtrl->setParameterByClass('ilasshintpagegui', 'hint_id', $hintId);
$linkTarget = $ilCtrl->getLinkTargetByClass('ilAssHintPageGUI', '', '', false, $xmlStyle);
}
else
{
$ilCtrl->setParameter($this, 'hintId', $hintId);
$linkTarget = $ilCtrl->getLinkTarget($this, self::CMD_SHOW_HINT, '', false, $xmlStyle);
}
return $linkTarget;
}

+ Here is the caller graph for this function:

ilAssQuestionHintRequestGUI::isQuestionPreview ( )
private

Definition at line 285 of file class.ilAssQuestionHintRequestGUI.php.

Referenced by populateContent().

{
if( $this->questionHintTracking instanceof ilAssQuestionPreviewHintTracking )
{
return true;
}
return false;
}

+ Here is the caller graph for this function:

ilAssQuestionHintRequestGUI::performRequestCmd ( )
private

Performs a hint request and invokes the (re-)saving the question solution.

Redirects to local showHint command

private ilCtrl $ilCtrl

Definition at line 219 of file class.ilAssQuestionHintRequestGUI.php.

References $_GET, $ilCtrl, getHintPresentationLinkTarget(), and ilUtil\redirect().

{
global $ilCtrl;
if( !isset($_GET['hintId']) || !(int)$_GET['hintId'] )
{
throw new ilTestException('no hint id given');
}
$nextRequestableHint = $this->questionHintTracking->getNextRequestableHint();
if( $nextRequestableHint->getId() != (int)$_GET['hintId'] )
{
throw new ilTestException('given hint id does not relate to the next requestable hint');
}
$this->questionHintTracking->storeRequest($nextRequestableHint);
$redirectTarget = $this->getHintPresentationLinkTarget($nextRequestableHint->getId(), false);
ilUtil::redirect($redirectTarget);
}

+ Here is the call graph for this function:

ilAssQuestionHintRequestGUI::populateContent (   $content)
private

populates the rendered questin hint relating output content to global template depending on possibly active kiosk mode

ilTemplate $tpl

Parameters
string$content

Definition at line 262 of file class.ilAssQuestionHintRequestGUI.php.

References $tpl, and isQuestionPreview().

Referenced by confirmRequestCmd(), showHintCmd(), and showListCmd().

{
global $tpl;
if( !$this->isQuestionPreview() && $this->parentGUI->object->getKioskMode() )
{
$tpl->setBodyClass('kiosk');
$tpl->setAddFooter(false);
$tpl->addBlockFile(
'CONTENT', 'content', 'tpl.il_tst_question_hints_kiosk_page.html', 'Modules/TestQuestionPool'
);
$tpl->setVariable('KIOSK_HEAD', $this->parentGUI->getKioskHead());
$tpl->setVariable('KIOSK_CONTENT', $content);
}
else
{
$tpl->setContent($content);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAssQuestionHintRequestGUI::showHintCmd ( )
private

shows an allready requested hint

private ilCtrl $ilCtrl ilTemplate $tpl ilLanguage $lng

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

References $_GET, $ilCtrl, $lng, $tpl, ilAssQuestionHint\getInstanceById(), populateContent(), ilUtil\prepareTextareaOutput(), and ilNonEditableValueGUI\setValue().

{
global $ilCtrl, $tpl, $lng;
if( !isset($_GET['hintId']) || !(int)$_GET['hintId'] )
{
throw new ilTestException('no hint id given');
}
$isRequested = $this->questionHintTracking->isRequested((int)$_GET['hintId']);
if( !$isRequested )
{
throw new ilTestException('hint with given id is not yet requested for given testactive and testpass');
}
$questionHint = ilAssQuestionHint::getInstanceById((int)$_GET['hintId']);
require_once 'Services/Utilities/classes/class.ilUtil.php';
require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
require_once 'Services/Form/classes/class.ilNonEditableValueGUI.php';
// build form
$form = new ilPropertyFormGUI();
$form->setFormAction($ilCtrl->getFormAction($this));
$form->setTableWidth('100%');
$form->setTitle(sprintf(
$lng->txt('tst_question_hints_form_header_edit'),
$questionHint->getIndex(),
$this->questionOBJ->getTitle()
));
$form->addCommandButton(self::CMD_BACK_TO_QUESTION, $lng->txt('tst_question_hints_back_to_question'));
$numExistingRequests = $this->questionHintTracking->getNumExistingRequests();
if($numExistingRequests > 1)
{
$form->addCommandButton(self::CMD_SHOW_LIST, $lng->txt('button_show_requested_question_hints'));
}
// form input: hint text
$nonEditableHintText = new ilNonEditableValueGUI($lng->txt('tst_question_hints_form_label_hint_text'), 'hint_text', true);
$nonEditableHintText->setValue( ilUtil::prepareTextareaOutput($questionHint->getText(), true) );
$form->addItem($nonEditableHintText);
// form input: hint points
$nonEditableHintPoints = new ilNonEditableValueGUI($lng->txt('tst_question_hints_form_label_hint_points'), 'hint_points');
$nonEditableHintPoints->setValue($questionHint->getPoints());
$form->addItem($nonEditableHintPoints);
$this->populateContent( $ilCtrl->getHtml($form) );
}

+ Here is the call graph for this function:

ilAssQuestionHintRequestGUI::showListCmd ( )
private

shows the list of allready requested hints

private

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

References $ilCtrl, $tpl, and populateContent().

{
global $ilCtrl, $tpl;
require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintsTableGUI.php';
$questionHintList = $this->questionHintTracking->getRequestedHintsList();
$this->questionOBJ, $questionHintList, $this, self::CMD_SHOW_LIST
);
$this->populateContent( $ilCtrl->getHtml($table) );
}

+ Here is the call graph for this function:

Field Documentation

ilAssQuestionHintRequestGUI::$parentCMD = null
protected

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

Referenced by __construct().

ilAssQuestionHintRequestGUI::$parentGUI = null
protected

Definition at line 32 of file class.ilAssQuestionHintRequestGUI.php.

Referenced by __construct().

ilAssQuestionHintRequestGUI::$questionHintTracking = null
protected

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

Referenced by __construct().

const ilAssQuestionHintRequestGUI::CMD_BACK_TO_QUESTION = 'backToQuestion'
const ilAssQuestionHintRequestGUI::CMD_CONFIRM_REQUEST = 'confirmRequest'
const ilAssQuestionHintRequestGUI::CMD_PERFORM_REQUEST = 'performRequest'

Definition at line 26 of file class.ilAssQuestionHintRequestGUI.php.

Referenced by confirmRequestCmd().

const ilAssQuestionHintRequestGUI::CMD_SHOW_HINT = 'showHint'

Definition at line 24 of file class.ilAssQuestionHintRequestGUI.php.


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