Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Add showpenalty option" #55

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
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
16 changes: 3 additions & 13 deletions src/turnin.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ int maxturnins = 10;
int binary = 0;
int daypenalty = 10;
int weekendpenalty = 5;
int showpenalty = 1;

int penalty = 0;

time_t duedate = 0;
Expand Down Expand Up @@ -168,8 +168,7 @@ void version() {
"Copyright 2010-2014 Bryce Boe <[email protected]>\n"
"Copyright 2014 Foivos S. Zakkak <[email protected]> and\n"
" Antonios Chariton<[email protected]>\n"
"Copyright 2015-2022 Foivos S. Zakkak <[email protected]>\n"
"Copyright 2024 Paul Walther <[email protected]>\n\n"
"Copyright 2015-2022 Foivos S. Zakkak <[email protected]>\n\n"
"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.\n"
"This is free software: you are free to change and redistribute it.\n"
"There is NO WARRANTY, to the extent permitted by law.\n\n"
Expand Down Expand Up @@ -635,13 +634,6 @@ void setup(char *arg) {
exit(1);
}
weekendpenalty = n;
} else if (strcasecmp(keyword, "showpenalty") == 0) {
if ((n != 0) || (n != 1)) {
fprintf(stderr, "turnin: showpenalty must be either 0 or 1\n"
" Please notify the Instructor or a TA.\n");
exit(1);
}
showpenalty = n;
} else if (strcasecmp(keyword, "duedate") == 0) {
if (sscanf(buf, "%s %14c", keyword, str_date) != 2) {
warn = 1;
Expand Down Expand Up @@ -1393,9 +1385,7 @@ void checkdue() {
fprintf(stderr, "******************************************\n");
(void)fclose(fd);
}
if ((penalty > 0) && showpenalty) {
fprintf(stderr, "\n*** This turn in will get %d%% penalty, due to late turn in, on the final grade ***\n", penalty);
}
fprintf(stderr, "\n*** This turn in will get %d%% penalty, due to late turn in, on the final grade ***\n", penalty);
wanttocontinue();
}

Expand Down
Loading