Quote from: kujdik at Mar 28, 2008, 11:14 AMHi kujdik
Hello,
this looks good. But I have question about possibilities of this module..
I need multiple poll module - i think, more than one question in one set and log votes from webusers.
Is it possible with this module? Or is it in plan to the future???
(I have not found an other module)
Thank you...
I’m not sure if i really understand what you’re trying to achieve.
With EasyPoll you can:
- Create multiple polls...
- ... and add multiple choices/answers to these polls
- Translate your polls into multiple languages
What do you mean by "log votes from webusers"?
Currently you can log the Users IP and/or store a cookie on his computer to prevent him from voting multiple times. However: You cannot track which user voted for which option. To do this, you’ll have to extend the software in a way, that it’s more of a quiz/test instead of a poll. Currently i have no plans to do so, but it’s certainly doable. The hardest part would probably be to actually create groups of questions and then create a summary of people who: successfully passed the test, failed the test and people who didn’t complete the test (maybe even separated into "started" and "not started").
If you plan to extend the software in such a way, i’d be interested in what you came up with.

) since yours looks really good...
/**
* ------------------------------------------------------------------------------
* Easy Poll Module for MODx
* ------------------------------------------------------------------------------
* Easy Poll Voting, inspired by the Poll Module developed by garryn
*
* This Module allows creation of multiple Polls, localized for different languages.
* Polls can be set active/inactive and timed with a start and end date.
*
* ------------------------------------------------------------------------------
* Read the bundled documentation.html for usage instructions.
* ------------------------------------------------------------------------------
*
* The EasyPoll Module is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* EasyPoll is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with EasyPoll (located in "/snippets/EasyPoll/"); if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
* or visit: http://www.gnu.org/licenses/gpl-2.0.html
*
* Dependencies:
* MODx 0.9.5, 0.9.6 (this is the version this module was developped for. might work
* with other versions as well. not tested)
* PHP Version 5 or higher
* MySQL Version 4.1 or higher (utf-8, InnoDB, Trasactions)
*
* @author banal
* @version 0.3 <2008-02-08>
*/
if(!isset($modx)) die();
$basePath = $modx->config['base_path'];
$easyPollPath = $basePath . 'assets/modules/EasyPoll/';
// ------------------------------------------------------------------------------
// get the user language settings
// ------------------------------------------------------------------------------
$manager_language = $modx->config['manager_language'];
$sql = 'SELECT setting_name, setting_value FROM ' . $modx->getFullTableName('user_settings') .
' WHERE setting_name=\'manager_language\' AND user=' . $modx->getLoginUserID();
$rs = $modx->db->query($sql);
if ($modx->db->getRecordCount($rs) > 0) {
$row = $modx->db->getRow($rs);
$manager_language = $row['setting_value'];
}
// load localization file.
$_lang = array();
include_once($easyPollPath . 'lang/english.inc.php');
if($manager_language != 'english') {
$langfile = $easyPollPath . 'lang/' . $manager_language . '.inc.php';
if(file_exists($langfile)) {
include_once $langfile;
}
}
// ------------------------------------------------------------------------------
// Create EasyPollController
// ------------------------------------------------------------------------------
$classfile = $easyPollPath . 'include/EasyPollController.class.php';
if(!file_exists($classfile))
$modx->messageQuit(sprintf($_lang['EP_noclassfile'], $classfile));
require_once($classfile);
$controller = new EasyPollController($_lang, $easyPollPath);
try {
$controller->run();
} catch (Exception $ex){
$modx->messageQuit($ex->getMessage());
}
return;
Hi Ryan
Hi banal,
Nice job on the execution of this add on. Kudos! I wonder if it would be a good idea to fall back to the key for the Poll name and each option to make putting up single-language polls more straightforward. That way you wouldn’t have to copy/paste the "internal title" for each choice.

