首页 > 编程语言 >计算机毕业设计选题推荐-在线学习平台-Java/Python项目实战

计算机毕业设计选题推荐-在线学习平台-Java/Python项目实战

时间:2024-08-18 15:25:06浏览次数:10  
标签:EntityWrapper Java String Python params 毕业设计 put new ew

作者主页:IT研究室✨
个人简介:曾从事计算机专业培训教学,擅长Java、Python、微信小程序、Golang、安卓Android等项目实战。接项目定制开发、代码讲解、答辩教学、文档编写、降重等。
☑文末获取源码☑
精彩专栏推荐⬇⬇⬇
Java项目
Python项目
安卓项目
微信小程序项目

文章目录

一、前言

在线教育作为教育技术变革的产物,已经在国内外迅速兴起,成为教育服务的重要组成部分。根据《2021年中国在线教育行业市场现状、细分市场及发展趋势分析》报告,我国在线教育用户规模达到3.42亿,市场规模约达4230亿元,显示出在线教育行业的巨大潜力和发展空间。在线学习平台通过提供灵活的学习时间和丰富的学习资源,满足了不同用户群体的教育需求。

尽管在线教育行业发展迅速,但仍存在一些问题。例如,学生在使用在线学习平台时可能面临网络延迟或卡顿的问题,影响学习效率。此外,平台的交互性不足,导致师生之间难以实现有效沟通,降低了学习体验的质量。还有,一些在线教育平台的个性化服务和学习效果评估功能不够完善,难以满足用户的多样化需求。

本课题旨在设计并实现一个功能齐全、用户友好的在线学习平台,该平台将提供稳定的网络连接、丰富的学习资源、高效的师生互动、以及精准的学习效果评估。通过该系统,希望能够为用户带来更加便捷、高效、个性化的学习体验。

在在线学习平台中,管理员负责用户账户的创建与维护、课程内容的审核与更新、学习资源的整合与管理、平台功能的持续优化与升级;教师能够创建和发布课程、管理在线课堂、跟踪学生的学习进度、进行在线辅导和答疑;学生用户可以浏览课程目录、选择并参与课程学习、提交作业和参与讨论、接收学习反馈和进度报告。系统通过这些功能模块的整合,旨在提供一个全面、互动的在线学习环境,满足不同用户角色的需求,优化学习流程,提高教育质量。

本课题的研究具有重要的理论意义和实际意义。从理论角度来看,它为在线教育领域提供了新的研究思路,即如何利用信息技术提升在线学习体验和教学效果。从实际角度来看,在线学习平台的应用将有助于提高教育资源的利用效率,促进教育公平,提升学习者的自主学习能力,推动教育现代化的发展。同时,系统的推广应用还将为教育工作者提供更多的教学创新空间,为学习者创造更加开放和灵活的学习环境。

二、开发环境

  • 开发语言:Java/Python
  • 数据库:MySQL
  • 系统架构:B/S
  • 后端:SpringBoot/SSM/Django/Flask
  • 前端:Vue

三、系统界面展示

  • 在线学习平台界面展示:
    教师-课程信息管理:
    教师-课程信息管理
    教师-作业管理:
    教师-作业管理
    教师-试题管理:
    教师-试题管理
    学生-查看课程信息:
    学生-查看课程信息
    学生-填写作业:
    学生-填写作业
    学生-查看错题本:
    学生-查看错题本

四、代码参考

  • 项目实战代码参考:
@RestController
@RequestMapping("/kechengxinxi")
public class KechengxinxiController {
    @Autowired
    private KechengxinxiService kechengxinxiService;

    @Autowired
    private StoreupService storeupService;


    @Autowired
    private XuexikechengService xuexikechengService;

    


    /**
     * 后端列表
     */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params,KechengxinxiEntity kechengxinxi,
		HttpServletRequest request){
		String tableName = request.getSession().getAttribute("tableName").toString();
		if(tableName.equals("jiaoshi")) {
			kechengxinxi.setJiaoshigonghao((String)request.getSession().getAttribute("username"));
		}
        EntityWrapper<KechengxinxiEntity> ew = new EntityWrapper<KechengxinxiEntity>();

		PageUtils page = kechengxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, kechengxinxi), params), params));

        return R.ok().put("data", page);
    }
    
    /**
     * 前端列表
     */
	@IgnoreAuth
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params,KechengxinxiEntity kechengxinxi, 
		HttpServletRequest request){
        EntityWrapper<KechengxinxiEntity> ew = new EntityWrapper<KechengxinxiEntity>();

		PageUtils page = kechengxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, kechengxinxi), params), params));
        return R.ok().put("data", page);
    }

	/**
     * 列表
     */
    @RequestMapping("/lists")
    public R list( KechengxinxiEntity kechengxinxi){
       	EntityWrapper<KechengxinxiEntity> ew = new EntityWrapper<KechengxinxiEntity>();
      	ew.allEq(MPUtil.allEQMapPre( kechengxinxi, "kechengxinxi")); 
        return R.ok().put("data", kechengxinxiService.selectListView(ew));
    }

	 /**
     * 查询
     */
    @RequestMapping("/query")
    public R query(KechengxinxiEntity kechengxinxi){
        EntityWrapper< KechengxinxiEntity> ew = new EntityWrapper< KechengxinxiEntity>();
 		ew.allEq(MPUtil.allEQMapPre( kechengxinxi, "kechengxinxi")); 
		KechengxinxiView kechengxinxiView =  kechengxinxiService.selectView(ew);
		return R.ok("查询课程信息成功").put("data", kechengxinxiView);
    }
	
    /**
     * 后端详情
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Long id){
        KechengxinxiEntity kechengxinxi = kechengxinxiService.selectById(id);
		kechengxinxi.setClicknum(kechengxinxi.getClicknum()+1);
		kechengxinxiService.updateById(kechengxinxi);
        return R.ok().put("data", kechengxinxi);
    }

    /**
     * 前端详情
     */
	@IgnoreAuth
    @RequestMapping("/detail/{id}")
    public R detail(@PathVariable("id") Long id){
        KechengxinxiEntity kechengxinxi = kechengxinxiService.selectById(id);
		kechengxinxi.setClicknum(kechengxinxi.getClicknum()+1);
		kechengxinxiService.updateById(kechengxinxi);
        return R.ok().put("data", kechengxinxi);
    }
    



    /**
     * 后端保存
     */
    @RequestMapping("/save")
    public R save(@RequestBody KechengxinxiEntity kechengxinxi, HttpServletRequest request){
    	//ValidatorUtils.validateEntity(kechengxinxi);
        kechengxinxiService.insert(kechengxinxi);
        return R.ok();
    }
    
    /**
     * 前端保存
     */
    @RequestMapping("/add")
    public R add(@RequestBody KechengxinxiEntity kechengxinxi, HttpServletRequest request){
    	//ValidatorUtils.validateEntity(kechengxinxi);
        kechengxinxiService.insert(kechengxinxi);
        return R.ok();
    }




    /**
     * 修改
     */
    @RequestMapping("/update")
    @Transactional
    public R update(@RequestBody KechengxinxiEntity kechengxinxi, HttpServletRequest request){
        //ValidatorUtils.validateEntity(kechengxinxi);
        kechengxinxiService.updateById(kechengxinxi);//全部更新
        return R.ok();
    }

    /**
     * 审核
     */
    @RequestMapping("/shBatch")
    @Transactional
    public R update(@RequestBody Long[] ids, @RequestParam String sfsh, @RequestParam String shhf){
        List<KechengxinxiEntity> list = new ArrayList<KechengxinxiEntity>();
        for(Long id : ids) {
            KechengxinxiEntity kechengxinxi = kechengxinxiService.selectById(id);
            kechengxinxi.setSfsh(sfsh);
            kechengxinxi.setShhf(shhf);
            list.add(kechengxinxi);
        }
        kechengxinxiService.updateBatchById(list);
        return R.ok();
    }


    

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids){
        kechengxinxiService.deleteBatchIds(Arrays.asList(ids));
        return R.ok();
    }
    
	
	/**
     * 前端智能排序
     */
	@IgnoreAuth
    @RequestMapping("/autoSort")
    public R autoSort(@RequestParam Map<String, Object> params,KechengxinxiEntity kechengxinxi, HttpServletRequest request,String pre){
        EntityWrapper<KechengxinxiEntity> ew = new EntityWrapper<KechengxinxiEntity>();
        Map<String, Object> newMap = new HashMap<String, Object>();
        Map<String, Object> param = new HashMap<String, Object>();
		Iterator<Map.Entry<String, Object>> it = param.entrySet().iterator();
		while (it.hasNext()) {
			Map.Entry<String, Object> entry = it.next();
			String key = entry.getKey();
			String newKey = entry.getKey();
			if (pre.endsWith(".")) {
				newMap.put(pre + newKey, entry.getValue());
			} else if (StringUtils.isEmpty(pre)) {
				newMap.put(newKey, entry.getValue());
			} else {
				newMap.put(pre + "." + newKey, entry.getValue());
			}
		}
		params.put("sort", "clicknum");
        params.put("order", "desc");
		PageUtils page = kechengxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, kechengxinxi), params), params));
        return R.ok().put("data", page);
    }


    /**
     * 协同算法(基于用户的协同算法)
     */
    @RequestMapping("/autoSort2")
    public R autoSort2(@RequestParam Map<String, Object> params,KechengxinxiEntity kechengxinxi, HttpServletRequest request){
        String userName = (String)request.getSession().getAttribute("username");
        Integer limit = params.get("limit")==null?10:Integer.parseInt(params.get("limit").toString());
        List<XuexikechengEntity> xuexikechengList = xuexikechengService.selectList(new EntityWrapper<XuexikechengEntity>());
        Map<String, Map<String, Double>> ratings = new HashMap<>();
        if(xuexikechengList!=null && xuexikechengList.size()>0) {
            for(XuexikechengEntity xuexikecheng : xuexikechengList) {
                Map<String, Double> userRatings = null;
                if(ratings.containsKey(xuexikecheng.getZhanghao().toString())) {
                    userRatings = ratings.get(xuexikecheng.getZhanghao().toString());
                } else {
                    userRatings = new HashMap<>();
                    ratings.put(xuexikecheng.getZhanghao().toString(), userRatings);
                }
                if(userRatings.containsKey(xuexikecheng.getKechengleixing().toString())) {
                    userRatings.put(xuexikecheng.getKechengleixing().toString(), userRatings.get(xuexikecheng.getKechengleixing().toString())+1.0);
                } else {
                    userRatings.put(xuexikecheng.getKechengleixing().toString(), 1.0);
                }

            }
        }
        // 创建协同过滤对象
        UserBasedCollaborativeFiltering filter = new UserBasedCollaborativeFiltering(ratings);

        // 为指定用户推荐物品
        String targetUser = userName;
        int numRecommendations = limit;
        List<String> recommendations = filter.recommendItems(targetUser, numRecommendations);

        // 输出推荐结果
        System.out.println("Recommendations for " + targetUser + ":");
        for (String item : recommendations) {
            System.out.println(item);
        }

        EntityWrapper<KechengxinxiEntity> ew = new EntityWrapper<KechengxinxiEntity>();
        ew.in("kechengleixing", String.join(",", recommendations));
        if(recommendations!=null && recommendations.size()>0) {
            ew.last("order by FIELD(kechengleixing, "+"'"+String.join("','", recommendations)+"'"+")");
        }

        PageUtils page = kechengxinxiService.queryPage(params, ew);
        List<KechengxinxiEntity> pageList = (List<KechengxinxiEntity>)page.getList();
        if(pageList.size()<limit) {
            int toAddNum = limit-pageList.size();
            ew = new EntityWrapper<KechengxinxiEntity>();
            ew.notIn("kechengleixing", recommendations);
            ew.orderBy("id", false);
            ew.last("limit "+toAddNum);
            pageList.addAll(kechengxinxiService.selectList(ew));
        } else if(pageList.size()>limit) {
            pageList = pageList.subList(0, limit);
        }
        page.setList(pageList);

        return R.ok().put("data", page);
    }



    @RequestMapping("/importExcel")
    public R importExcel(@RequestParam("file") MultipartFile file){
        try {
            //获取输入流
            InputStream inputStream = file.getInputStream();
            //创建读取工作簿
            Workbook workbook = WorkbookFactory.create(inputStream);
            //获取工作表
            Sheet sheet = workbook.getSheetAt(0);
            //获取总行
            int rows=sheet.getPhysicalNumberOfRows();
            if(rows>1){
                //获取单元格
                for (int i = 1; i < rows; i++) {
                    Row row = sheet.getRow(i);
                    KechengxinxiEntity kechengxinxiEntity =new KechengxinxiEntity();
                    kechengxinxiEntity.setId(new Date().getTime());
                     
                    //想数据库中添加新对象
                    kechengxinxiService.insert(kechengxinxiEntity);//方法
                }
            }
            inputStream.close();
        } catch (InvalidFormatException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return R.ok("导入成功");
    }

    /**
     * (按值统计)
     */
    @RequestMapping("/value/{xColumnName}/{yColumnName}")
    public R value(@PathVariable("yColumnName") String yColumnName, @PathVariable("xColumnName") String xColumnName,HttpServletRequest request) {
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("xColumn", xColumnName);
        params.put("yColumn", yColumnName);
        EntityWrapper<KechengxinxiEntity> ew = new EntityWrapper<KechengxinxiEntity>();
		String tableName = request.getSession().getAttribute("tableName").toString();
		if(tableName.equals("jiaoshi")) {
            ew.eq("jiaoshigonghao", (String)request.getSession().getAttribute("username"));
		}
        List<Map<String, Object>> result = kechengxinxiService.selectValue(params, ew);
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        for(Map<String, Object> m : result) {
            for(String k : m.keySet()) {
                if(m.get(k) instanceof Date) {
                    m.put(k, sdf.format((Date)m.get(k)));
                }
            }
        }
        return R.ok().put("data", result);
    }

    /**
     * (按值统计(多))
     */
    @RequestMapping("/valueMul/{xColumnName}")
    public R valueMul(@PathVariable("xColumnName") String xColumnName,@RequestParam String yColumnNameMul, HttpServletRequest request) {
        String[] yColumnNames = yColumnNameMul.split(",");
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("xColumn", xColumnName);
        List<List<Map<String, Object>>> result2 = new ArrayList<List<Map<String,Object>>>();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        EntityWrapper<KechengxinxiEntity> ew = new EntityWrapper<KechengxinxiEntity>();
        String tableName = request.getSession().getAttribute("tableName").toString();
        if(tableName.equals("jiaoshi")) {
            ew.eq("jiaoshigonghao", (String)request.getSession().getAttribute("username"));
        }
        for(int i=0;i<yColumnNames.length;i++) {
            params.put("yColumn", yColumnNames[i]);
            List<Map<String, Object>> result = kechengxinxiService.selectValue(params, ew);
            for(Map<String, Object> m : result) {
                for(String k : m.keySet()) {
                    if(m.get(k) instanceof Date) {
                        m.put(k, sdf.format((Date)m.get(k)));
                    }
                }
            }
            result2.add(result);
        }
        return R.ok().put("data", result2);
    }

    /**
     * (按值统计)时间统计类型
     */
    @RequestMapping("/value/{xColumnName}/{yColumnName}/{timeStatType}")
    public R valueDay(@PathVariable("yColumnName") String yColumnName, @PathVariable("xColumnName") String xColumnName, @PathVariable("timeStatType") String timeStatType,HttpServletRequest request) {
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("xColumn", xColumnName);
        params.put("yColumn", yColumnName);
        params.put("timeStatType", timeStatType);
        EntityWrapper<KechengxinxiEntity> ew = new EntityWrapper<KechengxinxiEntity>();
        String tableName = request.getSession().getAttribute("tableName").toString();
        if(tableName.equals("jiaoshi")) {
            ew.eq("jiaoshigonghao", (String)request.getSession().getAttribute("username"));
        }
        List<Map<String, Object>> result = kechengxinxiService.selectTimeStatValue(params, ew);
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        for(Map<String, Object> m : result) {
            for(String k : m.keySet()) {
                if(m.get(k) instanceof Date) {
                    m.put(k, sdf.format((Date)m.get(k)));
                }
            }
        }
        return R.ok().put("data", result);
    }

    /**
     * (按值统计)时间统计类型(多)
     */
    @RequestMapping("/valueMul/{xColumnName}/{timeStatType}")
    public R valueMulDay(@PathVariable("xColumnName") String xColumnName, @PathVariable("timeStatType") String timeStatType,@RequestParam String yColumnNameMul,HttpServletRequest request) {
        String[] yColumnNames = yColumnNameMul.split(",");
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("xColumn", xColumnName);
        params.put("timeStatType", timeStatType);
        List<List<Map<String, Object>>> result2 = new ArrayList<List<Map<String,Object>>>();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        EntityWrapper<KechengxinxiEntity> ew = new EntityWrapper<KechengxinxiEntity>();
        String tableName = request.getSession().getAttribute("tableName").toString();
        if(tableName.equals("jiaoshi")) {
            ew.eq("jiaoshigonghao", (String)request.getSession().getAttribute("username"));
        }
        for(int i=0;i<yColumnNames.length;i++) {
            params.put("yColumn", yColumnNames[i]);
            List<Map<String, Object>> result = kechengxinxiService.selectTimeStatValue(params, ew);
            for(Map<String, Object> m : result) {
                for(String k : m.keySet()) {
                    if(m.get(k) instanceof Date) {
                        m.put(k, sdf.format((Date)m.get(k)));
                    }
                }
            }
            result2.add(result);
        }
        return R.ok().put("data", result2);
    }

    /**
     * 分组统计
     */
    @RequestMapping("/group/{columnName}")
    public R group(@PathVariable("columnName") String columnName,HttpServletRequest request) {
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("column", columnName);
        EntityWrapper<KechengxinxiEntity> ew = new EntityWrapper<KechengxinxiEntity>();
        String tableName = request.getSession().getAttribute("tableName").toString();
        if(tableName.equals("jiaoshi")) {
            ew.eq("jiaoshigonghao", (String)request.getSession().getAttribute("username"));
        }
        List<Map<String, Object>> result = kechengxinxiService.selectGroup(params, ew);
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        for(Map<String, Object> m : result) {
            for(String k : m.keySet()) {
                if(m.get(k) instanceof Date) {
                    m.put(k, sdf.format((Date)m.get(k)));
                }
            }
        }
        return R.ok().put("data", result);
    }




    /**
     * 总数量
     */
    @RequestMapping("/count")
    public R count(@RequestParam Map<String, Object> params,KechengxinxiEntity kechengxinxi, HttpServletRequest request){
        String tableName = request.getSession().getAttribute("tableName").toString();
        if(tableName.equals("jiaoshi")) {
            kechengxinxi.setJiaoshigonghao((String)request.getSession().getAttribute("username"));
        }
        EntityWrapper<KechengxinxiEntity> ew = new EntityWrapper<KechengxinxiEntity>();
        int count = kechengxinxiService.selectCount(MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, kechengxinxi), params), params));
        return R.ok().put("data", count);
    }



}

@RestController
@RequestMapping("/exampaper")
public class ExampaperController {
    @Autowired
    private ExampaperService exampaperService;




    @Autowired
    private ExamquestionService examquestionService;

    @Autowired
    private ExamquestionbankService examquestionbankService;

    @Autowired
    private ExamrecordService examrecordService;
    


    /**
     * 后端列表
     */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params,ExampaperEntity exampaper,
		HttpServletRequest request){
        EntityWrapper<ExampaperEntity> ew = new EntityWrapper<ExampaperEntity>();

		PageUtils page = exampaperService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, exampaper), params), params));

        return R.ok().put("data", page);
    }
    
    /**
     * 前端列表
     */
	@IgnoreAuth
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params,ExampaperEntity exampaper, 
		HttpServletRequest request){
        EntityWrapper<ExampaperEntity> ew = new EntityWrapper<ExampaperEntity>();

		PageUtils page = exampaperService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, exampaper), params), params));
        return R.ok().put("data", page);
    }

	/**
     * 列表
     */
    @RequestMapping("/lists")
    public R list( ExampaperEntity exampaper){
       	EntityWrapper<ExampaperEntity> ew = new EntityWrapper<ExampaperEntity>();
      	ew.allEq(MPUtil.allEQMapPre( exampaper, "exampaper")); 
        return R.ok().put("data", exampaperService.selectListView(ew));
    }

	 /**
     * 查询
     */
    @RequestMapping("/query")
    public R query(ExampaperEntity exampaper){
        EntityWrapper< ExampaperEntity> ew = new EntityWrapper< ExampaperEntity>();
 		ew.allEq(MPUtil.allEQMapPre( exampaper, "exampaper")); 
		ExampaperView exampaperView =  exampaperService.selectView(ew);
		return R.ok("查询线上测试表成功").put("data", exampaperView);
    }
	
    /**
     * 后端详情
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Long id){
        ExampaperEntity exampaper = exampaperService.selectById(id);
        return R.ok().put("data", exampaper);
    }

    /**
     * 前端详情
     */
	@IgnoreAuth
    @RequestMapping("/detail/{id}")
    public R detail(@PathVariable("id") Long id){
        ExampaperEntity exampaper = exampaperService.selectById(id);
        return R.ok().put("data", exampaper);
    }
    



    /**
     * 后端保存
     */
    @RequestMapping("/save")
    public R save(@RequestBody ExampaperEntity exampaper, HttpServletRequest request){
    	//ValidatorUtils.validateEntity(exampaper);
        exampaperService.insert(exampaper);
        return R.ok();
    }
    
    /**
     * 前端保存
     */
    @RequestMapping("/add")
    public R add(@RequestBody ExampaperEntity exampaper, HttpServletRequest request){
    	//ValidatorUtils.validateEntity(exampaper);
        exampaperService.insert(exampaper);
        return R.ok();
    }


     /**
     * 获取用户密保
     */
    @RequestMapping("/security")
    @IgnoreAuth
    public R security(@RequestParam String username){
        ExampaperEntity exampaper = exampaperService.selectOne(new EntityWrapper<ExampaperEntity>().eq("", username));
        return R.ok().put("data", exampaper);
    }


    /**
     * 修改
     */
    @RequestMapping("/update")
    @Transactional
    @IgnoreAuth
    public R update(@RequestBody ExampaperEntity exampaper, HttpServletRequest request){
        //ValidatorUtils.validateEntity(exampaper);
        exampaperService.updateById(exampaper);//全部更新
        return R.ok();
    }



    

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids){
        exampaperService.deleteBatchIds(Arrays.asList(ids));
        return R.ok();
    }
    
	
	/**
     * 前端智能排序
     */
	@IgnoreAuth
    @RequestMapping("/autoSort")
    public R autoSort(@RequestParam Map<String, Object> params,ExampaperEntity exampaper, HttpServletRequest request,String pre){
        EntityWrapper<ExampaperEntity> ew = new EntityWrapper<ExampaperEntity>();
        Map<String, Object> newMap = new HashMap<String, Object>();
        Map<String, Object> param = new HashMap<String, Object>();
		Iterator<Map.Entry<String, Object>> it = param.entrySet().iterator();
		while (it.hasNext()) {
			Map.Entry<String, Object> entry = it.next();
			String key = entry.getKey();
			String newKey = entry.getKey();
			if (pre.endsWith(".")) {
				newMap.put(pre + newKey, entry.getValue());
			} else if (StringUtils.isEmpty(pre)) {
				newMap.put(newKey, entry.getValue());
			} else {
				newMap.put(pre + "." + newKey, entry.getValue());
			}
		}
		params.put("sort", "clicktime");
        params.put("order", "desc");
		PageUtils page = exampaperService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, exampaper), params), params));
        return R.ok().put("data", page);
    }









    /**
     * 组卷
     */
    @RequestMapping("/compose")
    public R compose(HttpServletRequest request,@RequestParam Long paperid, @RequestParam String papername, @RequestParam Integer radioNum,
        @RequestParam Integer multipleChoiceNum, @RequestParam Integer determineNum, @RequestParam Integer fillNum, @RequestParam Integer subjectivityNum){
        //如果已存在考试记录,不能进行重新组卷
        if(examrecordService.selectCount(new EntityWrapper<ExamrecordEntity>().eq("paperid", paperid))>0) {
            return R.error("已存在考试记录,无法重新组卷");
        }
        //组卷之前删除该试卷之前的所有题目
        examquestionService.deleteByMap(new MapUtils().put("paperid", paperid));
        List<ExamquestionbankEntity> questionList = new ArrayList<ExamquestionbankEntity>();
        //单选题
        if(radioNum>0) {
            Integer radioSize = examquestionbankService.selectCount(new EntityWrapper<ExamquestionbankEntity>().eq("type", 0));
            if(radioSize<radioNum) {
                return R.error("单选题库不足");
            } else {
                Wrapper<ExamquestionbankEntity> ew = new EntityWrapper<ExamquestionbankEntity>();
                ew.eq("type", 0).orderBy("RAND()").last("limit "+radioNum);
                List<ExamquestionbankEntity> radioList = examquestionbankService.selectList(ew);
                questionList.addAll(radioList);
            }
        }
        //多选题
        if(multipleChoiceNum>0) {
            Integer multipleChoiceSize = examquestionbankService.selectCount(new EntityWrapper<ExamquestionbankEntity>().eq("type", 1));
            if(multipleChoiceSize<multipleChoiceNum) {
                return R.error("多选题库不足");
            } else {
                Wrapper<ExamquestionbankEntity> ew = new EntityWrapper<ExamquestionbankEntity>();
                ew.eq("type", 1).orderBy("RAND()").last("limit "+multipleChoiceNum);
                List<ExamquestionbankEntity> multipleChoiceList = examquestionbankService.selectList(ew);
                questionList.addAll(multipleChoiceList);
            }
        }
        //判断题
        if(determineNum>0) {
            Integer determineSize = examquestionbankService.selectCount(new EntityWrapper<ExamquestionbankEntity>().eq("type", 2));
            if(determineSize<determineNum) {
                return R.error("判断题库不足");
            } else {
                Wrapper<ExamquestionbankEntity> ew = new EntityWrapper<ExamquestionbankEntity>();
                ew.eq("type", 2).orderBy("RAND()").last("limit "+determineNum);
                List<ExamquestionbankEntity> determineList = examquestionbankService.selectList(ew);
                questionList.addAll(determineList);
            }
        }
        //填空题
        if(fillNum>0) {
            Integer fillSize = examquestionbankService.selectCount(new EntityWrapper<ExamquestionbankEntity>().eq("type", 3));
            if(fillSize<fillNum) {
                return R.error("填空题库不足");
            } else {
                Wrapper<ExamquestionbankEntity> ew = new EntityWrapper<ExamquestionbankEntity>();
                ew.eq("type", 3).orderBy("RAND()").last("limit "+fillNum);
                List<ExamquestionbankEntity> fillList = examquestionbankService.selectList(ew);
                questionList.addAll(fillList);
            }
        }
        //主观题
        if(subjectivityNum>0) {
            Integer subjectivitySize = examquestionbankService.selectCount(new EntityWrapper<ExamquestionbankEntity>().eq("type", 4));
            if(subjectivitySize<subjectivityNum) {
                return R.error("主观题库不足");
            } else {
                Wrapper<ExamquestionbankEntity> ew = new EntityWrapper<ExamquestionbankEntity>();
                ew.eq("type", 4).orderBy("RAND()").last("limit "+subjectivityNum);
                List<ExamquestionbankEntity> subjectivityList = examquestionbankService.selectList(ew);
                questionList.addAll(subjectivityList);
            }
        }
        if(questionList!=null && questionList.size()>0) {
            long seq = 0;
            for(ExamquestionbankEntity q : questionList) {
                ExamquestionEntity examquestion = new ExamquestionEntity();
                examquestion.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
                examquestion.setPaperid(paperid);
                examquestion.setPapername(papername);
                examquestion.setQuestionname(q.getQuestionname());
                examquestion.setOptions(q.getOptions());
                examquestion.setScore(q.getScore());
                examquestion.setAnswer(q.getAnswer());
                examquestion.setAnalysis(q.getAnalysis());
                examquestion.setType(q.getType());
                examquestion.setSequence(++seq);
                examquestionService.insert(examquestion);
            }
        }
        return R.ok();
    }

}

五、论文参考

  • 计算机毕业设计选题推荐-在线学习平台论文参考:
    计算机毕业设计选题推荐-在线学习平台论文参考

六、系统视频

在线学习平台项目视频:

<iframe allowfullscreen="true" data-mediaembed="csdn" frameborder="0" id="bipFu4y4-1723867336586" src="https://live.csdn.net/v/embed/418119"></iframe>

计算机毕业设计选题推荐-在线学习平台-Java/Python

结语

计算机毕业设计选题推荐-在线学习平台-Java/Python项目实战
大家可以帮忙点赞、收藏、关注、评论啦~
源码获取:⬇⬇⬇

精彩专栏推荐⬇⬇⬇
Java项目
Python项目
安卓项目
微信小程序项目

标签:EntityWrapper,Java,String,Python,params,毕业设计,put,new,ew
From: https://blog.csdn.net/2301_79456892/article/details/141277820

相关文章

  • 计算机毕业设计选题推荐-宾馆酒店客房管理系统-民宿管理系统-Java/Python项目实战
    ✨作者主页:IT研究室✨个人简介:曾从事计算机专业培训教学,擅长Java、Python、微信小程序、Golang、安卓Android等项目实战。接项目定制开发、代码讲解、答辩教学、文档编写、降重等。☑文末获取源码☑精彩专栏推荐⬇⬇⬇Java项目Python项目安卓项目微信小程序项目......
  • 计算机毕业设计选题推荐-高校实验室管理系统-Java/Python项目实战
    ✨作者主页:IT研究室✨个人简介:曾从事计算机专业培训教学,擅长Java、Python、微信小程序、Golang、安卓Android等项目实战。接项目定制开发、代码讲解、答辩教学、文档编写、降重等。☑文末获取源码☑精彩专栏推荐⬇⬇⬇Java项目Python项目安卓项目微信小程序项目......
  • java计算机毕业设计在线教育平台系统(开题+程序+论文)
    本系统(程序+源码)带文档lw万字以上 文末可获取一份本项目的java源码和数据库参考。系统程序文件列表开题报告内容研究背景随着互联网技术的飞速发展,教育资源的获取方式正经历着前所未有的变革。传统教育模式受限于时间、空间及资源分配不均等问题,难以满足广大学习者多元化......
  • java计算机毕业设计校园物品私人订制平台(开题+程序+论文)
    本系统(程序+源码)带文档lw万字以上 文末可获取一份本项目的java源码和数据库参考。系统程序文件列表开题报告内容研究背景随着教育环境的日益多样化和学生个性化需求的增长,传统校园商业模式已难以满足学生群体对独特、专属学习生活用品的追求。当前市场上虽不乏各类电商平......
  • java计算机毕业设计网上竞拍系统(开题+程序+论文)
    本系统(程序+源码)带文档lw万字以上 文末可获取一份本项目的java源码和数据库参考。系统程序文件列表开题报告内容研究背景随着互联网技术的飞速发展,电子商务已成为全球经济的重要组成部分,其中网上竞拍作为一种新兴的交易模式,正逐渐改变着人们的购物习惯。传统拍卖活动受限......
  • Java面试题———Redis篇①
    目录1、项目中为什么用Redis2、Redis的数据类型有哪些3、Redis为什么这么快4、Redis的过期删除策略有哪些5、Redis的内存淘汰策略有哪些6、Redis的RDB和AOF区别7、RDB期间可以同时处理写请求吗8、Redis集群有哪些方案1、项目中为什么用Redis我们项目中之所以选择R......
  • Java面试题———JVM篇
    目录1、JVM的主要组成部分有哪些2、堆栈的区别是什么3、JVM的类加载器有哪些4、什么是双亲委派模型5、说一下类加载器的执行过程6、怎么判断对象是否可以被回收7、JVM的垃圾回收算法有哪些8、JVM的垃圾回收器都有哪些1、JVM的主要组成部分有哪些JVM主要分为下面几......
  • 最新版Java面试题及答案整理(程序员必备)
    1、java为什么要有包装类型?主要原因包括以下几点:处理基本数据类型的null值:基本数据类型(如int,double等)不能直接赋值为null,而包装类型(如Integer、Double)可以表示null值,这对于某些业务逻辑和数据处理来说非常有用。提供额外功能:包装类型提供了一些额外的方法和功能,这些......
  • 零基础学习人工智能—Python—Pytorch学习(五)
    前言上文有一些文字打错了,已经进行了修正。本文主要介绍训练模型和使用模型预测数据,本文使用了一些numpy与tensor的转换,忘记的可以第二课的基础一起看。线性回归模型训练结合numpy使用首先使用datasets做一个数据X和y,然后结合之前的内容,求出y_predicted。#pipinstallmatp......
  • JavaEE篇:多线程(1)
    一认识线程(Thread)1.1概念1.1.1线程是什么?线程被创建出来是为了完成分配给它的任务。线程又称轻量级进程,是操作系统的基本调度单位。一个线程就是一个执行流。线程的创建销毁和切换都比进程更加的方便。进程是操作系统分配资源的基本单位,线程的创建和释放不涉及资源分配......