From f7e9300061ae627489535d407f5e34c6993a7b7b Mon Sep 17 00:00:00 2001 From: Rossiani Wijaya Date: Fri, 20 Aug 2010 02:40:13 +0000 Subject: [PATCH] MDL-23867 - removing some extra whitespaces. --- mod/choice/lib.php | 12 ++++++------ mod/choice/view.php | 19 +++++++++---------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/mod/choice/lib.php b/mod/choice/lib.php index 0b5128e32f868..55c044233df44 100644 --- a/mod/choice/lib.php +++ b/mod/choice/lib.php @@ -339,8 +339,8 @@ function prepare_choice_show_results($choice, $course, $cm, $allresponses, $forc $display = clone($choice); $display->coursemoduleid = $cm->id; - $display->courseid = $course->id; - + $display->courseid = $course->id; + //overwrite options value; $display->options = array(); $totaluser = 0; @@ -362,7 +362,7 @@ function prepare_choice_show_results($choice, $course, $cm, $allresponses, $forc $display->viewresponsecapability = has_capability('mod/choice:readresponses', $context); $display->deleterepsonsecapability = has_capability('mod/choice:deleteresponses',$context); $display->fullnamecapability = has_capability('moodle/site:viewfullnames', $context); - + if (empty($allresponses)) { echo $OUTPUT->heading(get_string("nousersyet")); return false; @@ -681,8 +681,8 @@ function choice_reset_userdata($data) { if (!empty($data->reset_choice)) { $choicessql = "SELECT ch.id - FROM {choice} ch - WHERE ch.course=?"; + FROM {choice} ch + WHERE ch.course=?"; $DB->delete_records_select('choice_answers', "choiceid IN ($choicessql)", array($data->courseid)); $status[] = array('component'=>$componentstr, 'item'=>get_string('removeresponses', 'choice'), 'error'=>false); @@ -739,7 +739,7 @@ function choice_get_response_data($choice, $cm, $groupmode) { unset($allresponses[0][$response->userid]); // Remove from unanswered column } } - } + } return $allresponses; } diff --git a/mod/choice/view.php b/mod/choice/view.php index 017f3677315ea..405f307e68597 100644 --- a/mod/choice/view.php +++ b/mod/choice/view.php @@ -115,7 +115,7 @@ // They haven't made their choice yet or updates allowed and choice is open $options = choice_prepare_options($choice, $USER, $cm, $allresponses); - $renderer = $PAGE->get_renderer('mod_choice'); + $renderer = $PAGE->get_renderer('mod_choice'); echo $renderer->display_options($options, $cm->id, $choice->display); $choiceformshown = true; } else { @@ -128,7 +128,7 @@ if (isguestuser()) { // Guest account echo $OUTPUT->confirm(get_string('noguestchoose', 'choice').'

'.get_string('liketologin'), - get_login_url(), new moodle_url('/course/view.php', array('id'=>$course->id))); + get_login_url(), new moodle_url('/course/view.php', array('id'=>$course->id))); } else if (!is_enrolled($context)) { // Only people enrolled can make a choice $SESSION->wantsurl = $FULLME; @@ -139,26 +139,25 @@ echo $OUTPUT->container_start('continuebutton'); echo $OUTPUT->single_button(new moodle_url('/enrol/index.php?', array('id'=>$course->id)), get_string('enrolme', 'core_enrol', format_string($course->shortname))); echo $OUTPUT->container_end(); - echo $OUTPUT->box_end(); + echo $OUTPUT->box_end(); } } // print the results at the bottom of the screen if ( $choice->showresults == CHOICE_SHOWRESULTS_ALWAYS or - ($choice->showresults == CHOICE_SHOWRESULTS_AFTER_ANSWER and $current ) or - ($choice->showresults == CHOICE_SHOWRESULTS_AFTER_CLOSE and !$choiceopen )) { + ($choice->showresults == CHOICE_SHOWRESULTS_AFTER_ANSWER and $current) or + ($choice->showresults == CHOICE_SHOWRESULTS_AFTER_CLOSE and !$choiceopen)) { if (!empty($choice->showunanswered)) { $choice->option[0] = get_string('notanswered', 'choice'); $choice->maxanswers[0] = 0; } - - $results = prepare_choice_show_results($choice, $course, $cm, $allresponses); - $renderer = $PAGE->get_renderer('mod_choice'); - + $results = prepare_choice_show_results($choice, $course, $cm, $allresponses); + $renderer = $PAGE->get_renderer('mod_choice'); echo $renderer->display_result($results); - } else if (!$choiceformshown) { + + } else if (!$choiceformshown) { echo $OUTPUT->box(get_string('noresultsviewable', 'choice')); }