Moodle Questionnaire Response Notification

Moodle Questionnaire Response Notification

by Aaron Thomas -
Number of replies: 2

Hi all,

In Questionnaire, it is possible to send the response to a specific email address.   The problem that I'm having is that I don't want to actually get the specific response but rather just a notification that someone has completed the Questionnaire.  I really just need the first two lines of the response notification.   

I am assuming I would need to change the source code to comment out the sections I do not need.  How or rather where would I go to do this?  


Thanks so much for any help. 


https://XXX.UUU>EDU/mod/questionnaire/report.php?action=vresp&sid=27&rid=297&instance=27

Response from questionnaire "Module  1 Sample Survey" 

Response : 297 

Submitted on: 17/09/2014 13:57:31 

Institution : 

Department : 

User Course : Sample Course

Group : 

Email address : <span class="s3">c007@uffffl.edu</span> 

ID : 164 

Full name : John Smith

Username : jsmith

Q01_Well Being : Moderately distressed 

Q02 : Mildly satisfied 

Q03 : Not at all energetic and motivated 

Q04 : Almost Always 

Q05 : Sometimes 

Q06 : Sometimes 

Q07 : Almost Always 

Average of ratings: -
In reply to Aaron Thomas

Re: Moodle Questionnaire Response Notification

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi Aaron,

In yourmoodle/mod/questionnaire/questionnaire.class.php, locate function response_send_email($rid, $userid=false). That's from line 1602 in Questionnaire version 2.7. Comment out these lines:

for ($i = 0; $i < count($answers[0]); $i++) {
            $sep = ' : ';

            switch($i) {
                case 1:
                    $sep = ' ';
                    break;
                case 4:
                    $bodyhtml        .= get_string('user').' ';
                    $bodyplaintext   .= get_string('user').' ';
                    break;
                case 6:
                    if ($this->respondenttype != 'anonymous') {
                        $bodyhtml         .= get_string('email').$sep.$USER->email. $endhtml;
                        $bodyplaintext    .= get_string('email').$sep.$USER->email. $endplaintext;
                    }
            }
            $bodyhtml         .= $answers[0][$i].$sep.$answers[1][$i]. $endhtml;
            $bodyplaintext    .= $answers[0][$i].$sep.$answers[1][$i]. $endplaintext;
        }

Joseph

In reply to Joseph Rézeau

Re: Moodle Questionnaire Response Notification

by Aaron Thomas -

Thank you so much!  This has really helped our project move forward.