Skip to content

Commit

Permalink
MDL-37800 mod_feedback - item "information" does not appear correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
grabs committed Feb 1, 2013
1 parent 5e3412d commit c962e3f
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions mod/feedback/item/info/lib.php
Expand Up @@ -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:
Expand Down Expand Up @@ -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));
Expand All @@ -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);
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit c962e3f

Please sign in to comment.