Advertisement
spacerose

кр

May 20th, 2021
792
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5.70 KB | None | 0 0
  1.     @PostMapping("/noun/testChecked")
  2.     public String testCheck(@RequestParam String a1, String a2, String a3, String a4, String a5, String a6,
  3.                             String a7, Model model) {
  4. //        if(!password.equals(password2)){
  5. //            model.addAttribute("Status", "password!=password2");
  6. //            return "user/signUp";
  7. //        }
  8. //        else {
  9. //         {
  10.  
  11. //        Phone phone = new Phone();
  12. //        phone.setName(name);
  13. //        phone.setCreationYear(creationYear);
  14. //        phone.setManufacture(manufactureDAO.show(manufacture_id));
  15. //        phoneDAO.save(phone);
  16. //        emailService.MailSender(phone);
  17.         if (a1.equals("apples")) {
  18.             model.addAttribute("Status1", "correct");
  19.         } else {
  20.             model.addAttribute("Status1", "wrong");
  21.         }
  22.         if (a2.equals("tomatoes")) {
  23.             model.addAttribute("Status2", "correct");
  24.         } else {
  25.             model.addAttribute("Status2", "wrong");
  26.         }
  27.         if (a3.equals("wolves")) {
  28.             model.addAttribute("Status3", "correct");
  29.         } else {
  30.             model.addAttribute("Status3", "wrong");
  31.         }
  32.         if (a4.equals("children")) {
  33.             model.addAttribute("Status4", "correct");
  34.         } else {
  35.             model.addAttribute("Status4", "wrong");
  36.         }
  37.         if (a5.equals("boxes")) {
  38.             model.addAttribute("Status5", "correct");
  39.         } else {
  40.             model.addAttribute("Status5", "wrong");
  41.         }
  42.         if (a6.equals("shoes")) {
  43.             model.addAttribute("Status6", "correct");
  44.         } else {
  45.             model.addAttribute("Status6", "wrong");
  46.         }
  47.         if (a7.equals("skies")) {
  48.             model.addAttribute("Status7", "correct");
  49.         } else {
  50.             model.addAttribute("Status7", "wrong");
  51.         }
  52.  
  53.         return "user/english/nountest";
  54.  
  55.     }
  56.  
  57.     @GetMapping("/adjective/test")
  58.     public String testAdj() {
  59.         return "user/english/adjtest";
  60.     }
  61.  
  62.     @PostMapping("/adjective/testChecked")
  63.     public String test2Check(@RequestParam String a1, String a2, String a3, String a4, String a5, String a6,
  64.                              String a7, Model model) {
  65. //        if(!password.equals(password2)){
  66. //            model.addAttribute("Status", "password!=password2");
  67. //            return "user/signUp";
  68. //        }
  69. //        else {
  70. //         {
  71.  
  72. //        Phone phone = new Phone();
  73. //        phone.setName(name);
  74. //        phone.setCreationYear(creationYear);
  75. //        phone.setManufacture(manufactureDAO.show(manufacture_id));
  76. //        phoneDAO.save(phone);
  77. //        emailService.MailSender(phone);
  78.         if (a1.equals("easier")) {
  79.             model.addAttribute("Status1", "correct");
  80.         } else {
  81.             model.addAttribute("Status1", "wrong");
  82.         }
  83.         if (a2.equals("higher")) {
  84.             model.addAttribute("Status2", "correct");
  85.         } else {
  86.             model.addAttribute("Status2", "wrong");
  87.         }
  88.         if (a3.equals("most beautiful")) {
  89.             model.addAttribute("Status3", "correct");
  90.         } else {
  91.             model.addAttribute("Status3", "wrong");
  92.         }
  93.         if (a4.equals("elder")) {
  94.             model.addAttribute("Status4", "correct");
  95.         } else {
  96.             model.addAttribute("Status4", "wrong");
  97.         }
  98.         if (a5.equals("worst")) {
  99.             model.addAttribute("Status5", "correct");
  100.         } else {
  101.             model.addAttribute("Status5", "wrong");
  102.         }
  103.         if (a6.equals("better")) {
  104.             model.addAttribute("Status6", "correct");
  105.         } else {
  106.             model.addAttribute("Status6", "wrong");
  107.         }
  108.         if (a7.equals("safest")) {
  109.             model.addAttribute("Status7", "correct");
  110.         } else {
  111.             model.addAttribute("Status7", "wrong");
  112.         }
  113.  
  114.         return "user/english/adjtest";
  115.  
  116.     }
  117.  
  118.     @GetMapping("/verb/test")
  119.     public String testVerb() {
  120.         return "user/english/verbtest";
  121.     }
  122.  
  123.     @PostMapping("/verb/testChecked")
  124.     public String test3Check(@RequestParam String a1, String a2, String a3, String a4, String a5, String a6,
  125.                              String a7, Model model) {
  126.  
  127. //        Phone phone = new Phone();
  128. //        phone.setName(name);
  129. //        phone.setCreationYear(creationYear);
  130. //        phone.setManufacture(manufactureDAO.show(manufacture_id));
  131. //        phoneDAO.save(phone);
  132. //        emailService.MailSender(phone);
  133.         if (a1.equals("easier")) {
  134.             model.addAttribute("Status1", "correct");
  135.         } else {
  136.             model.addAttribute("Status1", "wrong");
  137.         }
  138.         if (a2.equals("higher")) {
  139.             model.addAttribute("Status2", "correct");
  140.         } else {
  141.             model.addAttribute("Status2", "wrong");
  142.         }
  143.         if (a3.equals("most beautiful")) {
  144.             model.addAttribute("Status3", "correct");
  145.         } else {
  146.             model.addAttribute("Status3", "wrong");
  147.         }
  148.         if (a4.equals("elder")) {
  149.             model.addAttribute("Status4", "correct");
  150.         } else {
  151.             model.addAttribute("Status4", "wrong");
  152.         }
  153.         if (a5.equals("worst")) {
  154.             model.addAttribute("Status5", "correct");
  155.         } else {
  156.             model.addAttribute("Status5", "wrong");
  157.         }
  158.         if (a6.equals("better")) {
  159.             model.addAttribute("Status6", "correct");
  160.         } else {
  161.             model.addAttribute("Status6", "wrong");
  162.         }
  163.         if (a7.equals("safest")) {
  164.             model.addAttribute("Status7", "correct");
  165.         } else {
  166.             model.addAttribute("Status7", "wrong");
  167.         }
  168.  
  169.         return "user/english/verbtest";
  170.  
  171.     }
  172.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement