Community Documentation

Question/Answer

Last updated March 17, 2011. Created by jcisio on October 28, 2010.
Edited by Stephen Rockwell, aspilicious. Log in to edit this page.

Question/Answer module adds a question/answer section for website. Different from other modules, it uses only one node type for question, and the core comment.module for answer. This allow reutilisation of CCK, Views...

Version 6 of this module is dependant on CCK and CTools. Both are in D7-core, thus version 7 has not any dependency.

Features

  • Users who post questions are allowed to select a comment as the answer.
  • The selected answer is displayed right below question.
  • The posters may specify a date, after this duration, there will be a "most voted answer" if no comment is selected as the answer (not yet implemented, might require Voting API).

Usage

Installation

  • Create a new content type, or reuse existing one
  • Add a new number/integer field for this content type (require Number module, shipped with CCK): go to admin/content/node-type/NODETYPE/fields (D6) or admin/structure/types/manage/NODETYPE/fields (D7)
  • Select the format "Selected answer" for this field in the "Display fields" section: admin/content/node-type/NODETYPE/display (D6) or admin/structure/types/manage/NODETYPE/display (D7).
  • Go to the Q/A settings page (admin/settings/question_answer in D6 and admin/config/question_answer in D7) and select the content type/field name above.
  • That's all!

Question expiration

You can set the expiration time for each question. After this time, the reply with the most votes will be automatically selected as the answer.

  • Go to the Q/A content type, create a new field "duration"
    • Type: Integer (D7: List (Integer))
    • Widget: Select list
    • In the configure page, enter prefined time in second, for example (unlimited, 1 day, 7 days and 30 days):
      0|No expiration
      86400|1 day
      604800|1 week
      2592000|1 month
  • Go to the Q/A setting page, select this field.
  • Install VotingAPI module and another module, for example, vote_up_down (don't forget to enable "vud on comments").
  • Go to permissions page, allow anonymous to vote on comments.

Screenshots

An answered question
An opened question

Comments

The killer app

This is the very first module that I installed in my very first Drupal site. Thanks so much.

Page status

No known problems

Log in to edit this page

About this page

Drupal version
Drupal 6.x, Drupal 7.x
Audience
Developers and coders, Site administrators

Site Building Guide

Drupal’s online documentation is © 2000-2012 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution-ShareAlike 2.0. PHP code is distributed under the GNU General Public License. Comments on documentation pages are used to improve content and then deleted.