Index: code/branches/Dialog_HS17/src/modules/dialog/Dialog.cc
===================================================================
--- code/branches/Dialog_HS17/src/modules/dialog/Dialog.cc	(revision 11612)
+++ code/branches/Dialog_HS17/src/modules/dialog/Dialog.cc	(revision 11642)
@@ -24,6 +24,6 @@
 		XMLPortParam(Dialog, "name", setName, getName, xmlelement, mode);
 		XMLPortParam(Dialog, "currentQuestionId", setCurrentQuestionId, getCurrentQuestionId, xmlelement, mode);
-		XMLPortObject(Dialog, Question, "Questions", addQuestion, getQuestion, xmlelement, mode);
-		XMLPortObject(Dialog, Answer, "Answers", addAnswer, getAnswer, xmlelement, mode);
+		XMLPortObject(Dialog, Question, "questions", addQuestion, getQuestion, xmlelement, mode);
+		XMLPortObject(Dialog, Answer, "answers", addAnswer, getAnswer, xmlelement, mode);
 	}
 
@@ -79,10 +79,11 @@
 	}
 
-	std::vector<std::string> Dialog::getAnswers() // returned vector mit allen momentanen AntwortenIds
+	std::vector<std::string>* Dialog::getAnswerIds() // returned vector mit allen momentanen AntwortenIds
 	{
-
+		
 		Question* question = (this->questions_.find(this->currentQuestionId_))->second;
-		std::vector<std::string> answers = question->getAnswerIds();
+		std::vector<std::string>* answers = question->getAnswerIds();
 		return answers;
+		
 	} 
 	
@@ -90,8 +91,13 @@
     {  
     	DialogManager& m = DialogManager::getInstance();
-    	m.setDialog(this);
-    	orxout() << "dialog executed \n"; 
-        OrxonoxOverlay::showOverlay("Dialog");
-
+    	
+    	if(questions_.count(this->currentQuestionId_)){
+    		m.setDialog(this);
+    		OrxonoxOverlay::showOverlay("Dialog");
+    	}
+    	else {
+    		orxout() << "no start defined " << endl;
+    	}
+    	
         return false;
     }
@@ -106,7 +112,5 @@
     {
     	bool end = false;
-    	if (this->currentQuestionId_ == "end"){
-    		end = true;
-    	} else if ((this->questions_.find(this->currentQuestionId_)->second)->getAnswerIds().empty()){
+    	if ((this->questions_.find(this->currentQuestionId_)->second)->getAnswerIds()->empty()){
     		end = true;
     	}	
@@ -118,3 +122,8 @@
 		return this->questions_.find(this->currentQuestionId_)->second->getQuestion();
 	}
+
+	std::string Dialog::getAnswerString(std::string answerId)
+	{
+		return this->answers_.find(answerId)->second->getAnswer();
+	}
 }
Index: code/branches/Dialog_HS17/src/modules/dialog/Dialog.h
===================================================================
--- code/branches/Dialog_HS17/src/modules/dialog/Dialog.h	(revision 11612)
+++ code/branches/Dialog_HS17/src/modules/dialog/Dialog.h	(revision 11642)
@@ -35,5 +35,5 @@
 			Question* getQuestion(unsigned int index) const; // // benoetigt fuer xmlPort
 			Answer* getAnswer(unsigned int index) const; // benoetigt fuer xmlPort
-			std::vector<std::string> getAnswers(); 	// returned vector mit allen momentanen AntwortenIds
+			std::vector<std::string>* getAnswerIds(); 	// returned vector mit allen momentanen AntwortenIds
 
 	 		bool execute(bool bTriggered, BaseObject* trigger);
@@ -44,4 +44,5 @@
 
 			std::string getQuestionString(); //gibt string der momentanen Frage 
+			std::string getAnswerString(std::string answerId); //gibt string der zur Id passenden Frage
 
 		private: 
Index: code/branches/Dialog_HS17/src/modules/dialog/DialogManager.cc
===================================================================
--- code/branches/Dialog_HS17/src/modules/dialog/DialogManager.cc	(revision 11612)
+++ code/branches/Dialog_HS17/src/modules/dialog/DialogManager.cc	(revision 11642)
@@ -16,5 +16,6 @@
 	void DialogManager::setDialog(Dialog* dialog)
 	{
-		this->currentTalk_ = dialog;	
+		this->currentTalk_ = dialog;
+		answerIds_ = currentTalk_->getAnswerIds();	
 	}
 
@@ -26,10 +27,28 @@
     }
 
-    /*
-    std::vector<std::string> DialogManager::getAnswers()
+    int DialogManager::getSize()
+    {   
+        return 2; //return this->answerIds_->size();
+    }
+
+    std::string DialogManager::getAnswer(int index)
     {
-    	// lua hat komisch arrays (eigentlich tables), wie implementiert man answers so das man nacher den key der gegeben antwort a
-    	// hat um ihn fuer update zu benutzen?
+    	return this->currentTalk_->getAnswerString(this->answerIds_->at(index));
     }
-	*/
+	
+    std::string DialogManager::getPerson()
+    {
+    	return this->currentTalk_->getName();
+    }
+
+    bool DialogManager::endtest()
+    {
+    	return this->currentTalk_->ending();
+    }
+
+    void DialogManager::update(int index)
+    {
+    	this->currentTalk_->update(answerIds_->at(index));
+    	answerIds_ = this->currentTalk_->getAnswerIds();
+    }
 }
Index: code/branches/Dialog_HS17/src/modules/dialog/DialogManager.h
===================================================================
--- code/branches/Dialog_HS17/src/modules/dialog/DialogManager.h	(revision 11612)
+++ code/branches/Dialog_HS17/src/modules/dialog/DialogManager.h	(revision 11642)
@@ -30,5 +30,9 @@
 
         std::string getQuestion(); //tolua_export
-        //std::vector<std::string> getAnswers();
+        int getSize(); //tolua_export
+        std::string getAnswer(int index); //tolua_export
+        std::string getPerson(); //tolua_export
+        bool endtest(); //tolua_export
+        void update(int index); //tolua_export
 
 private:
@@ -36,4 +40,5 @@
 
     Dialog* currentTalk_;
+    std::vector<std::string>* answerIds_;
 
     };//tolua_export
Index: code/branches/Dialog_HS17/src/modules/dialog/Question.cc
===================================================================
--- code/branches/Dialog_HS17/src/modules/dialog/Question.cc	(revision 11612)
+++ code/branches/Dialog_HS17/src/modules/dialog/Question.cc	(revision 11642)
@@ -19,5 +19,5 @@
 		XMLPortParam(Question, "Id", setQuestionId, getQuestionId, xmlement, mode);
 
-		XMLPortObject(Question, AnswerId, "answers", addAnswerId, getAnswerId, xmlement, mode);
+		XMLPortObject(Question, AnswerId, "answerIds", addAnswerId, getAnswerId, xmlement, mode);
 	}
 
@@ -52,7 +52,7 @@
 	}
 
-	std::vector<std::string> Question::getAnswerIds()
+	std::vector<std::string>* Question::getAnswerIds()
 	{
-		return this->answerIds_;
+		return &(this->answerIds_);
 	}
 	
Index: code/branches/Dialog_HS17/src/modules/dialog/Question.h
===================================================================
--- code/branches/Dialog_HS17/src/modules/dialog/Question.h	(revision 11612)
+++ code/branches/Dialog_HS17/src/modules/dialog/Question.h	(revision 11642)
@@ -33,5 +33,5 @@
 			// die sowieso gebraucht wird?
 
-			std::vector<std::string> getAnswerIds(); //returnt vektor mit allen Ids
+			std::vector<std::string>* getAnswerIds(); //returnt vektor mit allen Ids
 
 
