public function process()
    {
        $testSession = $this->getState();
        $itemSubset = $this->getItemSubset();
        $numberPresented = 0;

        foreach ($itemSubset as $item) {
            $itemSessions = $testSession->getAssessmentItemSessions($item->getIdentifier());
            
            if ($itemSessions !== false) {
                foreach ($itemSessions as $itemSession) {
                
                    if ($itemSession->isPresented() === true) {
                
                        $numberPresented++;
                    }
                }
            }
        }

        return new QtiInteger($numberPresented);
    }
public function process()
    {
        $testSession = $this->getState();
        $itemSubset = $this->getItemSubset();
        $numberPresented = 0;

        foreach ($itemSubset as $item) {
            $itemSessions = $testSession->getAssessmentItemSessions($item->getIdentifier());
            
            if ($itemSessions !== false) {
                foreach ($itemSessions as $itemSession) {
                
                    if ($itemSession->isPresented() === true) {
                
                        $numberPresented++;
                    }
                }
            }
        }

        return new QtiInteger($numberPresented);
    }
public function process ( ) { $ testSession = $ this -> getState ( ) ; $ itemSubset = $ this -> getItemSubset ( ) ; $ numberPresented = 0 ; foreach ( $ itemSubset as $ item ) { $ itemSessions = $ testSession -> getAssessmentItemSessions ( $ item -> getIdentifier ( ) ) ; if ( $ itemSessions !== false ) { foreach ( $ itemSessions as $ itemSession ) { if ( $ itemSession -> isPresented ( ) === true ) { $ numberPresented ++ ; } } } } return new QtiInteger ( $ numberPresented ) ; }
Process the related NumberPresented expression.

@return integer The number of items in the given item sub-set that have been attempted (at least once).
@throws \qtism\runtime\expressions\ExpressionProcessingException
Process the related NumberPresented expression .