Is it possible to alter the poll module to allow an authenticated user to vote an unlimited amount of times on a poll??? I know this is a rare request, but in my situation multiple students share one account and would like to each get a chance to vote.

I tried altering this section, but I guess it's more complicated than that because I got an error

  // Determine whether or not this user is allowed to vote.
  $poll->allowvotes = FALSE;
  if (user_access('vote on polls') && $poll->active) {
    if ($user->uid) {
      $result = db_fetch_object(db_query('SELECT chorder FROM {poll_votes} WHERE nid = %d AND uid = %d', $node->nid, $user->uid));
    }
    else {
      $result = db_fetch_object(db_query("SELECT chorder FROM {poll_votes} WHERE nid = %d AND hostname = '%s'", $node->nid, ip_address()));
    }
    if (isset($result->chorder)) {
      $poll->vote = $result->chorder;
    }
    else {
      $poll->vote = -1;
      $poll->allowvotes = TRUE;
    }
  }
  return $poll;
}

any help is appreciated!

Comments

jebernier’s picture

Hey,

Interesting question...did you resolve this issue...I think IP address is logged so users at the same computer cannot take the poll twice.

John

Status: Active » Closed (outdated)

Automatically closed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.