Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge branch 'MDL-37800_24' of git://github.com/grabs/moodle into MOO…

…DLE_24_STABLE
  • Loading branch information...
commit 44a29a501a1bc4f30147065ee27fba351513e1f1 2 parents 7298cf7 + baea79c
Dan Poltawski danpoltawski authored

Showing 1 changed file with 15 additions and 5 deletions. Show diff stats Hide diff stats

  1. +15 5 mod/feedback/item/info/lib.php
20 mod/feedback/item/info/lib.php
@@ -112,8 +112,8 @@ public function get_analysed($item, $groupid = false, $courseid = false) {
112 112 $values = feedback_get_group_values($item, $groupid, $courseid);
113 113 if ($values) {
114 114 $data = array();
115   - $datavalue = new stdClass();
116 115 foreach ($values as $value) {
  116 + $datavalue = new stdClass();
117 117
118 118 switch($presentation) {
119 119 case 1:
@@ -279,7 +279,12 @@ public function print_item_complete($item, $value = '', $highlightrequire = fals
279 279 $requiredmark = ($item->required == 1)?'<span class="feedback_required_mark">*</span>':'';
280 280
281 281 $feedback = $DB->get_record('feedback', array('id'=>$item->feedback));
282   - $course = $DB->get_record('course', array('id'=>$feedback->course));
  282 +
  283 + if ($courseid = optional_param('courseid', 0, PARAM_INT)) {
  284 + $course = $DB->get_record('course', array('id'=>$courseid));
  285 + } else {
  286 + $course = $DB->get_record('course', array('id'=>$feedback->course));
  287 + }
283 288
284 289 if ($course->id !== SITEID) {
285 290 $coursecategory = $DB->get_record('course_categories', array('id'=>$course->category));
@@ -289,8 +294,13 @@ public function print_item_complete($item, $value = '', $highlightrequire = fals
289 294
290 295 switch($presentation) {
291 296 case 1:
292   - $itemvalue = time();
293   - $itemshowvalue = userdate($itemvalue);
  297 + if ($feedback->anonymous == FEEDBACK_ANONYMOUS_YES) {
  298 + $itemvalue = 0;
  299 + $itemshowvalue = '-';
  300 + } else {
  301 + $itemvalue = time();
  302 + $itemshowvalue = userdate($itemvalue);
  303 + }
294 304 break;
295 305 case 2:
296 306 $coursecontext = context_course::instance($course->id);
@@ -390,7 +400,7 @@ public function can_switch_require() {
390 400 }
391 401
392 402 public function value_type() {
393   - return PARAM_INT;
  403 + return PARAM_TEXT;
394 404 }
395 405
396 406 public function clean_input_value($value) {

0 comments on commit 44a29a5

Please sign in to comment.
Something went wrong with that request. Please try again.