/*
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 KQTIASSESSMENTITEM_H
#define KQTIASSESSMENTITEM_H

#include <KUrl>
#include <kqti_export.h>

#include <QString>
#include <QList>
#include <QDomDocument>
#include <QMetaType>

class KQtiChoiceInteraction;
class KQtiResponseDeclaration;
class KQtiItemBody;
                
/**
 * \class KQtiAssessmentItem
 * 
 * 
 * http://www.imsglobal.org/question/qtiv2p1pd2/imsqti_infov2p1pd2.html#element10012
 */

class KQTI_EXPORT KQtiAssessmentItem /*This is a base class*/
{
    public:
        KQtiAssessmentItem() {/*Hopefully this isn't used*/}
        explicit KQtiAssessmentItem(const QString& identifier, const QString& title, bool timeDependent=false);
        explicit KQtiAssessmentItem(const QDomDocument& document);
        ~KQtiAssessmentItem();
        
        QDomDocument document() const;
        
        void setTitle(const QString& title) {mTitle = title;}
        QString title() const {return mTitle;}
        void setTimeDependent(bool timeDependent) {mTimeDependent = timeDependent;}
        bool isTimeDependent() const {return mTimeDependent;}
        void setIdentifier(const QString& identifier) {mIdentifier = identifier;}
        QString identifier() const {return mIdentifier;}
        
        void addItemBody(KQtiItemBody* itemBody);
        KQtiItemBody* itemBody() const {return mItemBody;}
        void addResponseDeclaration(KQtiResponseDeclaration* responseDeclaration);
        QList<KQtiResponseDeclaration*> responseDeclarations() const {return mResponseDeclarations;}
        
    protected:
        ///Attributes
        QString mIdentifier; //[1]
        QString mTitle; //[1]
        bool mTimeDependent; //[1]
        ///Contains
        KQtiItemBody* mItemBody; //[0..1]
        QList<KQtiResponseDeclaration*> mResponseDeclarations; //[*]
};

//Q_DECLARE_METATYPE(KQtiAssessmentItem)
Q_DECLARE_METATYPE(KQtiAssessmentItem*)

#endif
