4 include_once
'Modules/Test/classes/inc.AssessmentConstants.php';
5 include_once
'Modules/Test/classes/class.ilTestScoringGUI.php';
22 parent::__construct($a_object);
35 if(!$ilAccess->checkAccess(
'write',
'', $this->ref_id))
38 $this->ctrl->redirectByClass(
'ilobjtestgui',
'infoScreen');
41 require_once
'Modules/Test/classes/class.ilObjAssessmentFolder.php';
45 $this->ctrl->redirectByClass(
'ilobjtestgui',
'infoScreen');
48 $cmd = $this->ctrl->getCmd();
49 $next_class = $this->ctrl->getNextClass($this);
52 $this->ctrl->redirect($this,
'manscoring');
56 $this->buildSubTabs(
'man_scoring_by_qst');
70 private function showManScoringByQuestionParticipantsTable($manPointsPost = array())
76 global
$tpl, $ilAccess;
78 if(!$ilAccess->checkAccess(
'write',
'', $this->ref_id))
81 $this->ctrl->redirectByClass(
'ilobjtestgui',
'infoScreen');
84 include_once
'Services/jQuery/classes/class.iljQueryUtil.php';
87 include_once
'Services/YUI/classes/class.ilYuiUtil.php';
97 $tpl->addJavascript(
'./Services/UIComponent/Overlay/js/ilOverlay.js');
98 $tpl->addJavaScript(
"./Services/JavaScript/js/Basic.js");
99 $tpl->addJavaScript(
"./Services/Form/js/Form.js");
100 $tpl->addCss($this->object->getTestStyleLocation(
"output"),
"screen");
102 require_once
'Modules/Test/classes/tables/class.ilTestManScoringParticipantsBySelectedQuestionAndPassTableGUI.php';
105 $table->setManualScoringPointsPostData($manPointsPost);
107 $qst_id = $table->getFilterItemByPostVar(
'question')->getValue();
108 $pass_id = $table->getFilterItemByPostVar(
'pass')->getValue();
110 $table_data = array();
112 $selected_questionData = null;
114 if(is_numeric($qst_id))
118 $selected_questionData = $info;
119 $type = $info[
"question_type_fi"];
120 if(in_array($type, $scoring))
122 $selected_questionData = $info;
126 if($selected_questionData && is_numeric($pass_id))
128 $data = $this->
object->getCompleteEvaluationData(FALSE);
130 foreach(
$data->getParticipants() as $active_id => $participant)
132 $testResultData = $this->
object->getTestResult($active_id, $pass_id - 1);
133 foreach($testResultData as $questionData)
135 if( !isset($questionData[
'qid']) || $questionData[
'qid'] != $selected_questionData[
'question_id'] )
140 $table_data[] = array(
141 'pass_id' => $pass_id - 1,
142 'active_id' => $active_id,
143 'qst_id' => $questionData[
'qid'],
146 'participant' => $participant,
153 $table->disable(
'header');
156 if($selected_questionData)
161 $maxpoints =
' (' . $maxpoints .
' ' . $this->lng->txt(
'point') .
')';
165 $maxpoints =
' (' . $maxpoints .
' ' . $this->lng->txt(
'points') .
')';
167 $table->setTitle($this->lng->txt(
'tst_man_scoring_by_qst') .
': ' . $selected_questionData[
'title'] . $maxpoints .
' ['. $this->lng->txt(
'question_id_short') .
': ' . $selected_questionData[
'question_id'] .
']');
171 $table->setTitle($this->lng->txt(
'tst_man_scoring_by_qst'));
174 $table->setData($table_data);
175 $tpl->setContent($table->getHTML());
178 public function saveManScoringByQuestion()
185 if(!$ilAccess->checkAccess(
'write',
'', $this->ref_id))
188 $this->ctrl->redirectByClass(
'ilobjtestgui',
'infoScreen');
191 if(!isset(
$_POST[
'scoring']) || !is_array(
$_POST[
'scoring']))
194 $this->showManScoringByQuestionParticipantsTable();
198 include_once
'Modules/TestQuestionPool/classes/class.assQuestion.php';
199 include_once
'Modules/Test/classes/class.ilObjTestAccess.php';
200 include_once
'Services/Tracking/classes/class.ilLPStatusWrapper.php';
202 $oneExceededMaxPoints =
false;
203 $manPointsPost = array();
204 $skipParticipant = array();
205 $maxPointsByQuestionId = array();
208 foreach((array)$active_ids as $active_id => $questions)
211 if( !$this->object->getTestResult($active_id,
$pass) )
213 if( !isset($skipParticipant[
$pass]) )
215 $skipParticipant[
$pass] = array();
218 $skipParticipant[
$pass][$active_id] =
true;
223 foreach((array)$questions as $qst_id => $reached_points)
225 if( !isset($manPointsPost[
$pass]) )
227 $manPointsPost[
$pass] = array();
230 if( !isset($manPointsPost[$pass][$active_id]) )
232 $manPointsPost[
$pass][$active_id] = array();
237 if( $reached_points > $maxPointsByQuestionId[$qst_id] )
239 $oneExceededMaxPoints =
true;
242 $manPointsPost[
$pass][$active_id][$qst_id] = $reached_points;
247 if( $oneExceededMaxPoints )
250 $this->showManScoringByQuestionParticipantsTable($manPointsPost);
254 $changed_one =
false;
257 foreach((array)$active_ids as $active_id => $questions)
259 $update_participant =
false;
261 if($skipParticipant[
$pass][$active_id])
266 foreach((array)$questions as $qst_id => $reached_points)
269 $active_id, $qst_id, $reached_points, $maxPointsByQuestionId[$qst_id],
$pass, 1, $this->object->areObligationsEnabled()
273 if($update_participant)
288 require_once
'./Modules/Test/classes/class.ilTestScoring.php';
290 $scorer->setPreserveManualScores(
true);
291 $scorer->recalculateSolutions();
294 $this->showManScoringByQuestionParticipantsTable();
302 require_once
'Modules/Test/classes/tables/class.ilTestManScoringParticipantsBySelectedQuestionAndPassTableGUI.php';
304 $table->resetOffset();
305 $table->writeFilterToSession();
306 $this->showManScoringByQuestionParticipantsTable();
314 require_once
'Modules/Test/classes/tables/class.ilTestManScoringParticipantsBySelectedQuestionAndPassTableGUI.php';
316 $table->resetOffset();
317 $table->resetFilter();
318 $this->showManScoringByQuestionParticipantsTable();
321 private function getAnswerDetail()
328 if(!$ilAccess->checkAccess(
'write',
'', $this->ref_id))
333 $active_id =
$_GET[
'active_id'];
335 $question_id =
$_GET[
'qst_id'];
337 $data = $this->
object->getCompleteEvaluationData(FALSE);
338 $participant =
$data->getParticipant($active_id);
340 $question_gui = $this->
object->createQuestionGUI(
'', $question_id);
342 $tmp_tpl =
new ilTemplate(
'tpl.il_as_tst_correct_solution_output.html', TRUE, TRUE,
'Modules/Test');
343 $result_output = $question_gui->getSolutionOutput($active_id,
$pass, FALSE, FALSE, FALSE, $this->object->getShowSolutionFeedback());
344 $tmp_tpl->setVariable(
'TEXT_YOUR_SOLUTION', $this->lng->txt(
'answers_of') .
' '. $participant->getName());
345 $maxpoints = $question_gui->object->getMaximumPoints();
347 $add_title =
' ['. $this->lng->txt(
'question_id_short') .
': ' . $question_id .
']';
351 $tmp_tpl->setVariable(
'QUESTION_TITLE', $this->object->getQuestionTitle($question_gui->object->getTitle()) .
' (' . $maxpoints .
' ' . $this->lng->txt(
'point') .
')' . $add_title);
355 $tmp_tpl->setVariable(
'QUESTION_TITLE', $this->object->getQuestionTitle($question_gui->object->getTitle()) .
' (' . $maxpoints .
' ' . $this->lng->txt(
'points') .
')' . $add_title);
357 $tmp_tpl->setVariable(
'SOLUTION_OUTPUT', $result_output);
358 $tmp_tpl->setVariable(
'RECEIVED_POINTS', sprintf($this->lng->txt(
'part_received_a_of_b_points'), $question_gui->object->getReachedPoints($active_id,
$pass), $maxpoints));
360 echo $tmp_tpl->get();
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static _updateStatus($a_obj_id, $a_usr_id, $a_obj=null, $a_percentage=false, $a_no_raise=false, $a_force_raise=false)
Update status.
ilTestManScoringParticipantsBySelectedQuestionAndPassTableGUI
& _getQuestionInfo($question_id)
Returns question information from the database.
applyManScoringByQuestionFilter()
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
& executeCommand()
execute command
getCommand($cmd)
Retrieves the ilCtrl command.
static _mananuallyScoreableQuestionTypesExists()
Returns the fact wether manually scoreable question types exist or not.
special template class to simplify handling of ITX/PEAR
_getParticipantId($active_id)
Get user id for active id.
_getMaximumPoints($question_id)
Returns the maximum points, a learner can reach answering the question.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static initPanel($a_resize=false)
Init yui panel.
resetManScoringByQuestionFilter()
while($lm_rec=$ilDB->fetchAssoc($lm_set)) $data
_getReachedPoints($active_id, $question_id, $pass=NULL)
Returns the points, a learner has reached answering the question.
static initOverlay()
Init YUI Overlay module.
_setReachedPoints($active_id, $question_id, $points, $maxpoints, $pass, $manualscoring, $obligationsEnabled)
Sets the points, a learner has reached answering the question Additionally objective results are upda...
static initjQuery($a_tpl=null)
Init jQuery.
__construct(ilObjTest $a_object)
if(strpos($jquery_path, './')===0) else if(strpos($jquery_path, '.')===0) $mathJaxSetting
ilTestScoringByQuestionsGUI
_getManualScoring()
Retrieve the manual scoring settings.