changeset 3108:1ae8c03dd6a6

Merge branch 'master' into vnext # Conflicts: # test_create.html # test_create/test_core.js
author Nicholas Jillings <nicholas.jillings@mail.bcu.ac.uk>
date Tue, 10 Apr 2018 10:22:34 +0100
parents 171706465aa9 (current diff) f99b888f57e9 (diff)
children 63086deafdf4 9ac4f490a1d8
files js/core.js python/survey_parser.py test_create.html test_create/test_core.js
diffstat 5 files changed, 23 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/README.md	Sun Feb 04 11:16:45 2018 +0000
+++ b/README.md	Tue Apr 10 10:22:34 2018 +0100
@@ -5,7 +5,7 @@
 | Author  | e-mail | 
 | ------- | ------ |
 | Nicholas Jillings 				| <[nicholas.jillings@mail.bcu.ac.uk](mailto:nicholas.jillings@mail.bcu.ac.uk)> |
-| Brecht De Man					| <[b.deman@qmul.ac.uk](mailto:b.deman@qmul.ac.uk)> | 
+| Brecht De Man					| <[brecht.deman@bcu.ac.uk](mailto:brecht.deman@bcu.ac.uk)> | 
 | David Moffat					| <[d.j.moffat@qmul.ac.uk](mailto:d.j.moffat@qmul.ac.uk)>| 
 | Joshua D. Reiss (supervisor)	| <[joshua.reiss@qmul.ac.uk](mailto:joshua.reiss@qmul.ac.uk)> | 
 | Ryan Stables (supervisor)		| <[ryan.stables@bcu.ac.uk](mailto:ryan.stables@bcu.ac.uk)> | 
--- a/js/core.js	Sun Feb 04 11:16:45 2018 +0000
+++ b/js/core.js	Tue Apr 10 10:22:34 2018 +0100
@@ -416,10 +416,11 @@
             }
         }
         storage.SessionKey.finish().then(function (resolved) {
+            var converter = new showdown.Converter();
             if (typeof specification.returnURL == "string" && specification.returnURL.length > 0) {
                 window.location = specification.returnURL;
             } else {
-                popup.popupContent.textContent = specification.exitText;
+                popup.popupContent.innerHTML = converter.makeHtml(specification.exitText);
             }
         }, function (message) {
             console.log("Save: Error! " + message.textContent);
--- a/python/survey_parser.py	Sun Feb 04 11:16:45 2018 +0000
+++ b/python/survey_parser.py	Tue Apr 10 10:22:34 2018 +0100
@@ -153,7 +153,6 @@
             filewriter = csv.writer(f, delimiter=",")
             filewriter.writerow(storage["globals"][position][ref]["header"])
             for row in storage["globals"][position][ref]["responses"]:
-                row = [element.encode("utf-8") for element in row]
                 filewriter.writerow(row)
 for page_name in storage["pages"].keys():
     for position in storage["pages"][page_name].keys():
@@ -164,7 +163,6 @@
                 filewriter = csv.writer(f, delimiter=",")
                 filewriter.writerow(storage["pages"][page_name][position][ref]["header"])
                 for row in storage["pages"][page_name][position][ref]["responses"]:
-                    row = [element.encode("utf-8") for element in row]
                     filewriter.writerow(row)
 
 # Time to plot
--- a/test_create.html	Sun Feb 04 11:16:45 2018 +0000
+++ b/test_create.html	Tue Apr 10 10:22:34 2018 +0100
@@ -1112,13 +1112,18 @@
                 <div class="modal-body" ng-switch="state">
                     <div ng-switch-when="0">
                         <div>
+                            <h3>Please wait while assets load...</h3>
+                        </div>
+                    </div>
+                    <div ng-switch-when="1">
+                        <div>
                             <span>Welcome to the WAET test creator tool. This will allow you to create a new test from scratch to suit your testing needs. If you wish to update a test file, please drag and drop the XML document into the area below for processing, otherwise press 'Next' to start a new test. This tool generates files for the WAET 1.2.3 version.</span>
                         </div>
                         <div>
                             <input type="file" id="files" ng-model="files" onchange="handleFiles(event)" />
                         </div>
                     </div>
-                    <div ng-switch-when="1">
+                    <div ng-switch-when="2">
                         <div>
                             <span>Please select the interface you would like to use below. Selecting an interface will give a brief description of the interface type.</span>
                         </div>
@@ -1135,7 +1140,7 @@
                             </div>
                         </div>
                     </div>
-                    <div ng-switch-when="2" dropzone>
+                    <div ng-switch-when="3" dropzone>
                         <div>
                             <h4>Audio Files</h4>
                             <p>{{selected}} is a pairwise test with only two fragments per page. To make it easy to add a lot of fragments (and therefore pages) you can automatically drop your fragments onto here, set a name for each and we will populate your page elements for you!</p>
--- a/test_create/test_core.js	Sun Feb 04 11:16:45 2018 +0000
+++ b/test_create/test_core.js	Tue Apr 10 10:22:34 2018 +0100
@@ -115,6 +115,7 @@
     get("xml/test-schema.xsd").then(function (text) {
         specification.processSchema(text);
         $s.globalSchema = specification.getSchema();
+        $s.$apply();
     });
     $s.availableInterfaceModules = [];
     get("interfaces/interfaces.json").then(JSON.parse).then(function (d) {
@@ -211,12 +212,12 @@
         $($e[0]).modal('hide');
     }
     $s.next = function () {
-        if (($s.state === 0 && $s.file) || $s.state === 1) {
+        if (($s.state === 1 && $s.file) || $s.state === 2) {
             $s.initialise($s.selected);
             if ($s.selected != "AB" && $s.selected != "ABX") {
                 $s.close();
             }
-        } else if ($s.state === 2 && $s.audioFragments.length > 0) {
+        } else if ($s.state === 3 && $s.audioFragments.length > 0) {
             // Populate the audio pages by creating a pairwise set of pairs
             $s.populatePages((function (a) {
                 var b = [];
@@ -231,7 +232,7 @@
                 return b;
             })($s.audioFragments));
             $s.close();
-        } else if ($s.state > 2) {
+        } else if ($s.state > 3) {
             $s.close();
         }
         $s.state++;
@@ -243,6 +244,15 @@
     $s.back = function () {
         $s.state--;
     };
+
+    $s.$watch(function () {
+        return ($s.globalSchema !== undefined)
+    }, function () {
+        if ($s.globalSchema !== undefined && $s.state === 0) {
+            $s.state = 1;
+        }
+    })
+
     $s.mouseover = function (name) {
         var obj = $s.testSpecifications.interfaces.find(function (i) {
             return i.name == name;