Class: SD3Test

Inherits:
ScaleTest show all
Defined in:
lib/jungi/paulhus.rb

Overview

Short Dark Triad Test

Constant Summary collapse

DOC =
<<END_FILE
Short Dark Triad
-
Delroy L. Paulhus

This test evaluates how strongly you display the
dark triad of personality.  Answer each question with
a "1" for Strongly Disagree, "2" for Disagree,
"3" for Neither Agree nor Disagree, "4" for Agree,
and "5" for Strongly Agree.  Press <ENTER> after
you've made your choice.
END_FILE
QUESTIONS =
[
  'Whatever it takes, you must get the important people'\
  ' on your side.',
  'Avoid direct conflict with others because they may be'\
  ' useful in the future.',
  'I have never gotten into trouble with the law.',
  'People often say I’m out of control.',
  'I avoid dangerous situations.',
  'I like to get acquainted with important people.',
  'I feel embarrassed if someone compliments me.',
  'Many group activities tend to be dull without me.',
  'People see me as a natural leader.',
  'It’s wise to keep track of information that you can use'\
  ' against people later.',
  'I am an average person.',
  'There are things you should hide from other people because'\
  ' they don’t need to know.',
  'It’s true that I can be mean to others.',
  'I know that I am special because everyone keeps telling'\
  ' me so.',
  'I have been compared to famous people.',
  'I enjoy having sex with people I hardly know',
  'I’ll say anything to get what I want.',
  'I hate being the center of attention.',
  'I like to use clever manipulation to get my way.',
  'I like to get revenge on authorities.',
  'You should wait for the right time to get back at people.',
  'Make sure your plans benefit you, not others.',
  'Most people can be manipulated.',
  "It's not wise to tell your secrets.",
  'I insist on getting the respect I deserve.',
  'People who mess with me always regret it.',
  'Payback needs to be quick and nasty.'
]

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ScaleTest

#randomize!, #set_answer

Methods inherited from Test

#answer, #answer=, #answers, #done?, #finished?, #get_question, #initialize, #method_missing, #out_of_index?, #question, #set_answer

Constructor Details

This class inherits a constructor from Test

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Test

Class Method Details

.parse_mach(mach) ⇒ Object



76
77
78
79
80
81
82
83
84
85
86
# File 'lib/jungi/paulhus.rb', line 76

def self.parse_mach(mach)
  if mach < 1.5
    "Strong(#{mach}) Anti-Machivellianism\n"
  elsif mach < 3.1
    "Weak(#{mach}) Anti-Machivellianism\n"
  elsif mach < 4.3
    "Weak(#{mach}) Machivellianism\n"
  else
    "Strong(#{mach}) Machivellianism\n"
  end
end

.parse_narc(narc) ⇒ Object



88
89
90
91
92
93
94
95
96
97
98
# File 'lib/jungi/paulhus.rb', line 88

def self.parse_narc(narc)
  if narc < 1.5
    "Strong(#{narc}) Anti-Narcissism\n"
  elsif narc < 2.8
    "Weak(#{narc}) Anti-Narcissism\n"
  elsif narc < 4
    "Weak(#{narc}) Narcissism\n"
  else
    "Strong(#{narc}) Narcissism\n"
  end
end

.parse_psycho(psycho) ⇒ Object



100
101
102
103
104
105
106
107
108
109
110
# File 'lib/jungi/paulhus.rb', line 100

def self.parse_psycho(psycho)
  if psycho < 1.5
    "Strong(#{psycho}) Anti-Psychopathy\n"
  elsif psycho < 2.4
    "Weak(#{psycho}) Anti-Psychopathy\n"
  elsif psycho < 3
    "Weak(#{psycho}) Psychopathy\n"
  else
    "Strong(#{psycho}) Psychopathy\n"
  end
end

.parse_result(mach, narc, psycho) ⇒ Object



112
113
114
115
116
117
# File 'lib/jungi/paulhus.rb', line 112

def self.parse_result(mach, narc, psycho)
  mach = (mach.round 1)
  narc = (narc.round 1)
  psycho = (psycho.round 1)
  parse_mach(mach) << parse_narc(narc) << parse_psycho(psycho)
end

Instance Method Details

#resultObject



119
120
121
122
123
124
125
126
127
128
129
130
# File 'lib/jungi/paulhus.rb', line 119

def result
  mach = (self.Q24 + self.Q19 + self.Q1 + self.Q2 + self.Q10 +
         self.Q21 + self.Q12 + self.Q22 + self.Q23) / 9.0
  narc = (self.Q9 + Question::Answer.reverse_scale(self.Q18) +
         self.Q8 + self.Q14 + self.Q6 +
         Question::Answer.reverse_scale(self.Q7) +
         self.Q15 + Question::Answer.reverse_scale(self.Q11) + self.Q25) / 9.0
  psycho = (self.Q20 + Question::Answer.reverse_scale(self.Q5) +
         self.Q27 + self.Q4 + self.Q13 + self.Q26 +
         Question::Answer.reverse_scale(self.Q3) + self.Q16 + self.Q17) / 9.0
  [mach, narc, psycho]
end