Skip to main content
This guide covers all administrative tasks for managing your Wecode installation, including system configuration, user management, and maintenance.

System Overview

As an administrator, you have full access to all Wecode features including:
  • System settings and configuration
  • User management (creating, editing, bulk import)
  • Class (Lop) management
  • Problem and assignment oversight
  • System maintenance and security

Accessing Admin Settings

Navigate to the Settings page from the main navigation menu. Only users with admin or head instructor roles can access these settings.
Permission Required: Admin role only for modifying system settings

System Settings

General Configuration

The settings page (/settings route, handled by setting_controller.php) provides access to core system configuration:
1

Navigate to Settings

Click on “Settings” in the main navigation menu
2

Configure Basic Settings

Update the following essential settings:
  • Site Name: Your Wecode installation name
  • Timezone: System timezone for all date/time operations
  • Theme: UI theme selection
3

Save Changes

Click “Update Settings” to apply your changes

Critical System Paths

These settings are critical for system operation. Changes require server access and should only be modified by system administrators with technical knowledge.
Tester Path (tester_path)
  • Location of the code testing and evaluation scripts
  • Used for judging submissions
  • Must be accessible by the web server
Assignments Root (assignments_root)
  • Base directory for storing all assignments, problems, and submissions
  • Requires write permissions for the web server
  • Contains subdirectories:
    • /problems/{problem_id}/ - Problem test cases and descriptions
    • /assignment_{assignment_id}/ - Assignment-specific files
    • /assignment_{assignment_id}/problem_{problem_id}/{username}/ - Student submissions

Submission Limits

File Size Limit (file_size_limit)
  • Maximum upload size for student code submissions (in KB)
  • Default: Varies based on installation
  • Affects both file uploads and pasted code
Output Size Limit (output_size_limit)
  • Maximum output size for program execution (in KB)
  • Prevents infinite loops from consuming disk space

Registration Settings

Enable Registration (enable_registration)
  • Toggle public user registration
  • When disabled, only admins can create accounts
Registration Code (registration_code)
  • Optional code required for self-registration
  • Leave empty to allow open registration (when enabled)
  • Students must enter this code during signup

Late Submission Policy

Default Late Rule (default_late_rule)
  • Mathematical expression for calculating late penalties
  • Uses variables: delay, extra_time
  • Example: max(0, 100 - delay/3600) (1% penalty per hour)
Submit Penalty (submit_penalty)
  • Additional penalty per submission attempt
  • Used in some grading schemes

Display Settings

Results Per Page (All) (results_per_page_all)
  • Number of items shown in submission lists
  • Default: 30
Results Per Page (Final) (results_per_page_final)
  • Number of items in final submission views
  • Default: 30
Week Start (week_start)
  • First day of week for calendar displays
  • 0 = Sunday, 1 = Monday

Queue Configuration

Concurrent Queue Processes (concurent_queue_process)
  • Number of parallel judging processes
  • Higher values = faster judging but more CPU usage
  • Recommended: 2-4 depending on server capacity

Language Settings

Default Language Number (default_language_number)
  • Default programming language for new problems
  • Corresponds to language ID in database
Default Trial Time (default_trial_time)
  • Hours of access for trial student accounts
  • After expiration, student accounts become guest accounts
  • Set to 0 or null for unlimited access

Security Settings

IP White List (ip_white_list)
  • Restrict access to specific IP addresses or ranges
  • Format: Comma-separated list of IPs or CIDR ranges
  • Example: 192.168.1.0/24, 10.0.0.1
  • Leave empty to allow all IPs
Be careful when configuring IP whitelisting. Incorrect settings may lock you out of the system.

User Management

Viewing All Users

Access the user list at /users to see all registered users:
  • Username and display name
  • Email address
  • Role (Admin, Head Instructor, Instructor, Student, Guest)
  • Account creation date
  • Trial time (if applicable)

Creating Individual Users

1

Navigate to User Creation

Click “Users” → “Add New User”
2

Enter User Details

  • Username: Unique identifier (required)
  • Email: Valid email address (required)
  • Password: Minimum 8 characters (required)
  • Display Name: Optional friendly name
  • Role: Select from available roles
3

Submit

Click “Create User” to add the account

Bulk Adding Users

For adding multiple users at once (e.g., enrolling a class):
1

Navigate to Bulk Add

Go to “Users” → “Add Multiple Users”
2

Prepare User List

Format each user on a new line with comma-separated values:
username, email, password, role, display_name
Example:
student1, [email protected], password123, student, John Doe
student2, [email protected], random[12], student, Jane Smith
# This is a comment and will be ignored
instructor1, [email protected], securepass, instructor, Dr. Johnson
3

Password Generation

Use random[N] to auto-generate a password of N characters:
  • random[8] generates an 8-character random password
  • random[12] generates a 12-character random password
4

Submit and Review

  • Paste your user list into the text area
  • Optionally enable email notifications
  • Click “Add Users”
  • Review the results showing successful and failed additions
Lines starting with # are treated as comments and ignored. Empty lines are also skipped.

Role Permissions

Admin
  • Full system access
  • Can create/modify any user, problem, or assignment
  • Access to all settings
Head Instructor
  • Can create classes (lops) and assignments
  • Can create instructors and students
  • Can manage their own classes and assignments
  • Cannot access system settings
Instructor
  • Can view classes they belong to
  • Can create students
  • Can create problems and assignments
  • Limited to their own resources
Student
  • Can enroll in open classes
  • Can submit to assignments
  • Can practice on available problems
Guest
  • Read-only access
  • Cannot submit code
  • Typically students whose trial period has expired

Editing Users

Click on any user in the user list to:
  • Update email, display name, or password
  • Change role (admin only)
  • Set trial time duration
  • View user statistics and submission history

Trial Accounts

Set trial time for temporary student access:
1

Access Trial Settings

Navigate to user list, click “Set Trial Time”
2

Enter Usernames

Enter usernames (space or comma-separated)
3

Set Duration

Choose either:
  • New Time: Number of hours from account creation
  • End Time: Specific date/time when access expires
4

Apply

Submit to update trial accounts. Users automatically convert to guest role after expiration.

Deleting Users

User deletion is permanent and requires that the user has no submissions. Delete all submissions first.
To delete a user:
  1. Click the delete icon next to the user
  2. If user has submissions, you’ll need to delete them first
  3. Confirm deletion

Class (Lop) Management

What are Lops?

“Lop” (Vietnamese for “class”) represents a group of students and instructors. Classes are used to:
  • Organize students into cohorts
  • Assign homework/assignments to groups
  • Track class-wide performance

Creating a Class

1

Navigate to Classes

Click “Classes” in the navigation menu
2

Create New Class

Click “Add New Class”
3

Configure Class

  • Name: Class identifier (e.g., “CS101 Spring 2024”)
  • Open: Toggle whether students can self-enroll
  • User List: Comma or space-separated usernames to enroll
4

Save

Click “Create Class”. The creator is automatically enrolled as an instructor.

Managing Class Enrollment

Edit a class to:
  • Add users by entering their usernames
  • Remove users by checking the boxes next to their names
  • Toggle open/closed status for self-enrollment

Class Scoreboards

View aggregate class performance:
  1. Navigate to the class list
  2. Click “Scoreboard” next to a class
  3. View cumulative scores across all class assignments

Problem Management

Admins can view and edit all problems in the system.

Problem Oversight

  • View all problems at /problems
  • Filter by owner, tags, or search term
  • See usage statistics (total submissions, acceptance rate)
  • Edit any problem regardless of owner

Problem Settings

Allow Practice
  • Enables/disables problem for practice mode
  • Students can submit outside of assignments
Sharable
  • Allows other instructors to use the problem
  • Visible to all instructors, editable only by owner
Allow Input/Output Download
  • Permits students to download test case inputs/outputs
  • Useful for local debugging

Import/Export Problems

Exporting Problems
  1. Select problems from the problem list
  2. Click “Export Selected”
  3. Download ZIP containing:
    • Test cases (in/out folders)
    • Problem description
    • Metadata JSON file
Importing Problems
  1. Prepare ZIP file in Wecode export format
  2. Go to Problems → Import
  3. Upload ZIP file
  4. Problems are imported with your user as owner

Assignment Management

Admins can access and modify all assignments.

Assignment Settings

Open/Closed Status
  • Open: Students can submit
  • Closed: Only instructors can submit
  • Toggle by clicking the status indicator
Scoreboard Visibility
  • Enable to show public rankings
  • Disable to keep submissions private

Downloading Submissions

For any assignment, you can download: All Submissions
  • Complete submission history
  • Includes all files and judging results
Final Submissions by User
  • One file per student per problem
  • Organized in folders: username/problem_X.ext
Final Submissions by Problem
  • One file per student per problem
  • Organized in folders: problem_X/username.ext

Rejudging Submissions

Use when test cases or grading logic changes:
1

Navigate to Assignment

Find the assignment needing rejudging
2

Access Rejudge

Click “Rejudge” button
3

Select Scope

Choose:
  • All problems in assignment
  • Specific problem only
4

Confirm

Click “Rejudge” to queue all submissions for re-evaluation
Rejudging resets submission status to PENDING and re-runs all test cases.

Language Management

Configure supported programming languages at /languages:
  • Language name and file extension
  • Compiler/interpreter commands
  • Default time and memory limits
  • Sorting order for display

Adding a Language

Adding languages requires configuring the tester system. This is an advanced operation requiring server access.

Plagiarism Detection (Moss)

Integrate with Stanford’s MOSS (Measure of Software Similarity) for plagiarism detection.

Setup Moss

1

Obtain Moss User ID

Register for a MOSS account at http://theory.stanford.edu/~aiken/moss/
2

Configure in Wecode

Navigate to Moss page, enter your Moss User ID
3

Test Connection

Click “Update” to save and verify configuration

Running Moss Detection

1

Select Assignment

Navigate to the Moss page and choose an assignment
2

Run Detection

Click “Detect Plagiarism”
3

Wait for Results

Processing may take several minutes. Status shows “awaiting response”
4

View Results

Click the generated Moss link to see similarity reports

Maintenance Tasks

Database Backups

Regular backups are essential. Back up both the database and the assignments_root directory.
Recommended backup strategy:
  1. Daily automated database dumps
  2. Weekly full filesystem backups of assignments_root
  3. Store backups off-server

Disk Space Management

Monitor disk usage in:
  • assignments_root/ directory (submissions and test cases)
  • Database size (submission records)

Queue Monitoring

Check the queue status to ensure submissions are being processed:
  • Navigate to Queue page
  • View pending submissions
  • Check for stuck items
  • Manually trigger queue processing if needed

Log Files

Monitor application logs for:
  • Failed submissions
  • System errors
  • Authentication issues
  • File permission problems

Security Best Practices

1

Use Strong Passwords

Enforce minimum password requirements (default: 8 characters)
2

Enable IP Whitelisting

Restrict access to known networks for added security
3

Regular Updates

Keep Wecode and server software up to date
4

Monitor Access

Review user login times and activity regularly
5

Backup Verification

Test backup restoration periodically
6

File Permissions

Ensure assignments_root has appropriate permissions (typically 755 for directories, 644 for files)

Troubleshooting

Submissions Stuck in Queue

Symptoms: Submissions stay in PENDING status Solutions:
  1. Check queue worker is running
  2. Verify tester_path is correct and accessible
  3. Check file permissions on assignments_root
  4. Manually trigger queue processing
  5. Review error logs

Users Cannot Upload Files

Symptoms: File upload errors Solutions:
  1. Check file_size_limit setting
  2. Verify PHP upload_max_filesize and post_max_size
  3. Confirm assignments_root write permissions
  4. Check disk space

Moss Not Working

Symptoms: No Moss results generated Solutions:
  1. Verify Moss User ID is correct
  2. Check tester_path contains moss script
  3. Ensure moss script is executable (chmod +x)
  4. Verify network connectivity to Moss servers

Assignment Time Issues

Symptoms: Wrong start/finish times Solutions:
  1. Verify timezone setting matches server timezone
  2. Check system time on server
  3. Ensure timezone is set in both settings and PHP configuration

Advanced Configuration

Customizing Late Penalties

The late_rule field accepts mathematical expressions using: Variables:
  • delay: Seconds after deadline
  • extra_time: Extra time allowed (seconds)
Functions:
  • Mathematical: max(), min(), abs(), floor(), ceil()
  • Trigonometric: sin(), cos(), tan()
  • Exponential: exp(), log(), pow()
Examples:
// Linear decay: 1% per hour late
max(0, 100 - delay/3600)

// No penalty within extra_time, then 0
delay <= extra_time ? 100 : 0

// Exponential decay
100 * exp(-delay/86400)

// Step function: 20% off per day
max(0, 100 - floor(delay/86400)*20)

Email Configuration

Configure email settings for notifications (requires server mail configuration):
  • Mail From: Sender email address
  • Mail From Name: Sender display name
  • Reset Password Mail: Template for password resets
  • Add User Mail: Template for new user notifications
Email functionality requires proper SMTP configuration in Laravel’s .env file.

Summary

As an administrator, you control all aspects of your Wecode installation. Key responsibilities include:
  • ✅ Configuring system settings and paths
  • ✅ Managing user accounts and permissions
  • ✅ Organizing classes and instructors
  • ✅ Monitoring system health and queue status
  • ✅ Maintaining backups and security
  • ✅ Supporting instructors and students
  • ✅ Troubleshooting issues
For instructor-specific features, see the Instructor Guide. For student features, see the Student Guide.

Build docs developers (and LLMs) love