Skip to content

Commit a9fbd28

Browse files
Merge pull request #216 from makeopensource/64-instructor-gradebook
#64 - Instructor gradebook
2 parents 6226c5c + 952915d commit a9fbd28

11 files changed

Lines changed: 613 additions & 328 deletions

File tree

devU-client/src/assets/global.scss

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,19 @@
2323
text-align: center;
2424
}
2525

26+
a{
27+
color: var(--link-blue);
28+
}
29+
2630
// general button template, extends to 3 types of buttons - primary, secondary, delete
2731
.btn {
2832
cursor: pointer;
2933
padding: 5px 15px;
30-
border-radius: 100px;
31-
height: fit-content;
34+
border-radius: 30px;
3235
border: none;
3336
font-weight: 700;
34-
transition: background-color 0.3s ease;
37+
font-size: 16px;
38+
transition: all 0.2s ease;
3539
}
3640

3741
.no_items {
@@ -156,6 +160,7 @@
156160
--blue-lighter: #74b9ff;
157161
--blue: #0984e3;
158162
--blue-darker: #083967;
163+
--link-blue: #075D92;
159164
--btn-secondary-border: var(--primary);
160165
--btn-secondary-background: #FFF;
161166
--btn-secondary-text: var(--primary);
@@ -190,7 +195,7 @@
190195
--red-lighter: #FFA3A3;
191196
--red: #8A2626;
192197

193-
--purple-lightest: #efecfd;
198+
--purple-lightest: #dcd5fb;
194199
--purple-lighterer: #9885f0;
195200
--purple-lighter: #7257EB;
196201
--purple: #52468A;

devU-client/src/components/pages/courses/courseDetailPage.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ const CourseDetailPage = () => {
7373
<div>
7474
{/* Course Title */}
7575
<div className={styles.header}>
76+
7677
<h1 className={styles.class_title}>{courseInfo.number}: {courseInfo.name}</h1>
7778
{role.isInstructor() && (
7879
<button className='btnPrimary' id={styles.parallel_button} onClick={() => {
@@ -97,6 +98,7 @@ const CourseDetailPage = () => {
9798
<h3>Course Links</h3>
9899
<div className={styles.buttons_container}>
99100
<button className='btnSecondary' onClick={() => {
101+
role.isInstructor() ? history.push(`/course/${courseId}/gradebook/instructor`) :
100102
history.push(`/course/${courseId}/gradebook`)
101103
}}>Gradebook
102104
</button>

devU-client/src/components/pages/forms/assignments/assignmentUpdatePage.tsx

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ const AssignmentUpdatePage = () => {
2626
const { courseId } = useParams<{ courseId: string }>()
2727
const [setAlert] = useActionless(SET_ALERT)
2828
const currentAssignmentId = parseInt(assignmentId)
29-
const [assignmentsList, setAssignmentsList] = useState<Assignment[]>([])
3029
const [assignmentProblems, setAssignmentProblems] = useState<AssignmentProblem[]>([])
3130
const [nonContainerAutograders, setNonContainerAutograders] = useState<NonContainerAutoGrader[]>([])
3231
const [containerAutograders, setContainerAutograders] = useState<ContainerAutoGrader[]>([])
@@ -122,27 +121,14 @@ setFiles;
122121
useEffect(() => {RequestService.get(`/api/course/${courseId}/assignment/${assignmentId}/assignment-problems`).then((res) => { setAssignmentProblems(res) })}, [])
123122
useEffect(() => {RequestService.get(`/api/course/${courseId}/assignment/${assignmentId}/non-container-auto-graders`).then((res) => { setNonContainerAutograders(res) })}, [])
124123
useEffect(() => {RequestService.get(`/api/course/${courseId}/assignment/${assignmentId}/container-auto-graders`).then((res) => { setContainerAutograders(res) })}, [])
125-
useEffect(() => {RequestService.get(`/api/course/${courseId}/assignments`).then((res) => { setAssignmentsList(res) })}, [])
124+
//useEffect(() => {RequestService.get(`/api/course/${courseId}/assignments`).then((res) => { setAssignmentsList(res) })}, [])
126125

127126
/*useEffect(() => {RequestService.get(`/api/course/${courseId}/categories/`).then((res) => { setCategories(res) }).finally(convertToOptions)}, [])
128127
const convertToOptions = () => {
129128
setAllCategoryOptions(categories.map((category) => ({label: category.name, value: category})))
130129
}*/
131130

132131

133-
useEffect(() => {
134-
// for(let i : number = 0; i < assignmentsList.length; i++) { // this is used for swapping between assignments on edit page, which is no longer part of the design
135-
// RequestService.get(`/api/course/${courseId}/assignment/${assignmentsList[i].id}/assignment-problems`)
136-
// .then((res) => {
137-
// setAllAssignmentProblems(prevState => {
138-
// const newMap = new Map(prevState);
139-
// newMap.set(Number(assignmentsList[i].id), res);
140-
// return newMap;
141-
// });
142-
// })
143-
// }
144-
},[assignmentsList])
145-
146132
const handleAssignmentUpdate = () => {
147133
const finalFormData = {
148134
courseId: formData.courseId,
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
@import 'variables';
2+
3+
.pageWrapper{
4+
height: 90vh;
5+
.categoryName {
6+
color: $text-color;
7+
font-size: 1.25rem;
8+
}
9+
10+
.late {
11+
color: #876212;
12+
}
13+
14+
.no_submission{
15+
color: #8A2626;
16+
}
17+
.no_submission
18+
.tableWrapper {
19+
padding: 0 100px;
20+
}
21+
22+
.tableContainer {
23+
overflow: scroll;
24+
scrollbar-color: $primary;
25+
border-radius: 10px;
26+
border: 3px solid $primary;
27+
background: linear-gradient($primary 43px, $background 0, $background) // makes table header color consistent on rubberband
28+
}
29+
30+
table {
31+
border-radius: 20px;
32+
gap:10px;
33+
// margin: 15px auto;
34+
border-collapse: collapse;
35+
width: 100%;
36+
position: relative;
37+
text-wrap: nowrap;
38+
}
39+
40+
.header{
41+
display: grid;
42+
grid-template-columns: 1fr 1fr 1fr;
43+
justify-items: center;
44+
align-items: center;
45+
}
46+
47+
.pageTitle{
48+
margin-top: 20px;
49+
width: fit-content;
50+
align-self: center;
51+
grid-column-start: 2;
52+
}
53+
54+
.buttonContainer{
55+
display: flex;
56+
gap: 10px;
57+
margin-left: auto;
58+
padding: 10px 20px;
59+
}
60+
.subheader{
61+
display: flex;
62+
align-items: center;
63+
margin: 20px 0;
64+
gap: 10px;
65+
}
66+
.textField{
67+
width: 300px;
68+
border-radius: 20px;
69+
margin: 0;
70+
}
71+
.dropdown{
72+
width: 300px;
73+
border-radius: 20px;
74+
margin: 0;
75+
}
76+
.key{
77+
margin-right: auto;
78+
}
79+
.name{ //couldn't find a good way for these to stick without magic numbers that
80+
// position: sticky; don't translate accross devices.
81+
// left: 0;
82+
// width: 100px;
83+
text-align: left;
84+
width:180px;
85+
min-width: 180px;
86+
}
87+
.noName{
88+
text-align: left;
89+
width:180px;
90+
min-width: 180px;
91+
font-style: italic;
92+
}
93+
94+
.email{
95+
// position: sticky;
96+
text-align: left;
97+
width:180px;
98+
min-width: 180px;
99+
}
100+
101+
tr.row {
102+
border-bottom: 1px solid #ddd;
103+
}
104+
105+
tr.row:last-of-type {
106+
border-bottom: none;
107+
}
108+
109+
th {
110+
background-color: $primary;
111+
color: #FFF;
112+
font-weight: 600;
113+
}
114+
115+
td,
116+
th {
117+
padding: 10px 20px;
118+
text-align: center;
119+
min-width: 100px
120+
}
121+
122+
td{
123+
background-color: $background;
124+
}
125+
}

0 commit comments

Comments
 (0)