You are here

answers.readme.txt in Answers 7.2

Same filename and directory in other branches
  1. 6.2 answers.readme.txt
  2. 6 answers.readme.txt
  3. 7 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. • The updated features version of the module written by me.
  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. • Viewers can also see lists of questions they asked and they answered
  24. 1. Viewer Role:
  25. • The module offers some predefined views to see lists of questions
  26. - 'questions/all': A list of all questions
  27. - 'questions/unanswered': A list of questions without answers
  28. - 'questions/search': A form to search for questions
  29. • Users can view an individual question along with its responses.
  30. • Users can vote a question thumbs up or thumbs down is he has permission.
  31. • Users can see questions asked and answered by themselves or others (these are shown under a "Your Questions" menu item on user profiles):
  32. - 'user/%/questions/asked': A list of questions asked by a user
  33. - 'user/%/questions/answered': A list of questions answered by a user
  34. 2. Question Author Role:
  35. • 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
  36. • 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.
  37. 3. Answer Author Role:
  38. • 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.
  39. 4. Site Administrator Role: Site Administrators can define:
  40. • Which drupal system roles can view questions and answers (by setting the permission 'access content')
  41. • Which drupal system roles can ask a new question (by setting the permission 'create question content')
  42. • Which drupal system roles can answer questions (by setting the permission 'create answer content')
  43. • Which drupal system roles can vote responses up/down (by setting the permission 'use vote up/down on nodes')
  44. • Which drupal system roles can see the tally of up/down votes(by setting the permission 'use vote up/down on nodes')
  45. • Whether users can edit or delete their own or others questions and answers (by setting the corresponding permissions)
  46. • The subject and body templates for an email notification (using the path 'admin/settings/answers')
  47. 5. Site Developer Role:
  48. 5.1 To set up the module:
  49. • Install the module
  50. • Configure the administration options (see "Administrator Role" above)
  51. 5.2 A few pointers on how it works:
  52. • The module was developed using the Features module
  53. • It defines two CCK types: Question and Answer
  54. • It defines a couple of views: all_questions and question answers
  55. • It defines a couple of strongarm variables: 'answers_answer_notification_subject' and 'answers_answer_notification_body'
  56. • It employs a small amount of custom code to:
  57. • Provide administrative settings
  58. • Send notification emails
  59. • Make some nice adjustments to the search and new question forms
  60. • Hide the notification option when anonymoous users add questions.
  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.).