Advertisement
Guest User

Untitled

a guest
Aug 2nd, 2015
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 29.62 KB | None | 0 0
  1. <?php
  2. defined('BASEPATH') OR exit('No direct script access allowed');
  3.  
  4. class Hello extends CI_Controller {function __construct(){
  5. parent::__construct();
  6. if (!$this->ion_auth->logged_in()) {
  7. redirect("auth/login");
  8. }
  9.  
  10. }
  11.  
  12. /*public function gobackwriting($prevquestionid){
  13. $category = "SELECT Category FROM SMARTDiagnosticQSourceData WHERE QuestionID = $prevquestionid";
  14. $larry = $this->db->query($category);
  15. $moe = $larry->row();
  16. if ($moe->Category == "IP"){
  17. for ($i = 1; $moe->Category = "IP"; $i++){
  18. $prevquestionid = $prevquestionid - 1;
  19. echo $prevquestionid;
  20. $category = "SELECT Category FROM SMARTDiagnosticQSourceData WHERE QuestionID = $prevquestionid";
  21. $larry = $this->db->query($category);
  22. $moe = $larry->row();
  23. }
  24. }
  25. redirect("/Hello/writingdiagnostics/{prevquestionid}");
  26. }*/
  27. public function submit_ans($q_num, $q_ans, $q_time){
  28.  
  29. $user = $this->ion_auth->user()->row();
  30. $userid = $user->email;
  31.  
  32. $duh = array("1" => "A", "2" => "B", "3" => "C", "4" => "D", "5" => "E", "6" => "F", "7" => "yolo");
  33.  
  34. $numbans = $q_ans;
  35. $timetaken = $q_time;
  36. $i = $q_num;
  37.  
  38. $yolo = "SELECT QuestionID FROM SMARTDiagnosticWritingQSourceData WHERE SmartDiagnosticID = $i";
  39.  
  40. $cholo = $this->db->query($yolo);
  41. $bolo = $cholo->row();
  42. $lolo = $bolo->QuestionID; //extracting the real question id
  43.  
  44. $rage = "SELECT QuestionAnswer FROM QSourceData WHERE QuestionID = $lolo";
  45. $anger = $this->db->query($rage);
  46. $hatred = $anger->row();
  47. $venom = $hatred->QuestionAnswer; // extracted answer correct answer, reterded benjamin with his stupid variable names >:-|
  48. $insert = "INSERT INTO TestDatabase (UserID, QuestionID, CorrectAnswer, SelectedAnswer, Time, Type) VALUES ('$userid', '$lolo', '$venom', '$duh[$numbans]', '$timetaken', 'Writing')";
  49. $this->db->query($insert);
  50. echo "success";
  51. }
  52. public function submit_ans_reading($q_num, $q_ans, $q_time){
  53.  
  54. $user = $this->ion_auth->user()->row();
  55. $userid = $user->email;
  56.  
  57. $duh = array("1" => "A", "2" => "B", "3" => "C", "4" => "D", "5" => "E", "6" => "F", "7" => "yolo");
  58.  
  59. $numbans = $q_ans;
  60. $timetaken = $q_time;
  61. $i = $q_num;
  62.  
  63. $yolo = "SELECT QuestionID FROM SMARTDiagnosticReadingQSourceData WHERE SmartDiagnosticID = $i";
  64.  
  65. $cholo = $this->db->query($yolo);
  66. $bolo = $cholo->row();
  67. $lolo = $bolo->QuestionID; //extracting the real question id
  68.  
  69. $rage = "SELECT QuestionAnswer FROM QSourceData WHERE QuestionID = $lolo";
  70. $anger = $this->db->query($rage);
  71. $hatred = $anger->row();
  72. $venom = $hatred->QuestionAnswer; // extracted answer correct answer, reterded benjamin with his stupid variable names >:-|
  73. $insert = "INSERT INTO TestDatabase (UserID, QuestionID, CorrectAnswer, SelectedAnswer, Time, Type) VALUES ('$userid', '$lolo', '$venom', '$duh[$numbans]', '$timetaken', 'Reading')";
  74. $this->db->query($insert);
  75. echo "success";
  76. }
  77.  
  78. public function ans_get_writing()
  79. {
  80. $user = $this->ion_auth->user()->row();
  81. $userid = $user->email;
  82. $meh = $this->input->post('len');
  83. echo $meh;
  84. $newdata = ($meh - 1)/2 ;
  85. $duh = array("1" => "A", "2" => "B", "3" => "C", "4" => "D", "5" => "E", "6" => "F", "7" => "yolo");
  86. /*$category = "SELECT Category FROM SMARTDiagnosticQSourceData WHERE QuestionID = $q_num";
  87. $larry = $this->db->query($category);
  88. $moe = $larry->row();*/
  89.  
  90. for ($i = 1; $i <= 61; $i++){
  91. $conlion = "$i" . "_time";
  92. $contiger = "$i" . "_ans";
  93. if (isset($contiger)){
  94. $numbans = $this->input->post("$contiger");
  95. $timetaken = $this->input->post("$conlion");
  96. $yolo = "SELECT QuestionID FROM SMARTDiagnosticWritingQSourceData WHERE SmartDiagnosticID = $i";
  97. $cholo = $this->db->query($yolo);
  98. $bolo = $cholo->row();
  99. $lolo = $bolo->QuestionID;
  100. $rage = "SELECT QuestionAnswer FROM QSourceData WHERE QuestionID = $lolo";
  101. $anger = $this->db->query($rage);
  102. $hatred = $anger->row();
  103. $venom = $hatred->QuestionAnswer;
  104.  
  105. $insert = "INSERT INTO TestDatabase (UserID, QuestionID, CorrectAnswer, SelectedAnswer, Time, Type) VALUES ('$userid', '$lolo', '$venom', '$duh[$numbans]', '$timetaken', 'Writing')";
  106. $this->db->query($insert);
  107. $this->db->query("DELETE FROM TestDatabase WHERE SelectedAnswer = ' ';");
  108.  
  109. }
  110. }
  111. }
  112.  
  113. public function ans_get_writing_quiz_one()
  114. {
  115. $user = $this->ion_auth->user()->row();
  116. $userid = $user->email;
  117. $meh = $this->input->post('len');
  118. echo $meh;
  119. $newdata = ($meh - 1)/2 ;
  120. $duh = array("1" => "A", "2" => "B", "3" => "C", "4" => "D", "5" => "E", "6" => "F", "7" => "yolo");
  121. /*$category = "SELECT Category FROM SMARTDiagnosticQSourceData WHERE QuestionID = $q_num";
  122. $larry = $this->db->query($category);
  123. $moe = $larry->row();*/
  124.  
  125. for ($i = 1; $i <= $newdata; $i++){
  126. $conlion = "$i" . "_time";
  127. $contiger = "$i" . "_ans";
  128. $numbans = $this->input->post("$contiger");
  129. $timetaken = $this->input->post("$conlion");
  130. $yolo = "SELECT QuestionID FROM SMARTQuizOneWritingQSourceData WHERE SmartDiagnosticID = $i";
  131. $cholo = $this->db->query($yolo);
  132. $bolo = $cholo->row();
  133. $lolo = $bolo->QuestionID;
  134.  
  135. $insert = "INSERT INTO TestDatabase (UserID, QuestionID, SelectedAnswer, Time, Type) VALUES ('$userid', '$lolo', '$duh[$numbans]', '$timetaken', 'Writing')";
  136. $this->db->query($insert);
  137. $this->db->query("DELETE FROM TestDatabase WHERE SelectedAnswer = ' ';");
  138.  
  139. }
  140. }
  141. public function ans_get_reading()
  142. {
  143. $user = $this->ion_auth->user()->row();
  144. $userid = $user->email;
  145. $meh = $this->input->post('len');
  146. echo $meh;
  147. $newdata = ($meh - 1)/2 ;
  148. $duh = array("1" => "A", "2" => "B", "3" => "C", "4" => "D", "5" => "E", "6" => "F", "7" => "yolo");
  149. /*$category = "SELECT Category FROM SMARTDiagnosticQSourceData WHERE QuestionID = $q_num";
  150. $larry = $this->db->query($category);
  151. $moe = $larry->row();*/
  152.  
  153. for ($i = 1; $i <= $newdata; $i++){
  154. $conlion = "$i" . "_time";
  155. $contiger = "$i" . "_ans";
  156. $numbans = $this->input->post("$contiger");
  157. $timetaken = $this->input->post("$conlion");
  158. $yolo = "SELECT QuestionID FROM SMARTDiagnosticReadingQSourceData WHERE SmartDiagnosticID = $i";
  159. $cholo = $this->db->query($yolo);
  160. $bolo = $cholo->row();
  161. $lolo = $bolo->QuestionID;
  162. $rage = "SELECT QuestionAnswer FROM QSourceData WHERE QuestionID = $lolo";
  163. $anger = $this->db->query($rage);
  164. $hatred = $anger->row();
  165. $venom = $hatred->QuestionAnswer;
  166.  
  167. $insert = "INSERT INTO TestDatabase (UserID, QuestionID, CorrectAnswer, SelectedAnswer, Time, Type) VALUES ('$userid', '$lolo', '$venom', '$duh[$numbans]', '$timetaken', 'Reading')";
  168. $this->db->query($insert);
  169. $this->db->query("DELETE FROM TestDatabase WHERE SelectedAnswer = ' ';");
  170. }
  171. }
  172.  
  173.  
  174. public function writingdiagnostics($smartdiagnosticid)
  175. {
  176.  
  177. $user = $this->ion_auth->user()->row();
  178. $userid = $user->username;
  179. $this->load->helper('url');
  180. $this->load->library('parser');
  181. $this->load->model('Model');
  182. // $sql = "INSERT INTO TestDatabase(UserID,QuestionID) VALUES ('$userid','$q_num');";
  183. // $this->db->query($sql);
  184.  
  185. $q_num = $this->Model->getqnumberwriting($smartdiagnosticid);
  186. $stuff = $this->Model->assign_sample_data_writing($q_num);
  187. $test = array('username' => $userid);
  188. $this->load->view('userheader', $test);
  189. $this->parser->parse($stuff["question_type"], $stuff);
  190.  
  191. }
  192. public function writingquizone($smartdiagnosticid)
  193. {
  194.  
  195. $user = $this->ion_auth->user()->row();
  196. $userid = $user->email;
  197. $this->load->helper('url');
  198. $this->load->library('parser');
  199. $this->load->model('Model');
  200. // $sql = "INSERT INTO TestDatabase(UserID,QuestionID) VALUES ('$userid','$q_num');";
  201. // $this->db->query($sql);
  202.  
  203. $q_num = $this->Model->getqnumberwritingquizone($smartdiagnosticid);
  204. $stuff = $this->Model->assign_sample_data_writing_quiz_one($q_num);
  205.  
  206. $this->parser->parse($stuff["question_type"], $stuff);
  207.  
  208. }
  209.  
  210. public function readingdiagnostics($smartdiagnosticid)
  211. {
  212.  
  213. $user = $this->ion_auth->user()->row();
  214. $userid = $user->username;
  215. $this->load->helper('url');
  216. $this->load->library('parser');
  217. $this->load->model('Model');
  218. // $sql = "INSERT INTO TestDatabase(UserID,QuestionID) VALUES ('$userid','$q_num');";
  219. // $this->db->query($sql);
  220.  
  221. $q_num = $this->Model->getqnumberreading($smartdiagnosticid);
  222. $stuff = $this->Model->assign_sample_data_reading($q_num);
  223.  
  224. $test = array('username' => $userid);
  225. $this->load->view('userheader', $test);
  226. $this->parser->parse($stuff["question_type"], $stuff);
  227.  
  228. }
  229.  
  230.  
  231. public function display_attempt_writing() {
  232. $this->db->query("DELETE TestDatabase FROM TestDatabase LEFT OUTER JOIN (SELECT MAX(num) AS num, UserID, QuestionID FROM TestDatabase GROUP BY UserID, QuestionID) AS KeepRows ON TestDatabase.num = KeepRows.num WHERE KeepRows.num IS NULL");
  233. $this->db->query("UPDATE TestDatabase SET SelectedAnswer = 'F' WHERE SelectedAnswer = 'yolo'");
  234. $answers = $this->load->view('writingattempts','', false);
  235. echo $answers;
  236.  
  237. }
  238. public function display_attempt_writing_quiz_one() {
  239. $answers = $this->load->view('writingattemptsquizone','', true);
  240. echo $answers;
  241.  
  242. }
  243.  
  244. public function display_attempt_reading() {
  245. $this->db->query("DELETE TestDatabase FROM TestDatabase LEFT OUTER JOIN (SELECT MAX(num) AS num, UserID, QuestionID FROM TestDatabase GROUP BY UserID, QuestionID) AS KeepRows ON TestDatabase.num = KeepRows.num WHERE KeepRows.num IS NULL");
  246. $this->db->query("UPDATE TestDatabase SET SelectedAnswer = 'F' WHERE SelectedAnswer = 'yolo'");
  247. $answers = $this->load->view('readingattempts','', true);
  248. echo $answers;
  249.  
  250. }
  251.  
  252. public function fuck() {
  253. $this->load->view('graph','');
  254. // echo base_url();
  255. }
  256.  
  257. public function get_directions($actualid, $q_type) {
  258. $this->load->helper('url');
  259. $this->load->library('parser');
  260. $stuff = array("actualid" => $actualid);
  261. $this->parser->parse($q_type . '_header', $stuff);
  262.  
  263. }
  264. public function diagnostics() {
  265. $user = $this->ion_auth->user()->row();
  266. $usercreated = $user->created_on;
  267. $userlogin = $user->last_login;
  268. $timespent = $userlogin - $usercreated;
  269. $hours = $timespent/3600;
  270. $stuff = array("hours" => "shit");
  271. $this->load->library('parser');
  272. $this->parser->parse('diagnostics', array("hours" => $hours));
  273.  
  274.  
  275. }
  276. public function get_incorrect_answers(){
  277.  
  278.  
  279. $user = $this->ion_auth->user()->row();
  280.  
  281. $userid = $user->email;
  282.  
  283. $ferrari = "SELECT QuestionID FROM TestDatabase WHERE (SelectedAnswer != CorrectAnswer AND UserID = '$userid' AND TYPE = 'Writing');" ;
  284.  
  285. $query = $this->db->query($ferrari);
  286. $qs = array();
  287. $count = 0;
  288. foreach ($query->result() as $row)
  289. {
  290. array_push($qs, $row->QuestionID);
  291. }
  292.  
  293. $nqs = array();
  294.  
  295. for ($i = 0; $i < count($qs); ++$i)
  296. {
  297. array_push($nqs, array('id' => $qs[$i], 'q_num' => $i + 1 ));
  298. }
  299. $stuff = array("data" => $nqs);
  300. $data = array(
  301.  
  302. 'blog_entries' => array(
  303. array('title' => 'Title 1'),
  304. array('title' => 'Title 2'),
  305. array('title' => 'Title 3'),
  306. array('title' => 'Title 4'),
  307. array('title' => 'Title 5')
  308. )
  309. );
  310. echo "<br><br>";
  311. $this->load->library('parser');
  312. $this->parser->parse("wrong_questions", $stuff);
  313.  
  314. }
  315.  
  316. public function writingdiagnostics_new($smartdiagnosticid)
  317. {
  318.  
  319. $user = $this->ion_auth->user()->row();
  320. $userid = $user->username;
  321. $this->load->helper('url');
  322. $this->load->library('parser');
  323. $this->load->model('Model');
  324. // $sql = "INSERT INTO TestDatabase(UserID,QuestionID) VALUES ('$userid','$q_num');";
  325. // $this->db->query($sql);
  326.  
  327. $q_num = $smartdiagnosticid;
  328. $stuff = $this->Model->assign_sample_data_writing($q_num);
  329. $test = array('username' => $userid);
  330. $this->load->view('userheader', $test);
  331.  
  332. $this->parser->parse($stuff["question_type"]."_review", $stuff);
  333.  
  334. }
  335.  
  336. public function statistics() {
  337. $user = $this->ion_auth->user()->row();
  338. $useremail = $user->email;
  339. $question = array();
  340.  
  341. for ($i = 1; $i <= 61; $i++){
  342. $yolo = "SELECT QuestionID FROM SMARTDiagnosticWritingQSourceData WHERE SmartDiagnosticID = $i";
  343. $cholo = $this->db->query($yolo);
  344. $bolo = $cholo->row();
  345. $lolo = $bolo->QuestionID;
  346. $rage = "SELECT SelectedAnswer, CorrectAnswer, Time FROM TestDatabase WHERE UserID = '$useremail' AND QuestionID = $lolo";
  347. $anger = $this->db->query($rage);
  348. $hatred = $anger->row();
  349. $venom = $hatred->SelectedAnswer;
  350. $poison = $hatred->CorrectAnswer;
  351. $carnage = $hatred->Time;
  352. ${$i} = array(
  353. "username" => $useremail,
  354. "Ans" => $venom,
  355. "Time" => $carnage,
  356. "CorrectAnswer" => $poison,
  357. );
  358. $questions[] = ${$i};
  359. }
  360. $stuff = array("details" => $questions);
  361.  
  362. $this->load->library('parser');
  363. $this->parser->parse("statistics", $stuff);
  364.  
  365.  
  366. }
  367. public function statistics2() {
  368. $user = $this->ion_auth->user()->row();
  369. $useremail = $user->email;
  370. $question = array();
  371.  
  372. for ($i = 1; $i <= 61; $i++){
  373. $yolo = "SELECT QuestionID FROM SMARTDiagnosticWritingQSourceData WHERE SmartDiagnosticID = $i";
  374. $cholo = $this->db->query($yolo);
  375. $bolo = $cholo->row();
  376. $lolo = $bolo->QuestionID;
  377. $rage = "SELECT SelectedAnswer, CorrectAnswer, Tim FROM TestDatabase WHERE UserID = '268098121@qq.com' AND QuestionID = $lolo";
  378. $anger = $this->db->query($rage);
  379. $hatred = $anger->row();
  380. $venom = $hatred->SelectedAnswer;
  381. $poison = $hatred->CorrectAnswer;
  382. $tony = "SELECT PercentageCorrect, AveTimeCorrect FROM SMARTDiagnosticWritingQSourceData WHERE QuestionID = $lolo";
  383. $stark = $this->db->query($tony);
  384. $invincible = $stark->row();
  385. $iron = $invincible->PercentageCorrect;
  386. $carnage = $hatred->Tim;
  387. $AveTimeCorrect = $invincible->AveTimeCorrect;
  388.  
  389. ${$i} = array(
  390. "q_num" => $i,
  391. "username" => $useremail,
  392. "Ans" => $venom,
  393. "CorrectAnswer" => $poison,
  394. "Tim" => $carnage,
  395. "PercentageCorrect" => $iron,
  396. "AveTimeCorrect" => $AveTimeCorrect
  397. );
  398.  
  399. $questions[] = ${$i};
  400. }
  401.  
  402. $test = array("details" => $questions);
  403. $this->load->library('parser');
  404. $this->parser->parse('statistics', $test);
  405.  
  406. }
  407.  
  408. public function statistics3() {
  409.  
  410.  
  411. $user = $this->ion_auth->user()->row();
  412. $useremail = 'Anderson';
  413. $ferrari = "SELECT WritingCorrect, WritingSkipped, WritingIncorrect, WritingTotal FROM UserDistributions2 WHERE User = 'Anderson'";
  414. $algo = $this->db->query($ferrari);
  415. $aldo = $algo->row();
  416. $roma = $aldo->WritingCorrect;
  417. $alta = $aldo->WritingTotal;
  418. $forza = $aldo->WritingSkipped;
  419. $italia = $aldo->WritingIncorrect;
  420. $florentina = intval($italia)*(-0.25) + intval($roma);
  421. $simple = array(
  422. "Correct" => $roma,
  423. "Skipped" => $forza,
  424. "Incorrect" => $italia,
  425. "Total" => $alta,
  426. "Scaled" => $florentina
  427. );
  428.  
  429. $this->load->library('parser');
  430. $this->parser->parse('stats_ind', $simple);
  431.  
  432. }
  433.  
  434.  
  435.  
  436. public function statistics4() {
  437. $user = $this->ion_auth->user()->row();
  438. $useremail = 'Anderson';
  439. /*$ferrari = "SELECT WritingCorrect, WritingSkipped, WritingIncorrect, WritingTotal FROM UserDistributions2 WHERE User = 'Anderson'";
  440. $algo = $this->db->query($ferrari);
  441. $aldo = $algo->row();
  442. $roma = $aldo->WritingCorrect;
  443. $alta = $aldo->WritingTotal;
  444. $forza = $aldo->WritingSkipped;
  445. $italia = $aldo->WritingIncorrect;
  446. $total = array(
  447. "Correct" => $roma,
  448. "Skipped" => $forza,
  449. "Incorrect" => $aldo,
  450. "Total" => $alta,
  451. );*/
  452. $ferrari = "SELECT IECorrect, IESkipped, IEIncorrect, IETotal FROM UserDistributions2 WHERE User = 'Anderson'";
  453. $algo = $this->db->query($ferrari);
  454. $aldo = $algo->row();
  455. $IECorrect = $aldo->IECorrect;
  456. $IETotal = $aldo->IETotal;
  457. $IESkipped = $aldo->IESkipped;
  458. $IEIncorrect = $aldo->IEIncorrect;
  459.  
  460. $ferrari = "SELECT ISCorrect, ISSkipped, ISIncorrect, ISTotal FROM UserDistributions2 WHERE User = 'Anderson'";
  461. $algo = $this->db->query($ferrari);
  462. $aldo = $algo->row();
  463. $ISCorrect = $aldo->ISCorrect;
  464. $ISTotal = $aldo->ISTotal;
  465. $ISSkipped = $aldo->ISSkipped;
  466. $ISIncorrect = $aldo->ISIncorrect;
  467.  
  468. $ferrari = "SELECT IPCorrect, IPSkipped, IPIncorrect, IPTotal FROM UserDistributions2 WHERE User = 'Anderson'";
  469. $algo = $this->db->query($ferrari);
  470. $aldo = $algo->row();
  471. $IPCorrect = $aldo->IPCorrect;
  472. $IPTotal = $aldo->IPTotal;
  473. $IPSkipped = $aldo->IPSkipped;
  474. $IPIncorrect = $aldo->IPIncorrect;
  475. $yes = array(
  476. "IE_Correct" => $IECorrect,
  477. "IE_Skipped" => $IESkipped,
  478. "IE_Incorrect" => $IEIncorrect,
  479. "IE_Total" => $IETotal,
  480. "IS_Correct" => $ISCorrect,
  481. "IS_Skipped" => $ISSkipped,
  482. "IS_Incorrect" => $ISIncorrect,
  483. "IS_Total" => $ISTotal,
  484. "IP_Correct" => $IPCorrect,
  485. "IP_Skipped" => $IPSkipped,
  486. "IP_Incorrect" => $IPIncorrect,
  487. "IP_Total" => $IPTotal
  488. );
  489. $this->load->library('parser');
  490. $this->parser->parse('stats_total', $yes);
  491. }
  492.  
  493. public function statistics65() {
  494. $user = $this->ion_auth->user()->row();
  495. $useremail = $user->first_name;
  496. $ferrari = "SELECT WritingCorrect, WritingSkipped, WritingIncorrect, WritingTotal FROM UserDistributions2 WHERE User = '$useremail'";
  497. $algo = $this->db->query($ferrari);
  498. $aldo = $algo->row();
  499. $roma = $aldo->WritingCorrect;
  500. $alta = $aldo->WritingTotal;
  501. $forza = $aldo->WritingSkipped;
  502. $italia = $aldo->WritingIncorrect;
  503. $total = array(
  504. "Correct" => $roma,
  505. "Skipped" => $forza,
  506. "Incorrect" => $aldo,
  507. "Total" => $alta,
  508. );
  509. $ferrari = "SELECT IECorrect, IESkipped, IEIncorrect, IETotal FROM UserDistributions2 WHERE User = '$useremail'";
  510. $algo = $this->db->query($ferrari);
  511. $aldo = $algo->row();
  512. $IECorrect = $aldo->IECorrect;
  513. $IETotal = $aldo->IETotal;
  514. $IESkipped = $aldo->IESkipped;
  515. $IEIncorrect = $aldo->IEIncorrect;
  516. echo $IEIncorrect;
  517.  
  518. $ferrari = "SELECT ISCorrect, ISSkipped, ISIncorrect, ISTotal FROM UserDistributions2 WHERE User = '$useremail'";
  519. $algo = $this->db->query($ferrari);
  520. $aldo = $algo->row();
  521. $ISCorrect = $aldo->ISCorrect;
  522. $ISTotal = $aldo->ISTotal;
  523. $ISSkipped = $aldo->ISSkipped;
  524. $ISIncorrect = $aldo->ISIncorrect;
  525.  
  526. echo $ISIncorrect;
  527. $ferrari = "SELECT IPCorrect, IPSkipped, IPIncorrect, IPTotal FROM UserDistributions2 WHERE User = '$useremail'";
  528. $algo = $this->db->query($ferrari);
  529. $aldo = $algo->row();
  530. $IPCorrect = $aldo->IPCorrect;
  531. $IPTotal = $aldo->IPTotal;
  532. $IPSkipped = $aldo->IPSkipped;
  533. $IPIncorrect = $aldo->IPIncorrect;
  534. $yes = array(
  535. "Correct" => $roma,
  536. "Skipped" => $forza,
  537. "Incorrect" => $italia,
  538. "Total" => $alta,
  539. "IE_Correct" => $IECorrect,
  540. "IE_Skipped" => $IESkipped,
  541. "IE_Incorrect" => $IEIncorrect,
  542. "IE_Total" => $IETotal,
  543. "IS_Correct" => $ISCorrect,
  544. "IS_Skipped" => $ISSkipped,
  545. "IS_Incorrect" => $ISIncorrect,
  546. "IS_Total" => $ISTotal,
  547. "IP_Correct" => $IPCorrect,
  548. "IP_Skipped" => $IPSkipped,
  549. "IP_Incorrect" => $IPIncorrect,
  550. "IP_Total" => $IPTotal
  551. );
  552. $this->load->library('parser');
  553. $this->parser->parse('stats_total', $yes);
  554. }
  555.  
  556.  
  557. public function concept_wise(){
  558.  
  559. $user = $this->ion_auth->user()->row();
  560. $useremail = $user->first_name;
  561. $ferrari = "SELECT PronounCasePercentage, PronounAntecedentPercentage, WordPhraseUsagePercentage, ClausesPercentage, ConcisePercentage, VerbFormsPercentage, SubjectAgreementPercentage, ModifiersPercentage, ParallelismPercentage, ComparisonPercentage, ImprovingParagraphsPercentage FROM UserDistributions2 WHERE User = '$useremail'";
  562. $algo = $this->db->query($ferrari);
  563. $aldo = $algo->row();
  564. $a = $aldo->PronounCasePercentage;
  565. $b = $aldo->PronounAntecedentPercentage;
  566. $c = $aldo->WordPhraseUsagePercentage;
  567. $d = $aldo->ClausesPercentage;
  568. $e = $aldo->ConcisePercentage;
  569. $f = $aldo->VerbFormsPercentage;
  570. $g = $aldo->SubjectAgreementPercentage;
  571. $h = $aldo->ModifiersPercentage;
  572. $i = $aldo->ParallelismPercentage;
  573. $j = $aldo->ComparisonPercentage;
  574. $k = $aldo->ImprovingParagraphsPercentage;
  575. if (floatval($a) < 0.75){$a = "Struggling";}
  576. else if (floatval($a) >= 0.75 && floatval($a) <= 0.99 ){$a = "Needs Practice";}
  577. else {$a = "Mastered";}
  578. if (floatval($b) < 0.75){$b = "Struggling";}
  579. else if (floatval($b) >= 0.75 && floatval($b) <= 0.99 ){$b = "Needs Practice";}
  580. else {$b = "Mastered";}
  581.  
  582. if (floatval($c) < 0.75){$c = "Struggling";}
  583. else if (floatval($c) >= 0.75 && floatval($c) <= 0.99 ){$c = "Needs Practice";}
  584. else {$c = "Mastered";}
  585.  
  586. if (floatval($d) < 0.75){$d = "Struggling";}
  587. else if (floatval($d) >= 0.75 && floatval($d) <= 0.99 ){$d = "Needs Practice";}
  588. else {$d = "Mastered";}
  589.  
  590. if (floatval($e) < 0.75){$e = "Struggling";}
  591. else if (floatval($e) >= 0.75 && floatval($e) <= 0.99 ){$e = "Needs Practice";}
  592. else {$e = "Mastered";}
  593.  
  594. if (floatval($f) < 0.75){$f = "Struggling";}
  595. else if (floatval($f) >= 0.75 && floatval($f) <= 0.99 ){$f = "Needs Practice";}
  596. else {$f = "Mastered";}
  597.  
  598. if (floatval($g) < 0.75){$g = "Struggling";}
  599. else if (floatval($g) >= 0.75 && floatval($g) <= 0.99 ){$g = "Needs Practice";}
  600. else {$g = "Mastered";}
  601.  
  602. if (floatval($h) < 0.75){$h = "Struggling";}
  603. else if (floatval($h) >= 0.75 && floatval($h) <= 0.99 ){$h = "Needs Practice";}
  604. else {$h = "Mastered";}
  605.  
  606. if (floatval($i) < 0.75){$i = "Struggling";}
  607. else if (floatval($i) >= 0.75 && floatval($i) <= 0.99 ){$i = "Needs Practice";}
  608. else {$i = "Mastered";}
  609.  
  610. if (floatval($j) < 0.75){$j = "Struggling";}
  611. else if (floatval($j) >= 0.75 && floatval($a) <= 0.99 ){$j = "Needs Practice";}
  612. else {$j = "Mastered";}
  613.  
  614. if (floatval($k) < 0.75){$k = "Struggling";}
  615. else if (floatval($k) >= 0.75 && floatval($a) <= 0.99 ){$k = "Needs Practice";}
  616. else {$k = "Mastered";}
  617. $no = array(
  618. "PronounCase" => $a,
  619. "PronounAntecedent" => $b,
  620. "WordPhrase" => $c,
  621. "Clauses" => $d,
  622. "Conciseness" => $e,
  623. "VerbForms" => $f,
  624. "SubjectAgreement" => $g,
  625. "Modifiers" => $h,
  626. "Parallelism" => $i,
  627. "Comparison" => $j,
  628. "ImprovingParagraphs" => $k
  629.  
  630. );
  631.  
  632. $this->load->library('parser');
  633.  
  634. $this->parser->parse('concept', $no);
  635.  
  636. }
  637.  
  638. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement