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

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

/**
 * \class KQtiItemResult
 * The result of an item session is reported with an itemResult. A report may
 * contain multiple results for the same instance of an item representing
 * multiple attempts, progression through an adaptive item, or even more
 * detailed tracking. In these cases, each item result must have a different
 * datestamp.
 * 
 * http://www.imsglobal.org/question/qtiv2p1pd2/imsqti_resultv2p1pd2.html#element10816
 */

enum KQtiSessionStatus
{
    Initial,
    PendingSubmission,
    PendingResponseProcessing,
    Final
};

class KQtiItemVariable;

class KQTI_EXPORT KQtiItemResult /*This is a base class*/
{
    public:
        KQtiItemResult();
        //KQtiItemResult(const QDomElement& element);
        virtual ~KQtiItemResult();
        
        void setIdentifier(const QString& identifier) {mIdentifier = identifier;}
        QString identifier() const {return mIdentifier;}
        void setSequenceIndex(int index) {mSequenceIndex = index;}
        int sequenceIndex() const {return mSequenceIndex;}
        void setSessionStatus(KQtiSessionStatus sessionStatus) {mSessionStatus = sessionStatus;}
        KQtiSessionStatus sessionStatus() const {return mSessionStatus;}
        void addItemVariable(KQtiItemVariable* itemVariable);
        QList<KQtiItemVariable*> itemVariables() const {return mItemVariables;}
        
        /**
         * element
         * @return create and return the DOM element
         */
        //virtual QDomElement element() const = 0;
        
    protected:
        QString mIdentifier;
        int mSequenceIndex; //[0..1]
        //datestamp //[1]
        KQtiSessionStatus mSessionStatus; //[1]
        QList<KQtiItemVariable*> mItemVariables; //[*]
        //candidateComment //[0..1]
};

#endif
