Skip to main content

Overview

Classes (called “Lops” in the system) are organizational units that group students, instructors, and assignments together. They provide a way to manage course sections and control access to assignments.

Class structure

Each class has:
  • Name: Identifier for the class (e.g., “CS101 Spring 2024”)
  • Open status: Controls whether students can self-enroll
  • Users: Students and instructors enrolled in the class
  • Assignments: Assignments associated with this class

Creating a class

As an admin or head instructor:
  1. Navigate to Classes in the main menu
  2. Click Create New Class
  3. Enter the class name
  4. Set the open status:
    • Open: Students can find and enroll themselves
    • Closed: Only admins can add students
Classes are referenced in the codebase as “Lop” (the Vietnamese word for class).

Managing enrollment

Adding students

  1. Open the class details page
  2. Click Add Students
  3. Select students from the user list
  4. Click Enroll

Managing instructors

Classes can have multiple instructors:
  1. Open the class details
  2. Go to the Instructors tab
  3. Add or remove instructor access
  4. Instructors can view all assignments and submissions for their class

Assigning coursework

Adding assignments to a class

When creating an assignment:
  1. In the assignment form, select Classes
  2. Choose one or more classes
  3. All enrolled students will see the assignment
  4. Class scoreboards will include the assignment

Class scoreboards

View aggregated performance across all assignments:
Route: GET /lop/scoreboard/{lop}
The class scoreboard shows:
  • Total score across all assignments
  • Rank within the class
  • Individual assignment scores
  • Overall class statistics

Student enrollment workflow

For open classes

Students can self-enroll:
  1. Log in to Wecode
  2. Navigate to Classes
  3. Browse available open classes
  4. Click Enroll on the desired class
  5. Confirm enrollment
Route: POST /lops/{lop}/enrol/{in}
Parameter: in=1 (enroll), in=0 (unenroll)

For closed classes

Admins must manually enroll students:
  • Students cannot see closed classes in the listing
  • Only users explicitly added can access the class

Permissions

ActionAdminHead InstructorInstructorStudent
Create class
Edit classLimited
Delete class
Add students
Add instructors
View scoreboardOwn only
Self-enroll (if open)

API reference

Model: Lop

Location: app/Models/Lop.php

Fillable fields

name
string
required
The class name or identifier
open
boolean
required
Whether students can self-enroll (1) or class is closed (0)

Relationships

// Get all enrolled users (students and instructors)
$class->users()

// Get all instructors (roles 1, 2, 3)
$class->instructors()

// Get all assignments for this class
$class->assignments()

// Get the class creator
$class->creator()

Methods

// Get classes available to a specific user
Lop::available($user_id)
// Returns classes that are either:
// - Open for enrollment, OR
// - The user is already enrolled in

Routes

MethodURIActionPermission
GET/lopsList all classesAuthenticated
GET/lops/createShow create formAdmin/Head Instructor
POST/lopsStore new classAdmin/Head Instructor
GET/lops/{lop}Show class detailsEnrolled users
GET/lops/{lop}/editShow edit formAdmin/Head Instructor
PUT/PATCH/lops/{lop}Update classAdmin/Head Instructor
DELETE/lops/{lop}Delete classAdmin/Head Instructor
POST/lops/{lop}/enrol/{in}Enroll/unenrollStudent (if open)
GET/lop/scoreboard/{lop}View class scoreboardEnrolled users

Best practices

Naming conventions

Use clear, consistent names like “CS101-Fall2024” or “Algorithms-Section-A” to help students identify the right class.

Open vs closed

Use closed classes for small sections or invite-only courses. Use open for large lectures where students self-register.

Multiple instructors

Add teaching assistants as instructors so they can help grade and manage submissions without full admin access.

Assignment grouping

Assign all related coursework to the same class to keep the scoreboard and student view organized.

Common workflows

Setting up a new course

1

Create the class

Create a new class with the course identifier as the name.
2

Add instructors

Enroll all TAs and co-instructors who need access.
3

Enroll students

Either open for self-enrollment or bulk import the student roster.
4

Create assignments

Create and link all assignments for the semester to this class.

End of semester cleanup

1

Close enrollment

Set the class to closed to prevent new enrollments.
2

Archive assignments

Close all assignment submission windows.
3

Export data

Download final scoreboards and submission archives for record-keeping.
4

Optional: Delete class

Delete the class if you don’t need historical data (this removes enrollments but keeps submissions).

Build docs developers (and LLMs) love