Skip to content

Commit

Permalink
Merge branch 'MDL-74821-311' of https://github.com/junpataleta/moodle
Browse files Browse the repository at this point in the history
…into MOODLE_311_STABLE
  • Loading branch information
junpataleta committed Jul 5, 2022
2 parents d16e3a8 + cc7ccb6 commit b7d7906
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion mod/feedback/analysis_course.php
Expand Up @@ -119,7 +119,7 @@

echo '<tr>';
echo '<td>'.$shortname.'</td>';
echo '<td align="right">';
echo '<td class="text-right">';
echo format_float(($c->sumvalue / $c->countvalue), 2);
echo '</td>';
echo '</tr>';
Expand Down
2 changes: 1 addition & 1 deletion mod/feedback/complete.php
Expand Up @@ -116,7 +116,7 @@
'generalbox boxaligncenter');
}
if ($feedbackcompletion->can_view_analysis()) {
echo '<p align="center">';
echo '<p class="text-center">';
$analysisurl = new moodle_url('/mod/feedback/analysis.php', array('id' => $cm->id, 'courseid' => $courseid));
echo html_writer::link($analysisurl, get_string('completed_feedbacks', 'feedback'));
echo '</p>';
Expand Down
4 changes: 2 additions & 2 deletions mod/feedback/item/info/lib.php
Expand Up @@ -157,7 +157,7 @@ public function print_analysed($item, $itemnr = '', $groupid = false, $courseid
$analysed_item = $this->get_analysed($item, $groupid, $courseid);
$data = $analysed_item->data;
if (is_array($data)) {
echo '<tr><th colspan="2" align="left">';
echo '<tr><th class="text-left">';
echo $itemnr . ' ';
if (strval($item->label) !== '') {
echo '('. format_string($item->label).') ';
Expand All @@ -167,7 +167,7 @@ public function print_analysed($item, $itemnr = '', $groupid = false, $courseid
$sizeofdata = count($data);
for ($i = 0; $i < $sizeofdata; $i++) {
$class = strlen(trim($data[$i]->show)) ? '' : ' class="isempty"';
echo '<tr'.$class.'><td colspan="2" class="singlevalue">';
echo '<tr'.$class.'><td class="singlevalue">';
echo str_replace("\n", '<br />', $data[$i]->show);
echo '</td></tr>';
}
Expand Down
7 changes: 4 additions & 3 deletions mod/feedback/item/multichoice/lib.php
Expand Up @@ -209,14 +209,14 @@ public function print_analysed($item, $itemnr = '', $groupid = false, $courseid
if ($analysed_item) {
$itemname = $analysed_item[1];
echo "<table class=\"analysis itemtype_{$item->typ}\">";
echo '<tr><th colspan="2" align="left">';
echo '<tr><th class="text-left">';
echo $itemnr . ' ';
if (strval($item->label) !== '') {
echo '('. format_string($item->label).') ';
}
echo format_string($itemname);
echo '</th></tr>';
echo "</table>";

$analysed_vals = $analysed_item[2];
$count = 0;
$data = [];
Expand All @@ -241,7 +241,8 @@ public function print_analysed($item, $itemnr = '', $groupid = false, $courseid
$chart->add_series($series);
$chart->set_labels($data['labels']);

echo $OUTPUT->render($chart);
echo '<tr><td>'. $OUTPUT->render($chart) . '</td></tr>';
echo "</table>";
}
}

Expand Down
9 changes: 4 additions & 5 deletions mod/feedback/item/multichoicerated/lib.php
Expand Up @@ -180,14 +180,13 @@ public function print_analysed($item, $itemnr = '', $groupid = false, $courseid
$analysed_item = $this->get_analysed($item, $groupid, $courseid);
if ($analysed_item) {
echo "<table class=\"analysis itemtype_{$item->typ}\">";
echo '<tr><th colspan="2" align="left">';
echo '<tr><th class="text-left">';
echo $itemnr . ' ';
if (strval($item->label) !== '') {
echo '('. format_string($item->label).') ';
}
echo format_string($analysed_item[1]);
echo '</th></tr>';
echo '</table>';
$analysed_vals = $analysed_item[2];
$avg = 0.0;
$count = 0;
Expand Down Expand Up @@ -215,12 +214,12 @@ public function print_analysed($item, $itemnr = '', $groupid = false, $courseid
$series->set_labels($data['series_labels']);
$chart->add_series($series);
$chart->set_labels($data['labels']);
echo $OUTPUT->render($chart);

echo '<tr><td>'. $OUTPUT->render($chart) . '</td></tr>';
$avg = format_float($avg, 2);
echo '<tr><td align="left" colspan="2"><b>';
echo '<tr><td class="text-left"><b>';
echo get_string('average', 'feedback').': '.$avg.'</b>';
echo '</td></tr>';
echo '</table>';
}
}

Expand Down
6 changes: 3 additions & 3 deletions mod/feedback/item/numeric/lib.php
Expand Up @@ -144,7 +144,7 @@ public function print_analysed($item, $itemnr = '', $groupid = false, $courseid

if (isset($values->data) AND is_array($values->data)) {
echo "<table class=\"analysis itemtype_{$item->typ}\">";
echo '<tr><th colspan="2" align="left">';
echo '<tr><th class="text-left">';
echo $itemnr . ' ';
if (strval($item->label) !== '') {
echo '('. format_string($item->label).') ';
Expand All @@ -153,7 +153,7 @@ public function print_analysed($item, $itemnr = '', $groupid = false, $courseid
echo '</th></tr>';

foreach ($values->data as $value) {
echo '<tr><td colspan="2" class="singlevalue">';
echo '<tr><td class="singlevalue">';
echo $this->format_float($value);
echo '</td></tr>';
}
Expand All @@ -163,7 +163,7 @@ public function print_analysed($item, $itemnr = '', $groupid = false, $courseid
} else {
$avg = '-';
}
echo '<tr><td colspan="2"><b>';
echo '<tr><td><b>';
echo get_string('average', 'feedback').': '.$avg;
echo '</b></td></tr>';
echo '</table>';
Expand Down
4 changes: 2 additions & 2 deletions mod/feedback/item/textarea/lib.php
Expand Up @@ -135,7 +135,7 @@ public function print_analysed($item, $itemnr = '', $groupid = false, $courseid
$values = feedback_get_group_values($item, $groupid, $courseid);
if ($values) {
echo "<table class=\"analysis itemtype_{$item->typ}\">";
echo '<tr><th colspan="2" align="left">';
echo '<tr><th class="text-left">';
echo $itemnr . ' ';
if (strval($item->label) !== '') {
echo '('. format_string($item->label).') ';
Expand All @@ -145,7 +145,7 @@ public function print_analysed($item, $itemnr = '', $groupid = false, $courseid
foreach ($values as $value) {
$class = strlen(trim($value->value)) ? '' : ' class="isempty"';
echo '<tr'.$class.'>';
echo '<td colspan="2" class="singlevalue">';
echo '<td class="singlevalue">';
echo str_replace("\n", '<br />', $value->value);
echo '</td>';
echo '</tr>';
Expand Down
4 changes: 2 additions & 2 deletions mod/feedback/item/textfield/lib.php
Expand Up @@ -131,7 +131,7 @@ public function print_analysed($item, $itemnr = '', $groupid = false, $courseid
$values = feedback_get_group_values($item, $groupid, $courseid);
if ($values) {
echo "<table class=\"analysis itemtype_{$item->typ}\">";
echo '<tr><th colspan="2" align="left">';
echo '<tr><th class="text-left">';
echo $itemnr . ' ';
if (strval($item->label) !== '') {
echo '('. format_string($item->label).') ';
Expand All @@ -140,7 +140,7 @@ public function print_analysed($item, $itemnr = '', $groupid = false, $courseid
echo '</th></tr>';
foreach ($values as $value) {
$class = strlen(trim($value->value)) ? '' : ' class="isempty"';
echo '<tr'.$class.'><td colspan="2" class="singlevalue">';
echo '<tr'.$class.'><td class="singlevalue">';
echo str_replace("\n", '<br />', $value->value);
echo '</td></tr>';
}
Expand Down
2 changes: 1 addition & 1 deletion mod/feedback/lib.php
Expand Up @@ -488,7 +488,7 @@ function feedback_print_recent_mod_activity($activity, $courseid, $detail, $modn

echo '<table border="0" cellpadding="3" cellspacing="0" class="forum-recent">';

echo "<tr><td class=\"userpicture\" valign=\"top\">";
echo "<tr><td class=\"userpicture align-top\">";
echo $OUTPUT->user_picture($activity->user, array('courseid'=>$courseid));
echo "</td><td>";

Expand Down
4 changes: 2 additions & 2 deletions mod/feedback/tests/behat/behat_mod_feedback.php
Expand Up @@ -153,8 +153,8 @@ function($context, $args) use ($behatgeneralcontext) {
*/
public function i_show_chart_data_for_the_feedback($feedbackname) {

$feedbackxpath = "//th[contains(normalize-space(string(.)), \"" . $feedbackname . "\")]/ancestor::table/" .
"following-sibling::div[contains(concat(' ', normalize-space(@class), ' '), ' chart-area ')][1]" .
$feedbackxpath = "//th[contains(normalize-space(string(.)), \"" . $feedbackname . "\")]/ancestor::table//" .
"div[contains(concat(' ', normalize-space(@class), ' '), ' chart-table ')]" .
"//p[contains(concat(' ', normalize-space(@class), ' '), ' chart-table-expand ') and ".
"//a[contains(normalize-space(string(.)), '".get_string('showchartdata')."')]]";

Expand Down

0 comments on commit b7d7906

Please sign in to comment.