Advertisement
Guest User

Untitled

a guest
Apr 18th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.54 KB | None | 0 0
  1. $assessmentQuestions = [
  2. 1 => 'My face gets hot and blushes',
  3. 2 => 'I have nightmares',
  4. 3 => 'I feel like I’m falling apart and going to pieces',
  5. 4 => 'I get so lost in thoughts that I ignore or forget my surroundings',
  6. 5 => 'If the room is full, I stay closer to the walls, avoiding the center',
  7. 6 => 'I fall asleep easily and get a good night’s rest',
  8. 7 => 'I am bothered by headaches, neck and back pains',
  9. 8 => 'I feel that everything is all right and nothing bad will happen',
  10. 9 => 'I can feel my heart beating fast',
  11. 10 => 'My travel plans are well thought out',
  12. 11 => 'I get upset easily or feel panicky',
  13. 12 => 'I feel more energetic after spending time with a group of people'
  14. ];
  15.  
  16. $fakepost = [
  17. q1 => 5,
  18. q2 => 3,
  19. q3 => 5,
  20. q4 => 6,
  21. q5 => 6,
  22. q6 => 5,
  23. q7 => 5,
  24. q8 => 6,
  25. q9 => 5,
  26. q10 => 5,
  27. q11 => 5,
  28. q12 => 6,
  29. q13 => 5,
  30. q14 => 5,
  31. q15 => 6,
  32. q16 => 5,
  33. q17 => 4,
  34. q18 => 5,
  35. q19 => 5,
  36. q20 => 5,
  37. q21 => 5,
  38. q22 => 6,
  39. q23 => 5,
  40. q24 => 6,
  41. q25 => 5,
  42. q26 => 5,
  43. q27 => 7,
  44. q28 => 2,
  45. q29 => 5,
  46. q30 => 6,
  47. q31 => 6,
  48. q32 => 5,
  49. q33 => 6,
  50. q34 => 6,
  51. q35 => 4,
  52. q36 => 6
  53. ];
  54.  
  55.  
  56. $reverseQuestions = [5, 6, 8, 14, 18, 27, 31, 32, 35];
  57.  
  58. for ($i = 1; $i <= sizeof($assessmentQuestions); $i++) {
  59. $questionName = 'q' . $i;
  60. echo $questionName . '<br>';
  61.  
  62. if (in_array($i, $reverseQuestions) && in_array($i, $assessmentQuestions)) {
  63. if ($fakepost[$questionName] == 1) { $qwew = 7; echo $qwew . '<br>';}
  64. else if ($fakepost[$questionName] == 2) { $qwew = 6; echo $qwew . '<br>';}
  65. else if ($fakepost[$questionName] == 3) { $qwew = 5; echo $qwew . '<br>';}
  66. else if ($fakepost[$questionName] == 4) { $qwew = 4; echo $qwew . '<br>';}
  67. else if ($fakepost[$questionName] == 5) { $qwew = 3; echo $qwew . '<br>';}
  68. else if ($fakepost[$questionName] == 6) { $qwew = 2; echo $qwew . '<br>';}
  69. else if ($fakepost[$questionName] == 7) { $qwew = 1; echo $qwew . '<br>';}
  70. }
  71.  
  72. else if (!in_array($i, $reverseQuestions) && in_array($i, $assessmentQuestions)) {
  73. $qwew = $fakepost[$questionName]; echo $qwew . '<br>';
  74. }
  75. echo 'POST: ' . $fakepost[$questionName] . '<br>';
  76. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement