We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 27656
    • 5 Posts
    Hi, everybody!

    I’m MODx n00b and I have to make psychological test on my site.

    Visitors of the site must be able to take a test (YES/NO type of questions) and then get their score and appropriate summary.

    I’m trying to use eForm and its &thankyou parameter, but I don’t know how I can send form values to some script in order to get scores counted and other server-side processing, e.g. I need to show a user which questions they answered correctly and which wrongly. And it would be great to show brief key/explanation to every questions.

    What’s the best way to do it without too much hacks?
    Maybe there are existing extras I could use? Please help if you can.
    Sorry if I’ve written something stupid smiley I’m just a beginner here so don’t judge too severely.

    Thank you,
    Silkworm
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Use eForm’s events to take care of the processing with a custom snippet with the functions you need. The functions will have eForm’s $fields array available. These are the values that are made into placeholders, and originally come from the form fields, including any hidden input fields. You can do any processing you need using these values, then add anything you want to the array, then use the placeholders (which will now include your added values) in your final report.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 27656
        • 5 Posts
        Thank you very much, Susan.
        Btw, your tutorials are great laugh, although I’ve only read several.
        The comunity is the best of all I’ve ever seen! And MODx’s philosophy is so unique compared to other systems. I really like it. Only one thing confuses me, that TVs are coupled with templates. Does it mean that I can’t abstract my data from presentation. Or, maybe, I’m missing the point here.
        Thank you one more time. Now I’m back to some RTFMming smiley
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Template variables are just variables associated with the assigned template(s) that can be modified for each resource using that template.
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 27656
            • 5 Posts
            Yes, this moment is clear.
            I meant that values of TVs are stored in connection with templates (well, they are called template variables smiley) . So, if site’s user/manager need, for example, testimonials from site’s visitors to be displayed (manager chooses the good ones, of course, and put them on the site). So I’ll need to create resource for each testimonial and assign dedicated template for this type of resources to use needed TVs although I will not use this template as a template smiley, because I will embed testimonial somewhere on site’s homepage using snippet.
            I mean, it would be handy to edit all testimonials in one place (one resource) and don’t use template where it shouldn’t be used. So, here some kind of CRUD features would be great.
            Again, it’s my current nooby understanding of how MODx works, and maybe I’m wrong.
            Sorry, I’m bugging you with all this questions huh
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              I would use Jot for this. While Jot was originally intended to be for comments to articles or what-have-you, it works very well for any kind of simple list of items like FAQ question/answer pairs, or testimonials (which if you think about it are just a specific set of comments). It has templating, forms, user control and moderation already built-in.
                Studying MODX in the desert - http://sottwell.com
                Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                Join the Slack Community - http://modx.org
                • 27656
                • 5 Posts
                Thanks, Susan. I’ll definitely try it.

                I solved my problem using your advice.
                So, for beginners like me, who will read this topic, use &eformOnBeforeMailSent and hidden fields (if you need to output additional info in your report/thankyou page) and everything will be all right smiley Actually, it’s covered in documentetion, but I didn’t notice it right away.

                Should I change topic’s status to "solved"?
                  • 15001
                  • 697 Posts
                  Maybe have a look at this http://hotpot.uvic.ca/
                  It appeared me very promising.

                  I cannot remember the technology behind. I think, Java was used in batch mode to generate HTML polls. Had unfortunately not enough time to test, so your feedback is much welcome!
                    • 10449
                    • 956 Posts