钱的错?我的错?

   虽然我我也喜欢钱,可是比起人与人之前的各种感情,我更喜欢在轻松,团结,充满欢笑的地方生活,学习,工作。原以为自己找到了这么一个地方,可是突如其来这个小小的事件,让我对周围的人和我原本很喜欢的公司失去了所有的信息,也让我从自己的理想状态回到了现实,终于明白为什么那么多人会去写相关职场方面的书,为什么那么多人会去读这些书。以前很好奇,人和人的相处不管什么时候不都是只要真诚相待,就会有好结果的么,现在才知道,即便不是你的过错,也会因为各种原因把你扯进去,成为大家矛盾的焦点,这样的生活和工作真的不是我想要。我真的好想对身边的哪些人说:我有错么,为什么你们一个个要要对我摆出一副爱理不理的态度,感觉像我欠了你们钱一样。这两天我也想明白了,人一旦走进职场,以后的发展态势真的不能完全像自己想的那么单纯,所以我告诉自己,有一天,我要变的很强大,让你们每个人不再像现在这样对待我!!!!

前端页面代码示例(使用jQuery实现): HTML部分: ```html <!-- 题目显示区域 --> <div id="question"> <p id="timu"></p> <input type="text" id="answer" placeholder="请输入答案" /> <button id="submit">提交</button> </div> <!-- 正确/误提示区域 --> <div id="result"></div> <!-- 我的题集区域 --> <div id="error-questions"> <h3>我的题集</h3> <ul id="error-list"></ul> </div> ``` JavaScript部分: ```javascript $(function() { // 随机获取一道题目 $.ajax({ url: "/getQuestion", type: "get", dataType: "json", success: function(data) { $("#timu").text(data.timu); } }); // 提交答案 $("#submit").click(function() { var answer = $("#answer").val(); $.ajax({ url: "/checkAnswer", type: "post", dataType: "json", data: {answer: answer}, success: function(data) { if (data.result == "correct") { $("#result").text("正确"); } else { $("#result").text("误"); } // 更新我的题集 updateErrorQuestions(); } }); }); // 更新我的题集 function updateErrorQuestions() { $.ajax({ url: "/getErrorQuestions", type: "get", dataType: "json", success: function(data) { var errorList = $("#error-list"); errorList.empty(); for (var i = 0; i < data.length; i++) { errorList.append("<li>" + data[i].timu + ",答案:" + data[i].answer + "</li>"); } } }); } }); ``` 后端代码示例(使用Spring+MyBatis实现): Controller部分: ```java @Controller public class QuestionController { @Autowired private QuestionService questionService; // 获取一道随机题目 @RequestMapping("/getQuestion") @ResponseBody public Question getQuestion() { return questionService.getRandomQuestion(); } // 检查答案是否正确 @RequestMapping(value = "/checkAnswer", method = RequestMethod.POST) @ResponseBody public Map<String, String> checkAnswer(@RequestParam("answer") String answer) { Map<String, String> result = new HashMap<String, String>(); if (questionService.checkAnswer(answer)) { result.put("result", "correct"); } else { result.put("result", "wrong"); } return result; } // 获取题集 @RequestMapping("/getErrorQuestions") @ResponseBody public List<Question> getErrorQuestions() { return questionService.getErrorQuestions(); } } ``` Service部分: ```java @Service public class QuestionService { @Autowired private QuestionMapper questionMapper; // 获取一道随机题目 public Question getRandomQuestion() { int total = questionMapper.getTotalQuestions(); int randomIndex = (int) (Math.random() * total); return questionMapper.getQuestionByIndex(randomIndex); } // 检查答案是否正确 public boolean checkAnswer(String answer) { Question question = getRandomQuestion(); boolean result = question.getAnswer().equals(answer); if (result) { question.setMark(0); questionMapper.updateQuestionMark(question); } else { question.setMark(1); questionMapper.updateQuestionMark(question); } return result; } // 获取题集 public List<Question> getErrorQuestions() { return questionMapper.getErrorQuestions(); } } ``` Mapper部分: ```java public interface QuestionMapper { int getTotalQuestions(); Question getQuestionByIndex(int index); void updateQuestionMark(Question question); List<Question> getErrorQuestions(); } ``` 以上代码仅为示例,实际实现中需要根据具体需求进行修改和完善。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值