Skip to content

Commit 390d4af

Browse files
authored
Merge pull request #259 from makeopensource/122-Drop-Course-Page
122 drop course page
2 parents 7066c22 + 103e23e commit 390d4af

16 files changed

+1370
-373
lines changed

devU-client/src/components/authenticatedRouter.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ import SubmissionFileView from './pages/submissions/submissionFileView'
2323
import UserCoursesListPage from "./pages/listPages/courses/coursesListPage";
2424
import JoinCoursePage from "./pages/listPages/joinwithcodepage";
2525
import InstructorAttendancePage from './pages/Attendence/InstructorAttendancePage';
26-
import matchingTable from './pages/Multiplechoice/matchingTable';
26+
import MatchingTableStudentPage from './pages/Multiplechoice/MatchingTableStudentPage'
2727
import WebhookURLForm from './pages/webhookURLForm'
28+
import MatchingTableInstructorPage from './pages/Multiplechoice/MatchingTableInstructorPage'
2829

2930
const AuthenticatedRouter = () => (
3031
<Switch>
@@ -49,8 +50,9 @@ const AuthenticatedRouter = () => (
4950
<Route exact path='/course/:courseId/assignment/:assignmentId/createProblem' component={AssignmentProblemFormPage} />
5051
<Route exact path='/course/:courseId/webhooks' component={WebhookURLForm} />
5152
<Route exact path="/course/:courseId/attendance/instructor" component={InstructorAttendancePage} />
53+
<Route exact path="/matching/instructor" component={MatchingTableInstructorPage} />
54+
<Route exact path="/matching-table/student" component={MatchingTableStudentPage} />
5255

53-
<Route path="/matchingTable" component={matchingTable} />
5456

5557

5658
<Route exact path='/course/:courseId/assignment/:assignmentId/submission/:submissionId'

devU-client/src/components/pages/Attendence/InstructorAttendanceModal.tsx

Lines changed: 61 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,27 @@ import './attendancePage.scss';
55
interface Props {
66
open: boolean;
77
onClose: () => void;
8+
onSubmit: (data: {
9+
courseInfo: {
10+
id: string;
11+
number: string;
12+
name: string;
13+
semester: string;
14+
};
15+
date: string;
16+
code: string;
17+
duration: string;
18+
description?: string;
19+
}) => void;
20+
courseInfo: {
21+
id: string;
22+
number: string;
23+
name: string;
24+
semester: string;
25+
};
826
}
927

10-
const InstructorAttendanceModal: React.FC<Props> = ({ open, onClose }) => {
11-
const [course, setCourse] = useState('');
28+
const InstructorAttendanceModal: React.FC<Props> = ({ open, onClose, onSubmit, courseInfo }) => {
1229
const [date, setDate] = useState('');
1330
const [code, setCode] = useState('');
1431
const [duration, setDuration] = useState('15');
@@ -20,9 +37,16 @@ const InstructorAttendanceModal: React.FC<Props> = ({ open, onClose }) => {
2037
};
2138

2239
const handleSubmit = () => {
23-
const attendanceData = { course, date, code, duration, description };
40+
const attendanceData = {
41+
courseInfo,
42+
date,
43+
code,
44+
duration,
45+
description
46+
};
47+
2448
console.log('Submitting attendance:', attendanceData);
25-
onClose();
49+
onSubmit(attendanceData);
2650
};
2751

2852
return (
@@ -32,44 +56,50 @@ const InstructorAttendanceModal: React.FC<Props> = ({ open, onClose }) => {
3256
onClose={onClose}
3357
buttonAction={handleSubmit}
3458
>
35-
<div className="assignment-form">
36-
<div className="formRow">
37-
<label>Course:</label>
38-
<select value={course} onChange={(e) => setCourse(e.target.value)} required>
39-
<option value="" disabled>Select course</option>
40-
<option value="CSE 312">CSE 312: Web Applications</option>
41-
<option value="CSE 443">CSE 443: Software Engineering</option>
42-
<option value="CSE 331">CSE 331: Algorithms and Complexity</option>
43-
</select>
59+
<div className="assignment-form"style={{ display: 'flex', flexDirection: 'column', gap: '1rem' }}>
60+
<div className="formRow" style={{ display: 'flex', flexDirection: 'column' }}>
61+
<label>
62+
<strong>Course:</strong>
63+
</label>
64+
<span>
65+
{courseInfo.number}: {courseInfo.name}
66+
</span>
4467
</div>
45-
46-
<div className="formRow">
68+
69+
<div className="formRow" style={{ display: 'flex', flexDirection: 'column' }}>
4770
<label>Session Date:</label>
4871
<input
49-
type="date"
50-
value={date}
51-
onChange={(e) => setDate(e.target.value)}
52-
required
72+
type="date"
73+
value={date}
74+
onChange={(e) => setDate(e.target.value)}
75+
required
5376
/>
5477
</div>
55-
56-
<div className="formRow">
78+
79+
<div className="formRow" style={{ display: 'flex', flexDirection: 'column' }}>
5780
<label>Attendance Code:</label>
58-
<div className="code-input-row">
81+
<div
82+
className="code-input-row"
83+
style={{ display: 'flex', gap: '0.5rem' }}
84+
>
5985
<input
60-
type="text"
61-
value={code}
62-
onChange={(e) => setCode(e.target.value.toUpperCase())}
63-
placeholder="Enter or generate a code"
64-
required
86+
type="text"
87+
value={code}
88+
onChange={(e) => setCode(e.target.value.toUpperCase())}
89+
placeholder="Enter or generate a code"
90+
required
91+
style={{ flexGrow: 1 }}
6592
/>
66-
<button type="button" className="btnPrimary" onClick={handleGenerateCode}>
93+
<button
94+
type="button"
95+
className="btnPrimary"
96+
onClick={handleGenerateCode}>
6797
Generate
68-
</button>
98+
</button>
6999
</div>
70100
</div>
71101

72-
<div className="formRow">
102+
<div className="formRow" style={{ display: 'flex', flexDirection: 'column' }}>
73103
<label>Duration (minutes):</label>
74104
<input
75105
type="number"
@@ -80,7 +110,7 @@ const InstructorAttendanceModal: React.FC<Props> = ({ open, onClose }) => {
80110
/>
81111
</div>
82112

83-
<div className="formRow">
113+
<div className="formRow" style={{ display: 'flex', flexDirection: 'column' }}>
84114
<label>Description (optional):</label>
85115
<textarea
86116
value={description}
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
@import 'variables';
2+
3+
.instructor-attendance-page {
4+
padding: 2rem $pagePadding;
5+
6+
h2 {
7+
text-align: center;
8+
margin-bottom: 2rem;
9+
font-size: 1.6rem;
10+
font-weight: 700;
11+
color: $text-color;
12+
}
13+
14+
.modal-launcher {
15+
display: flex;
16+
justify-content: center;
17+
margin-bottom: 1.5rem;
18+
}
19+
20+
.attendance-table {
21+
width: 100%;
22+
max-width: 900px;
23+
margin: 0 auto;
24+
border-collapse: collapse;
25+
border-radius: $border-radius;
26+
box-shadow: $box-shadow;
27+
overflow: hidden;
28+
29+
th, td {
30+
padding: 12px 16px;
31+
text-align: left;
32+
font-size: 0.95rem;
33+
}
34+
35+
th {
36+
background-color: $grey-lightest;
37+
color: $text-color;
38+
font-weight: bold;
39+
border-bottom: 1px solid $grey;
40+
}
41+
42+
td {
43+
background-color: $background;
44+
color: $text-color;
45+
border-bottom: 1px solid $grey-lighter;
46+
}
47+
48+
tr:nth-child(even) td {
49+
background-color: $table-row-even;
50+
}
51+
52+
tr:nth-child(odd) td {
53+
background-color: $table-row-odd;
54+
}
55+
56+
tr:last-child td {
57+
border-bottom: none;
58+
}
59+
}
60+
61+
.empty-message {
62+
text-align: center;
63+
font-style: italic;
64+
margin-top: 3rem;
65+
font-size: 1.05rem;
66+
color: $text-color-secondary;
67+
}
68+
}
69+
70+
@media (max-width: $medium) {
71+
.instructor-attendance-page {
72+
padding: 2rem 50px;
73+
74+
.attendance-table {
75+
font-size: 0.92rem;
76+
77+
th, td {
78+
padding: 10px 12px;
79+
}
80+
}
81+
}
82+
}
83+
84+
@media (max-width: $small) {
85+
.instructor-attendance-page {
86+
padding: 1.5rem $phonePadding;
87+
88+
h2 {
89+
font-size: 1.4rem;
90+
}
91+
92+
.attendance-table {
93+
font-size: 0.88rem;
94+
th, td {
95+
padding: 8px;
96+
}
97+
}
98+
}
99+
}

0 commit comments

Comments
 (0)