149149 </b-collapse >
150150
151151 <!-- Graphical View of Template -->
152- <div class =" dnd-window" id =" drag-components-here" >
152+ <div class =" dnd-window" id =" drag-components-here" :key = " signifyChange " >
153153 <b-card no-body >
154154 <b-tabs card class =" files" content-class =" m-2" fill >
155155
235235 <b-icon class =" when-open" icon =" caret-up" ></b-icon >
236236 </b-button >
237237 </b-card-header >
238- <b-collapse :id =" item.identifier+'content'" visible accordion =" my-accordion-2" role =" tabpanel" >
238+ <b-collapse :id =" item.identifier +'content'" visible accordion =" my-accordion-2" role =" tabpanel" >
239239 <b-card-body >
240240 <div class =" part-content-field" >
241241 <div class =" d-flex" >
@@ -1279,7 +1279,8 @@ export default {
12791279 }
12801280 ],
12811281 validationRunning: false ,
1282- classValidity: " "
1282+ classValidity: " " ,
1283+ signifyChange: true ,
12831284 };
12841285 },
12851286 computed: {
@@ -1320,6 +1321,14 @@ export default {
13201321 this .$store .commit (" updateGeneratedComputationTemplate" , newValue)
13211322 }
13221323 },
1324+ modifiedByTeacher : {
1325+ get () {
1326+ return this .$store .state .modifiedByTeacher ;
1327+ },
1328+ set (newValue) {
1329+ this .$store .commit (" updateModifiedByTeacher" , newValue)
1330+ }
1331+ },
13231332 thereIsTemplate () {
13241333 for (var file in this .computationTemplate .files ) {
13251334 for (var part in this .computationTemplate .files [file].parts ) {
@@ -1633,6 +1642,8 @@ export default {
16331642 this .validationPartParameterResult = null ;
16341643 this .validationArgsResult = null ;
16351644 this .validationRunning = false ;
1645+
1646+ this .$forceUpdate ()
16361647 },
16371648 deep: true
16381649 },
@@ -2567,15 +2578,17 @@ export default {
25672578 // TODO: Should also function without metadata as it is not required
25682579 // add metadata if missing
25692580
2581+ // save current template, as it will be overwritten to perform validation
25702582 let tmp = this .computationTemplate ;
2583+ // set generatedTemplate/computationTemplate so validation can be performed
25712584 this .$store .commit (" updateGeneratedComputationTemplate" , obj)
25722585 let isValid = this .validateJson (true )
25732586 if (! isValid) {
25742587 this .$alert (" Your template is not valid. Thus, it can not be imported!" , " Import Error" , " error" );
25752588 this .$store .commit (" updateGeneratedComputationTemplate" , tmp)
25762589 } else {
25772590 this .$store .commit (" updateGeneratedComputationTemplate" , obj)
2578-
2591+ this . signifyChange = ! this . signifyChange
25792592 // set number of options for configuring parameters and commandline arguments
25802593 this .setNumbersOfOptions ();
25812594 }
@@ -2615,7 +2628,7 @@ export default {
26152628 let file = JSON .stringify (this .computationTemplate );
26162629 let dataBase64url = base64url (Buffer .from (file).toString ());
26172630
2618- // baseUrl = "http://localhost:3000/";
2631+ baseUrl = " http://localhost:3000/" ;
26192632 fetch (baseUrl + " sign" , {
26202633 method: ' POST' ,
26212634 body: dataBase64url
@@ -2629,8 +2642,9 @@ export default {
26292642 }).then (jsonResponse => {
26302643 // get token from sign-endpoint
26312644 let token = jsonResponse .token ;
2632-
2645+
26332646 // set all values in Vuex store
2647+ this .$store .commit (" updateModifiedByTeacher" , true );
26342648 this .$store .commit (" updateJsonTemplate" , this .computationTemplate )
26352649 this .$store .commit (" updateToken" , token);
26362650 this .$store .commit (" updateDataTemplate" , dataBase64url);
0 commit comments