Permalink
Browse files

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

…DLE_23_STABLE
  • Loading branch information...
2 parents 9aa9fbd + c962e3f commit e04ddf75cb347a383ea9cc20691e203c1a17c56e @danpoltawski danpoltawski committed Feb 5, 2013
Showing with 15 additions and 5 deletions.
  1. +15 −5 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 = get_context_instance(CONTEXT_COURSE, $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 e04ddf7

Please sign in to comment.