
function ActivityRunTimeObjective (
			Identifier,
			SuccessStatus,
			CompletionStatus,
			ScoreScaled, 
			ScoreRaw, 
			ScoreMax, 
			ScoreMin, 
			ProgressMeasure, 
			Description){
	this.Identifier = Identifier;
	this.SuccessStatus = SuccessStatus;
	this.CompletionStatus = CompletionStatus;
	this.ScoreScaled = ScoreScaled; 
	this.ScoreRaw = ScoreRaw; 
	this.ScoreMax = ScoreMax; 
	this.ScoreMin = ScoreMin; 
	this.ProgressMeasure = ProgressMeasure; 
	this.Description = Description; 
	
	this.SuccessStatusChangedDuringRuntime = false;
	this.MeasureChangedDuringRuntime = false;
}

ActivityRunTimeObjective.prototype.GetXml = ActivityRunTimeObjective_GetXml;
ActivityRunTimeObjective.prototype.toString = ActivityRunTimeObjective_toString;

function ActivityRunTimeObjective_GetXml(activityId, index){
	
	var ServerFormat = new ServerFormater();
	
	var xml = new XmlElement("ActivityRunTimeObjective");

	xml.AddAttribute("ActivityId", activityId);
	xml.AddAttribute("Index", index);
	
	if (this.Identifier !== null){	
		xml.AddAttribute("Identifier", ServerFormat.TrimToLength(this.Identifier, 4000));
	}
	
	xml.AddAttribute("SuccessStatus", ServerFormat.ConvertSuccessStatus(this.SuccessStatus));
	xml.AddAttribute("CompletionStatus", ServerFormat.ConvertCompletionStatus(this.CompletionStatus));
	
	if (this.ScoreScaled !== null){
		xml.AddAttribute("ScoreScaled", this.ScoreScaled);
	}
	if (this.ScoreRaw !== null){
		xml.AddAttribute("ScoreRaw", this.ScoreRaw);
	}
	if (this.ScoreMax !== null){
		xml.AddAttribute("ScoreMax", this.ScoreMax);
	}
	if (this.ScoreMin !== null){
		xml.AddAttribute("ScoreMin", this.ScoreMin);
	}
	if (this.ProgressMeasure !== null){
		xml.AddAttribute("ProgressMeasure", this.ProgressMeasure);
	}
	if (this.Description !== null){
		xml.AddAttribute("Description", ServerFormat.TrimToLength(this.Description, 500));
	}
	
	return xml.toString();
}

function ActivityRunTimeObjective_toString(){
	return "ActivityRunTimeObjective - " + this.Identifier;
}
