forked from ucsb-cs/turnin
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0f5be60
commit d907833
Showing
1 changed file
with
13 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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; | ||
|
@@ -168,7 +168,8 @@ 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\n" | ||
"Copyright 2015-2022 Foivos S. Zakkak <[email protected]>\n" | ||
"Copyright 2024 Paul Walther <[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" | ||
|
@@ -634,6 +635,13 @@ 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; | ||
|
@@ -1385,7 +1393,9 @@ void checkdue() { | |
fprintf(stderr, "******************************************\n"); | ||
(void)fclose(fd); | ||
} | ||
fprintf(stderr, "\n*** This turn in will get %d%% penalty, due to late turn in, on the final grade ***\n", penalty); | ||
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); | ||
} | ||
wanttocontinue(); | ||
} | ||
|
||
|