Index: lams_flex/LamsAuthor/src/LamsAuthor.mxml =================================================================== RCS file: /usr/local/cvsroot/lams_flex/LamsAuthor/src/LamsAuthor.mxml,v diff -u -r1.11 -r1.12 --- lams_flex/LamsAuthor/src/LamsAuthor.mxml 3 Feb 2010 04:04:40 -0000 1.11 +++ lams_flex/LamsAuthor/src/LamsAuthor.mxml 11 Feb 2010 05:07:38 -0000 1.12 @@ -23,7 +23,6 @@ import org.lamsfoundation.lams.common.util.WDDXParser; import flash.utils.Dictionary; - // If testing is set to true, load data from test directory public const TESTING:Boolean = true; public const TESTING_LOCAL:Boolean = true; // If true use assets folder, else use localhost @@ -49,13 +48,19 @@ // current selected activity public var selectedActivity:ActivityComponent; + // Next toolContentID 1 by default for testing + public var nextToolContentID:int = 1; + [Bindable] public var applicationCenter:Point = new Point(); // dictionary [Bindable] public var dictionary:XMLDictionaryRegistry; + // Determines the next UIID for each activity + public var nextUIID:int = 1; + private function preInit():void { if (TESTING && !TESTING_LOCAL) { Index: lams_flex/LamsAuthor/src/assets/languages/en_AU.xml =================================================================== RCS file: /usr/local/cvsroot/lams_flex/LamsAuthor/src/assets/languages/en_AU.xml,v diff -u -r1.6 -r1.7 --- lams_flex/LamsAuthor/src/assets/languages/en_AU.xml 8 Feb 2010 06:05:24 -0000 1.6 +++ lams_flex/LamsAuthor/src/assets/languages/en_AU.xml 11 Feb 2010 05:07:38 -0000 1.7 @@ -206,5 +206,8 @@ Map to competencies + + None + \ No newline at end of file Index: lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/components/LearningLibraryEntryComponent.mxml =================================================================== RCS file: /usr/local/cvsroot/lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/components/LearningLibraryEntryComponent.mxml,v diff -u -r1.3 -r1.4 --- lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/components/LearningLibraryEntryComponent.mxml 20 Jan 2010 06:31:19 -0000 1.3 +++ lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/components/LearningLibraryEntryComponent.mxml 11 Feb 2010 05:07:37 -0000 1.4 @@ -46,15 +46,15 @@ if (dragInitiator.learningLibraryEntry.isCombined) { var combinedAactivityComponent:CombinedActivityComponent = new CombinedActivityComponent(); combinedAactivityComponent.learningLibraryEntry = dragInitiator.learningLibraryEntry - combinedAactivityComponent.load(); + combinedAactivityComponent.load(0); combinedAactivityComponent.x = UIComponent(event.currentTarget).mouseX; combinedAactivityComponent.y = UIComponent(event.currentTarget).mouseY; ds.addData(combinedAactivityComponent, "img"); DragManager.doDrag(dragInitiator, ds, event, combinedAactivityComponent, 25, 15, 1.00, false); } else { var toolActivityComponent:ToolActivityComponent = new ToolActivityComponent(); toolActivityComponent.tool = dragInitiator.learningLibraryEntry.toolTemplates[0]; - toolActivityComponent.load(); + toolActivityComponent.load(0); toolActivityComponent.x = UIComponent(event.currentTarget).mouseX; toolActivityComponent.y = UIComponent(event.currentTarget).mouseY; ds.addData(toolActivityComponent, "img"); Index: lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/components/PropertyInspector.mxml =================================================================== RCS file: /usr/local/cvsroot/lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/components/PropertyInspector.mxml,v diff -u -r1.6 -r1.7 --- lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/components/PropertyInspector.mxml 8 Feb 2010 06:05:24 -0000 1.6 +++ lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/components/PropertyInspector.mxml 11 Feb 2010 05:07:38 -0000 1.7 @@ -17,6 +17,8 @@ width || event.localY < 0 || event.localY > height){ + this.styleName = "propertyInspectorUnselected" + setChildIndex(opacityLayer, this.getChildren().length -1); + focusManager.hideFocus(); + } + } // Minimise/Maxomise the property inspector @@ -112,8 +123,16 @@ if (activity is ToolActivityComponent) { this.currentState = STATE_TOOL_ACTIVITY; var toolActivity:ToolActivityComponent = activity as ToolActivityComponent; - var groupings:ArrayCollection = toolActivity.allPossibleGroupings; - changeWatcherArray.addItem(BindingUtils.bindProperty(groupingCombo, "dataProvider", toolActivity, "allPossibleGroupings")); + + loadGroupsDropDown(toolActivity); + loadToolOutputDefs(toolActivity); + + changeWatcherArray.addItem(BindingUtils.bindProperty(runOffline, "selected", toolActivity, "runOffline")); + changeWatcherArray.addItem(BindingUtils.bindProperty(toolActivity, "runOffline", runOffline, "selected")); + + changeWatcherArray.addItem(BindingUtils.bindProperty(defineLater, "selected", toolActivity, "defineLater")); + changeWatcherArray.addItem(BindingUtils.bindProperty(toolActivity, "defineLater", defineLater, "selected")); + } else if (activity is RandomGroupActivityComponent) { this.currentState = STATE_GROUP_RANDOM; @@ -154,6 +173,57 @@ } + private function loadGroupsDropDown(activityComponent:ActivityComponent):void { + currentAvailableGroups.removeAll(); + + // Set a dummy null grouping so it can be binded to the combo box in the preoperty inspector + var nullGrouping:Object = new Object(); + nullGrouping.title = Application.application.dictionary.getLabel("none_act_lbl"); + nullGrouping.activityUIID = 0; + currentAvailableGroups.addItem(nullGrouping); + currentAvailableGroups.addAll(activityComponent.allPossibleGroupings); + + groupingCombo.selectedItem = nullGrouping; + for each (var item:Object in currentAvailableGroups) { + if (activityComponent.groupingUIID == item.activityUIID) { + groupingCombo.selectedItem = item; + } + } + } + + private function loadToolOutputDefs(toolActivityComponent:ToolActivityComponent):void { + + + var nullOutput:ToolOutputDefinition = new ToolOutputDefinition();; + nullOutput.description = Application.application.dictionary.getLabel("none_act_lbl"); + + toolOutputDefs.removeAll(); + toolOutputDefs.addItem(nullOutput); + toolOutputDefs.addAll(Application.application.mainMap.getToolOutputDefinitions(toolActivityComponent)); + + gradebookOutputCombo.selectedItem = nullOutput; + for each (var item:ToolOutputDefinition in toolOutputDefs) { + if (item.isEqual(toolActivityComponent.gradebookOutput)) { + gradebookOutputCombo.selectedItem = item; + break; + } + } + + } + + private function groupChange(event:ListEvent):void { + Application.application.selectedActivity.groupingUIID = event.currentTarget.selectedItem.activityUIID; + } + + private function outputsChange(event:ListEvent):void { + + if (Application.application.selectedActivity is ToolActivityComponent) { + var toolActivity:ToolActivityComponent = Application.application.selectedActivity as ToolActivityComponent; + toolActivity.gradebookOutput = event.currentTarget.selectedItem; + } + + } + private function groupNumChange(event:Event):void { if (Application.application.selectedActivity is GroupActivityComponent) { var groupActivity:GroupActivityComponent = Application.application.selectedActivity as GroupActivityComponent; @@ -168,19 +238,10 @@ } - private function openNameGroupsWindow():void { nameGroupsWindow.openWindow(); } - - private function getGroupingComboLabel(obj_data:Object):String { - if (obj_data is GroupActivityComponent) { - return (obj_data as GroupActivityComponent).title.text; - } else { - return "none"; - } - } - + ]]> @@ -192,9 +253,17 @@ - + + + + + + + + + @@ -235,8 +304,9 @@ - + + + @@ -259,8 +329,9 @@ - + + + @@ -319,30 +390,24 @@ - + + + - - - - - - - - + - + - + @@ -352,7 +417,7 @@ - + @@ -362,7 +427,7 @@ - + @@ -374,10 +439,15 @@ + + + + + Index: lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/components/activity/ActivityComponent.mxml =================================================================== RCS file: /usr/local/cvsroot/lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/components/activity/ActivityComponent.mxml,v diff -u -r1.13 -r1.14 --- lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/components/activity/ActivityComponent.mxml 3 Feb 2010 05:23:49 -0000 1.13 +++ lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/components/activity/ActivityComponent.mxml 11 Feb 2010 05:07:37 -0000 1.14 @@ -14,6 +14,8 @@ Index: lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/components/activity/CombinedActivityComponent.mxml =================================================================== RCS file: /usr/local/cvsroot/lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/components/activity/CombinedActivityComponent.mxml,v diff -u -r1.6 -r1.7 --- lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/components/activity/CombinedActivityComponent.mxml 3 Feb 2010 04:04:40 -0000 1.6 +++ lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/components/activity/CombinedActivityComponent.mxml 11 Feb 2010 05:07:37 -0000 1.7 @@ -17,10 +17,11 @@ public var toolActivityComponent1:ToolActivityComponent; public var toolActivityComponent2:ToolActivityComponent; public var learningLibraryEntry:LearningLibraryEntry; + public var toolContentID:int; - override public function load():void { + public function loadCombined(UIIDCombined:int, UIIDActivity1:int, UIIDActivity2:int):void { - super.load(); + super.load(UIIDCombined); var vbox:VBox = new VBox(); vbox.setConstraintValue("verticalAlign", "middle"); @@ -43,7 +44,7 @@ if (tool1 != null) { toolActivityComponent1 = new ToolActivityComponent(); toolActivityComponent1.tool = learningLibraryEntry.toolTemplates[1]; - toolActivityComponent1.load(); + toolActivityComponent1.load(UIIDActivity1); toolActivityComponent1.isDragable = false; toolActivityComponent1.canStartTransitions = false; toolActivityComponent1.canAcceptTransitions = false; @@ -54,7 +55,7 @@ if (tool1 != null) { toolActivityComponent2 = new ToolActivityComponent(); toolActivityComponent2.tool = learningLibraryEntry.toolTemplates[2]; - toolActivityComponent2.load(); + toolActivityComponent2.load(UIIDActivity2); toolActivityComponent2.isDragable = false; toolActivityComponent2.canStartTransitions = false; toolActivityComponent2.canAcceptTransitions = false; @@ -65,9 +66,9 @@ this.addChild(vbox); // Set the title - super.load(); + title = new Label(); title.text = learningLibraryEntry.title; - + this.addChild(title); } ]]> Index: lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/components/activity/OptionalActivityComponent.mxml =================================================================== RCS file: /usr/local/cvsroot/lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/components/activity/OptionalActivityComponent.mxml,v diff -u -r1.3 -r1.4 --- lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/components/activity/OptionalActivityComponent.mxml 3 Feb 2010 04:04:40 -0000 1.3 +++ lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/components/activity/OptionalActivityComponent.mxml 11 Feb 2010 05:07:37 -0000 1.4 @@ -17,7 +17,7 @@ public var minActivities:int; public var maxActivities:int; - public var desription:String; + public var description:String; // The dragEnter event handler for the Canvas container // enables dropping. @@ -48,7 +48,8 @@ Application.application.changeCursorState(Constants.CURSOR_STATE_NORMAL); } - override public function load():void { + override public function load(UIID:int):void { + super.load(UIID); title = new Label(); title.text = Application.application.dictionary.getLabel("grouping_act_title"); this.disableTitle(); Index: lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/components/activity/ToolActivityComponent.mxml =================================================================== RCS file: /usr/local/cvsroot/lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/components/activity/ToolActivityComponent.mxml,v diff -u -r1.6 -r1.7 --- lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/components/activity/ToolActivityComponent.mxml 8 Feb 2010 06:05:24 -0000 1.6 +++ lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/components/activity/ToolActivityComponent.mxml 11 Feb 2010 05:07:37 -0000 1.7 @@ -7,6 +7,8 @@ - Index: lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/components/activity/group/GroupActivityComponent.mxml =================================================================== RCS file: /usr/local/cvsroot/lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/components/activity/group/GroupActivityComponent.mxml,v diff -u -r1.1 -r1.2 --- lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/components/activity/group/GroupActivityComponent.mxml 3 Feb 2010 04:04:40 -0000 1.1 +++ lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/components/activity/group/GroupActivityComponent.mxml 11 Feb 2010 05:07:38 -0000 1.2 @@ -11,10 +11,13 @@ public var numGroups:Number = 2; + public var isNull:Boolean = false; + [Bindable] public var groupNames:ArrayCollection = new ArrayCollection(); - override public function load():void { + override public function load(UIID:int):void { + super.load(UIID); this.title = new Label(); title.text = Application.application.dictionary.getLabel("grouping_act_title"); this.addChild(title); @@ -35,5 +38,4 @@ - Index: lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/controller/AuthorController.as =================================================================== RCS file: /usr/local/cvsroot/lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/controller/AuthorController.as,v diff -u -r1.12 -r1.13 --- lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/controller/AuthorController.as 3 Feb 2010 05:23:50 -0000 1.12 +++ lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/controller/AuthorController.as 11 Feb 2010 05:07:37 -0000 1.13 @@ -30,6 +30,8 @@ private var dictionaryFallback:XML; public var transitionArray:ArrayCollection = new ArrayCollection(); + + public var activities:Dictionary = new Dictionary(); public function AuthorController(){} @@ -79,8 +81,9 @@ // Get the current mouse point, and convert it to co-ordinates in CanvasBox var comp:UIComponent = UIComponent(event.currentTarget); var currentMousePoint:Point = new Point(comp.mouseX, comp.mouseY); - currentMousePoint = canvasBox.globalToLocal(currentMousePoint); + currentMousePoint = canvasBox.globalToLocal(currentMousePoint); + // This condition is true if the activity was already on the canvas if (event.dragInitiator is ActivityComponent) { var activityComponent:ActivityComponent; activityComponent = event.dragInitiator as ActivityComponent; @@ -89,70 +92,93 @@ activityComponent.setCenter(); activityComponent.updateTransitionPositions(); activityComponent.selectActivity(); - } else if (event.dragInitiator is LearningLibraryEntryComponent) { - var learningLibraryComponent:LearningLibraryEntryComponent = event.dragInitiator as LearningLibraryEntryComponent; + } else { + // Adding a new activity to the canvas - if (learningLibraryComponent.learningLibraryEntry.isCombined) { - var combinedActivityComponent:CombinedActivityComponent = new CombinedActivityComponent(); - combinedActivityComponent.learningLibraryEntry = learningLibraryComponent.learningLibraryEntry; - combinedActivityComponent.load() - combinedActivityComponent.x = currentMousePoint.x; - combinedActivityComponent.y = currentMousePoint.y - canvasBox.addChild(combinedActivityComponent); - combinedActivityComponent.setCenter(); - combinedActivityComponent.selectActivity(); - } else { - var toolActivityComponent:ToolActivityComponent = new ToolActivityComponent(); - toolActivityComponent.tool = learningLibraryComponent.learningLibraryEntry.toolTemplates[0]; - toolActivityComponent.load() - toolActivityComponent.x = currentMousePoint.x; - toolActivityComponent.y = currentMousePoint.y; - canvasBox.addChild(toolActivityComponent); - toolActivityComponent.setCenter(); - toolActivityComponent.selectActivity(); - } - } else if (event.dragInitiator is SystemToolComponent) { - var systemToolComponent:SystemToolComponent = event.dragInitiator as SystemToolComponent; + // Get the next UIID + var nextActivityUIID:int = getNewUIID(); - switch (systemToolComponent.type) { - case Constants.SYSTEM_ACTIVITY_TYPE_OPTIONAL: - var optionalActivityComponent:OptionalActivityComponent = new OptionalActivityComponent(); - optionalActivityComponent.x = currentMousePoint.x; - optionalActivityComponent.y = currentMousePoint.y; - canvasBox.addChild(optionalActivityComponent); - optionalActivityComponent.setCenter(); - optionalActivityComponent.load(); - optionalActivityComponent.selectActivity(); - break; - case Constants.SYSTEM_ACTIVITY_TYPE_GROUP_RANDOM: - var randomGroup:RandomGroupActivityComponent = new RandomGroupActivityComponent(); - randomGroup.x = currentMousePoint.x; - randomGroup.y = currentMousePoint.y; - canvasBox.addChild(randomGroup); - randomGroup.setCenter(); - randomGroup.load(); - randomGroup.selectActivity(); - break; - case Constants.SYSTEM_ACTIVITY_TYPE_GROUP_MONITOR: - var monitorGroup:MonitorGroupActivityComponent = new MonitorGroupActivityComponent(); - monitorGroup.x = currentMousePoint.x; - monitorGroup.y = currentMousePoint.y; - canvasBox.addChild(monitorGroup); - monitorGroup.setCenter(); - monitorGroup.load(); - monitorGroup.selectActivity(); - break; - case Constants.SYSTEM_ACTIVITY_TYPE_GROUP_LEARNER: - var learnerGroup:GroupActivityComponent = new LearnerGroupActivityComponent(); - learnerGroup.x = currentMousePoint.x; - learnerGroup.y = currentMousePoint.y; - canvasBox.addChild(learnerGroup); - learnerGroup.setCenter(); - learnerGroup.load(); - learnerGroup.selectActivity(); - break; - } + if (event.dragInitiator is LearningLibraryEntryComponent) { + var learningLibraryComponent:LearningLibraryEntryComponent = event.dragInitiator as LearningLibraryEntryComponent; + + // Get the current toolContentID then increment the global counter + var toolContentID:int = Application.application.nextToolContentID; + Application.application.nextToolContentID++; + + if (learningLibraryComponent.learningLibraryEntry.isCombined) { + + var act1UIID:int = getNewUIID(); + var act2UIID:int = getNewUIID(); + var combinedActivityComponent:CombinedActivityComponent = new CombinedActivityComponent(); + combinedActivityComponent.toolContentID = toolContentID; + combinedActivityComponent.learningLibraryEntry = learningLibraryComponent.learningLibraryEntry; + combinedActivityComponent.loadCombined(nextActivityUIID, act1UIID, act2UIID) + combinedActivityComponent.x = currentMousePoint.x; + combinedActivityComponent.y = currentMousePoint.y + canvasBox.addChild(combinedActivityComponent); + combinedActivityComponent.setCenter(); + combinedActivityComponent.selectActivity(); + activities[nextActivityUIID] = combinedActivityComponent; + } else { + var toolActivityComponent:ToolActivityComponent = new ToolActivityComponent(); + toolActivityComponent.toolContentID = toolContentID; + toolActivityComponent.tool = learningLibraryComponent.learningLibraryEntry.toolTemplates[0]; + toolActivityComponent.load(nextActivityUIID) + toolActivityComponent.x = currentMousePoint.x; + toolActivityComponent.y = currentMousePoint.y; + canvasBox.addChild(toolActivityComponent); + toolActivityComponent.setCenter(); + toolActivityComponent.selectActivity(); + activities[nextActivityUIID] = toolActivityComponent; + } + } else if (event.dragInitiator is SystemToolComponent) { + var systemToolComponent:SystemToolComponent = event.dragInitiator as SystemToolComponent; + + switch (systemToolComponent.type) { + case Constants.SYSTEM_ACTIVITY_TYPE_OPTIONAL: + var optionalActivityComponent:OptionalActivityComponent = new OptionalActivityComponent(); + optionalActivityComponent.x = currentMousePoint.x; + optionalActivityComponent.y = currentMousePoint.y; + canvasBox.addChild(optionalActivityComponent); + optionalActivityComponent.setCenter(); + optionalActivityComponent.load(nextActivityUIID); + optionalActivityComponent.selectActivity(); + activities[nextActivityUIID] = optionalActivityComponent; + break; + case Constants.SYSTEM_ACTIVITY_TYPE_GROUP_RANDOM: + var randomGroup:RandomGroupActivityComponent = new RandomGroupActivityComponent(); + randomGroup.x = currentMousePoint.x; + randomGroup.y = currentMousePoint.y; + canvasBox.addChild(randomGroup); + randomGroup.setCenter(); + randomGroup.load(nextActivityUIID); + randomGroup.selectActivity(); + activities[nextActivityUIID] = randomGroup; + break; + case Constants.SYSTEM_ACTIVITY_TYPE_GROUP_MONITOR: + var monitorGroup:MonitorGroupActivityComponent = new MonitorGroupActivityComponent(); + monitorGroup.x = currentMousePoint.x; + monitorGroup.y = currentMousePoint.y; + canvasBox.addChild(monitorGroup); + monitorGroup.setCenter(); + monitorGroup.load(nextActivityUIID); + monitorGroup.selectActivity(); + activities[nextActivityUIID] = monitorGroup; + break; + case Constants.SYSTEM_ACTIVITY_TYPE_GROUP_LEARNER: + var learnerGroup:GroupActivityComponent = new LearnerGroupActivityComponent(); + learnerGroup.x = currentMousePoint.x; + learnerGroup.y = currentMousePoint.y; + canvasBox.addChild(learnerGroup); + learnerGroup.setCenter(); + learnerGroup.load(nextActivityUIID); + learnerGroup.selectActivity(); + activities[nextActivityUIID] = learnerGroup; + break; + } + } } + // Return cursor state to normal Application.application.changeCursorState(Constants.CURSOR_STATE_NORMAL); @@ -322,6 +348,10 @@ } - + private function getNewUIID():int{ + var UIID:int = Application.application.nextUIID; + Application.application.nextUIID++; + return UIID; + } } } \ No newline at end of file Index: lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/events/ToolActivityEvent.as =================================================================== RCS file: /usr/local/cvsroot/lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/events/ToolActivityEvent.as,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/events/ToolActivityEvent.as 11 Feb 2010 05:07:38 -0000 1.1 @@ -0,0 +1,19 @@ +package org.lamsfoundation.lams.author.events +{ + import flash.events.Event; + + import org.lamsfoundation.lams.author.components.activity.ToolActivityComponent; + + public class ToolActivityEvent extends Event + { + public static const GET_OUTPUT_DEFINITIONS:String = "getOutputDefinitions"; + + public var toolActivityComponent:ToolActivityComponent; + + public function ToolActivityEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false) + { + super(type, bubbles, cancelable); + } + + } +} \ No newline at end of file Index: lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/maps/MainEventMap.mxml =================================================================== RCS file: /usr/local/cvsroot/lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/maps/MainEventMap.mxml,v diff -u -r1.6 -r1.7 --- lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/maps/MainEventMap.mxml 2 Feb 2010 00:41:52 -0000 1.6 +++ lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/maps/MainEventMap.mxml 11 Feb 2010 05:07:38 -0000 1.7 @@ -3,6 +3,11 @@ + + + @@ -109,15 +154,17 @@ + + - + Index: lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/model/ToolOutputDefinition.as =================================================================== RCS file: /usr/local/cvsroot/lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/model/ToolOutputDefinition.as,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/model/ToolOutputDefinition.as 11 Feb 2010 05:07:37 -0000 1.1 @@ -0,0 +1,31 @@ +package org.lamsfoundation.lams.author.model +{ + public class ToolOutputDefinition + { + public var description:String; + public var isDefaultGradebookMark:Boolean; + public var name:String; + public var showConditionNameOnly:String; + public var startValue:Object; + public var type:String; + + public function ToolOutputDefinition() {} + + public function loadFromDTO(dto:Object):void { + description = dto.description; + isDefaultGradebookMark = dto.isDefaultGradebookMark; + name = dto.name; + showConditionNameOnly = dto.showConditionNameOnly; + startValue = dto.startValue; + type = dto.type; + } + + public function isEqual(compare:ToolOutputDefinition):Boolean { + if (compare==null || compare.name == null) { + return false; + } else { + return this.name == compare.name; + } + } + } +} \ No newline at end of file Index: lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/model/learninglibrary/Tool.as =================================================================== RCS file: /usr/local/cvsroot/lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/model/learninglibrary/Tool.as,v diff -u -r1.1 -r1.2 --- lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/model/learninglibrary/Tool.as 12 Jan 2010 01:20:21 -0000 1.1 +++ lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/model/learninglibrary/Tool.as 11 Feb 2010 05:07:38 -0000 1.2 @@ -1,79 +1,81 @@ -package org.lamsfoundation.lams.author.model.learninglibrary -{ - import mx.collections.ArrayCollection; - import mx.core.Application; - - - /** - * This class contains the information for each tool so it doesnt need to be stored - * inside the ToolActivity class for each activity. - * - * This information will be held in one global hashmap with the tool id as a key, - * and each tool activity will have a reference to it via the id. - * - */ - public class Tool - { - public var toolID:int; - public var toolName:String; - public var toolDisplayName:String; - public var toolSignature:String; - public var activityCategoryID:int; - public var description:String; - public var authoringURL:String; - public var monitoringURL:String; - public var contributeURL:String; - public var helpURL:String; - public var supportsContribute:Boolean; - public var supportsDefineLater:Boolean; - public var supportsModeration:Boolean; - public var supportsRunOffline:Boolean; - public var supportsOutputs:Boolean; - public var valid:Boolean; - public var groupingSupportType:int; - public var libraryActivityUIImage:String; - public var toolOutputDefinitions:ArrayCollection; - - // For tool adapter tools - public var mappedServers:ArrayCollection; // List of allowable servers to show this tool for - public var extLmsId:String; // External LMS id for tool adapter tools - - // Convenience property - public var learningLibraryID:int; - - public function Tool(dto:Object, learningLibraryIDIn:int) - { - this.toolID = parseInt(dto.toolID); - this.toolName = dto.activityTitle; - this.toolDisplayName = dto.toolDisplayName; - this.toolSignature = dto.toolSignature; - this.activityCategoryID = parseInt(dto.activityCategoryID); - this.description = dto.description; - this.authoringURL = dto.authoringURL; - this.monitoringURL = dto.monitoringURL; - this.contributeURL = dto.contributeURL; - this.helpURL = dto.helpURL; - this.supportsContribute = Boolean(dto.supporstBoolean); - this.supportsDefineLater = Boolean(dto.supportsDefineLater); - this.supportsModeration = Boolean(dto.supportsModeration); - this.supportsRunOffline = Boolean(dto.supportsRunOffline); - this.supportsOutputs = Boolean(dto.supportsOutputs); - this.valid = Boolean(dto.valid); - this.groupingSupportType = parseInt(dto.groupingSupportType); - this.libraryActivityUIImage = dto.libraryActivityUIImage; - - toolOutputDefinitions = new ArrayCollection(); - - mappedServers = dto.mappedServers; - this.extLmsId = dto.extLmsId; - - this.learningLibraryID = learningLibraryIDIn; - - if (Application.application.TESTING && Application.application.TESTING_LOCAL) { - libraryActivityUIImage = "assets/test/toolimages" + libraryActivityUIImage.substring(libraryActivityUIImage.lastIndexOf("/")); - } else { - libraryActivityUIImage = Application.application.lamsURL + libraryActivityUIImage; - } - } - } +package org.lamsfoundation.lams.author.model.learninglibrary +{ + import mx.collections.ArrayCollection; + import mx.core.Application; + + + /** + * This class contains the information for each tool so it doesnt need to be stored + * inside the ToolActivity class for each activity. + * + * This information will be held in one global hashmap with the tool id as a key, + * and each tool activity will have a reference to it via the id. + * + */ + public class Tool + { + public var toolID:int; + public var defaultToolContentID:int; + public var toolName:String; + public var toolDisplayName:String; + public var toolSignature:String; + public var activityCategoryID:int; + public var description:String; + public var authoringURL:String; + public var monitoringURL:String; + public var contributeURL:String; + public var helpURL:String; + public var supportsContribute:Boolean; + public var supportsDefineLater:Boolean; + public var supportsModeration:Boolean; + public var supportsRunOffline:Boolean; + public var supportsOutputs:Boolean; + public var valid:Boolean; + public var groupingSupportType:int; + public var libraryActivityUIImage:String; + public var toolOutputDefinitions:ArrayCollection; + + // For tool adapter tools + public var mappedServers:ArrayCollection; // List of allowable servers to show this tool for + public var extLmsId:String; // External LMS id for tool adapter tools + + // Convenience property + public var learningLibraryID:int; + + public function Tool(dto:Object, learningLibraryIDIn:int) + { + this.toolID = parseInt(dto.toolID); + this.defaultToolContentID = parseInt(dto.toolContentID); + this.toolName = dto.activityTitle; + this.toolDisplayName = dto.toolDisplayName; + this.toolSignature = dto.toolSignature; + this.activityCategoryID = parseInt(dto.activityCategoryID); + this.description = dto.description; + this.authoringURL = dto.authoringURL; + this.monitoringURL = dto.monitoringURL; + this.contributeURL = dto.contributeURL; + this.helpURL = dto.helpURL; + this.supportsContribute = Boolean(dto.supporstBoolean); + this.supportsDefineLater = Boolean(dto.supportsDefineLater); + this.supportsModeration = Boolean(dto.supportsModeration); + this.supportsRunOffline = Boolean(dto.supportsRunOffline); + this.supportsOutputs = Boolean(dto.supportsOutputs); + this.valid = Boolean(dto.valid); + this.groupingSupportType = parseInt(dto.groupingSupportType); + this.libraryActivityUIImage = dto.libraryActivityUIImage; + + toolOutputDefinitions = new ArrayCollection(); + + mappedServers = dto.mappedServers; + this.extLmsId = dto.extLmsId; + + this.learningLibraryID = learningLibraryIDIn; + + if (Application.application.TESTING && Application.application.TESTING_LOCAL) { + libraryActivityUIImage = "assets/test/toolimages" + libraryActivityUIImage.substring(libraryActivityUIImage.lastIndexOf("/")); + } else { + libraryActivityUIImage = Application.application.lamsURL + libraryActivityUIImage; + } + } + } } \ No newline at end of file Index: lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/util/TestingConstants.as =================================================================== RCS file: /usr/local/cvsroot/lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/util/TestingConstants.as,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/util/TestingConstants.as 11 Feb 2010 05:07:37 -0000 1.1 @@ -0,0 +1,11 @@ +package org.lamsfoundation.lams.author.util +{ + public class TestingConstants + { + public function TestingConstants(){} + + public static const SAMPLE_OUTPUT_DEFINITION:String = "
getToolOutputDefinitions3.0Number of attempts made by userlearner.number.of.attempts0OUTPUT_LONGTime takenlearner.time.taken0OUTPUT_LONGUser's total score0learner.total.score0OUTPUT_LONG"; + + } +} +