Skip to content

Commit

Permalink
Show Only Points
Browse files Browse the repository at this point in the history
  • Loading branch information
mbecker-databay committed Oct 19, 2023
1 parent 8208b7d commit 20201a5
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public function toForm(
$inputs['title_output'] = $f->radio($lng->txt('tst_title_output'))
->withOption('0', $lng->txt('tst_title_output_full'))
->withOption('1', $lng->txt('tst_title_output_hide_points'))
->withOption('3', $lng->txt('tst_title_output_only_points'))
->withOption('2', $lng->txt('tst_title_output_no_title'))
->withValue($this->getQuestionTitleOutputMode())
->withAdditionalTransformation($refinery->kindlyTo()->int());
Expand Down
35 changes: 28 additions & 7 deletions Modules/Test/classes/class.ilObjTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1464,16 +1464,37 @@ public function &getQuestionTitlesAndIndexes(): array
* @return string The title for the question title output
* @access public
*/
public function getQuestionTitle($title, $nr = null): string
public function getQuestionTitle($title, $nr = null, $points = null): string
{
if ($this->getTitleOutput() !== 2) {
return $title;
}
switch($this->getTitleOutput())
{
case '0':
case '1':
return $title;
break;
case '2':
if (isset($nr)) {
return $this->lng->txt("ass_question") . ' ' . $nr;
}
return $this->lng->txt("ass_question");
break;
case 3:
if (isset($nr)) {
$txt = $this->lng->txt("ass_question") . ' ' . $nr;
} else {
$txt = $this->lng->txt("ass_question");
}
if($points != '') {
$lngv = $this->lng->txt('points');
if ($points == 1) {
$lngv = $this->lng->txt('point');
}
$txt .= ' - ' . $points . ' ' . $lngv;
}
return $txt;
break;

if ($this->getTitleOutput() === 2 && isset($nr)) {
return $this->lng->txt("ass_question") . ' ' . $nr;
}

return $this->lng->txt("ass_question");
}
// fau.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,9 @@ protected function buildQuestionRelatedObjectivesString(): string
public function getPresentationTitle(): string
{
switch ($this->getHeaderMode()) {
case 3: // only points => show no title here
return $this->buildQuestionPointsString();
break;
case 2: // neither titles nor points => show position as title
return $this->buildQuestionPositionString();
break;
Expand Down Expand Up @@ -329,6 +332,9 @@ public function getQuestionInfoHTML(): string
$text = $this->buildQuestionPositionString();
break;

case 3: // only points => show nothing here
$text = $this->buildQuestionPositionString();
break;
case 2: // neither titles nor points => position is separate title, show nothing here
$text = '';
break;
Expand Down
4 changes: 3 additions & 1 deletion Modules/Test/classes/class.ilTestService.php
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,12 @@ public function getQuestionSummaryData(ilTestSequenceSummaryProvider $testSequen
}
}



// fau: testNav - add number parameter for getQuestionTitle()
$data[] = array(
'order' => $value["nr"],
'title' => $this->object->getQuestionTitle($value["title"], $value["nr"]),
'title' => $this->object->getQuestionTitle($value["title"], $value["nr"], $value["points"]),
'description' => $description,
'disabled' => $disableLink,
'worked_through' => $value["worked_through"],
Expand Down
1 change: 1 addition & 0 deletions lang/ilias_de.lang
Original file line number Diff line number Diff line change
Expand Up @@ -1882,6 +1882,7 @@ assessment#:#tst_title_output#:#Anzeige der Fragentitel
assessment#:#tst_title_output_full#:#Fragentitel und erreichbare Punkte
assessment#:#tst_title_output_hide_points#:#Nur Fragentitel
assessment#:#tst_title_output_no_title#:#Weder Fragentitel noch erreichbare Punkte
assessment#:#tst_title_output_only_points#:#Nur erreichbare Punkte
assessment#:#tst_trigger_result_refreshing#:#Es erfolgt eine Neuberechnung des Ergebnisses. Dies kann eine Weile dauern.
assessment#:#tst_type#:#Test-Typ
assessment#:#tst_unchanged_answer_is_correct#:#Die vorgegebene Antwort ist korrekt.
Expand Down
1 change: 1 addition & 0 deletions lang/ilias_en.lang
Original file line number Diff line number Diff line change
Expand Up @@ -1882,6 +1882,7 @@ assessment#:#tst_title_output#:#Show Question Title
assessment#:#tst_title_output_full#:#Question Titles and Available Points
assessment#:#tst_title_output_hide_points#:#Only Question Titles
assessment#:#tst_title_output_no_title#:#Neither Question Titles nor Available Points
assessment#:#tst_title_output_only_points#:#Only Available Points
assessment#:#tst_trigger_result_refreshing#:#Results need to be recalculated. This may take a while.
assessment#:#tst_type#:#Test Type
assessment#:#tst_unchanged_answer_is_correct#:#The preset answer is correct###fau: testNav
Expand Down

0 comments on commit 20201a5

Please sign in to comment.