Skip to content

Commit

Permalink
CONTRIB-6841 - Make workshop feedback comment headings accessible
Browse files Browse the repository at this point in the history
  • Loading branch information
segunbabalolasprynt committed Jul 18, 2019
1 parent 2a024ab commit 6d523e4
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
16 changes: 11 additions & 5 deletions lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ public function has_workshop_feedback($userid, $subid, $assignid, $cid, $itemnum
}
if ($pfeed) {
$feedback .= strip_tags($feedback) ? '<br/>' : '';
$feedback .= '<b>' . get_string('peerfeedback', 'report_myfeedback') . '</b>';
$feedback .= '<strong>' . get_string('peerfeedback', 'report_myfeedback') . '</strong>';
}
foreach ($asse as $as) {
if ($as->feedbackauthor && $as->reviewerid != $userid) {
Expand All @@ -368,7 +368,7 @@ public function has_workshop_feedback($userid, $subid, $assignid, $cid, $itemnum
}
if ($self) {
$feedback .= strip_tags($feedback) ? '<br/>' : '';
$feedback .= '<b>' . get_string('selfassessment', 'report_myfeedback') . '</b>';
$feedback .= '<strong>' . get_string('selfassessment', 'report_myfeedback') . '</strong>';
}
foreach ($asse as $as1) {
if ($as1->feedbackauthor && $as1->reviewerid == $userid) {
Expand Down Expand Up @@ -396,11 +396,11 @@ public function has_workshop_feedback($userid, $subid, $assignid, $cid, $itemnum
}
if ($c) {
$feedback .= strip_tags($feedback) ? '<br/>' : '';
$feedback .= "<br/><b>" . get_string('comments', 'report_myfeedback') . "</b>";
$feedback .= "<br/><strong>" . get_string('comments', 'report_myfeedback') . "</strong>";
}
foreach ($commentscheck as $ts) {
$feedback .= strip_tags($ts->description) ? "<br/><b>" . $ts->description : '';
$feedback .= strip_tags($ts->description) ? "<br/><b>" . get_string('comment', 'report_myfeedback') . "</b>: " . strip_tags($ts->peercomment) . "<br/>" : '';
$feedback .= strip_tags($ts->description) ? "<br/><strong>" . get_string('comment', 'report_myfeedback') . "</strong>: " . strip_tags($ts->peercomment) . "<br/>" : '';
}
}

Expand Down Expand Up @@ -2297,7 +2297,13 @@ public function get_unique_category_users($catid, $capability = 'report/myfeedba
//add all the roleid code into the where query
$params[] = $roleids[0];
$i = 1; //start at 1, because the first role is already in the query
while($roleids[$i] != null){

// Segun Babalola, 2019-07-18.
// The following line of code is causing warnings in the UI because $i exceeds array size.
// This is unrelated to the issue I'm trying to fix (i.e. https://tracker.moodle.org/browse/CONTRIB-6841),
// however I will guard execution with an existence check for now. Hopefully the root cause of
// the issue will be addressed in future.
while(isset($roleids[$i]) && $roleids[$i] != null){
$sql .= ' OR roleid = ?';
$params[] = $roleids[$i];
$i++;
Expand Down
13 changes: 11 additions & 2 deletions programmeadmin/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,17 @@
if (!isset($pguserspermod[$key1][$pf1][$key3])) {
$pguserspermod[$key1][$pf1][$key3] = 0;
}
$pgusers[$pf1][$key3] += $val3;
$pguserspermod[$key1][$pf1][$key3] += $val3;

// Segun Babalola, 2019-07-18.
// The following two lines of code are causes warnings in the UI because
// the value of $val3 is sometimes non-numeric. This is unrelated to the issue I'm
// trying to fix (i.e. https://tracker.moodle.org/browse/CONTRIB-6841), however I will
// guard execution of these statements with a check for now. Hopefully the root cause of
// the issue will be addressed in future.
if (is_numeric($val3)) {
$pgusers[$pf1][$key3] += $val3;
$pguserspermod[$key1][$pf1][$key3] += $val3;
}
}
}
}
Expand Down

0 comments on commit 6d523e4

Please sign in to comment.