/*
Copyright (c) 2007 Matt Williams matt@milliams.com

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License or (at
your option) version 3 or, at the discretion of KDE e.V. (which shall
act as a proxy as in section 14 of the GPLv3), any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef KQTIITEMBODY_H
#define KQTIITEMBODY_H

#include "kqtibodyelement.h"

#include <kqti_export.h>
#include <QDomElement>
#include <QList>

class KQtiChoiceInteraction;
class KQtiBlock;

/**
 * \class KQtiItemBody
 * The item body contains the text, graphics, media objects, and interactions
 * that describe the item's content and information about how it is structured.
 * The body is presented by combining it with stylesheet information, either
 * explicitly or implicitly using the default style rules of the delivery or
 * authoring system.
 * 
 * The body must be presented to the candidate when the associated item session
 * is in the interacting state. In this state, the candidate must be able to
 * interact with each of the visible interactions and therefore set or update
 * the values of the associated response variables. The body may be presented
 * to the candidate when the item session is in the closed or review state. In
 * these states, although the candidate's responses should be visible, the
 * interactions must be disabled so as to prevent the candidate from setting or
 * updating the values of the associated response variables. Finally, the body
 * may be presented to the candidate in the solution state, in which case the
 * correct values of the response variables must be visible and the associated
 * interactions disabled.
 * 
 * http://www.imsglobal.org/question/qtiv2p1pd2/imsqti_infov2p1pd2.html#element10110
 * \todo Allow a list of 'block' items
 */

class KQTI_EXPORT KQtiItemBody : public KQtiBodyElement
{
    public:
        KQtiItemBody();
        KQtiItemBody(const QDomElement& element);
        ~KQtiItemBody();
        
        void addBlock(KQtiBlock* block);
        QList<KQtiBlock*> blocks() const {return mBlocks;}
        
        /**
         * element
         * @return create and return the DOM element
         */
        QDomElement element() const;
        
    protected:
        QList<KQtiBlock*> mBlocks; ///[*]
};

#endif
