Skip to content
Open
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
a5acd69
i_1006 Add initial code changes for scoring problems
johnbrvc Sep 18, 2024
994a00d
i_1006 Added junit for ContestImportUtilities
johnbrvc Sep 19, 2024
f9644a9
i_1006 Fix JUnit tests and rebase errors
johnbrvc Jun 23, 2025
c4e49fa
i_1006 Rework for legacy TestDataGroup specification
johnbrvc Jul 5, 2025
c0bf453
i_1006 Remove debug prints from JUnit test
johnbrvc Jul 5, 2025
2e5986d
i_1006 Read problem test data using new TestDataGroup
johnbrvc Jul 6, 2025
a800aee
i_1006 Add Legacy Default Grader with JUnits
johnbrvc Jul 7, 2025
53d0cf7
i_1006 Fix bugs found by JUnit
johnbrvc Jul 8, 2025
c3f775b
i_1006 Adjust JUnits for new TestDataGroups
johnbrvc Jul 9, 2025
e1e622a
i1006: add "pointscoring" sample contest (v.1)
Jul 10, 2025
1d6262c
i1006 Fix JUnits to include ensureStaticLog()
johnbrvc Jul 10, 2025
5717d21
i_1006 Fix JUnit issues
johnbrvc Jul 10, 2025
8b22eb6
i1006: update "pointscoring" contest.yaml to specify "scoreboard-type"
Jul 10, 2025
5c17389
Merge pull request #1142 from johnbrvc/i1006_scoring_algorithm_changes
johnbrvc Jul 10, 2025
7f776b4
Merge pull request #1143 from clevengr/i1006_point_scoring_add_sample…
johnbrvc Jul 11, 2025
c69e128
i_1006 Remember scoreboard type in ContestInformation
johnbrvc Jul 11, 2025
449576c
i1006 Fix JUnits to include ensureStaticLog()
johnbrvc Jul 10, 2025
ed62158
i_1006 JUnit fixes
johnbrvc Jul 11, 2025
ec76b81
i_1006 Implement point scoring in DSA
johnbrvc Jul 13, 2025
f785e0c
i_1006 PR change requests to comments
johnbrvc Jul 16, 2025
6ff085e
i_1006 Add comment explaining comparision logic
johnbrvc Jul 16, 2025
dc2ae23
i_1006 Fix event feed for point scoring
johnbrvc Jul 18, 2025
b50c961
i_1006 allow LegacyGrader to accept list of judgments
johnbrvc Jul 18, 2025
253fdfd
i_1006 Add ignore_sample option to LegacyGrader
johnbrvc Jul 27, 2025
e3e8ae8
i_1006 use test data groups for validateCDP
johnbrvc Jul 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions samps/contests/pointscoring/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
This folder contains the configuration for a PC2 sample "point scoring" contest.

The contest has a "problemset.yaml" file containing descriptions of three problems: 'a', 'b', and 'c'.
The intent is to (eventually) configure a variety of different problems, each with different "scoring properties".
Currently however, problem folders 'b' and 'c' contain duplicates of problem 'a' (except with the appropriate problem names changed).

The intent is to expand the contest by modifying the scoring attributes of problems 'b' and 'c' so that they test various other
"point scoring" attribute combinations. (Eventually of course there may be additional combinations, requiring addition of new problems 'd', 'e', etc.)

All problems are intended to be based on the PC2 "Sumit" problem ("read input integers and print the sum of the positive integers").
This allows for easy testing, since there already exist correct and incorrect solutions to Sumit (in several languages) in the PC2 "samps/src" folder.

Problem 'a' has the following attributes:
- a problem_statement folder with a "problem.tex" file describing the PC2 "Sumit" problem.
- a problem.yaml file stating that the problem named "a" is "type:scoring".
- a submissions folder containing accepted, "partially accepted" and "wrong answer" solutions for the Sumit problem.
(The "partially accepted" submission prints the sum of ALL integers in the input; i.e., it fails to ignore negative integers.
This could be used for example to give "partial credit" for such a solution.)
- both "sample" and "secret" data folders, but only with test data (.in/.ans pairs) at the root level (i.e., no scoring subgroups)
- no "testdata.yaml" files at any level -- hence, tests the premise that if there is no testdata.yaml file, then a "testdata.yaml"
file is implicitly added to the root ("data") group (see https://www.kattis.com/problem-package-format/spec/legacy.html#test-data-groups)
with default values, which are:
- on_reject: break
- grading: default
- grader_flags: "" (i.e. the empty string)
- input_validator_flags: ""
- output_validator_flags: ""
- accept_score: 1.0
- reject_score: 0.0
- range: -inf +inf
- Since "grader_flags" defaults to the empty string, the Grader will implicitly use the following default values
(see https://www.kattis.com/problem-package-format/spec/legacy.html#default-grader-specification):
- verdict mode: worst_error
- scoring mode: sum

Problems 'b' and 'c' are currently just duplicates of problem 'a'; they need to be modified to test other point-scoring combinations
(for example, the use of scoring subgroups; the use of different grader flags, etc.)



1 change: 1 addition & 0 deletions samps/contests/pointscoring/config/a/data/sample/01.ans
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The sum of the integers is 75
3 changes: 3 additions & 0 deletions samps/contests/pointscoring/config/a/data/sample/01.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
25
50
0
1 change: 1 addition & 0 deletions samps/contests/pointscoring/config/a/data/secret/02.ans
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The sum of the integers is 75
4 changes: 4 additions & 0 deletions samps/contests/pointscoring/config/a/data/secret/02.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
25
50
-25
0
1 change: 1 addition & 0 deletions samps/contests/pointscoring/config/a/data/secret/03.ans
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The sum of the integers is 50
4 changes: 4 additions & 0 deletions samps/contests/pointscoring/config/a/data/secret/03.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
25
25
-25
0
12 changes: 12 additions & 0 deletions samps/contests/pointscoring/config/a/problem.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Point Scoring problem configuration, problem 'a', version 1.0
---

name: a
type: scoring

limits:
timeout: 1

input:
readFromSTDIN: true

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
\problemtitle{Sumit a}

\begin{document
\section{Problem Statement}
Write a program which reads a series of integers from stdin and prints a message "The sum of the integers is XXX", where XXX is the sum of the positive
integers in the input.
\end{document}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

// Copyright (C) 1989-2025 PC2 Development Team: John Clevenger, Douglas Lane, Samir Ashoo, and Troy Boudreau.
import java.io.*;

//
// File: ISumit.java
// Purpose: to print the sum of the positive integers from stdin

public class ISumit {
public static void main(String[] args) {
try {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in), 1);

String line;
int sum = 0;
int rv = 0;
while ((line = br.readLine()) != null) {
rv = new Integer(line.trim()).intValue();
if (rv > 0)
sum = sum + rv;
}
System.out.print("The sum of the integers is ");
System.out.println(sum);
} catch (Exception e) {
System.out.println("Possible trouble reading stdin");
System.out.println("Message: " + e.getMessage());
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

// Copyright (C) 1989-2025 PC2 Development Team: John Clevenger, Douglas Lane, Samir Ashoo, and Troy Boudreau.
import java.io.*;

//
// File: ISumitPartial.java
// Purpose: to print the sum of the integers from stdin but failing to ignore negative numbers

public class ISumitPartial {
public static void main(String[] args) {
try {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in), 1);

String line;
int sum = 0;
int rv = 0;
while ((line = br.readLine()) != null) {
rv = new Integer(line.trim()).intValue();
sum = sum + rv;
}
System.out.print("The sum of the integers is ");
System.out.println(sum);
} catch (Exception e) {
System.out.println("Possible trouble reading stdin");
System.out.println("Message: " + e.getMessage());
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

// Copyright (C) 1989-2019 PC2 Development Team: John Clevenger, Douglas Lane, Samir Ashoo, and Troy Boudreau.
import java.io.*;

//
// File: ISumitWA.java
// Purpose: to sum the integers from stdin but print an incorrect sum
// (that is, to fail to correctly print the sum of the positive integers from stdin)

public class ISumitWA {
public static void main(String[] args) {
try {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in), 1);

String line;
int sum = 0;
int rv = 0;
while ((line = br.readLine()) != null) {
rv = new Integer(line.trim()).intValue();
if (rv > 0)
sum = sum + rv;
}
System.out.print("Dumn integers is ");
System.out.println(sum + 1024);
} catch (Exception e) {
System.out.println("Possible trouble reading stdin");
System.out.println("Message: " + e.getMessage());
}
}
}
1 change: 1 addition & 0 deletions samps/contests/pointscoring/config/b/data/sample/01.ans
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The sum of the integers is 75
3 changes: 3 additions & 0 deletions samps/contests/pointscoring/config/b/data/sample/01.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
25
50
0
1 change: 1 addition & 0 deletions samps/contests/pointscoring/config/b/data/secret/02.ans
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The sum of the integers is 75
4 changes: 4 additions & 0 deletions samps/contests/pointscoring/config/b/data/secret/02.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
25
50
-25
0
1 change: 1 addition & 0 deletions samps/contests/pointscoring/config/b/data/secret/03.ans
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The sum of the integers is 50
4 changes: 4 additions & 0 deletions samps/contests/pointscoring/config/b/data/secret/03.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
25
25
-25
0
12 changes: 12 additions & 0 deletions samps/contests/pointscoring/config/b/problem.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Point Scoring problem configuration, problem 'b', version 1.0 (a duplicate of problem 'a')
---

name: b
type: scoring

limits:
timeout: 1

input:
readFromSTDIN: true

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
\problemtitle{Sumit b}

\begin{document
\section{Problem Statement}
Write a program which reads a series of integers from stdin and prints a message "The sum of the integers is XXX", where XXX is the sum of the positive
integers in the input.
\end{document}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

// Copyright (C) 1989-2025 PC2 Development Team: John Clevenger, Douglas Lane, Samir Ashoo, and Troy Boudreau.
import java.io.*;

//
// File: ISumit.java
// Purpose: to print the sum of the positive integers from stdin

public class ISumit {
public static void main(String[] args) {
try {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in), 1);

String line;
int sum = 0;
int rv = 0;
while ((line = br.readLine()) != null) {
rv = new Integer(line.trim()).intValue();
if (rv > 0)
sum = sum + rv;
}
System.out.print("The sum of the integers is ");
System.out.println(sum);
} catch (Exception e) {
System.out.println("Possible trouble reading stdin");
System.out.println("Message: " + e.getMessage());
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

// Copyright (C) 1989-2025 PC2 Development Team: John Clevenger, Douglas Lane, Samir Ashoo, and Troy Boudreau.
import java.io.*;

//
// File: ISumitPartial.java
// Purpose: to print the sum of the integers from stdin but failing to ignore negative numbers

public class ISumitPartial {
public static void main(String[] args) {
try {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in), 1);

String line;
int sum = 0;
int rv = 0;
while ((line = br.readLine()) != null) {
rv = new Integer(line.trim()).intValue();
sum = sum + rv;
}
System.out.print("The sum of the integers is ");
System.out.println(sum);
} catch (Exception e) {
System.out.println("Possible trouble reading stdin");
System.out.println("Message: " + e.getMessage());
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

// Copyright (C) 1989-2019 PC2 Development Team: John Clevenger, Douglas Lane, Samir Ashoo, and Troy Boudreau.
import java.io.*;

//
// File: ISumitWA.java
// Purpose: to sum the integers from stdin but print an incorrect sum
// (that is, to fail to correctly print the sum of the positive integers from stdin)

public class ISumitWA {
public static void main(String[] args) {
try {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in), 1);

String line;
int sum = 0;
int rv = 0;
while ((line = br.readLine()) != null) {
rv = new Integer(line.trim()).intValue();
if (rv > 0)
sum = sum + rv;
}
System.out.print("Dumn integers is ");
System.out.println(sum + 1024);
} catch (Exception e) {
System.out.println("Possible trouble reading stdin");
System.out.println("Message: " + e.getMessage());
}
}
}
1 change: 1 addition & 0 deletions samps/contests/pointscoring/config/c/data/sample/01.ans
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The sum of the integers is 75
3 changes: 3 additions & 0 deletions samps/contests/pointscoring/config/c/data/sample/01.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
25
50
0
1 change: 1 addition & 0 deletions samps/contests/pointscoring/config/c/data/secret/02.ans
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The sum of the integers is 75
4 changes: 4 additions & 0 deletions samps/contests/pointscoring/config/c/data/secret/02.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
25
50
-25
0
1 change: 1 addition & 0 deletions samps/contests/pointscoring/config/c/data/secret/03.ans
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The sum of the integers is 50
4 changes: 4 additions & 0 deletions samps/contests/pointscoring/config/c/data/secret/03.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
25
25
-25
0
12 changes: 12 additions & 0 deletions samps/contests/pointscoring/config/c/problem.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Point Scoring problem configuration, problem 'c', version 1.0 (currently a duplicat of problem 'a')
---

name: c
type: scoring

limits:
timeout: 1

input:
readFromSTDIN: true

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
\problemtitle{Sumit c}

\begin{document
\section{Problem Statement}
Write a program which reads a series of integers from stdin and prints a message "The sum of the integers is XXX", where XXX is the sum of the positive
integers in the input.
\end{document}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

// Copyright (C) 1989-2025 PC2 Development Team: John Clevenger, Douglas Lane, Samir Ashoo, and Troy Boudreau.
import java.io.*;

//
// File: ISumit.java
// Purpose: to print the sum of the positive integers from stdin

public class ISumit {
public static void main(String[] args) {
try {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in), 1);

String line;
int sum = 0;
int rv = 0;
while ((line = br.readLine()) != null) {
rv = new Integer(line.trim()).intValue();
if (rv > 0)
sum = sum + rv;
}
System.out.print("The sum of the integers is ");
System.out.println(sum);
} catch (Exception e) {
System.out.println("Possible trouble reading stdin");
System.out.println("Message: " + e.getMessage());
}
}
}
Loading