# mathematical-generator **Repository Path**: bbfbbf/mathematical-generator ## Basic Information - **Project Name**: mathematical-generator - **Description**: No description available - **Primary Language**: Java - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2018-01-31 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 口算题生成 小学老师要手动出口算题和比较大小题,实在受不了每天编写算术题了,简单写了一个小程序,一次全部生成,打印出来每天做一页。 word模板,是建好一个doc文件,另存为xml。然后使用freemarker直接渲染出来的。 ## 简单用法 设置MathService里面的常量 **MATH_MAX** 来控制口算题的范围。 比如20以内,则 MATH_MAX = 20 ````java /** * 创建口算文件 * @param arithmeticCount 口算题目数量 * @param comparisonCount 比较大小题目数量 * @param fileName 文件名 * @param userName 答题人 * @param ct 题目页数 * @return 成功返回文件全名,失败抛异常 * @throws Exception 生成文件异常 */ public String createMathFile(int arithmeticCount, int comparisonCount, String fileName, String userName, int ct) throws Exception { } ```` 调用示例: ````java // 口算题20道,比较大小题10道;生成30组 new mathService.createMathFile(20, 10, "d:/multiPageFormula.doc", "姓名:", 30); ````