From 991cb0ed962f348761ad473aa5ce5c0da12333ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davi=20Ant=C3=B4nio?= <30875784+DaviAntonio@users.noreply.github.com> Date: Thu, 30 Mar 2023 11:48:17 +0000 Subject: Release 1.5.18-1 (#28) * Update version info and year The following files were updated to the next version to be released and the current year: - src/version - src/versionnum.php * Release 1.5.17-1 Update changelog with all the changes made since its last update on commit 818abd88. * Format code with black 23.1.0 * Release 1.5.18-1 Update changelog with all the changes made since its last update on commit 194f6764. --- src/admin/report/barplot.py | 16 ++++++------- src/admin/report/piechart.py | 57 ++++++++++++++++++++++++++++---------------- 2 files changed, 44 insertions(+), 29 deletions(-) (limited to 'src') diff --git a/src/admin/report/barplot.py b/src/admin/report/barplot.py index d07f156..edc9df1 100644 --- a/src/admin/report/barplot.py +++ b/src/admin/report/barplot.py @@ -5,23 +5,23 @@ filename = sys.argv[1] title = sys.argv[2] -x = [str(x) + '-' + str(x+10) for x in range(0,300,10)] +x = [str(x) + "-" + str(x + 10) for x in range(0, 300, 10)] -with open(filename,'r') as file: +with open(filename, "r") as file: y = [int(line) for line in file] # Create a bar plot -plt.bar(x, y,width=0.5) +plt.bar(x, y, width=0.5) # Set the y-axis tick labels to step by 5 plt.xticks(rotation=90) -if(max(y)<200): - plt.yticks(range(0, max(y)+1, 5)) +if max(y) < 200: + plt.yticks(range(0, max(y) + 1, 5)) else: - plt.yticks(range(0, max(y)+1, 10)) + plt.yticks(range(0, max(y) + 1, 10)) # Add gridlines to the y-axis -plt.grid(axis='y') +plt.grid(axis="y") # Add a title to the plot plt.title(title) @@ -29,4 +29,4 @@ plt.title(title) plt.tight_layout() # Show the plot -plt.savefig(filename.replace('.txt','.png'),dpi=600,transparent=True) +plt.savefig(filename.replace(".txt", ".png"), dpi=600, transparent=True) diff --git a/src/admin/report/piechart.py b/src/admin/report/piechart.py index 75e5a9d..70904bb 100644 --- a/src/admin/report/piechart.py +++ b/src/admin/report/piechart.py @@ -4,37 +4,52 @@ import sys filename = sys.argv[1] title = sys.argv[2] -label=[] -value=[] +label = [] +value = [] color = [] -with open(filename,'r') as f: +with open(filename, "r") as f: for line in f: tokens = line.split() c = tokens[-1] - problem_data = ' '.join(tokens[0:-1]) - l,v = problem_data.split(':') - if(int(v)>0): - label.append(l+'('+v+')') + problem_data = " ".join(tokens[0:-1]) + l, v = problem_data.split(":") + if int(v) > 0: + label.append(l + "(" + v + ")") value.append(v) color.append(c) -wedges, texts, autotexts = plt.pie(value, colors=color,autopct=lambda p: '{:.1f}%'.format(round(p)) if p > 0 else '',pctdistance=1.2,wedgeprops= {"edgecolor":"black", - 'linewidth': 1, - 'antialiased': False}) +wedges, texts, autotexts = plt.pie( + value, + colors=color, + autopct=lambda p: "{:.1f}%".format(round(p)) if p > 0 else "", + pctdistance=1.2, + wedgeprops={"edgecolor": "black", "linewidth": 1, "antialiased": False}, +) -plt.legend(wedges, label, - loc="center left", - bbox_to_anchor=(1.1, 0, 0.5,1)) +plt.legend(wedges, label, loc="center left", bbox_to_anchor=(1.1, 0, 0.5, 1)) # Add title -plt.title(title,pad=20) -if(len(sys.argv)<=3): - plt.legend(label, bbox_to_anchor=(1.1,0.5), loc="center right", fontsize=10, - bbox_transform=plt.gcf().transFigure,shadow=True) +plt.title(title, pad=20) +if len(sys.argv) <= 3: + plt.legend( + label, + bbox_to_anchor=(1.1, 0.5), + loc="center right", + fontsize=10, + bbox_transform=plt.gcf().transFigure, + shadow=True, + ) else: - plt.legend(label,loc="lower center", bbox_to_anchor=(0.5,-0.1), fontsize=10, - bbox_transform=plt.gcf().transFigure,shadow=True) + plt.legend( + label, + loc="lower center", + bbox_to_anchor=(0.5, -0.1), + fontsize=10, + bbox_transform=plt.gcf().transFigure, + shadow=True, + ) # Show plot # plt.tight_layout() -plt.savefig(filename.replace('.txt','.png'),dpi=600,transparent=True, bbox_inches="tight") - +plt.savefig( + filename.replace(".txt", ".png"), dpi=600, transparent=True, bbox_inches="tight" +) -- cgit v1.2.3 From 98d9dd26e241b0a7a494af02262ab5e1f7eb3aa4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Laiola=20Guimar=C3=A3es?= Date: Mon, 17 Apr 2023 09:13:40 -0300 Subject: Update autojudging.php (#30) --- src/private/autojudging.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/private/autojudging.php b/src/private/autojudging.php index e44aaeb..83e2bdd 100755 --- a/src/private/autojudging.php +++ b/src/private/autojudging.php @@ -79,10 +79,10 @@ $key=md5(mt_rand() . rand() . mt_rand()); $cf = globalconf(); $ip = $cf["ip"]; -$activecontest=DBGetActiveContest(); $prevsleep=0; //$dodebug=1; while(42) { + $activecontest=DBGetActiveContest(); if(($run = DBGetRunToAutojudging($activecontest["contestnumber"], $ip)) === false) { if($prevsleep==0) -- cgit v1.2.3 From b7c5e309c728840a42eeec3113f2f58f6834eed9 Mon Sep 17 00:00:00 2001 From: Daniel Saad Nogueira Nunes Date: Thu, 24 Aug 2023 22:13:57 -0300 Subject: fscore.php: now CE, Name Mismatch and Contact staff do not generate penalties. (#31) --- src/fscore.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/fscore.php b/src/fscore.php index 6faeb63..df3fce3 100644 --- a/src/fscore.php +++ b/src/fscore.php @@ -365,10 +365,13 @@ function DBScoreSite($contest, $site, $verifylastmile, $hor=-1, $data=null) { $resp[$user . '-' . $site]["problem"][$problem]["count"] = 0; while ($i<$n && $a[$i]["anstime"] <= $ta && $a[$i]["user"]==$user && $a[$i]["problem"]==$problem && $a[$i]["yes"]!='t') { - $time += (int) (($ct["contestpenalty"])/60); - $k++; - $i++; + // now CE, Name Mismatch and Contact Staff do not generate penalties + if($a[$i]["answer"] != '2' && $a[$i]["answer"] != '7' && $a[$i]["answer"] != '8') + $time += (int) (($ct["contestpenalty"])/60); + $k++; + $i++; } + $resp[$user . '-' . $site]["problem"][$problem]["count"] = $k; if ($i>=$n) break; -- cgit v1.2.3 From 8431900f5f128ea29394b9e51c3febd4b92e1a22 Mon Sep 17 00:00:00 2001 From: Daniel Saad Nogueira Nunes Date: Thu, 24 Aug 2023 23:08:55 -0300 Subject: scorelower.php: usernames starting with scoreboss* bypass the frozen scoreboard (#32) --- src/scorelower.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/scorelower.php b/src/scorelower.php index 62165f1..f4b88b1 100644 --- a/src/scorelower.php +++ b/src/scorelower.php @@ -36,6 +36,9 @@ if($_SESSION["usertable"]["usertype"]=='staff') $ver=false; if($_SESSION["usertable"]["usertype"]=="score") $des=false; else $des=true; +if($_SESSION["usertable"]["usertype"]=="score" && substr($_SESSION["usertable"]["username"],0,9) == "scoreboss" ) $ver=false; + + // temp do carlinhos (placar de judge == placar de time) //if ($_SESSION["usertable"]["usertype"]=="judge") $ver = true; -- cgit v1.2.3