Skip to content

Commit

Permalink
MDL-23867 - removing some extra whitespaces.
Browse files Browse the repository at this point in the history
  • Loading branch information
rwijaya committed Aug 20, 2010
1 parent 40b87a5 commit f7e9300
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
12 changes: 6 additions & 6 deletions mod/choice/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -739,7 +739,7 @@ function choice_get_response_data($choice, $cm, $groupmode) {
unset($allresponses[0][$response->userid]); // Remove from unanswered column
}
}
}
}
return $allresponses;
}

Expand Down
19 changes: 9 additions & 10 deletions mod/choice/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -128,7 +128,7 @@
if (isguestuser()) {
// Guest account
echo $OUTPUT->confirm(get_string('noguestchoose', 'choice').'<br /><br />'.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;
Expand All @@ -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'));
}

Expand Down

0 comments on commit f7e9300

Please sign in to comment.