Exemplo n.º 1
0
     if (!$rid) {
         $rid = $rids[0];
     }
     if ($rid) {
         $numresp = $questionnaire->count_submissions($USER->id);
         $titletext = get_string('myresponsetitle', 'questionnaire', $numresp);
     }
     // Print the page header.
     echo $OUTPUT->header();
     // Print the tabs.
     include 'tabs.php';
     echo $OUTPUT->box_start();
     echo $OUTPUT->heading($titletext);
     if (count($resps) > 1) {
         echo '<div style="text-align:center; padding-bottom:5px;">';
         $questionnaire->survey_results_navbar_student($rid, $userid, $instance, $resps);
         echo '</div>';
     }
     $questionnaire->view_response($rid);
     if (count($resps) > 1) {
         echo '<div style="text-align:center; padding-bottom:5px;">';
         $questionnaire->survey_results_navbar_student($rid, $userid, $instance, $resps);
         echo '</div>';
     }
     echo $OUTPUT->box_end();
     // Finish the page.
     echo $OUTPUT->footer($course);
     break;
 case get_string('return', 'questionnaire'):
 default:
     redirect('view.php?id=' . $cm->id);
         //<![CDATA[
         document.write("<link rel=\\"stylesheet\\" type=\\"text/css\\" href=\\"' . $href . '\\">")
         //]]>
         </script>';
 }
 /// Print the main part of the page
 echo '<br/><br/>';
 echo '<div style="text-align:center; padding-bottom:5px;">';
 if ($groupid === 0) {
     $groupname = '<strong>' . get_string('groupmembersonlyerror', 'group') . '</strong>';
     echo get_string('viewbyresponse', 'questionnaire') . '. ' . $groupname . '. ';
 } elseif ($noresponses) {
     echo get_string('group') . ' <strong>' . groups_get_group_name($groupid) . '</strong>: ' . get_string('noresponses', 'questionnaire');
 } else {
     if ($groupid != -1) {
         $questionnaire->survey_results_navbar_student($rid, $resp->username, $instance, $resps, 'report', $sid);
     } else {
         $questionnaire->survey_results_navbar($rid);
     }
     echo '</div>';
     echo '<div class = "active">';
     $ret = $questionnaire->view_response($rid);
     echo '</div>';
     echo '<div style="text-align:center; padding-bottom:5px;">';
     if ($groupid != -1) {
         $questionnaire->survey_results_navbar_student($rid, $userid, $instance, $resps, 'report', $sid);
     } else {
         $questionnaire->survey_results_navbar($rid);
     }
 }
 echo '</div>';