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

#include <kqti_export.h>

#include <QDomElement>
#include <QMetaType>

class KQtiAssessmentSection;

/**
 * \class KQtiTestPart
 * 
 * 
 * http://www.imsglobal.org/question/qtiv2p1pd2/imsqti_infov2p1pd2.html#element10488
 */

class KQTI_EXPORT KQtiTestPart /*This is a base class*/
{
    public:
        explicit KQtiTestPart(const QString& navigationMode=QString("linear"), const QString& submissionMode=QString("individual"));
        explicit KQtiTestPart(const QDomElement& element);
        ~KQtiTestPart();
        
        void addAssessmentSection(KQtiAssessmentSection* assessmentSection);
        QList<KQtiAssessmentSection*> assessmentSections() const {return mAssessmentSections;}
        
        void setIdentifier(const QString& identifier) {mIdentifier = identifier;}
        QString identifier() const {return mIdentifier;}
        
        /**
         * element
         * @return create and return the DOM element
         */
        QDomElement element() const;
        
    protected:
        QList<KQtiAssessmentSection*> mAssessmentSections; //[1..*]
        QString mNavigationMode; //[1]
        QString mIdentifier; //[1]
        QString mSubmissionMode; //[1]
        //QList<KQtiTestFeeback*> testFeedbacks; //[*]
        //KQtiTimeLimits timeLimits; //[0..1]
        //QList<KQtiPreCondition*> preConditions//[*]
        //QList<KQtiBranchRule*> branchRules//[*]
        //itemSessionControl //[0..1] TODO This exists now
};

//Q_DECLARE_METATYPE(KQtiTestPart)
Q_DECLARE_METATYPE(KQtiTestPart*)

#endif
