Documentation

GetNextTerm

Use case for fetching the next term to test.

Retrieves the next word using spaced repetition algorithm, gets sentence context, and formats the solution.

Tags
since
3.0.0

Table of Contents

Properties

$repository  : ReviewRepositoryInterface

Methods

__construct()  : mixed
Constructor.
execute()  : ReviewWord}
Get the next term for testing.
formatTermForTest()  : array{0: string, 1: string}
Format term for test display.
getSentenceForWord()  : string
Get sentence for word based on mode.
getSolution()  : string
Get solution text for the test.

Properties

Methods

formatTermForTest()

Format term for test display.

private formatTermForTest(ReviewWord $word, string $sentence, int $testType) : array{0: string, 1: string}
Parameters
$word : ReviewWord

Word entity

$sentence : string

Sentence containing the word

$testType : int

Test type (1-5)

Return values
array{0: string, 1: string}

[HTML display, plain word text]

getSentenceForWord()

Get sentence for word based on mode.

private getSentenceForWord(ReviewWord $word, bool $wordMode) : string
Parameters
$word : ReviewWord

The word

$wordMode : bool

Whether in word mode

Return values
string

Sentence with word marked

getSolution()

Get solution text for the test.

private getSolution(int $testType, ReviewWord $word, bool $wordMode, string $wordText) : string
Parameters
$testType : int

Test type

$word : ReviewWord

Word entity

$wordMode : bool

Word mode flag

$wordText : string

Displayed word text

Return values
string

Solution text


        
On this page

Search results