-
Notifications
You must be signed in to change notification settings - Fork 522
/
exam-grade.sh
executable file
·102 lines (86 loc) · 2.58 KB
/
exam-grade.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#!/bin/bash
# exit if not root
clear
# evaluating tasks
echo -e "\033[1mchecking task 1 results\033[0m"
source labs/exam-task1.sh
echo the score is $SCORE
TOTALSCORE=$SCORE
TOTALTOTAL=$TOTAL
echo -e "\033[1mchecking task 2 results\033[0m"
source labs/exam-task2.sh
echo the score is $SCORE
TOTALSCORE=$(( TOTAL + SCORE ))
TOTALTOTAL=$TOTAL
echo -e "\033[1mchecking task 3 results\033[0m"
source labs/exam-task3.sh
echo the score is $SCORE
TOTALSCORE=$(( TOTAL + SCORE ))
TOTALTOTAL=$TOTAL
echo -e "\033[1mchecking task 4 results\033[0m"
source labs/exam-task4.sh
echo the score is $SCORE
TOTALSCORE=$(( TOTAL + SCORE ))
TOTALTOTAL=$TOTAL
echo -e "\033[1mchecking task 5 results\033[0m"
source labs/exam-task5.sh
echo the score is $SCORE
TOTALSCORE=$(( TOTAL + SCORE ))
TOTALTOTAL=$TOTAL
echo -e "\033[1mchecking task 6 results\033[0m"
source labs/exam-task6.sh
echo the score is $SCORE
TOTALSCORE=$(( TOTAL + SCORE ))
TOTALTOTAL=$TOTAL
echo -e "\033[1mchecking task 7 results\033[0m"
source labs/exam-task7.sh
echo the score is $SCORE
TOTALSCORE=$(( TOTAL + SCORE ))
TOTALTOTAL=$TOTAL
echo -e "\033[1mchecking task 8 results\033[0m"
source labs/exam-task8.sh
echo the score is $SCORE
TOTALSCORE=$(( TOTAL + SCORE ))
TOTALTOTAL=$TOTAL
echo -e "\033[1mchecking task 9 results\033[0m"
source labs/exam-task9.sh
echo the score is $SCORE
TOTALSCORE=$(( TOTAL + SCORE ))
TOTALTOTAL=$TOTAL
echo -e "\033[1mchecking task 10 results\033[0m"
source labs/exam-task10.sh
echo the score is $SCORE
TOTALSCORE=$(( TOTAL + SCORE ))
TOTALTOTAL=$TOTAL
echo -e "\033[1mchecking task 11 results\033[0m"
source labs/exam-task11.sh
echo the score is $SCORE
TOTALSCORE=$(( TOTAL + SCORE ))
TOTALTOTAL=$TOTAL
echo -e "\033[1mchecking task 12 results\033[0m"
source labs/exam-task12.sh
echo the score is $SCORE
TOTALSCORE=$(( TOTAL + SCORE ))
TOTALTOTAL=$TOTAL
echo -e "\033[1mchecking task 13 results\033[0m"
source labs/exam-task13.sh
echo the score is $SCORE
TOTALSCORE=$(( TOTAL + SCORE ))
TOTALTOTAL=$TOTAL
echo -e "\033[1mchecking task 14 results\033[0m"
source labs/exam-task14.sh
echo the score is $SCORE
TOTALSCORE=$(( TOTAL + SCORE ))
TOTALTOTAL=$TOTAL
echo -e "\033[1mchecking task 15 results\033[0m"
source labs/exam-task15.sh
#### print PASS/FAIL
echo -e "\n"
echo your score is $SCORE out of a total of $TOTAL
if [[ $SCORE -ge $(( TOTAL / 10 * 7 )) ]]
then
echo -e "\033[32mCONGRATULATIONS!!\033[0m\t\t You passed this sample exam!"
echo -e "\033[1mResults obtained here don't guarantee anything for the real exam\033[0m"
else
echo -e "\033[31m[FAIL]\033[0m\t\t You did NOT pass this sample exam \033[36m:-(\033[0m"
fi