Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Student Performance Decision Engine

A cross-language command-line application that analyses student participation, academic performance and attendance using a rule-based decision engine.

OCaml is responsible for parsing the data, calculating indicators and applying the decision rules. Java provides the interactive interface, starts the OCaml executable through ProcessBuilder, presents the results and generates individual JSON reports.

Project Status

Completed academic project

This repository contains a portfolio-oriented version of the original submission, with reorganised source files, synthetic sample data and expanded technical documentation.

Features

  • Parse Prolog-formatted facts directly in OCaml
  • List students alphabetically with activity and attendance indicators
  • Calculate forum participation, task average, quiz average and combined average
  • Calculate attendance percentages and evaluate self-assessment consistency
  • Apply a deterministic rule-based classification process
  • Sort students by final status and name
  • Invoke the OCaml decision engine from Java using ProcessBuilder
  • Generate an individual student report in JSON format
  • List students with consistent self-assessments as an additional feature
  • Handle missing files, malformed input, invalid arguments and unknown student IDs

Technologies

  • OCaml
  • Java
  • Java ProcessBuilder
  • Functional programming
  • Regular expressions and data parsing
  • Rule-based decision logic
  • JSON file generation

Architecture

The application separates data processing from user interaction:

  • OCaml: data parsing, indicator calculations, decision rules, sorting and formatted output
  • Java: command-line interface, process execution, input validation and JSON report generation
  • Sample data: synthetic facts stored in a Prolog-style text format

System Flow

flowchart TD
    U[User] -->|Selects an operation| J[Java CLI]
    J -->|Requests analysis| I[IntegradorOCaml]
    I -->|Starts process and passes command| O[OCaml Decision Engine]

    O -->|Reads and parses facts| D[(sample_database.pl)]
    D -.->|Returns facts| O

    O -.->|Writes result to stdout| I
    I -.->|Returns captured output| J

    J -->|Displays result| C[Console Output]
    J -->|Creates report| B[BoletimJson]
    B -->|Writes file| R[(JSON Report)]
Loading

Decision Rules

Rule Condition Result
R1 At least 3 forum participations Adequate participation
R2 Combined task and quiz average of at least 10 Positive performance
R3 Attendance of at least 75% Regular attendance
R4 Self-assessment within 2 points of the combined average Consistent self-assessment

The final state is determined from the first three rules and can be improved by one level when R4 is satisfied. A Retido result is never upgraded.

Possible final states:

  • Aprovado
  • Condicionado
  • Em Observacao
  • Em Risco
  • Retido

Project Structure

student-performance-decision-engine/
├── data/
│   └── sample_database.pl
├── src/
│   ├── java/
│   │   ├── Aplicacao.java
│   │   ├── BoletimJson.java
│   │   ├── IntegradorOCaml.java
│   │   └── Menu.java
│   └── ocaml/
│       └── main.ml
├── .gitignore
└── README.md

Available Commands

The OCaml executable accepts the following commands:

listar_alunos
indicadores <id>
avaliar <id>
listar_estados
listar_coerentes

Requirements

  • OCaml with the standard Str library
  • Java Development Kit 8 or later

How to Run on Windows

Open PowerShell in the repository root.

1. Compile the OCaml decision engine

cd src\ocaml
ocamlc -custom -I +str -o main.exe str.cma main.ml

Test it directly:

.\main.exe listar_alunos
.\main.exe indicadores 1
.\main.exe avaliar 2
.\main.exe listar_estados
.\main.exe listar_coerentes

2. Compile and run the Java interface

cd ..\java
javac *.java
java Aplicacao

The Java application automatically looks for ../ocaml/main.exe. A different executable path can be supplied explicitly:

java Aplicacao "C:\path\to\main.exe"

How to Run on Linux or macOS

Open a terminal in the repository root.

1. Compile the OCaml decision engine

cd src/ocaml
ocamlc -I +str -o main str.cma main.ml
chmod +x main

2. Compile and run the Java interface

cd ../java
javac *.java
java Aplicacao

The Java application automatically looks for ../ocaml/main on non-Windows systems.

Generated JSON Report

The Java interface can create a file named:

boletim_aluno_<id>.json

The report stores the calculated indicators and the detailed rule evaluation returned by the OCaml engine.

Academic Context

Developed for the Programming Languages course of the Bachelor's Degree in Informatics Engineering at Universidade Aberta.

The project explores functional programming in OCaml, object-oriented programming in Java and communication between independent processes.

What I Learned

  • Functional data transformation with List.map, List.filter and List.fold_left
  • Parsing structured text with regular expressions
  • Modelling deterministic decision rules as pure functions
  • Sorting records by multiple criteria
  • Integrating Java with an external executable through ProcessBuilder
  • Capturing standard output and process exit codes
  • Separating processing logic from the user interface
  • Generating and escaping JSON content
  • Designing input validation and error handling across two languages

Limitations and Future Improvements

  • Add automated tests for the OCaml rules and parsers
  • Replace manual JSON construction with a dedicated JSON library
  • Add CSV and JSON data import options
  • Provide an English-language interface
  • Add a graphical or web-based interface
  • Configure continuous integration after validating OCaml and Java toolchains

Author

Bruna Landgraff
Informatics Engineering Student
GitHub · LinkedIn

About

Cross-language student analytics application using OCaml for data processing and rule-based decisions, with a Java CLI and JSON reporting.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages