山东大学创新项目智研雅思先锋队 第九周

主要任务:优化考试流程与评价系统

设置考试开始提示

点击考试开始后创建新的examid,并且进入考试

评价系统优化并且生成提示

考试结束时,模型生成得分与评价,使用正则表达式分别提取得分与评价

评价模板

score:8,comment:考生回答流畅,能够清晰地表达自己的想法。在Part 1中,考生对于使用社交媒体的时间进行了明确的回答。在Part 2的个人陈述中,考生详细地描述了自己想要去放松的地方,并解释了原因。在Part 3的深入讨论中,考生能够针对问题进行讨论,表达自己的观点。虽然在某些方面可以进一步深入和扩展,但整体表现良好。

使用正则表达式提取出成绩和评价,返回前端并展示

public static ScoreAndComment extractFeedback(String message) {
        // 定义正则表达式
        String scoreRegex = "score:(\\d+)";
        String commentRegex = "comment:(.*)";

        // 编译正则表达式
        Pattern scorePattern = Pattern.compile(scoreRegex);
        Pattern commentPattern = Pattern.compile(commentRegex);

        // 创建匹配器
        Matcher scoreMatcher = scorePattern.matcher(message);
        Matcher commentMatcher = commentPattern.matcher(message);

        // 提取分数
        String score = null;
        if (scoreMatcher.find()) {
            score = scoreMatcher.group(1);
        }
        int scoreInt=Integer.parseInt(score);

        // 提取评论
        String comment = null;
        if (commentMatcher.find()) {
            comment = commentMatcher.group(1);
        }

        ScoreAndComment s=new ScoreAndComment();
        s.setComment(comment);
        s.setScore(scoreInt);
        return s;
    }

前端展示

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值