Skip to content
Browse files

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

…DLE_24_STABLE
  • Loading branch information...
2 parents 7298cf7 + baea79c commit 44a29a501a1bc4f30147065ee27fba351513e1f1 @danpoltawski danpoltawski committed Feb 5, 2013
Showing with 15 additions and 5 deletions.
  1. +15 −5 mod/feedback/item/info/lib.php
View
20 mod/feedback/item/info/lib.php
@@ -112,8 +112,8 @@ public function get_analysed($item, $groupid = false, $courseid = false) {
$values = feedback_get_group_values($item, $groupid, $courseid);
if ($values) {
$data = array();
- $datavalue = new stdClass();
foreach ($values as $value) {
+ $datavalue = new stdClass();
switch($presentation) {
case 1:
@@ -279,7 +279,12 @@ public function print_item_complete($item, $value = '', $highlightrequire = fals
$requiredmark = ($item->required == 1)?'<span class="feedback_required_mark">*</span>':'';
$feedback = $DB->get_record('feedback', array('id'=>$item->feedback));
- $course = $DB->get_record('course', array('id'=>$feedback->course));
+
+ if ($courseid = optional_param('courseid', 0, PARAM_INT)) {
+ $course = $DB->get_record('course', array('id'=>$courseid));
+ } else {
+ $course = $DB->get_record('course', array('id'=>$feedback->course));
+ }
if ($course->id !== SITEID) {
$coursecategory = $DB->get_record('course_categories', array('id'=>$course->category));
@@ -289,8 +294,13 @@ public function print_item_complete($item, $value = '', $highlightrequire = fals
switch($presentation) {
case 1:
- $itemvalue = time();
- $itemshowvalue = userdate($itemvalue);
+ if ($feedback->anonymous == FEEDBACK_ANONYMOUS_YES) {
+ $itemvalue = 0;
+ $itemshowvalue = '-';
+ } else {
+ $itemvalue = time();
+ $itemshowvalue = userdate($itemvalue);
+ }
break;
case 2:
$coursecontext = context_course::instance($course->id);
@@ -390,7 +400,7 @@ public function can_switch_require() {
}
public function value_type() {
- return PARAM_INT;
+ return PARAM_TEXT;
}
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.