Jump to ContentJump to Navigation/Login
` ` ` ` ` `

[Register]

Occasional ATutor release updates


No Members Logged In

(9 guests in past 15 min.)

Access Understanding Web Accessibility to learn about accessibility, or Register to take the course for FREE.

Support Forums

ATutor Modules

Poll/questionnaire module?


You must be signed-in to post.

AuthorSubject
  Page: 1
rury
Subject: Poll/questionnaire module?Quote this post in your reply
Hello

I would like to collect data from our online trainees with a poll or questionnaire.

It will be placed into each course and will need to record the data.

What is the best way to do this? I looked around and couldn't find a module for it, I'm positive I saw one before!

Any help would be greatly appreciated.

All the best,
Rury
Posted: 2009-02-17 04:56:15
greg

Avatar for greg
Subject: Re: Poll/questionnaire module?Quote this post in your reply
You might try adapting either the current polls module or test module, both included with the core of ATutor.

You need to turn on these modules through Manage>Course Tools
Posted: 2009-02-19 08:51:27
miriamxx
Subject: Re: Poll/questionnaire module?Quote this post in your reply
I've created a module with different pages: it seems working but doesn't insert data in tables. Why?
No errors message appears.
All the best.
Miriam
Posted: 2009-02-21 07:01:58
greg

Avatar for greg
Subject: Re: Poll/questionnaire module?Quote this post in your reply
Have you use the TABLE_PREFIX variable in you SQL statements, or perhaps your tables are not prefixed?

See the Developer Documentation for details, or look at how SQL queries are written in other places in ATutor.
Posted: 2009-02-21 09:04:09
miriamxx
Subject: Re: Poll/questionnaire module?Quote this post in your reply
I've used the TABLE_PREFIX in my query:
"INSERT INTO ".TABLE_PREFIX."name table ......".
My tables are prefixed but I've created them manually because module.sql doesn't create them. The problem is connected with manually creation?
Thanks
bye
Posted: 2009-02-21 11:56:29
greg

Avatar for greg
Subject: Re: Poll/questionnaire module?Quote this post in your reply
If your SQL is valid, module.sql will create tables and insert data. Test run your SQL before adding it to module.sql.

We can't really help with writing SQL statements for your module. Refer a SQL reference, or use something like phpMyAdmin to generate the SQL.
Posted: 2009-02-21 13:07:45
miriamxx
Subject: Re: Poll/questionnaire module?Quote this post in your reply
I've corrected my code and it's ok. WOW!!!
Thank you!!
Another question if I can: why all my SELECT don't work?
My SQL valid because I've tested it in phpmyadmin.
I've created a forum 'My discussion on math' and then I've obtained the id:

$selectforum="SELECT forum_id FROM at_forums WHERE title='My discussion on math'";
$forum=mysql_query($selectforum,$conn);

if (mysql_query($forum,$conn))

echo "ok";
else
echo "Error";
Posted: 2009-02-22 15:17:44
greg

Avatar for greg
Subject: Re: Poll/questionnaire module?Quote this post in your reply
I'd guess you need to replace at_forums with

".TABLE_PREFIX."forum
Posted: 2009-02-23 09:07:30
miriamxx
Subject: Re: Poll/questionnaire module?Quote this post in your reply
My error deals with only SELECT, not INSERT that works without ".TABLE_PREFIX.". The error is:

Resource id #3Error during installation

Can you help please? If I solve this, I complete my thesis, thanks to your help and this powerful tool for e-learning

All the best
Bye
Posted: 2009-02-24 12:40:19
miriamxx
Subject: Re: Poll/questionnaire module?Quote this post in your reply
There is Resource id#3 because I've tried to show the result with echo. If I eliminate echo I've obtaneid Error because the query SELECT don't work. I don't know how solve this problem with SELECT.... frown
Posted: 2009-02-24 13:00:51
greg

Avatar for greg
Subject: Re: Poll/questionnaire module?Quote this post in your reply
All your queries should use TABLE_PREFIX.

I'm not quite sure what you are trying to do. Have a look at the debug() function described in the developer documentation. Turn it on in include/vitals.inc.php, then insert variables into the function to have their values displayed.

If you need help writing SQL, refer to the MySQL manual.
Posted: 2009-02-24 13:25:36
miriamxx
Subject: Re: Poll/questionnaire module?Quote this post in your reply
I have to explain better: after the SELECT I have to insert the result in another table. I have:

$selectforum="SELECT forum_id FROM at_forums WHERE title='My discussion on math'";
$forum =mysql_query($selectforum ,$conn);

Then I write:
$insertread="INSERT INTO at_forums_threads(post_id,parent_id,member_id,forum_id,last_comment,num_comments,subject,body,date,locked,sticky) VALUES('','0','1','$forum' ,'','0','Result','hello boys','$now','0','0')";

The second query don't insert ,'$forum' .
Help me please
Posted: 2009-02-24 13:40:14
greg

Avatar for greg
Subject: Re: Poll/questionnaire module?Quote this post in your reply
You will need to use something like mysql_fetch_array() or maybe mysql_fetch_row() to get the values out of $forum.

See the PHP manual for details
ca2.php.net/manual/en/function.mysql-fetch-array.php

The assumption we make here is you already know PHP/SQL when you take on a development project. We can help you with ATutor related issues, but for PHP or MySQL related programming issues, you need to refer the their respective manuals. We can't help you learn PHP in other words.
Posted: 2009-02-24 15:22:52
 Page: 1

You must be signed-in to post.