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

Public Member Functions

 __construct (ilTestOutputGUI $testOutputGUI, ilTestSession $testSession, assQuestionGUI $questionGUI)
 Constructor.
 executeCommand ()
 Execute Command.
- 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

 $testOutputGUI = null
 $testSession = 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

Detailed Description

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

Constructor & Destructor Documentation

ilAssQuestionHintRequestGUI::__construct ( ilTestOutputGUI  $testOutputGUI,
ilTestSession  $testSession,
assQuestionGUI  $questionGUI 
)

Constructor.

Parameters
ilTestOutputGUI$testOutputGUI
ilTestSession$testSession
assQuestionGUI$questionGUI

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

References $testOutputGUI, and $testSession.

{
$this->testOutputGUI = $testOutputGUI;
$this->testSession = $testSession;
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 254 of file class.ilAssQuestionHintRequestGUI.php.

References $ilCtrl.

{
global $ilCtrl;
$ilCtrl->redirectByClass('ilTestOutputGUI', 'redirectQuestion');
}
ilAssQuestionHintRequestGUI::confirmRequestCmd ( )
private

shows a confirmation screen for a hint request

private ilCtrl $ilCtrl ilTemplate $tpl ilLanguage $lng

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

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

{
global $ilCtrl, $tpl, $lng;
$this->questionOBJ->getId(), $this->testSession->getActiveId(), $this->testSession->getPass()
);
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 62 of file class.ilAssQuestionHintRequestGUI.php.

References $cmd, and $ilCtrl.

{
global $ilCtrl;
$cmd = $ilCtrl->getCmd(self::CMD_SHOW_LIST);
$nextClass = $ilCtrl->getNextClass($this);
switch($nextClass)
{
default:
$cmd .= 'Cmd';
return $this->$cmd();
break;
}
}
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 218 of file class.ilAssQuestionHintRequestGUI.php.

References $_GET, $ilCtrl, ilUtil\appendUrlParameterString(), ilAssQuestionHintTracking\getNextRequestableHint(), ilUtil\redirect(), and ilAssQuestionHintTracking\storeRequest().

{
global $ilCtrl;
if( !isset($_GET['hintId']) || !(int)$_GET['hintId'] )
{
throw new ilTestException('no hint id given');
}
$this->questionOBJ->getId(), $this->testSession->getActiveId(), $this->testSession->getPass()
);
if( $nextRequestableHint->getId() != (int)$_GET['hintId'] )
{
throw new ilTestException('given hint id does not relate to the next requestable hint');
}
$nextRequestableHint, $this->questionOBJ->getId(),
$this->testSession->getActiveId(), $this->testSession->getPass()
);
$ilCtrl->getLinkTarget($this, self::CMD_SHOW_HINT, '', false, false), "hintId={$nextRequestableHint->getId()}"
);
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 268 of file class.ilAssQuestionHintRequestGUI.php.

References $tpl.

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

{
global $tpl;
if( $this->testOutputGUI->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->testOutputGUI->getKioskHead());
$tpl->setVariable('KIOSK_CONTENT', $content);
}
else
{
$tpl->setContent($content);
}
}

+ 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 109 of file class.ilAssQuestionHintRequestGUI.php.

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

{
global $ilCtrl, $tpl, $lng;
if( !isset($_GET['hintId']) || !(int)$_GET['hintId'] )
{
throw new ilTestException('no hint id given');
}
(int)$_GET['hintId'], $this->testSession->getActiveId(), $this->testSession->getPass()
);
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'));
$this->questionOBJ->getId(), $this->testSession->getActiveId(), $this->testSession->getPass()
);
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 84 of file class.ilAssQuestionHintRequestGUI.php.

References $ilCtrl, $tpl, ilAssQuestionHintTracking\getRequestedHintsList(), and populateContent().

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

+ Here is the call graph for this function:

Field Documentation

ilAssQuestionHintRequestGUI::$testOutputGUI = null
protected

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

Referenced by __construct().

ilAssQuestionHintRequestGUI::$testSession = null
protected

Definition at line 38 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 27 of file class.ilAssQuestionHintRequestGUI.php.

Referenced by confirmRequestCmd().

const ilAssQuestionHintRequestGUI::CMD_SHOW_HINT = 'showHint'
const ilAssQuestionHintRequestGUI::CMD_SHOW_LIST = 'showList'

command constants

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

Referenced by ilTestOutputGUI\showRequestedHintList().


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