File tree Expand file tree Collapse file tree 5 files changed +33
-16
lines changed Expand file tree Collapse file tree 5 files changed +33
-16
lines changed Original file line number Diff line number Diff line change @@ -1302,7 +1302,7 @@ Blockly.Python.coderbot_audio_record = function (block) {
1302
1302
const elapse = Blockly . Python . valueToCode ( block , 'ELAPSE' ,
1303
1303
Blockly . Python . ORDER_NONE ) || '\'\'' ;
1304
1304
const code = `get_audio().record_to_file(filename=${ filename } , elapse=${ elapse } )\n` ;
1305
- return [ code , Blockly . Python . ORDER_ATOMIC ] ;
1305
+ return code ;
1306
1306
} ;
1307
1307
1308
1308
Blockly . Blocks . coderbot_audio_play = {
Original file line number Diff line number Diff line change 1081
1081
},
1082
1082
{
1083
1083
"kind" : " block" ,
1084
- "type" : " coderbot_audio_record"
1084
+ "type" : " coderbot_audio_record" ,
1085
+ "inputs" : {
1086
+ "FILENAME" : {
1087
+ "shadow" : {
1088
+ "kind" : " block" ,
1089
+ "type" : " text" ,
1090
+ "fields" : {
1091
+ "TEXT" : " sound"
1092
+ }
1093
+ }
1094
+ },
1095
+ "ELAPSE" : {
1096
+ "shadow" : {
1097
+ "kind" : " block" ,
1098
+ "type" : " math_number" ,
1099
+ "fields" : {
1100
+ "NUM" : 2
1101
+ }
1102
+ }
1103
+ }
1104
+ }
1085
1105
},
1086
1106
{
1087
1107
"kind" : " block" ,
Original file line number Diff line number Diff line change @@ -306,6 +306,10 @@ class CoderBot {
306
306
}
307
307
308
308
saveActivity ( an_activity ) {
309
+ // defaults requird by API
310
+ an_activity . description = an_activity . description == null ? '' : an_activity . description ;
311
+ an_activity . default = an_activity . default == null ? false : an_activity . default ;
312
+ an_activity . stock = an_activity . stock == null ? false : an_activity . stock ;
309
313
return this . $axios . post ( `${ this . CB } /activities` , an_activity ) ;
310
314
}
311
315
Original file line number Diff line number Diff line change @@ -413,7 +413,6 @@ export default {
413
413
methods: {
414
414
updateCssProps () {
415
415
// (Re)Compute the CSS variables from the activity definition, then update them
416
- console .log (' Computing CSS Props' );
417
416
const {
418
417
bodyFont
419
418
} = this .activity ;
@@ -444,7 +443,6 @@ export default {
444
443
' --codeFont' : fontFamilyCode,
445
444
' --transform' : textTransform,
446
445
};
447
- console .log (' Computed CSS props:' , this .cssProps );
448
446
},
449
447
450
448
onWorkspaceChanged () {
Original file line number Diff line number Diff line change 42
42
v-bind:error-messages =" v$.activity.description.$error == true ? $t('message.validation_alphanum') : ''"
43
43
>
44
44
</v-text-field >
45
- <v-select v-model =" activity.defaultView" :items =" viste "
45
+ <v-select v-model =" activity.defaultView" :items =" views "
46
46
v-bind:label =" $t('message.activity_predefined_view')" required
47
47
@input =" v$.activity.defaultView.$touch"
48
48
></v-select >
@@ -574,21 +574,16 @@ export default {
574
574
ar: false ,
575
575
// drawer: null,
576
576
source: null ,
577
- viste : [
577
+ views : [
578
578
{
579
- text : this .$i18n .t (' message.activity_views_program' ),
579
+ title : this .$i18n .t (' message.activity_views_program' ),
580
580
value: ' blocks'
581
- },
581
+ }/* ,
582
582
{
583
- text : this .$i18n .t (' message.activity_views_runtime' ),
583
+ title : this.$i18n.t('message.activity_views_runtime'),
584
584
value: 'exec',
585
585
disabled: true
586
- },
587
- {
588
- text: this .$i18n .t (' message.activity_views_python' ),
589
- value: ' python' ,
590
- disabled: true
591
- },
586
+ },*/
592
587
],
593
588
confirm_exit_dialog: null ,
594
589
route_next: null ,
@@ -621,7 +616,7 @@ export default {
621
616
mounted () {
622
617
if (this .$route .params .name ) {
623
618
this .saved = true ;
624
- this .$coderbot .loadActivity (this .$route .params .name , false ).then ((activity ) => {
619
+ this .$coderbot .loadActivity (this .$route .params .name , null ).then ((activity ) => {
625
620
this .activity = activity .data ;
626
621
if (this .activity .toolbox == null ) {
627
622
this .activity .toolbox = {
You can’t perform that action at this time.
0 commit comments