Skip to content

IPC20 Grading Procedure

Yu Li-Yu edited this page May 5, 2020 · 5 revisions

Using hw3 as an example.

Gather everyone's source code to /home/ipc20/ta/grading/hw3

  • The directories are named after students' usernames
root@hades01 /h/i/t/g/hw3# pwd
/home/ipc20/ta/grading/hw3
root@hades01 /h/i/t/g/hw3# tree .
.
├── ipc20005
│   ├── hw3.cu
│   └── report.pdf
├── ipc20014
│   ├── build.ninja
│   ├── hw3.cu
│   └── report.pdf

Drop permissions

  • Run in /home/ipc20/ta/grading/hw3
  • Run as root
chown -R root:root .
chmod -R g-rwx,o-rwx .
chmod 755 .

Add permissions to each user to read their own files

  • Run in /home/ipc20/ta/grading/hw3
  • Run as root
for d in *
do
  setfacl -R -m u:$d:rX $d
done

On systems where users have a group with a same name (such as apollo31 as of 2020 spring), the following can be used instead:

for d in *
do
  chown -R root:$d $d
  chmod -R g+rX $d
done

Set up the temporary scoreboard server

  • run anywhere as you wish
  • use any address as you wish
  • (optional) don't run as root
mkdir config
vim config/hw3-grading.toml
./sb --address localhost:8989

Run the judge for each user

  • as root
  • $u is the username
  • You can do this in a for loop with & and wait
  • Pass the --address for sb as --server to xjudge
  • You can of course change the options to xjudge, see xjudge --help
sudo -iu $u /usr/local/bin/xjudge --median-of=5 --homework=hw3-grading --server=localhost:8989 -C `realpath $u`

After finish running, export the results to Google Spreadsheet

Here's an example formula:

=IMPORTHTML("http://apollo.cs.nthu.edu.tw/ipc20/s/hw3/grading.html", "table", 1)

To force update in Google Spreadsheets, add arbitrary query parameters, such as ?v=1 to the URL. Google spreadsheets treat them as different URLs so it will re-fetch. Otherwise it will only update once in a while (some say it is updated hourly).

Clone this wiki locally