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(
'showManScoringByQuestionParticipantsTable');
49 $next_class = $this->ctrl->getNextClass($this);
52 $this->buildSubTabs(
'man_scoring_by_qst');
66 private function showManScoringByQuestionParticipantsTable($manPointsPost =
array())
72 global
$tpl, $ilAccess;
74 if(!$ilAccess->checkAccess(
'write',
'', $this->ref_id))
77 $this->ctrl->redirectByClass(
'ilobjtestgui',
'infoScreen');
80 include_once
'Services/jQuery/classes/class.iljQueryUtil.php';
83 include_once
'Services/YUI/classes/class.ilYuiUtil.php';
93 $tpl->addJavaScript(
"./Services/JavaScript/js/Basic.js");
94 $tpl->addJavaScript(
"./Services/Form/js/Form.js");
95 $tpl->addJavascript(
'./Services/UIComponent/Modal/js/Modal.js');
96 $tpl->addCss($this->
object->getTestStyleLocation(
"output"),
"screen");
98 $this->lng->toJSMap(
array(
'answer' => $this->lng->txt(
'answer')));
100 require_once
'Modules/Test/classes/tables/class.ilTestManScoringParticipantsBySelectedQuestionAndPassTableGUI.php';
103 $table->setManualScoringPointsPostData($manPointsPost);
105 $qst_id = $table->getFilterItemByPostVar(
'question')->getValue();
106 $pass_id = $table->getFilterItemByPostVar(
'pass')->getValue();
108 $table_data =
array();
110 $selected_questionData = null;
112 if(is_numeric($qst_id))
116 $selected_questionData =
$info;
117 $type =
$info[
"question_type_fi"];
118 if(in_array($type, $scoring))
120 $selected_questionData =
$info;
124 if($selected_questionData && is_numeric($pass_id))
126 $data = $this->
object->getCompleteEvaluationData(FALSE);
128 foreach(
$data->getParticipants() as $active_id => $participant)
130 $testResultData = $this->
object->getTestResult($active_id, $pass_id - 1);
131 foreach($testResultData as $questionData)
133 if( !isset($questionData[
'qid']) || $questionData[
'qid'] != $selected_questionData[
'question_id'] )
138 $table_data[] =
array(
139 'pass_id' => $pass_id - 1,
140 'active_id' => $active_id,
141 'qst_id' => $questionData[
'qid'],
144 'participant' => $participant,
151 $table->disable(
'header');
154 if($selected_questionData)
157 $table->setCurQuestionMaxPoints($maxpoints);
160 $maxpoints =
' (' . $maxpoints .
' ' . $this->lng->txt(
'point') .
')';
164 $maxpoints =
' (' . $maxpoints .
' ' . $this->lng->txt(
'points') .
')';
166 $table->setTitle($this->lng->txt(
'tst_man_scoring_by_qst') .
': ' . $selected_questionData[
'title'] . $maxpoints .
' ['. $this->lng->txt(
'question_id_short') .
': ' . $selected_questionData[
'question_id'] .
']');
170 $table->setTitle($this->lng->txt(
'tst_man_scoring_by_qst'));
173 $table->setData($table_data);
174 $tpl->setContent($table->getHTML());
177 public function saveManScoringByQuestion()
182 global $ilAccess,
$lng;
184 if(!$ilAccess->checkAccess(
'write',
'', $this->ref_id))
187 $this->ctrl->redirectByClass(
'ilobjtestgui',
'infoScreen');
190 if(!isset(
$_POST[
'scoring']) || !is_array(
$_POST[
'scoring']))
193 $this->showManScoringByQuestionParticipantsTable();
197 include_once
'Modules/TestQuestionPool/classes/class.assQuestion.php';
198 include_once
'Modules/Test/classes/class.ilObjTestAccess.php';
199 include_once
'Services/Tracking/classes/class.ilLPStatusWrapper.php';
201 $oneExceededMaxPoints =
false;
202 $manPointsPost =
array();
203 $skipParticipant =
array();
204 $maxPointsByQuestionId =
array();
207 foreach((
array)$active_ids as $active_id => $questions)
210 if( !$this->
object->getTestResult($active_id,
$pass) )
212 if( !isset($skipParticipant[
$pass]) )
217 $skipParticipant[
$pass][$active_id] =
true;
222 foreach((
array)$questions as $qst_id => $reached_points)
224 if( !isset($manPointsPost[
$pass]) )
229 if( !isset($manPointsPost[$pass][$active_id]) )
236 if( $reached_points > $maxPointsByQuestionId[$qst_id] )
238 $oneExceededMaxPoints =
true;
241 $manPointsPost[
$pass][$active_id][$qst_id] = $reached_points;
246 if( $oneExceededMaxPoints )
249 $this->showManScoringByQuestionParticipantsTable($manPointsPost);
253 $changed_one =
false;
254 $lastAndHopefullyCurrentQuestionId = null;
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)
277 $lastAndHopefullyCurrentQuestionId = $qst_id;
289 if($lastAndHopefullyCurrentQuestionId)
292 $qTitle = $question->getTitle();
295 $this->lng->txt(
'tst_saved_manscoring_by_question_successfully'), $qTitle,
$pass + 1
299 require_once
'./Modules/Test/classes/class.ilTestScoring.php';
301 $scorer->setPreserveManualScores(
true);
302 $scorer->recalculateSolutions();
305 $this->showManScoringByQuestionParticipantsTable();
313 require_once
'Modules/Test/classes/tables/class.ilTestManScoringParticipantsBySelectedQuestionAndPassTableGUI.php';
315 $table->resetOffset();
316 $table->writeFilterToSession();
317 $this->showManScoringByQuestionParticipantsTable();
325 require_once
'Modules/Test/classes/tables/class.ilTestManScoringParticipantsBySelectedQuestionAndPassTableGUI.php';
327 $table->resetOffset();
328 $table->resetFilter();
329 $this->showManScoringByQuestionParticipantsTable();
332 private function getAnswerDetail()
339 if(!$ilAccess->checkAccess(
'write',
'', $this->ref_id))
344 $active_id =
$_GET[
'active_id'];
346 $question_id =
$_GET[
'qst_id'];
348 $data = $this->
object->getCompleteEvaluationData(FALSE);
349 $participant =
$data->getParticipant($active_id);
351 $question_gui = $this->
object->createQuestionGUI(
'', $question_id);
353 $tmp_tpl =
new ilTemplate(
'tpl.il_as_tst_correct_solution_output.html', TRUE, TRUE,
'Modules/Test');
354 $result_output = $question_gui->getSolutionOutput($active_id,
$pass, FALSE, FALSE, FALSE, $this->
object->getShowSolutionFeedback(), FALSE, TRUE);
355 $tmp_tpl->setVariable(
'TEXT_YOUR_SOLUTION', $this->lng->txt(
'answers_of') .
' '. $participant->getName());
356 $maxpoints = $question_gui->object->getMaximumPoints();
358 $add_title =
' ['. $this->lng->txt(
'question_id_short') .
': ' . $question_id .
']';
362 $tmp_tpl->setVariable(
'QUESTION_TITLE', $this->
object->getQuestionTitle($question_gui->object->getTitle()) .
' (' . $maxpoints .
' ' . $this->lng->txt(
'point') .
')' . $add_title);
366 $tmp_tpl->setVariable(
'QUESTION_TITLE', $this->
object->getQuestionTitle($question_gui->object->getTitle()) .
' (' . $maxpoints .
' ' . $this->lng->txt(
'points') .
')' . $add_title);
368 $tmp_tpl->setVariable(
'SOLUTION_OUTPUT', $result_output);
369 $tmp_tpl->setVariable(
'RECEIVED_POINTS', sprintf($this->lng->txt(
'part_received_a_of_b_points'), $question_gui->object->getReachedPoints($active_id,
$pass), $maxpoints));
371 echo $tmp_tpl->get();
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static _getParticipantId($active_id)
Get user id for active id.
ilTestManScoringParticipantsBySelectedQuestionAndPassTableGUI
static _updateStatus($a_obj_id, $a_usr_id, $a_obj=null, $a_percentage=false, $a_force_raise=false)
Update status.
executeCommand()
execute command
applyManScoringByQuestionFilter()
static _getMaximumPoints($question_id)
Returns the maximum points, a learner can reach answering the question.
static _getQuestionInfo($question_id)
Returns question information from the database.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static _getReachedPoints($active_id, $question_id, $pass=NULL)
Returns the points, a learner has reached answering the question.
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
if(strpos($jquery_path, './')===0) else if(strpos($jquery_path, '.')===0) $mathJaxSetting
Create styles array
The data for the language used.
static _instantiateQuestion($question_id)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static initPanel($a_resize=false)
Init yui panel.
resetManScoringByQuestionFilter()
Create new PHPExcel object
obj_idprivate
static _getManualScoring()
Retrieve the manual scoring settings.
static initOverlay()
Init YUI Overlay module.
static initjQuery($a_tpl=null)
Init jQuery.
__construct(ilObjTest $a_object)
ilTestScoringByQuestionsGUI
static _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...