180 $nextClass = $this->ctrl->getNextClass();
182 $command = $this->ctrl->getCmd(self::CMD_SHOW_SKILL_QUEST_ASSIGNS);
186 $this->ctrl->redirect($this, self::CMD_SHOW_SKILL_QUEST_ASSIGNS);
191 case strtolower(__CLASS__):
213 case self::CMD_SAVE_SKILL_QUEST_ASSIGN_PROPERTIES_FORM:
214 case self::CMD_UPDATE_SKILL_QUEST_ASSIGNS:
226 if( is_array(
$_POST[
'skill_points']) )
228 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionSkillAssignment.php';
230 for($i = 0; $i < 2; $i++) foreach($_POST['skill_points'] as $assignmentKey => $skillPoints)
232 $assignmentKey = explode(
':', $assignmentKey);
233 $skillBaseId = (int)$assignmentKey[0];
234 $skillTrefId = (int)$assignmentKey[1];
235 $questionId = (int)$assignmentKey[2];
243 if(!$assignment->isValidSkillPoint($skillPoints))
252 $assignment->setQuestionId($questionId);
253 $assignment->setSkillBaseId($skillBaseId);
254 $assignment->setSkillTrefId($skillTrefId);
256 if($assignment->dbRecordExists())
258 $assignment->loadFromDb();
260 if(!$assignment->hasEvalModeBySolution())
262 $assignment->setSkillPoints((
int)$skillPoints);
263 $assignment->saveToDb();
273 $this->ctrl->redirect($this, self::CMD_SHOW_SKILL_QUEST_ASSIGNS);
284 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionSkillAssignmentList.php';
286 $questionId = (int)
$_GET[
'question_id'];
292 $assignmentList->loadFromDb();
294 $handledSkills =
array();
298 $skillIds = $sgui->getSelectedSkills();
300 foreach($skillIds as $skillId)
302 $skill = explode(
':',$skillId);
303 $skillBaseId = (int)$skill[0];
304 $skillTrefId = (int)$skill[1];
308 if( !$assignmentList->isAssignedToQuestionId($skillBaseId, $skillTrefId, $questionId) )
313 $assignment->setQuestionId($questionId);
314 $assignment->setSkillBaseId($skillBaseId);
315 $assignment->setSkillTrefId($skillTrefId);
319 $assignment->saveToDb();
322 $handledSkills[$skillId] = $skill;
326 foreach($assignmentList->getAssignmentsByQuestionId($questionId) as $assignment)
328 if( isset($handledSkills[
"{$assignment->getSkillBaseId()}:{$assignment->getSkillTrefId()}"]) )
333 $assignment->deleteFromDb();
341 $this->ctrl->redirect($this, self::CMD_SHOW_SYNC_ORIGINAL_CONFIRMATION);
345 $this->ctrl->redirect($this, self::CMD_SHOW_SKILL_QUEST_ASSIGNS);
350 $this->ctrl->saveParameter($this,
'question_id');
351 $questionId = (int)
$_GET[
'question_id'];
353 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionSkillAssignmentList.php';
356 $assignmentList->loadFromDb();
359 $assignmentList->getAssignmentsByQuestionId($questionId)
362 if( !$skillSelectorExplorerGUI->handleCommand() )
364 $tpl =
new ilTemplate(
'tpl.qpl_qst_skl_assign_selection.html',
false,
false,
'Modules/TestQuestionPool');
370 $skillSelectorToolbarGUI->setOpenFormTag(
true);
371 $skillSelectorToolbarGUI->setCloseFormTag(
false);
373 $tpl->setVariable(
'SKILL_SELECTOR_TOOLBAR_TOP', $this->ctrl->getHTML($skillSelectorToolbarGUI));
375 $tpl->setVariable(
'SKILL_SELECTOR_EXPLORER', $this->ctrl->getHTML($skillSelectorExplorerGUI));
377 $skillSelectorToolbarGUI->setOpenFormTag(
false);
378 $skillSelectorToolbarGUI->setCloseFormTag(
true);
380 $tpl->setVariable(
'SKILL_SELECTOR_TOOLBAR_BOTTOM', $this->ctrl->getHTML($skillSelectorToolbarGUI));
382 $this->tpl->setContent(
$tpl->get());
394 if( $questionGUI === null )
396 require_once
'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
400 if( $assignment === null )
403 (
int)
$_GET[
'question_id'], (
int)$_GET[
'skill_base_id'], (
int)$_GET[
'skill_tref_id']
416 $this->tpl->setContent( $this->ctrl->getHTML($form).
'<br />'.$questionPageHTML.$lacLegendHTML );
421 $questionId = (int)
$_GET[
'question_id'];
425 require_once
'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
429 (
int)
$_GET[
'question_id'], (
int)$_GET[
'skill_base_id'], (
int)$_GET[
'skill_tref_id']
434 if( !$form->checkInput() )
436 $form->setValuesByPost();
440 $form->setValuesByPost();
442 if($form->getItemByPostVar(
'eval_mode'))
444 $assignment->setEvalMode($form->getItemByPostVar(
'eval_mode')->getValue());
451 if($assignment->hasEvalModeBySolution())
453 $solCmpExprInput = $form->getItemByPostVar(
'solution_compare_expressions');
462 $assignment->initSolutionComparisonExpressionList();
463 $assignment->getSolutionComparisonExpressionList()->reset();
465 foreach($solCmpExprInput->getValues() as $expression)
467 $assignment->getSolutionComparisonExpressionList()->add($expression);
472 $assignment->setSkillPoints($form->getItemByPostVar(
'q_res_skill_points')->getValue());
475 $assignment->saveToDb();
481 $this->ctrl->redirect($this, self::CMD_SHOW_SYNC_ORIGINAL_CONFIRMATION);
485 $this->ctrl->redirect($this, self::CMD_SHOW_SKILL_QUEST_ASSIGNS);
490 require_once
'Modules/TestQuestionPool/classes/forms/class.ilAssQuestionSkillAssignmentPropertyFormGUI.php';
493 $form->setQuestion($question);
494 $form->setAssignment($assignment);
507 $table->loadSkillPointsFromRequest($loadSkillPointsFromRequest);
510 $assignmentList->loadFromDb();
511 $assignmentList->loadAdditionalSkillData();
512 $table->setSkillQuestionAssignmentList($assignmentList);
513 $table->setData($this->
orderQuestionData($this->questionList->getQuestionDataArray()));
515 $this->tpl->setContent($this->ctrl->getHTML($table));
520 $questionData = $this->questionList->getDataArrayForQuestionId($questionId);
522 if( !$questionData[
'original_id'] )
527 require_once
'Modules/TestQuestionPool/classes/class.assQuestion.php';
537 if( $this->access->checkAccess(
'write',
'', $parentRefId) )
548 $questionId = (int)
$_GET[
'question_id'];
550 require_once
'Services/Utilities/classes/class.ilConfirmationGUI.php';
553 $confirmation->setHeaderText($this->lng->txt(
'qpl_sync_quest_skl_assigns_confirmation'));
555 $confirmation->setFormAction($this->ctrl->getFormAction($this));
556 $confirmation->addHiddenItem(
'question_id', $questionId);
557 $confirmation->setConfirm($this->lng->txt(
'yes'), self::CMD_SYNC_ORIGINAL);
558 $confirmation->setCancel($this->lng->txt(
'no'), self::CMD_SHOW_SKILL_QUEST_ASSIGNS);
560 $this->tpl->setContent($this->ctrl->getHTML($confirmation));
565 $questionId = (int)
$_POST[
'question_id'];
571 $question->syncSkillAssignments($question->getObjId(), $question->getId(),
572 $question->lookupParentObjId($question->getOriginalId()), $question->getOriginalId()
578 $this->ctrl->redirect($this, self::CMD_SHOW_SKILL_QUEST_ASSIGNS);
583 require_once
'Modules/TestQuestionPool/classes/tables/class.ilAssQuestionSkillAssignmentsTableGUI.php';
593 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionSkillAssignmentList.php';
597 return $assignmentList;
605 require_once
'Services/Skill/classes/class.ilSkillSelectorGUI.php';
608 $this, self::CMD_SHOW_SKILL_SELECT, $this, self::CMD_UPDATE_SKILL_QUEST_ASSIGNS, self::PARAM_SKILL_SELECTION
611 $skillSelectorExplorerGUI->setSelectMode(self::PARAM_SKILL_SELECTION,
true);
612 $skillSelectorExplorerGUI->setNodeOnclickEnabled(
false);
617 foreach($assignments as $assignment)
619 $id =
"{$assignment->getSkillBaseId()}:{$assignment->getSkillTrefId()}";
621 $skillSelectorExplorerGUI->setSkillSelected($id);
624 return $skillSelectorExplorerGUI;
632 require_once
'Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php';
636 $skillSelectorToolbarGUI->setFormAction($this->ctrl->getFormAction($this));
637 $skillSelectorToolbarGUI->addFormButton($this->lng->txt(
'qpl_save_skill_assigns_update'), self::CMD_UPDATE_SKILL_QUEST_ASSIGNS);
638 $skillSelectorToolbarGUI->addFormButton($this->lng->txt(
'qpl_cancel_skill_assigns_update'), self::CMD_SHOW_SKILL_QUEST_ASSIGNS);
640 return $skillSelectorToolbarGUI;
645 $this->tpl->addCss(
'Services/COPage/css/content.css');
647 include_once(
"./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php");
651 $pageGUI->setRenderPageContainer(
true);
653 $pageGUI->setPresentationTitle($questionGUI->object->getTitle());
655 $questionGUI->object->setShuffle(
false);
656 $questionHTML = $questionGUI->
getSolutionOutput(0, 0,
false,
false,
true,
false,
true,
false,
true);
657 $pageGUI->setQuestionHTML(
array($questionGUI->object->getId() => $questionHTML));
659 $pageHTML = $pageGUI->presentation();
660 $pageHTML = preg_replace(
"/src=\"\\.\\//ims",
"src=\"" . ILIAS_HTTP_PATH .
"/", $pageHTML);
670 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionSkillAssignment.php';
675 $assignment->setQuestionId($questionId);
676 $assignment->setSkillBaseId($skillBaseId);
677 $assignment->setSkillTrefId($skillTrefId);
679 $assignment->loadFromDb();
680 $assignment->loadAdditionalSkillData();
687 return $this->questionList->isInList($questionId);
694 foreach($input->
getValues() as $expression)
700 $errors[] =
"{$this->lng->txt('ass_lac_expression')} {$expression->getOrderIndex()}: {$result}";
706 $alert = $this->lng->txt(
'ass_lac_validation_error');
707 $alert .=
'<br />'.implode(
'<br />',
$errors);
717 require_once
'Modules/TestQuestionPool/classes/questions/LogicalAnswerCompare/ilAssLacConditionParser.php';
718 require_once
'Modules/TestQuestionPool/classes/questions/LogicalAnswerCompare/ilAssLacQuestionProvider.php';
719 require_once
'Modules/TestQuestionPool/classes/questions/LogicalAnswerCompare/ilAssLacCompositeValidator.php';
724 $conditionComposite = $conditionParser->parse($expression->
getExpression());
726 $questionProvider->setQuestion($question);
729 $conditionValidator->validate($conditionComposite);
735 return $e->getFormAlert($this->lng);
746 $this->ctrl->saveParameter($this,
'question_id');
747 $this->ctrl->saveParameter($this,
'skill_base_id');
748 $this->ctrl->saveParameter($this,
'skill_tref_id');
753 $orderedQuestionsData =
array();
759 $orderedQuestionsData[$questionId] = $questionData[$questionId];
762 return $orderedQuestionsData;
765 foreach($questionData as $questionId =>
$data)
767 $orderedQuestionsData[$questionId] =
$data[
'title'];
772 foreach($orderedQuestionsData as $questionId => $questionTitle)
774 $orderedQuestionsData[$questionId] = $questionData[$questionId];
777 return $orderedQuestionsData;
790 $questionData = $this->questionList->getDataArrayForQuestionId($questionId);
792 return sprintf($this->lng->txt(
'qpl_qst_skl_selection_for_question_header'), $questionData[
'title']);
797 $flags = SORT_REGULAR;
801 $flags = SORT_NATURAL;
803 elseif(
defined(
'SORT_STRING') )
805 $flags = SORT_STRING;
808 if(
defined(
'SORT_FLAG_CASE') )
810 $flags = $flags | SORT_FLAG_CASE;
813 asort($array, $flags);
834 require_once
'Modules/TestQuestionPool/classes/questions/LogicalAnswerCompare/class.ilAssLacLegendGUI.php';
836 $legend->setQuestionOBJ($questionOBJ);
838 $lacLegendHTML = $this->ctrl->getHTML(
$legend);
839 return $lacLegendHTML;
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
getSolutionOutput( $active_id, $pass=NULL, $graphicalOutput=FALSE, $result_output=FALSE, $show_question_only=TRUE, $show_feedback=FALSE, $show_correct_solution=FALSE, $show_manual_scoring=FALSE, $show_question_text=TRUE)
This class provides processing control methods.
const CMD_UPDATE_SKILL_QUEST_ASSIGNS
Class iQuestionCondition.
const CMD_SHOW_SKILL_SELECT
setAssignmentConfigurationHintMessage($assignmentConfigurationHintMessage)
sortAlphabetically($array)
setQuestionContainerId($questionContainerId)
validateSolutionCompareExpression(ilAssQuestionSolutionComparisonExpression $expression, iQuestionCondition $question)
const PARAM_SKILL_SELECTION
saveSkillQuestionAssignmentPropertiesFormCmd()
keepAssignmentParameters()
Abstract basic class which is to be extended by the concrete assessment question type classes...
isSyncOriginalPossibleAndAllowed($questionId)
doesObjectTypeMatch($objectId)
isAssignmentEditingEnabled()
setAssignmentEditingEnabled($assignmentEditingEnabled)
getSkillSelectorHeader($questionId)
$assignmentConfigurationHintMessage
__construct(ilCtrl $ctrl, ilAccessHandler $access, ilTemplate $tpl, ilLanguage $lng, ilDBInterface $db)
showSyncOriginalConfirmationCmd()
const CMD_SAVE_SKILL_QUEST_ASSIGN_PROPERTIES_FORM
$assignmentEditingEnabled
const CMD_SAVE_SKILL_POINTS
static lookupParentObjId($questionId)
ilDBInterface $ilDB
static _getAllReferences($a_id)
get all reference ids of object
buildSkillQuestionAssignmentPropertiesForm(assQuestion $question, ilAssQuestionSkillAssignment $assignment)
showSkillQuestionAssignmentsCmd($loadSkillPointsFromRequest=false)
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
Class CompositeValidator.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
buildQuestionSkillAssignment($questionId, $skillBaseId, $skillTrefId)
static _getQuestionGUI($question_type, $question_id=-1)
Creates a question gui representation and returns the alias to the question gui note: please do not u...
special template class to simplify handling of ITX/PEAR
setQuestionList($questionList)
setQuestionOrderSequence($questionOrderSequence)
Basic GUI class for assessment questions.
buildLacLegendHTML(assQuestion $questionOBJ, ilAssQuestionSkillAssignment $assignment)
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
static _instantiateQuestion($question_id)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
getAssignmentConfigurationHintMessage()
checkSolutionCompareExpressionInput(ilLogicalAnswerComparisonExpressionInputGUI $input, assQuestion $question)
getQuestionOrderSequence()
isAvoidManipulationRedirectRequired($command)
Explorer class that works on tree objects (Services/Tree)
const DEFAULT_COMPETENCE_POINTS
Class ilParserQuestionProvider.
buildSkillSelectorExplorerGUI($assignments)
buildSkillSelectorToolbarGUI()
isTestQuestion($questionId)
showSkillQuestionAssignmentPropertiesFormCmd(assQuestionGUI $questionGUI=null, ilAssQuestionSkillAssignment $assignment=null, ilPropertyFormGUI $form=null)
const CMD_SHOW_SYNC_ORIGINAL_CONFIRMATION
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'
buildSkillQuestionAssignmentList()
const EVAL_MODE_BY_QUESTION_RESULT
handleAssignmentConfigurationHintMessage()
updateSkillQuestionAssignmentsCmd()
const CMD_SHOW_SKILL_QUEST_ASSIGNS
orderQuestionData($questionData)
buildQuestionPage(assQuestionGUI $questionGUI)
const CMD_SHOW_SKILL_QUEST_ASSIGN_PROPERTIES_FORM
setOutputMode($a_mode=IL_PAGE_PRESENTATION)
Set Output Mode.
Confirmation screen class.