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

support keywords 'invalid', 'withdrawn', 'declined' for 'selected'

parent ba9b6349
No related branches found
No related tags found
No related merge requests found
...@@ -103,6 +103,14 @@ skeleton = """ ...@@ -103,6 +103,14 @@ skeleton = """
table.list tr.registrant_selected_other a { table.list tr.registrant_selected_other a {
color: #999999; color: #999999;
} }
table.list tr.registrant_withdrawn {
text-decoration: line-through;
font-style: italic;
color: #999999;
}
table.list tr.registrant_withdrawn a {
color: #999999;
}
</style> </style>
</head> </head>
<body> <body>
...@@ -683,6 +691,8 @@ for fldName in ['Choice 1', 'Choice 2', 'Choice 3']: ...@@ -683,6 +691,8 @@ for fldName in ['Choice 1', 'Choice 2', 'Choice 3']:
for id in user_data: for id in user_data:
if user_data[id]['selected'].strip() in ['invalid', 'withdrawn', 'declined']:
continue
# loop over usr data and save selected students/registrants for each projct # loop over usr data and save selected students/registrants for each projct
if user_data[id]['selected'].strip(): if user_data[id]['selected'].strip():
# get project ID and order from selected number: 2001.1 (project ID.order of selection) # get project ID and order from selected number: 2001.1 (project ID.order of selection)
...@@ -771,15 +781,18 @@ for projID in project_ids: ...@@ -771,15 +781,18 @@ for projID in project_ids:
row = row.replace("{{OVERALL_COMMENT_1}}", student_data[id]['overall_comment'][0]) row = row.replace("{{OVERALL_COMMENT_1}}", student_data[id]['overall_comment'][0])
row = row.replace("{{OVERALL_COMMENT_2}}", student_data[id]['overall_comment'][1]) row = row.replace("{{OVERALL_COMMENT_2}}", student_data[id]['overall_comment'][1])
if user_data[id]['selected']: if user_data[id]['selected'] in ['invalid', 'withdrawn', 'declined']:
# current student is selected for project; display it in special way style = "registrant_withdrawn"
if user_data[id]['selected'].startswith("%d" % projID): elif user_data[id]['selected'].startswith("%d" % projID):
row = row.replace("{{REGISTRANT_SELECTED}}", "registrant_selected") # current student is selected for the current project
else: style = "registrant_selected"
row = row.replace("{{REGISTRANT_SELECTED}}", "registrant_selected_other") elif user_data[id]['selected']:
# current student is selected for a different project
style = "registrant_selected_other"
else: else:
# ordinary row # ordinary row
row = row.replace("{{REGISTRANT_SELECTED}}", "") style = ""
row = row.replace("{{REGISTRANT_SELECTED}}", style)
for part in ['motivation','ambasador','technical']: for part in ['motivation','ambasador','technical']:
# add all parts # add all parts
...@@ -872,12 +885,15 @@ for cell in user_sorted.most_common(): ...@@ -872,12 +885,15 @@ for cell in user_sorted.most_common():
project_list_tmp = "" project_list_tmp = ""
sep = "" sep = ""
if user_data[id]['selected']: if user_data[id]['selected'] in ['invalid', 'withdrawn', 'declined']:
style = "registrant_withdrawn"
elif user_data[id]['selected']:
# current student is selected for project; display it in special way # current student is selected for project; display it in special way
row = row.replace("{{REGISTRANT_SELECTED}}", "registrant_selected") style = "registrant_selected"
else: else:
# ordinary row # ordinary row
row = row.replace("{{REGISTRANT_SELECTED}}", "") style = ""
row = row.replace("{{REGISTRANT_SELECTED}}", style)
for fldName in ['Choice1ID', 'Choice2ID', 'Choice3ID']: for fldName in ['Choice1ID', 'Choice2ID', 'Choice3ID']:
# get all three projects and first add all user's first choise, then second and then third choice # get all three projects and first add all user's first choise, then second and then third choice
... ...
......
...@@ -66,7 +66,9 @@ while (<>) { ...@@ -66,7 +66,9 @@ while (<>) {
push @{$project{$pref2}{cand}}, {value => $score * $weight2, student => $id, score => $score, spref => 2, pweight => 1.0, ppref => 0} if $pref2; push @{$project{$pref2}{cand}}, {value => $score * $weight2, student => $id, score => $score, spref => 2, pweight => 1.0, ppref => 0} if $pref2;
push @{$project{$pref3}{cand}}, {value => $score * $weight3, student => $id, score => $score, spref => 3, pweight => 1.0, ppref => 0} if $pref3; push @{$project{$pref3}{cand}}, {value => $score * $weight3, student => $id, score => $score, spref => 3, pweight => 1.0, ppref => 0} if $pref3;
if ($selected) { if ($selected eq 'invalid' || $selected eq 'withdrawn' || $selected eq 'declined') {
$student2project{$id} = $selected;
} elsif ($selected) {
($p, $ps) = split(/\./, $selected, 2); ($p, $ps) = split(/\./, $selected, 2);
die "reassignment of $selected: $id vs. $project2student{$p}{$ps}->{student}" if defined $project2student{$p}{$ps}; die "reassignment of $selected: $id vs. $project2student{$p}{$ps}->{student}" if defined $project2student{$p}{$ps};
$student2project{$id} = $p; $student2project{$id} = $p;
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment