vanmesure / datastructure Goto Github PK
View Code? Open in Web Editor NEW在线提交代码测试
在线提交代码测试
这个网站是出于个人兴趣所做,主要功能是可以在线做一些c语言的编程题目,然后提交给服务器,服务器再返回结果。 用到的都是很基础的技术:html css ajax php ,服务器端负责编译运行的程序则是由java来写的。 用到的框架主要是 H-ui,CodeMirror 没有写后台,所以维护起来比较麻烦。new/里边为站点的全部资源,java/里边则是服务器端java程序的源码。 后期维护主要是以下几个方面: 1.数据库 2.增加新的题目 3.··· 0.目录结构(加*号的为维护时可能要用到的文件或目录,部分内容已省略,仅列出重要的) new |————index.php 跳转用页面 | |————code/ 主目录 | | | |————index.php 登录页面 | |————images/ 图片目录 | |————pages/ | | | | | |———logincheck.php 登录处理,由登录页面请求 | | |———getCode.php 获取代码(从question目录中) | | |———receive.php 提交代码(将提交的代码插入数据库) * | | |———qList.php 题目清单页面 | | |———getResult.php 查询结果 * | | |———compile/ 所有代码在该目录下被编译测试 * | | | |——test.jar 测试用java程序,整个网站的核心(java -jar test.jar) | | |——css/ css目录 | | |——js/ js目录 * | | |——qPages/ 存放题目页面(该目录下的页面请严格按照 “q题号.php” 命名,如“q2.php”) * | | |——questions/ 存放题目代码 (该目录下的文件请严格按照 “q题号.txt” 命名, 如“q2.txt”) 1.数据库 newds一共有两个表,表的结构如下: newds |——student_info | |————username: 用户名 | |————password: 密码 | |————name: 姓名 | |————class: 班级 | |————student_code |————username: 用户名 |————qID: 题号 |————code: 代码 |————status: 状态号 (0-待处理 1-编译错误 2-运行错误 3-通过) |————result: 结果 |————error_info 错误结果 (暂时不用) 2.增加新题目 请注意0中加*的目录或者文件,增加题目按照以下步骤: · 提交一个测试用c文件在compile目录下,命名规则为 "q + 题号 + _test.c", 例如 q1_test.c,该目录下的"_student.c"文件为自动生成的。 · 提交题目代码到qusetions目录下,命名规则为 “q + 题号 + .txt”,如 q1.txt · 代码准备工作完成,下面开始更新页面。首先更改qList.php页面, 其中.row类为一行, .qbox-a类为一个题目块,按需复制粘贴,更改对应的说明、超链接即可 · 在qPages目录下创建对应的题目页面,创建方法为复制粘贴一个已有的题目页面,然后按照"q题号.php"的命名规则改名, 然后修改代码中的两处(已经用注释标出),第一处在代码开头,修改_SESSION全局变量的qID为对应题号。第二处为<aside>中的说明性文字 关于题目: * 测试用程序的所有printf()都将插入到result字段中,因此可以方便的加入一些说明性文字。 * 有一点必须要注意,所有测试通过的程序,都要在最后输出一个 printf("0")或者printf("1"),最好是单独一行,test.jar是通过检测这个值来判断程序是否跑通的,如果是其他情况,请输出其他值。 * 测试程序main()函数必须有返回值,如果程序正确,返回0;错误的话,返回任意其他值 * 另外,这个值也将作为结果被插入result,editor页面已经做了相应的处理,因此不会输出到页面上。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.