• Hi

    Admin email send only [score] result.
    I want to add information about SCORE / QUESTIONS QUANITY like this:

    ——————————————————————————–
    $msg .= ‘<p><b>Score:</b> ‘.$result->score. / QUESTIONS QUANITY</p>’;
    ——————————————————————————–

    How to make it ?

    regards
    Tom

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Braden Keith

    (@richard_steeleagency)

    Hi Tom,

    The quantity of questions can be obtained using count($result->field_results) for the mailer templates. In a future release, we will look at adding the ability to do this in the UI.

    Thread Starter studiohsb

    (@studiohsb)

    Hi Braden

    Like this ?

    $msg = ”;
    $msg .= ‘<p><Qiuz title: </b>’.$result->quiz->title.'</p>’;
    $msg .= ‘<p>Score:</b> ‘.$result->score.'</p>’;
    $msg .= ‘<p>Question quanity:</b> ‘.count($result->field_results).'</p>’;

    mailer generate only number 1 ??

    Thread Starter studiohsb

    (@studiohsb)

    Hi

    Braden, can you help me with this problem ?
    thx

    regards
    Tom

    Plugin Author Braden Keith

    (@richard_steeleagency)

    Hi Tom,

    Here’s the line of code I added and was able to return how many questions were recorded:

    $msg .= '<p>User Score: '.$result->score.' out of '. count($result->field_results) .' questions</p>';

    • This reply was modified 8 years, 1 month ago by Braden Keith.
    Thread Starter studiohsb

    (@studiohsb)

    Hi Braden

    I create simple 3 question test (1+1=, 2+2= ,3+3=)
    Add your code to view.admin_email_content.php
    and answer (2,4,6)

    This is answer from email: User Score: 3 out of 1 questions
    Still quanity is 1 question ??

    Should I add something inside questions ?
    what am I doing wrong?

    regards
    Tom

    Thread Starter studiohsb

    (@studiohsb)

    .. it should be: User Score: 3 out of 3 questions right ?

    regards
    Tom

    Thread Starter studiohsb

    (@studiohsb)

    Hi

    Are you there Braden ? ??

    regards
    Tom

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Display number of questions in email’ is closed to new replies.