You are here

answers.readme.txt in Answers 6.2

Same filename and directory in other branches
  1. 6 answers.readme.txt
  2. 7 answers.readme.txt
  3. 7.2 answers.readme.txt
Non-displayable characters.

File

answers.readme.txt
View source
  1. This file gives a brief guide to the Answers Module.
  2. Last Updated: 6/17/11 by Chip Cleary
  3. This module is based on:
  4. • The original D5 "answers" module written by Amanuel Tewolde.
  5. • The original D6 conversion of that module written by Inders Singh
  6. • The original features version of the module written by Greg Harvey
  7. • An alternative D6 conversion written by seaji
  8. There are 5 relevant roles (these are not drupal system roles but rather types of users for the module):
  9. 1 Viewers: Those who view questions and answers
  10. 2 Question Authors: Those who ask a question.
  11. 3 Answer Authors: Those who answer a question
  12. 4 Site Administrator: Those who have the "administer settings" privilege and who can set up the module
  13. 5 Site Developer: Those who code sites using modules
  14. What the module does:
  15. • Users can create new questions by going to the path 'node/add/question' (in this approach, users are taken directly to the new question form)
  16. • Users can create new questions by going to the path 'questions/start_ask' (in this approach, users are asked to review questions that match theirs first)
  17. • Viewers can review a list of all questions. This is available at the path 'questions/all'
  18. • Viewers can review a list of unanswered questions. This is available at the path 'questions/unanswered'
  19. • Viewers can review a list of questions that match a search query. This is available at the path 'questions/search'
  20. • When viewing the list of questions, viewers can sort by title, post date, and page views
  21. • When displaying a question, the system shows all the answers to that question.
  22. • When deleting a question, also delete all of the answers to it.
  23. 1. Viewer Role:
  24. • The module offers some predefined views to see lists of questions
  25. - 'questions/all': A list of all questions
  26. - 'questions/unanswered': A list of questions without answers
  27. - 'questions/search': A form to search for question
  28. • Users can view an individual question along with its responses.
  29. • Users can vote a question thumbs up or thumbs down is he has permission.
  30. • Users can see questions asked and answered by themselves or others (these are shown under a "Your Questions" menu item on user profiles):
  31. - 'user/%/questions/asked': A list of questions asked by a user
  32. - 'user/%/questions/answered': A list of questions answered by a user
  33. 2. Question Author Role:
  34. • Users can ask a new question if they have permission. They can do so at 'node/add/question' or by using the Create Content -> Question menu item
  35. • When a user asks a new question, the user can specify whether they want to be notified by email when an answer is posted. This is a checkbox setting on the form used to create the question.
  36. 3. Answer Author Role:
  37. • When viewing a question, a user can enter a new answer if he has permission. This is done by using the 'Post an Answer' link on the question node view.
  38. 4. Site Administrator Role: Site Administrators can define:
  39. • Which drupal system roles can view questions and answers (by setting the permission 'access content')
  40. • Which drupal system roles can ask a new question (by setting the permission 'create question content')
  41. • Which drupal system roles can answer questions (by setting the permission 'create answer content')
  42. • Which drupal system roles can vote responses up/down (by setting the permission 'use vote up/down on nodes')
  43. • Which drupal system roles can see the tally of up/down votes(by setting the permission 'use vote up/down on nodes')
  44. • Whether users can edit or delete their own or others questions and answers (by setting the corresponding permissions)
  45. • The subject and body templates for an email notification (using the path 'admin/settings/answers')
  46. 5. Site Developer Role:
  47. 5.1 To set up the module:
  48. • Install the module
  49. • Configure the administration options (see "Administrator Role" above)
  50. 5.2 A few pointers on how it works:
  51. • The module was developed using the Features module
  52. • It defines two CCK types: Question and Answer
  53. • It defines several views: all_questions and question_answers, user_questions, and user_answers
  54. • It defines a couple of strongarm variables: 'answers_answer_notification_subject' and 'answers_answer_notification_body'
  55. • It employs custom code to:
  56. • Provide administrative settings
  57. • Send notification emails
  58. • Make some nice adjustments to the search and new question forms
  59. • Hide the notification option when anonymoous users add questions.
  60. • Prevent users from adding new answers after a question has been "locked" (Other modules are responsible for setting locks. This module implements the locks themselves).
  61. 5.3 Site Developer tips:
  62. • If you want to automatically search for questions that contain a string ...
  63. => You can use the path 'questions/search?keys=your-string'
  64. • If you want to lock a question so that viewers can no longer post new answers
  65. => Set $question_node->field_question_locked_p[0]['value'] = 1; (Or set it to 0 to unlock a question)
  66. • If you want users to ask a question but search for it first, send them to:
  67. => 'questions/start_ask' (if they don't yet have a question)
  68. => 'questions/continue_ask?keys=question-string' (if you do have a question string already)
  69. 5.4 Module Developer tips
  70. • Answers provides a simple api for other modules that would like to lock questions:
  71. • hook_answers_lock_question_p: Modules that want to set or release locks should define this hook. It returns TRUE if a question should be locked.
  72. • answers_lock_question: Lock a question
  73. • answers_unlock_question: Unlock a question
  74. • answers_reset_question_locks: Cycle through all questions and reset their locks. (This can be required when, e.g., a global policy is changed. For example, an administrator may change the policy in the Best Answers module to lock questions after a Best Answer is selected. When this happens, the module calls this function to update the locks.).