The project is in a healthy, maintained state
Ruby gem to generate automated test reports for academic assignments with HTML templates, CSV export, optional PDF (via prawn), class-wide reporting, and basic Jaccard code similarity.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 5.16
~> 2.5
~> 13.0
~> 1.21

Runtime

~> 3.2
 Project Readme

ruby_test_student_grader

License: MIT Gem Version

A Ruby gem for generating academic test reports in HTML format. Initially designed for automated grading of university programming assignments, with flexibility to adapt to different testing frameworks.

Current Status: Early Development (Beta)
Primary Use: Automated evaluation of academic coding tasks
Future Goal: Modular system for diverse testing scenarios


Installation

Local Development

Add to your Rails Gemfile:

gem 'ruby_test_student_grader', path: '/path/to/gem/directory'

Then run:

bundle install

From RubyGems (Once Published)

gem install ruby_test_student_grader

Basic Usage

Configure in your test helper:

 test/test_helper.rb
require 'ruby_test_student_grader'

Minitest.after_run do
  RubyTestStudentGrader::Reporter.new(
    total_score,      # Calculated score
    max_score,        # Maximum possible score
    failed_tests,     # Array of failed test names
    automated_feedback # Generated feedback summary
  ).generate
end

Report will be generated at:

License: MIT Gem Version

A Ruby gem for generating academic test reports in HTML format. Initially designed for automated grading of university programming assignments, with flexibility to adapt to different testing frameworks.

Current Status: Early Development (Beta)
Primary Use: Automated evaluation of academic coding tasks
Future Goal: Modular system for diverse testing scenarios


Installation

Local Development

Add to your Rails Gemfile:

gem 'ruby_test_student_grader', path: '/path/to/gem/directory'

Then run:

bundle install

From RubyGems (Once Published):

gem install ruby_test_student_grader

Basic Usage

Configure in your test helper:

test/test_helper.rb

require 'ruby_test_student_grader'

Minitest.after_run do
  RubyTestStudentGrader::Reporter.new(
    total_score,      # Calculated score
    max_score,        # Maximum possible score
    failed_tests,     # Array of failed test names
    automated_feedback # Generated feedback summary
  ).generate
end

Report will be generated at:

public/test_report.html

Evaluated Data

  • Test results (pass/fail)
  • Score calculations
  • Execution metadata
  • Custom feedback
  • Detailed error traces

Development Current Features

  • HTML Report Generation
  • Academic Grading System
  • Detailed Error Analysis
  • Customizable Templates

Planned Features

  • PDF/CSV Export
  • LMS Integration
  • Code Similarity Detection
  • AI-Powered Feedback

Academic Configuration

RubyTestStudentGrader.configure do |config|
  config.grading_scale = { 
    passing: 4.0,
    excellence: 5.5
  }
  config.rubric = {
    code_quality: 30%,
    coverage: 20%,
    functionality: 50%
  }
end

Architecture

lib/
├── ruby_test_student_grader/
│   ├── reporter.rb         # Core logic
│   ├── template.html.erb   # HTML template
├── ruby_test_student_grader.rb     # Main module

Contributing

We welcome contributions for:

  • New report formats
  • Additional framework support
  • Code analysis improvements
  • AI integration modules

License

MIT License - See LICENSE. Requires attribution in academic materials using this software.

Educational assessment tool - Adaptable for diverse pedagogical needs.

Note: This project is in very early stage and could have major bugs

Try the new features

See README_PROBAR.md for a step-by-step guide. Quick summary:

# HTML and CSV
reporter = RubyTestStudentGrader::Reporter.new(5.2, 6.0, ["test_model"], "Good job", course_name: "IIC2143")
reporter.generate
reporter.generate_csv("public/test_report.csv")

# PDF (optional, requires prawn)
reporter.generate_pdf("public/test_report.pdf")

# Multiple students
students = [ { id: 1, name: "Alice", total_score: 5.2, max_score: 6.0, failed_tests: ["test_model"], feedback: "OK" } ]
RubyTestStudentGrader::ClassReporter.new(students, course_name: "IIC2143", output_dir: "public/reports").generate_all

# Similarity
RubyTestStudentGrader::Similarity.jaccard("def a;1;end", "def b;1;end", k: 5)

Demo script

Use the demo script to verify everything end-to-end.

  • Path: scripts/demo.rb
  • It will:
    • Generate HTML and CSV in public/
    • Try to generate PDF (if prawn is installed)
    • Create per-student reports and an index under public/reports/
    • Print a code similarity score

Run:

bundle exec ruby scripts/demo.rb

Optional (for PDF):

bundle add prawn

Tip: set a course name for the report via env var (optional):

export COURSE_NAME="IIC2143"

Extras

  • CSV export: RubyTestStudentGrader::Reporter#generate_csv("public/test_report.csv")
  • PDF export (optional, requires prawn): RubyTestStudentGrader::Reporter#generate_pdf("public/test_report.pdf")
  • Course name in HTML/CSV/PDF: pass course_name: "IIC2143" to the constructor or set COURSE_NAME in your environment.

Reports for multiple students

students = [
  { id: 1, name: "Alice", total_score: 5.2, max_score: 6.0, failed_tests: ["test_model"], feedback: "Good job" },
  { id: 2, name: "Bob", total_score: 3.9, max_score: 6.0, failed_tests: ["test_controller"], feedback: "Check controllers" }
]
RubyTestStudentGrader::ClassReporter.new(students, course_name: "IIC2143", output_dir: "public/reports").generate_all

Basic similarity detection

RubyTestStudentGrader::Similarity.jaccard(code_a, code_b, k: 5) # => 0.0..1.0