Index: lams_flash/src/central/flash/org/lamsfoundation/lams/authoring/ToolOutputDefinition.as =================================================================== diff -u --- lams_flash/src/central/flash/org/lamsfoundation/lams/authoring/ToolOutputDefinition.as (revision 0) +++ lams_flash/src/central/flash/org/lamsfoundation/lams/authoring/ToolOutputDefinition.as (revision 317cecb7b29393ac71b1989dbfc6c618773698ac) @@ -0,0 +1,98 @@ +/*************************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2.0 + * as published by the Free Software Foundation. + * + * 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, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * ************************************************************************ + */ + +import org.lamsfoundation.lams.authoring.*; + +/** + * + * @author Mitchell Seaton + * @version 2.1 + **/ +class ToolOutputDefinition { + + public static var LONG:String = "OUTPUT_LONG"; + public static var BOOL:String = "OUTPUT_BOOLEAN"; + + private var _name:String; + private var _description:String; + private var _type:String; + private var _startValue:Object; + private var _endValue:Object; + + function ToolOutputCondition(){ + } + + public function populateFromDTO(dto:Object):Void { + _name = dto.name; + _description = dto.description; + _type = dto.type; + _startValue = dto.startValue; + _endValue = dto.endValue; + } + + public function toData():Object { + var dto = new Object(); + + if(_name) dto.name = _name; + if(_description) dto.description = _description; + if(_type) dto.type = _type; + if(_startValue) dto.startValue = _startValue; + if(_endValue) dto.endValue = _endValue; + + return dto; + } + + public function set name(a:String) { + _name = a; + } + + public function get name():String { + return _name; + } + + public function set type(a:String) { + _type = a; + } + + public function get type():String { + return _type; + } + + public function set startValue(a:Object) { + _startValue = a; + } + + public function get startValue():Object { + return _startValue; + } + + public function set endValue(a:Object) { + _endValue = a; + } + + public function get endValue():Object { + return _endValue; + } + + +} \ No newline at end of file Index: lams_flash/src/central/flash/org/lamsfoundation/lams/authoring/br/ToolOutputConditionsDialog.as =================================================================== diff -u -r6f4fd0fe7fee43ab750ec98ea12fb3f1b4cb07b5 -r317cecb7b29393ac71b1989dbfc6c618773698ac --- lams_flash/src/central/flash/org/lamsfoundation/lams/authoring/br/ToolOutputConditionsDialog.as (.../ToolOutputConditionsDialog.as) (revision 6f4fd0fe7fee43ab750ec98ea12fb3f1b4cb07b5) +++ lams_flash/src/central/flash/org/lamsfoundation/lams/authoring/br/ToolOutputConditionsDialog.as (.../ToolOutputConditionsDialog.as) (revision 317cecb7b29393ac71b1989dbfc6c618773698ac) @@ -21,7 +21,8 @@ * ************************************************************************ */ -import org.lamsfoundation.lams.authoring.br.*; +import org.lamsfoundation.lams.authoring.br.*; +import org.lamsfoundation.lams.authoring.ToolOutputDefinition; import org.lamsfoundation.lams.common.Dialog; import org.lamsfoundation.lams.common.style.*; @@ -45,7 +46,7 @@ private var _definitions:Array; private var _conditions:Array; - private var _selectedDefinition:Object; + private var _selectedDefinition:ToolOutputDefinition; private var _toolOutputDefin_cmb:ComboBox; @@ -183,22 +184,26 @@ } private function itemChanged(evt:Object):Void { - _selectedDefinition = evt.target.value; + _selectedDefinition = _toolOutputDefin_cmb.dataProvider[_toolOutputDefin_cmb.selectedIndex]; _output_type_lbl.text = "Output Type: " + _selectedDefinition.type; + + Debugger.log("type: " + _selectedDefinition.type, Debugger.CRITICAL, "itemChanged", "ToolOutputConditionsDialog"); + + Debugger.log("val: " + evt.target.value, Debugger.CRITICAL, "itemChanged", "ToolOutputConditionsDialog"); if(_selectedDefinition.type == "OUTPUT_LONG") { _start_value_stp.visible = true; _end_value_stp.visible = true; - _start_value_stp.minimum = _selectedDefinition.startValue; - _end_value_stp.minimum = _selectedDefinition.startValue; - _start_value_stp.maximum = _selectedDefinition.endValue; - _end_value_stp.maximum = _selectedDefinition.endValue; + _start_value_stp.minimum = Number(_selectedDefinition.startValue); + _end_value_stp.minimum = Number(_selectedDefinition.startValue); + _start_value_stp.maximum = Number(_selectedDefinition.endValue); + _end_value_stp.maximum = Number(_selectedDefinition.endValue); - _start_value_stp.value = _selectedDefinition.startValue; - _end_value_stp.value = _selectedDefinition.endValue; + _start_value_stp.value = Number(_selectedDefinition.startValue); + _end_value_stp.value = Number(_selectedDefinition.endValue); } else { _start_value_stp.visible = false; _end_value_stp.visible = false; @@ -235,9 +240,16 @@ //Gets+Sets - public function set definitions(a:Array):Void { - _definitions = a; + public function set definitions(a:Array):Void { + _definitions = new Array(); + for(var i=0; i< a.length; i++) { + var newTOD = new ToolOutputDefinition(); + newTOD.populateFromDTO(a[i]); + + _definitions.push(newTOD); + } + _toolOutputDefin_cmb.dataProvider = _definitions; _toolOutputDefin_cmb.labelField = "name";