Explorar o código

Seperate tech regulation, and add way to get GitHub push date

Xi Ruoyao %!s(int64=5) %!d(string=hai) anos
pai
achega
15f1a81852
Modificáronse 3 ficheiros con 55 adicións e 19 borrados
  1. 27 0
      get_github_push_date.sh
  2. 1 19
      rule-online.md
  3. 27 0
      tech-regulation.md

+ 27 - 0
get_github_push_date.sh

@@ -0,0 +1,27 @@
+#!/bin/sh
+
+echo -n "Enter your GitHub username: "
+read username
+echo -n "Enter the owner of the repository: "
+read owner
+echo -n "Enter the name of the repository: "
+read repo
+echo -n "Enter the commit SHA: "
+read sha
+
+node_id=$(curl \
+  "https://api.github.com/repos/${owner}/${repo}/commits/${sha}" \
+  2> /dev/null | grep node_id | head -n1 | sed 's@^.*"\(.*\)".*$@\1@')
+echo $node_id
+
+curl -u "${username}" -X POST -d " \
+  { \
+    \"query\": \"query { \
+      node(id: \\\"${node_id}\\\") { \
+        ... on Commit { \
+          message \
+          pushedDate \
+        } \
+      } \
+    }\" \
+  } " https://api.github.com/graphql

+ 1 - 19
rule-online.md

@@ -13,7 +13,7 @@
 代码在**比赛开始前**已经编写好并**发布**的;  
 代码是使用**比赛开始前**已经编写好并**发布**的工具生成的;  
 对于以上例外情况,选手有义务提供**发布时间**的确凿证据。
-有效证据的列表见附录 1,裁判组有权驳回其他证据。
+有效证据的列表见技术条例规定,裁判组有权驳回技术条例规定之外的证据。
 
 3. 有以下情形之一者,构成比赛特别重大违纪,**应当**给予封号、取消成绩、
 禁赛 4 年处罚:  
@@ -132,21 +132,3 @@
 自 2019 年校程序设计竞赛网络赛开始正式实行。如对本规则有任何意见,
 请在比赛开始前或结束后提出。比赛期间质疑本规则的,
 一律按照第 5 条之规定处理。
-
-## 附录 1:代码发布时间的确认方法
-
-1. 根据 [Baidu](https://www.baidu.com)、[Google](https://www.google.com)
-等知名搜索引擎的快照时间确定,如快照日期**严格小于**比赛开始日期,
-则认定该代码系比赛开始前发布。注意比赛期间快照日期可能变化。
-
-2. 根据 [Wayback Machine](https://web.archive.org) 确定,
-例如某代码发布于 `https://example.org/orz` ,
-比赛开始时间为 2019 年 01 月 02 日 11 时 22 分 33 秒,如访问 URL
-`https://web.archive.org/20190102032232/https://example.org/orz`
-可以看到代码,则认定该代码系比赛开始前发布。注意时区需要换算为 UTC。
-
-3. 根据 [Codeforces](https://codeforces.com) 等知名 OJ 的提交日期确定。
-
-4. 根据书籍 ISBN 查询出版日期,以官方或知名数据库(Springer 等)为准。
-
-5. 因为 Git 版本控制系统中的提交时间可以伪造,**不能**作为有效证据。

+ 27 - 0
tech-regulation.md

@@ -0,0 +1,27 @@
+# 西安电子科技大学程序设计竞赛技术条例
+
+与比赛规则不同,本条例是技术文档,
+在任何时候(包括比赛过程中)都可对本条例提出技术问题和修改意见。
+
+## 代码发布时间的确认方法
+
+1. 根据 [Baidu](https://www.baidu.com)、[Google](https://www.google.com)
+等知名搜索引擎的快照时间确定,以快照时间作为代码发布时间。
+注意比赛期间快照时间可能变化。
+
+2. 根据 [Wayback Machine](https://web.archive.org) 确定,
+例如某代码发布于 `https://example.org/orz` ,
+比赛开始时间为 2019 年 01 月 02 日 11 时 22 分 33 秒,如访问 URL
+`https://web.archive.org/20190102032232/https://example.org/orz`,
+可以看到代码,则以 Wayback Machine 给出的缓存时间作为代码公布时间。
+否则,认定代码系比赛开始后发布。
+如果选手有自己上传的模板,或者其他希望在比赛中使用的在线模板,
+可以在比赛开始前通过 Wayback Machine 访问模板所在的页面,这样
+Wayback Machine 就会对该页面进行缓存,以留存证据。
+
+3. 根据 [Codeforces](https://codeforces.com) 等知名 OJ 的提交日期确定。
+
+4. 根据书籍 ISBN 查询出版日期,以官方或知名数据库(Springer 等)为准。
+
+5. GitHub 中的代码可以使用附带的 `get_github_push_date.sh` 获取**推送**
+日期。Git 的提交日期可以伪造,不能作为证据。