Skip to content
Snippets Groups Projects
Commit 6cc38678 authored by Andreas Beckmann's avatar Andreas Beckmann
Browse files

make the scripts understand 2021 data

parent 90c27a19
Branches
Tags
No related merge requests found
# personal data
/Application_Form
/registrations*.csv
/submissions-638.csv
/reviews*.csv
/submissions*.csv
# generated
/Selection
......
......@@ -3,8 +3,8 @@
# in current directory. Creates evaluation.html and reviews/
#
# cd Selection
# usage: python3 ../create-evaluation-files-multi.py \
# ../registrations.csv ../submissions-638.csv [../assign-*.csv]
# usage: python3 ../create-evaluation-files.py \
# ../registrations.csv ../reviews.csv [../assign-*.csv]
#
# Some --- columns needs to be renamed in evaluation-results.csv
# First column --- to -o-
......@@ -525,7 +525,7 @@ for row in eval_data['rows']:
dic=dict(zip(eval_data['header'], row))
# print(dic)
userID=int(dic["Applicant number"])
userID=int(dic["Applicant number"].replace("#",""))
reviewerName=dic["Signature"].replace(" ","_")
filename = "reviews/{0:03}_{1}.html".format(userID,reviewerName)
......@@ -588,7 +588,7 @@ for row in eval_data['rows']:
for i in range(0,len(eval_data['header'])):
# loop over header to preserve key order
key = eval_data['header'][i]
value = row[i].strip()
value = row[i].strip().replace("#","")
#print(key, "|" + value + "|")
# replace value for all keys in row
html_fld = key.replace(" ", "_").upper()
......@@ -682,8 +682,10 @@ for row in eval_data['rows']:
# for fldName in ['First Choice', 'Second Choice', 'Third Choice']:
#for fldName in ['1', '2', '3']:
for fldName in ['Choice 1', 'Choice 2', 'Choice 3']:
choice = fldName.split(" ")[1].strip()
#for fldName in ['Choice 1', 'Choice 2', 'Choice 3']:
# choice = fldName.split(" ")[1].strip()
for fldName in ['1.', '2.', '3.']:
choice = fldName[0:1]
# get all three projects and first add all user's first choice, then second and then third choice
for id in user_data:
# loop over all users and extract projects and prepare arrays
......
......@@ -5,12 +5,21 @@ if [ ! -d Application_Form ]; then
echo "Missing 'Application_Form' directory"
exit 1
fi
for f in registrations.csv reviews.csv
do
if [ ! -f $f ]; then
echo "Missing $f"
exit 1
fi
done
rm -rf Selection
mkdir Selection
cd Selection
python3 ../create-evaluation-files.py ../registrations.csv ../submissions-638.csv ../assign-[0-2].csv
python3 ../create-evaluation-files.py ../registrations.csv ../reviews.csv ../assign-[0-2].csv
cd ..
mv Selection/students.csv .
perl sohpc-assign.pl slots-round1.csv weights-pref.csv students.csv project-preferences.csv > select-round1-by-pref.txt
perl sohpc-assign.pl slots-round2-1-2.csv weights-pref.csv students.csv project-preferences.csv | grep -v .1: > select-round2-by-pref-1-2.txt
perl sohpc-assign.pl slots-round2-1-5.csv weights-pref.csv students.csv project-preferences.csv | grep -v .1: > select-round2-by-pref-1-5.txt
......@@ -20,9 +29,9 @@ perl sohpc-assign.pl slots.csv weights-score.csv students.csv project-preference
awk '{ if ($2 == "slots,") { $3 = $3 + 1 }; print $0 }' project-preferences.csv > project-preferences-reserves.csv
perl sohpc-assign.pl slots-reserves-2-5.csv weights-pref.csv students.csv project-preferences-reserves.csv > select-reserves-by-pref-2-5.txt
for i in $(seq 2001 2024) ; do grep ^$i select-reserves-by-pref-2-5.txt | tail -n 1 ; done > select-reserves.txt
mkdir Selection/scripts
cp prepare-selection.sh create-evaluation-files.py evaluation-detail-format.html submissions-638.csv registrations.csv Selection/scripts
cp prepare-selection.sh create-evaluation-files.py evaluation-detail-format.html registrations.csv reviews.csv Selection/scripts
cp sohpc-assign.pl slots*.csv weights*.csv students.csv project-preferences.csv select*.txt assign-*.csv Selection/scripts
echo zip -r Selection Selection
# submissions-638.csv: David Henty's #24 renamed to #34, Duplicate #15 on line 151 removed
# registrations.csv: Keys 1,2,3 changed to Choice 1, Choice 2, Choice 3
rm -f Selection.zip
zip -q -r Selection Selection
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment