Changes between Version 1 and Version 2 of Student selects a class that is going to attend


Ignore:
Timestamp:
02/10/25 17:15:37 (12 days ago)
Author:
206046
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Student selects a class that is going to attend

    v1 v2  
    1 = Student selects a class that is going to attend =
     1= Student Class Selection Process =
     2
     3== Step 1 - System Login ==
     4The student logs into the system using their **email** and **password**. The password is securely hashed before verification.
     5
     6{{{
     7SELECT id_user, username
     8FROM User
     9WHERE email = :input_email AND password = :hashed_input_pass;
     10}}}
     11''Note:'' `:hashed_input_pass` is securely hashed before being checked.
     12
     13---
     14
     15== Step 2 - Student Dashboard ==
     16After logging in, the student can see their **enrolled courses** and **available classes**.
     17
     18=== List Enrolled Courses ===
     19{{{
     20SELECT c.id_Course, s.name AS subject_name, c.num_of_classes
     21FROM Enrollment e
     22JOIN Course c ON e.id_Course = c.id_Course
     23JOIN Subject_Course sc ON c.id_Course = sc.id_Course
     24JOIN Subject s ON sc.id_subject = s.id_subject
     25WHERE e.id_student = :curr_student_id;
     26}}}
     27Displays the courses the student is currently enrolled in.
     28
     29=== List Upcoming Available Classes ===
     30{{{
     31SELECT cl.id_class, cl.start_time, cl.end_time, cl.duration, t.id_teacher, u.username AS teacher_name, s.name AS subject_name
     32FROM Class cl
     33JOIN Teacher t ON cl.teacher_id = t.id_teacher
     34JOIN User u ON t.id_user = u.id_user
     35JOIN Course_Class cc ON cl.id_class = cc.id_class
     36JOIN Course c ON cc.id_Course = c.id_Course
     37JOIN Subject_Course sc ON c.id_Course = sc.id_Course
     38JOIN Subject s ON sc.id_subject = s.id_subject
     39WHERE cl.start_time >= CURRENT_TIME
     40AND c.id_Course IN (SELECT id_Course FROM Enrollment WHERE id_student = :curr_student_id);
     41}}}
     42Lists upcoming classes for courses the student is enrolled in.
     43
     44---
     45
     46== Step 3 - Selecting a Class to Attend ==
     47The student clicks on an **"Attend Class"** button next to an available class.
     48
     49---
     50
     51== Step 4 - Registering Attendance ==
     52The system registers the student's attendance for the selected class.
     53
     54=== Insert Attendance Record ===
     55{{{
     56INSERT INTO Attendance (id_attendance, id_student, id_class, attended)
     57VALUES (:new_attendance_id, :curr_student_id, :selected_class_id, TRUE);
     58}}}
     59Marks the student as attending the selected class.
     60
     61---
     62
     63== Step 5 - Viewing Attendance History ==
     64The student can review their past attendance records.
     65
     66=== Retrieve Attendance History ===
     67{{{
     68SELECT a.id_class, cl.start_time, cl.end_time, cl.duration, s.name AS subject_name, a.attended
     69FROM Attendance a
     70JOIN Class cl ON a.id_class = cl.id_class
     71JOIN Course_Class cc ON cl.id_class = cc.id_class
     72JOIN Course c ON cc.id_Course = c.id_Course
     73JOIN Subject_Course sc ON c.id_Course = sc.id_Course
     74JOIN Subject s ON sc.id_subject = s.id_subject
     75WHERE a.id_student = :curr_student_id
     76ORDER BY cl.start_time DESC;
     77}}}
     78Displays all past classes the student attended.
     79
     80---
     81
     82== Step 6 - Checking Completed Classes ==
     83The student can see which classes they have **completed**.
     84
     85=== Retrieve Completed Classes ===
     86{{{
     87SELECT DISTINCT cl.id_class, cl.start_time, cl.end_time, cl.duration, s.name AS subject_name
     88FROM Attendance a
     89JOIN Class cl ON a.id_class = cl.id_class
     90JOIN Course_Class cc ON cl.id_class = cc.id_class
     91JOIN Course c ON cc.id_Course = c.id_Course
     92JOIN Subject_Course sc ON c.id_Course = sc.id_Course
     93JOIN Subject s ON sc.id_subject = s.id_subject
     94WHERE a.id_student = :curr_student_id AND cl.end_time <= CURRENT_TIME;
     95}}}
     96Lists all classes the student has **already completed**.
     97
     98---
     99
     100== Step 7 - Unregistering from a Class (Optional) ==
     101If a student mistakenly registers for a class, they can **remove themselves**.
     102
     103=== Remove Attendance Record ===
     104{{{
     105DELETE FROM Attendance
     106WHERE id_student = :curr_student_id AND id_class = :selected_class_id;
     107}}}
     108Removes the student's attendance entry.
     109
     110---
     111
     112== Conclusion ==
     113This process allows students to: 
     114✔ Log in to the system. 
     115✔ View enrolled courses and available classes. 
     116✔ Select and attend classes. 
     117✔ Track attendance and completed classes. 
     118✔ Optionally unregister from a class if needed.