4 include_once
'Modules/Test/classes/inc.AssessmentConstants.php';
5 include_once
'Modules/Test/classes/class.ilTestScoringGUI.php';
22 parent::__construct($a_object);
30 return 'showManScoringByQuestionParticipantsTable';
38 return 'man_scoring_by_qst';
44 protected function showManScoringByQuestionParticipantsTable($manPointsPost = array())
47 $tpl = $DIC->ui()->mainTemplate();
51 include_once
'Services/jQuery/classes/class.iljQueryUtil.php';
54 include_once
'Services/YUI/classes/class.ilYuiUtil.php';
63 $tpl->addJavaScript(
"./Services/JavaScript/js/Basic.js");
64 $tpl->addJavaScript(
"./Services/Form/js/Form.js");
65 $tpl->addJavascript(
'./Services/UIComponent/Modal/js/Modal.js');
66 $tpl->addCss($this->object->getTestStyleLocation(
"output"),
"screen");
68 $this->lng->toJSMap(array(
'answer' => $this->lng->txt(
'answer')));
70 require_once
'Modules/Test/classes/tables/class.ilTestManScoringParticipantsBySelectedQuestionAndPassTableGUI.php';
73 $table->setManualScoringPointsPostData($manPointsPost);
75 $qst_id =
$table->getFilterItemByPostVar(
'question')->getValue();
76 $passNr =
$table->getFilterItemByPostVar(
'pass')->getValue();
78 $table_data = array();
80 $selected_questionData = null;
82 if (is_numeric($qst_id)) {
85 $selected_questionData =
$info;
87 if (in_array(
$type, $scoring)) {
88 $selected_questionData =
$info;
92 if ($selected_questionData && is_numeric($passNr)) {
93 $data = $this->
object->getCompleteEvaluationData(
false);
94 $participants =
$data->getParticipants();
96 require_once
'Modules/Test/classes/class.ilTestParticipantData.php';
109 $participant = $participants[$active_id];
110 $testResultData = $this->
object->getTestResult($active_id, $passNr - 1);
111 foreach ($testResultData as $questionData) {
112 if (!isset($questionData[
'qid']) || $questionData[
'qid'] != $selected_questionData[
'question_id']) {
117 $table_data[] = array(
118 'pass_id' => $passNr - 1,
119 'active_id' => $active_id,
120 'qst_id' => $questionData[
'qid'],
123 'participant' => $participant,
124 'lastname' =>
$user[0][
'lastname'],
125 'firstname' =>
$user[0][
'firstname'],
126 'login' => $participant->getLogin(),
131 $table->disable(
'header');
134 if ($selected_questionData) {
136 $table->setCurQuestionMaxPoints($maxpoints);
137 if ($maxpoints == 1) {
138 $maxpoints =
' (' . $maxpoints .
' ' . $this->lng->txt(
'point') .
')';
140 $maxpoints =
' (' . $maxpoints .
' ' . $this->lng->txt(
'points') .
')';
142 $table->setTitle($this->lng->txt(
'tst_man_scoring_by_qst') .
': ' . $selected_questionData[
'title'] . $maxpoints .
' [' . $this->lng->txt(
'question_id_short') .
': ' . $selected_questionData[
'question_id'] .
']');
144 $table->setTitle($this->lng->txt(
'tst_man_scoring_by_qst'));
147 $table->setData($table_data);
155 if (!isset(
$_POST[
'scoring']) || !is_array(
$_POST[
'scoring'])) {
157 $this->showManScoringByQuestionParticipantsTable();
162 $activeData = current(
$_POST[
'scoring']);
164 require_once
'Modules/Test/classes/class.ilTestParticipantData.php';
174 include_once
'Modules/TestQuestionPool/classes/class.assQuestion.php';
175 include_once
'Modules/Test/classes/class.ilObjTestAccess.php';
176 include_once
'Services/Tracking/classes/class.ilLPStatusWrapper.php';
178 $oneExceededMaxPoints =
false;
179 $manPointsPost = array();
180 $skipParticipant = array();
181 $maxPointsByQuestionId = array();
183 $questions = $activeData[$active_id];
186 if (!$this->object->getTestResult($active_id,
$pass)) {
187 if (!isset($skipParticipant[
$pass])) {
188 $skipParticipant[
$pass] = array();
191 $skipParticipant[
$pass][$active_id] =
true;
196 foreach ((array) $questions as $qst_id => $reached_points) {
197 if (!isset($manPointsPost[
$pass])) {
198 $manPointsPost[
$pass] = array();
201 if (!isset($manPointsPost[$pass][$active_id])) {
202 $manPointsPost[
$pass][$active_id] = array();
207 if ($reached_points > $maxPointsByQuestionId[$qst_id]) {
208 $oneExceededMaxPoints =
true;
211 $manPointsPost[
$pass][$active_id][$qst_id] = $reached_points;
215 if ($oneExceededMaxPoints) {
217 $this->showManScoringByQuestionParticipantsTable($manPointsPost);
221 $changed_one =
false;
222 $lastAndHopefullyCurrentQuestionId = null;
224 $questions = $activeData[$active_id];
226 $update_participant =
false;
228 if ($skipParticipant[
$pass][$active_id]) {
232 foreach ((array) $questions as $qst_id => $reached_points) {
237 $maxPointsByQuestionId[$qst_id],
240 $this->object->areObligationsEnabled()
244 if ($update_participant) {
247 $lastAndHopefullyCurrentQuestionId = $qst_id;
250 $this->object->getId(),
258 if ($lastAndHopefullyCurrentQuestionId) {
260 $qTitle = $question->getTitle();
263 $this->lng->txt(
'tst_saved_manscoring_by_question_successfully'),
267 ilUtil::sendSuccess($msg,
true);
277 $this->showManScoringByQuestionParticipantsTable();
285 require_once
'Modules/Test/classes/tables/class.ilTestManScoringParticipantsBySelectedQuestionAndPassTableGUI.php';
288 $table->writeFilterToSession();
289 $this->showManScoringByQuestionParticipantsTable();
297 require_once
'Modules/Test/classes/tables/class.ilTestManScoringParticipantsBySelectedQuestionAndPassTableGUI.php';
301 $this->showManScoringByQuestionParticipantsTable();
306 $active_id = (int)
$_GET[
'active_id'];
308 $question_id = (int)
$_GET[
'qst_id'];
310 if (!$this->
getTestAccess()->checkScoreParticipantsAccessForActiveId($active_id)) {
314 $data = $this->
object->getCompleteEvaluationData(
false);
315 $participant =
$data->getParticipant($active_id);
317 $question_gui = $this->
object->createQuestionGUI(
'', $question_id);
319 $tmp_tpl =
new ilTemplate(
'tpl.il_as_tst_correct_solution_output.html',
true,
true,
'Modules/Test');
320 if ($question_gui->supportsIntermediateSolutionOutput() && $question_gui->hasIntermediateSolution($active_id,
$pass)) {
321 $question_gui->setUseIntermediateSolution(
true);
322 $aresult_output = $question_gui->getSolutionOutput($active_id,
$pass,
false,
false,
true,
false,
false,
true);
323 $question_gui->setUseIntermediateSolution(
false);
324 $tmp_tpl->setVariable(
'TEXT_ASOLUTION_OUTPUT', $this->lng->txt(
'autosavecontent'));
325 $tmp_tpl->setVariable(
'ASOLUTION_OUTPUT', $aresult_output);
328 $result_output = $question_gui->getSolutionOutput($active_id,
$pass,
false,
false,
false, $this->object->getShowSolutionFeedback(),
false,
true);
329 $tmp_tpl->setVariable(
'TEXT_YOUR_SOLUTION', $this->lng->txt(
'answers_of') .
' ' . $participant->getName());
333 $maxpoints = $question_gui->object->getMaximumPoints();
335 $add_title =
' [' . $this->lng->txt(
'question_id_short') .
': ' . $question_id .
']';
337 if ($maxpoints == 1) {
338 $tmp_tpl->setVariable(
'QUESTION_TITLE', $this->object->getQuestionTitle($question_gui->object->getTitle()) .
' (' . $maxpoints .
' ' . $this->lng->txt(
'point') .
')' . $add_title);
340 $tmp_tpl->setVariable(
'QUESTION_TITLE', $this->object->getQuestionTitle($question_gui->object->getTitle()) .
' (' . $maxpoints .
' ' . $this->lng->txt(
'points') .
')' . $add_title);
342 $tmp_tpl->setVariable(
'SOLUTION_OUTPUT', $result_output);
343 $tmp_tpl->setVariable(
'RECEIVED_POINTS', sprintf($this->lng->txt(
'part_received_a_of_b_points'), $question_gui->object->getReachedPoints($active_id,
$pass), $maxpoints));
345 echo $tmp_tpl->get();
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.
const TAB_ID_MANUAL_SCORING
applyManScoringByQuestionFilter()
static _getMaximumPoints($question_id)
Returns the maximum points, a learner can reach answering the question.
saveManScoringByQuestion()
static _getQuestionInfo($question_id)
Returns question information from the database.
static initOverlay(ilTemplate $a_main_tpl=null)
Init YUI Overlay module.
special template class to simplify handling of ITX/PEAR
static _instantiateQuestion($question_id)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
resetManScoringByQuestionFilter()
static _getManualScoring()
Retrieve the manual scoring settings.
static getScoreParticipantsUserFilter($refId)
static initjQuery($a_tpl=null)
inits and adds the jQuery JS-File to the global or a passed template
__construct(ilObjTest $a_object)
if(strpos($jquery_path, './')===0) elseif(strpos($jquery_path, '.')===0) $mathJaxSetting
if(empty($password)) $table
static _getReachedPoints($active_id, $question_id, $pass=null)
Returns the points, a learner has reached answering the question.
static _getUserData($a_internalids)
return user data for given user ids
static initPanel($a_resize=false, ilTemplate $a_main_tpl=null)
Init yui panel.
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...