Quiz module question

richard.c.allen2386 - October 9, 2009 - 15:35

Hi, I have a hopefully easy question. I'm familair with php but am new to drupal but I think this will be an easy one.
We are planning to use the quiz module, http://drupal.org/project/modules?text=quiz on our website and have a contest with it. We need to tie the quiz scores into another system (we are a non-profit and we have to tie our activities in with Democracy in Action, they're web tools designed for non-profits that we use extensively). I was looking at the quiz.module file and found these lines of code:

function quiz_quiz_finished($quiz, $score, $rid) {
global $user;
// function to export results to grade book will be added later
// function to export result in pdf, XML, CVS format
// function to display results visually

//function to send results over email
if ($user->uid && variable_get('quiz_email_results', 1) && variable_get('quiz_use_passfail', 1)) { // email can be sent only for registered users
drupal_mail('quiz', 'notice', $user->mail, NULL, array($quiz, $score, $rid));
drupal_set_message(t('Results has been sent to your e-mail ID.'));
}

My question is, if I get rid of all this code and simply put in something like this

$URL="http://www.example.com/$aDIAPageToReadScore=$ScoreOfQuiz";

header ("Location: $URL");

Will this break the module? I am fairly confident it won't but I am not familiar enough with the module or drupal yet to know for sure. Also if I'm approaching this the wrong way let me know, I'm always open to doing things easier and the right way ;)

Thanks in advance for any help or suggestions.

I realized the last post was

richard.c.allen2386 - October 9, 2009 - 15:38

I realized the last post was not descriptive enough. Here is what the code would look like:

function quiz_quiz_finished($quiz, $score, $rid) {
global $user;
// function to export results to grade book will be added later
// function to export result in pdf, XML, CVS format
// function to display results visually

//function to send results over email
if ($user->uid && variable_get('quiz_email_results', 1) && variable_get('quiz_use_passfail', 1)) { // email can be sent only for registered users

$URL="http://www.example.com/$aDIAPageToReadScore=$score";

header ("Location: $URL");
}

Some suggestions

stGeorge - November 10, 2009 - 23:04

Hi Richard

Have a look here http://drupal.org/node/199572 for some documentation about the dev of the module.

Also you will probably get more responses if you place this question in the quiz issue que http://drupal.org/project/issues/quiz?status=All&categories=All. Each module has an issue que (found on the module's project page) which is monitored regularly by the module's maintainers.

I hope this helps

George

 
 

Drupal is a registered trademark of Dries Buytaert.