Ali ______ his lesson when I saw him.

Ali ______ his lesson when I saw him.

Explanation

The action "when I saw him" is in the past, so the ongoing past action should use past continuous tense.

"Was learning" correctly matches the timing and form.