Index: lams_central/src/flash/org/lamsfoundation/lams/authoring/cv/PropertyInspector.as =================================================================== diff -u -r9106d63be71900755d675e4c50168efc45b01622 -rc7cb4169bd37a4670f48f8d1452eecb8837e94ac --- lams_central/src/flash/org/lamsfoundation/lams/authoring/cv/PropertyInspector.as (.../PropertyInspector.as) (revision 9106d63be71900755d675e4c50168efc45b01622) +++ lams_central/src/flash/org/lamsfoundation/lams/authoring/cv/PropertyInspector.as (.../PropertyInspector.as) (revision c7cb4169bd37a4670f48f8d1452eecb8837e94ac) @@ -32,8 +32,11 @@ private var title_txt:TextInput; private var desc_lbl:Label; private var desc_txt:TextInput; - private var grouping_lbl:Label; + + private var grouping_lbl:Label; private var currentGrouping_lbl:Label; + private var appliedGroupingActivity_cmb:ComboBox; + private var editGrouping_btn:Button; private var runOffline_chk:CheckBox; private var defineLater_chk:CheckBox; @@ -50,8 +53,16 @@ private var endHours_stp:NumericStepper; private var endMins_stp:NumericStepper; - - + //grouping + private var groupType_lbl:Label; + private var numGroups_lbl:Label; + private var numLearners_lbl:Label; + private var groupType_cmb:ComboBox; + private var numGroups_rdo:RadioButton; + private var numLearners_rdo:RadioButton; + private var rndGroup_radio:RadioButtonGroup; + private var numGroups_stp:NumericStepper; + private var numLearners_stp:NumericStepper; //screen assets: @@ -93,25 +104,46 @@ runOffline_chk.addEventListener("click",this); defineLater_chk.addEventListener("click",this); + rndGroup_radio.addEventListener("click",Delegate.create(this,onGroupingMethodChange)); + groupType_cmb.addEventListener("change",Delegate.create(this,onGroupTypeChange)); gateType_cmb.addEventListener("change",Delegate.create(this,onGateTypeChange)); + appliedGroupingActivity_cmb.addEventListener("change",Delegate.create(this,onAppliedGroupingChange)); hours_stp.addEventListener("change",Delegate.create(this,onScheduleOffsetChange)); mins_stp.addEventListener("change",Delegate.create(this,onScheduleOffsetChange)); + hours_stp.addEventListener("focusOut",Delegate.create(this,onScheduleOffsetChange)); + mins_stp.addEventListener("focusOut",Delegate.create(this,onScheduleOffsetChange)); endHours_stp.addEventListener("change",Delegate.create(this,onScheduleOffsetChange)); endMins_stp.addEventListener("change",Delegate.create(this,onScheduleOffsetChange)); + endHours_stp.addEventListener("focusOut",Delegate.create(this,onScheduleOffsetChange)); + endMins_stp.addEventListener("focusOut",Delegate.create(this,onScheduleOffsetChange)); + numGroups_stp.addEventListener("change",Delegate.create(this,updateGroupingMethodData)); + numLearners_stp.addEventListener("change",Delegate.create(this,updateGroupingMethodData)); + numLearners_stp.addEventListener("focusOut",Delegate.create(this,updateGroupingMethodData)); + numGroups_stp.addEventListener("focusOut",Delegate.create(this,updateGroupingMethodData)); + gateType_lbl.text = Dictionary.getValue('trans_dlg_gatetypecmb'); hours_lbl.text = Dictionary.getValue('pi_hours'); mins_lbl.text = Dictionary.getValue('pi_mins'); startOffset_lbl.text = Dictionary.getValue('pi_start_offset'); endOffset_lbl.text = Dictionary.getValue('pi_end_offset'); + groupType_lbl.text = Dictionary.getValue('pi_group_type'); + numGroups_lbl.text = Dictionary.getValue('pi_num_groups'); + numLearners_lbl.text = Dictionary.getValue('pi_num_learners'); + + + //populate the synch type combo: gateType_cmb.dataProvider = Activity.getGateActivityTypes(); + groupType_cmb.dataProvider = Grouping.getGroupingTypesDataProvider(); + //hide all the controls at startup showGateControls(false); showToolActivityControls(false); showGroupingControls(false); + showAppliedGroupingControls(false); //fire event to say we have loaded _container.contentLoaded(); @@ -145,33 +177,54 @@ /** * Get called when something is selected in the cavas. - * Updates the details in the propertyu inspector widgets + * Updates the details in the property inspector widgets + * Depending on the type of item selected, different controls will be shown * @usage * @param cm * @return */ private function updateItemProperties(cm:CanvasModel):Void{ //try to cast the selected item to see what we have (instance of des not seem to work) if(CanvasActivity(cm.selectedItem) != null){ + // its a Canvas activity then Debugger.log('Its a canvas activity',4,'updateItemProperties','PropertyInspector'); var ca = CanvasActivity(cm.selectedItem); var a:Activity = ca.activity; if(a.isGateActivity()){ + //its a gate + showGroupingControls(false); showToolActivityControls(false); showGateControls(true); - showGroupingControls(true); + showAppliedGroupingControls(true); showGateActivityProperties(GateActivity(a)); checkEnableGateControls(); + showAppliedGroupingProperties(a); + //show the title + title_txt.text = StringUtils.cleanNull(a.title); + }else if(a.isGroupActivity()){ + //its a grouping activity + showGroupingControls(true); + showRelevantGroupOptions(); + showToolActivityControls(false); + showGateControls(false); + showAppliedGroupingControls(true); + populateGroupingProperties(GroupingActivity(a)); + showAppliedGroupingProperties(a); + //show the title + title_txt.text = StringUtils.cleanNull(a.title); + }else{ + //its a tool activity + showGroupingControls(false); showToolActivityControls(true); showGateControls(false); - showGroupingControls(true); + showAppliedGroupingControls(true); showToolActivityProperties(ToolActivity(a)); + showAppliedGroupingProperties(a); + //show the title + title_txt.text = StringUtils.cleanNull(a.title); } - /* - runOffline_txa.text = StringUtils.cleanNull(cm.selectedItem.activity.offlineInstructions); - runOnline_txa.text = StringUtils.cleanNull(cm.selectedItem.activity.onlineInstructions); - */ + }else if(CanvasTransition(cm.selectedItem) != null){ var ct = CanvasTransition(cm.selectedItem); @@ -198,7 +251,7 @@ toolDisplayName_lbl.text = StringUtils.cleanNull(ta.toolDisplayName); - title_txt.text = StringUtils.cleanNull(ta.title); + //title_txt.text = StringUtils.cleanNull(ta.title); desc_txt.text = StringUtils.cleanNull(ta.description); runOffline_chk.selected = ta.runOffline; defineLater_chk.selected = ta.defineLater; @@ -209,21 +262,185 @@ } private function showGateActivityProperties(ga:GateActivity){ - toolDisplayName_lbl.text = 'Gate'; + toolDisplayName_lbl.text = Dictionary.getValue('pi_activity_type_gate'); //loop through combo to fins SI of our gate activity type for (var i=0; i