diff --git a/.travis.yml b/.travis.yml index 7fda9c8..e9a9d97 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: php -sudo: false +os: linux dist: trusty @@ -12,36 +12,20 @@ services: - mysql addons: - postgresql: "9.4" + postgresql: "9.5" php: - - 7.0 - - 7.1 - 7.2 - 7.3 -matrix: - exclude: - - env: DB=pgsql MOODLE_BRANCH=master - php: 7.0 - - env: DB=mysqli MOODLE_BRANCH=master - php: 7.0 - - env: DB=pgsql MOODLE_BRANCH=MOODLE_37_STABLE - php: 7.0 - - env: DB=mysqli MOODLE_BRANCH=MOODLE_37_STABLE - php: 7.0 - fast_finish: true - env: global: - IGNORE_PATHS=amd/build matrix: - DB=pgsql MOODLE_BRANCH=master - DB=mysqli MOODLE_BRANCH=master - - DB=pgsql MOODLE_BRANCH=MOODLE_37_STABLE - - DB=mysqli MOODLE_BRANCH=MOODLE_37_STABLE - - DB=pgsql MOODLE_BRANCH=MOODLE_36_STABLE - - DB=mysqli MOODLE_BRANCH=MOODLE_36_STABLE + - DB=pgsql MOODLE_BRANCH=MOODLE_38_STABLE + - DB=mysqli MOODLE_BRANCH=MOODLE_38_STABLE before_install: - phpenv config-rm xdebug.ini @@ -61,7 +45,7 @@ jobs: # Prechecks against latest Moodle stable only. - stage: static php: 7.3 - env: DB=mysqli MOODLE_BRANCH=MOODLE_37_STABLE + env: DB=mysqli MOODLE_BRANCH=MOODLE_38_STABLE script: - moodle-plugin-ci phplint - moodle-plugin-ci phpcpd @@ -75,15 +59,23 @@ jobs: # Smaller build matrix for development builds - stage: develop php: 7.3 - env: DB=mysqli MOODLE_BRANCH=MOODLE_37_STABLE + env: DB=pgsql MOODLE_BRANCH=MOODLE_38_STABLE script: - moodle-plugin-ci phpunit --coverage-clover - - moodle-plugin-ci behat + - cd moodle + - php -S localhost:8000 >/dev/null 2>&1 & + - cd .. + - sleep 10 # Wait for behat to start + - php moodle/admin/tool/behat/cli/run.php --tags="@block_evasys_sync" # Default 'test' stage: Unit tests and behat tests against full matrix. script: - moodle-plugin-ci phpunit --coverage-clover - - moodle-plugin-ci behat + - cd moodle + - php -S localhost:8000 >/dev/null 2>&1 & + - cd .. + - sleep 10 # Wait for behat to start + - php moodle/admin/tool/behat/cli/run.php --tags="@block_evasys_sync_fulltest" after_success: - bash <(curl -s https://codecov.io/bash) diff --git a/README.md b/README.md index d7e7456..a911f3f 100644 --- a/README.md +++ b/README.md @@ -64,3 +64,181 @@ Nach Klick auf obigen Button wird eine Übersicht über Befragungen angezeigt, d In diesem Fall sind keine Befragungen vorbereitet. Falls Befragungen vorhanden sind, wird zusätzlich ein Button angezeigt, der zur Übertragung der Teilnehmerliste dient: ![Screenshot: Mit Evaluationen](https://cloud.githubusercontent.com/assets/432117/21343860/1d4ce964-c699-11e6-8cd9-2b20f3155153.png) + +## Tests + +Die Funktionsweise des Blocks wird durch Behattests sichergestellt. + +##### Tests durchführen: +Um die Test durchzuführen führen sie: +`php moodle/admin/tool/behat/cli/run.php --tags="@block_evasys_sync"` aus.
+Mehr Infos dazu in der [Dokumentation](https://docs.moodle.org/dev/Running_acceptance_test) + +##### Neue Tests schreiben: +- Diese Plugin verfügt über einen Behattest Generator, zu finden in `evasys_sync/tests/behat/generator`
+- Der Generator ist zweigeteilt. Um bestehende Schritte zu ändern reicht es die entsprechende Schrittdefiniton in `steps.py` zu finden und zu ändern. +- Um neue Schritte zu definieren, muss ein entsprechender Schritt in `steps.py` angelegt werden, und die entsprechenden parameter in `generator.py` als key im `OPTIONS dict` angelegt werden. zudem muss in den verwendeten methoden der Parameter hinzugefügt werden.
+Logischerweise muss der neue Schritt auch in `behat_block_evasys_sync` definiert werden sofern es kein Standardschritt ist. + +######Generator +Der generelle Aufbau des Generators ist wie folgt: +
`steps.py`: +- direkte Texterzeugende Methoden sollten hier definiert werden. +- Für einfache Schritte die nur von einem Parameter abhängen können `dicts` benutzt werden. +- Bennenungskonventionen: + * `dicts`: type_chechname_with_underscores + * `functions`: type_chechnamewithoutunderscores +- _type_ richtet sich nach der Funktion des zurückgegebenen Texts im Context des Behat tests: + * `description`: Der zurückgegebene Text ist für die Scenariobeschreibung. + * `step`: Der zurückgegebene Text legt die Umgebung des Tests fest. + * `check`: Der zurückgegebene Text ist eine Überprüfung der erzeugten Seite. + +
`generator.py`: +- 4 hauptmethoden die für die übergebenen Parameter entsprechende Texte zurückgeben: + * `get_checks` Gibt alle Checks aus + * `get_scenario` Gibt alle Umgebungsfestlegenden Texte zurück + * `get_combi_description` Gibt die Beschreibung eines Szenarios auch für eine mehrfachbelegung von parametern zurück + * `get_postcondensing_checks` Gibt die Checks die beim verkleinern der Szenarien nicht berücksichtigt werden sollen Zurück. + +Der generator erzeutgt zunächst aus allen in `OPTIONS` festgelegten Parametern das Karthesische Produkt.
+Danach werden für jede Option die Checks berechnet. +Alle Optionen mit gleichem Check werden darauf überprüft ob sie durch das abändern eines +Parameters mit einer der anderen Optionen übereinstimmen. Wenn Ja wird angenommen, dass der Parameter nicht relevant für den Ausgang ist und die 2 Tests zusammengefasst. + +######Mockingklassen: +Die Rückgaben des Evasys und LSF system werden für die Tests gemockt.
+Dies geschiet in den Dateien `lsf_api_mock_testable.php` sowie in der unterklasse `evasys_api_testable` in `evasys_api.php` +
+Die relationen sehen dabei wie folgt aus:
+`lsfid` → `(veranstnr, semestertext)` = `evasyskennung`
+Die daten werden als JSON array im `summary` Feld der `course` Tabelle gespeichert. Dabei haben die Daten folgende Form:
+`stdClass()->evacourses => array()` +
+ Single Evacourse vardump + + object(stdClass)[281] + public 'valid' => boolean true + public 'veranstnr' => int 0 + public 'semestertxt' => string 'WS 2017/18' (length=10) + public 'studentcount' => int 100 + public 'title' => string 'DynamicSurvey0' (length=14) + public 'surveys' => + array (size=1) + 0 => + object(stdClass)[282] + public 'num' => int 0 + public 'formid' => int 1 + public 'is_open' => string 't' (length=1) + public 'form_count' => int 20 + public 'pswd_count' => int 200 +
+ +Das `stdClass->evacourses` Array sollte dabei für eine lsfid die entsprechende Datenstruktur [siehe vardump](#evavardump) zurückliefern. +
+Die gemockte lsfapi gibt lediglich `semestertext` und `veranstnr` zurück da die restlichen Werte nicht behötigt werden
+Auch die gemockte evasysapi gibt lediglich benutzte Werte zurück und füllt den Rest mit dummys. Sollte ein neuer Wert benötigt werden, so muss dieser hier eingefügt werden.
+Hier sind dafür Vardumps bereitgestellt, (evasys Struktur ändert sich je nachdem ob der Kurs eine oder mehrere Umfragen besitzt!!!): +
+Evasys Kurs Vardump + + object(stdClass)[402] + public 'm_nCourseId' => int 166410 + public 'm_sProgramOfStudy' => string '' (length=0) + public 'm_sCourseTitle' => string 'AutoMultiSurvey' (length=15) + public 'm_sRoom' => string '' (length=0) + public 'm_nCourseType' => int 1 + public 'm_sPubCourseId' => string '1002 WS 2018/19' (length=15) + public 'm_sExternalId' => string '' (length=0) + public 'm_nCountStud' => int 2 + public 'm_sCustomFieldsJSON' => string '{}' (length=2) + public 'm_nUserId' => int 73350 + public 'm_nFbid' => int 338 + public 'm_nPeriodId' => int 40 + public 'm_aoParticipants' => + object(stdClass)[404] + public 'm_aoSecondaryInstructors' => + object(stdClass)[401] + public 'm_oSurveyHolder' => + object(stdClass)[411] + public 'm_aSurveys' => + object(stdClass)[412] + public 'Surveys' => + +
+
+Vardump von einem Kurs mit nur eimer Umfrage + + public 'm_aSurveys' => + object(stdClass)[412] + public 'Surveys' => + object(stdClass)[413] + public 'm_nSurveyId' => int 330416933 + public 'm_nState' => int 0 + public 'm_sTitle' => string 'AutoMultiSurvey' (length=15) + public 'm_cType' => string 'o' (length=1) + public 'm_nFrmid' => int 832 + public 'm_nStuid' => int 34763 + public 'm_nVerid' => int 166410 + public 'm_nOpenState' => int 1 + public 'm_nFormCount' => int 0 + public 'm_nPswdCount' => int 2 + public 'm_sLastDataCollectionDate' => string '' (length=0) + public 'm_nPageLinkOffset' => int 0 + public 'm_sMaskTan' => string '' (length=0) + public 'm_nMaskState' => int 0 + public 'm_oPeriod' => + object(stdClass)[414] + public 'm_nPeriodId' => int 40 + public 'm_sTitel' => string 'WS 2018/19' (length=10) + public 'm_sStartDate' => string '2018-10-01' (length=10) + public 'm_sEndDate' => string '2019-03-31' (length=10) +
+ +
+Vardump von einem Kurs mit mehreren Umfragen + + public 'm_aSurveys' => + object(stdClass)[412] + public 'Surveys' => + array (size=2) + 0 => + object(stdClass)[409] + public 'm_nSurveyId' => int 330416933 + public 'm_nState' => int 0 + public 'm_sTitle' => string 'AutoMultiSurvey' (length=15) + public 'm_cType' => string 'o' (length=1) + public 'm_nFrmid' => int 832 + public 'm_nStuid' => int 34763 + public 'm_nVerid' => int 166410 + public 'm_nOpenState' => int 1 + public 'm_nFormCount' => int 0 + public 'm_nPswdCount' => int 2 + public 'm_sLastDataCollectionDate' => string '' (length=0) + public 'm_nPageLinkOffset' => int 0 + public 'm_sMaskTan' => string '' (length=0) + public 'm_nMaskState' => int 0 + public 'm_oPeriod' => + object(stdClass)[410] + ... + 1 => + object(stdClass)[411] + public 'm_nSurveyId' => int 2114887341 + public 'm_nState' => int 0 + public 'm_sTitle' => string 'AutoMultiSurvey' (length=15) + public 'm_cType' => string 'o' (length=1) + public 'm_nFrmid' => int 784 + public 'm_nStuid' => int 34763 + public 'm_nVerid' => int 166410 + public 'm_nOpenState' => int 1 + public 'm_nFormCount' => int 0 + public 'm_nPswdCount' => int 2 + public 'm_sLastDataCollectionDate' => string '' (length=0) + public 'm_nPageLinkOffset' => int 0 + public 'm_sMaskTan' => string '' (length=0) + public 'm_nMaskState' => int 0 + public 'm_oPeriod' => + object(stdClass)[410] +
+ +Letztlich ist noch zu bemerken, dass für über die `idnumber` verknüpfte Kurse immer ein Sommersemester als `semestertext` gewählt werden sollte, +entsprechend für über die Mappingfunktion verknüpfte Kurse ein Wintersemester, um gleiche Evasyskennungen zu vermeiden. diff --git a/adminsettings.php b/adminsettings.php index 5e52ada..8cf170c 100755 --- a/adminsettings.php +++ b/adminsettings.php @@ -70,8 +70,7 @@ } $persistent = new \block_evasys_sync\user_cat_allocation(0, $record); $persistent->create(); - - redirect($PAGE->url); + // redirect($PAGE->url); exit(); } else if (isset($data->submitbutton)) { if (isset($data->evasys_wsdl_url)) { diff --git a/amd/build/edit_timeframe.min.js b/amd/build/edit_timeframe.min.js index 2951668..88c8cb1 100644 --- a/amd/build/edit_timeframe.min.js +++ b/amd/build/edit_timeframe.min.js @@ -1 +1,2 @@ -define(["jquery","core/modal_factory","core/templates","core/str","core/url"],function(a,b,c,d,e){var f=function(){var b=a("[name=minute_start]").last()[0].selectedIndex,c=a("[name=hour_start]").last()[0].selectedIndex,d=a("[name=day_start]").last()[0].selectedIndex,e=a("[name=month_start]").last()[0].selectedIndex,f=a("[name=year_start]").last()[0].selectedIndex+2e3,g=a("[name=minute_end]").last()[0].selectedIndex,h=a("[name=hour_end]").last()[0].selectedIndex,i=a("[name=day_end]").last()[0].selectedIndex,j=a("[name=month_end]").last()[0].selectedIndex,k=a("[name=year_end]").last()[0].selectedIndex+2e3,l=new Date(f,e,d+1,c,b),m=new Date(k,j,i+1,h,g);return{starttime:l.getTime()/1e3,endtime:m.getTime()/1e3}},g=function(){4===this.readyState&&this.status>=200&&""!=this.responseText&&require(["core/notification"],function(a){d.get_string("save_failure","block_evasys_sync").done(function(b){a.alert("Error",b,"OK")})})},h=function(h,i){var j=0;d.get_string("edit_time","block_evasys_sync").done(function(k){for(var l=!0;l;){var m=a("#timeediturl_"+j);if(m.length<=0){l=!1;break}m.on("click",function(j){var l=a(j.currentTarget);b.create({type:b.types.SAVE_CANCEL,title:k,body:c.render("block_evasys_sync/edittime",{})}).then(function(b){var c=b.getRoot();c.on("modal-save-cancel:save",function(){var b=new URL(l.prop("href")).searchParams.get("id"),c={},j=a("[name=use_standardtime]").last()[0].checked;j&&(c=f()),c.category=b;var k=new XMLHttpRequest;k.onreadystatechange=g;var m=e.relativeUrl("/blocks/evasys_sync/alterstandardtime.php",c,!0);k.open("GET",m),k.send();var n=l.prop("id").split("_")[1];h[n]=c.starttime,i[n]=c.endtime,j?d.get_string("time_set","block_evasys_sync").done(function(a){document.getElementById("timehint_"+n).innerHTML=a}):document.getElementById("timehint_"+n).innerHTML=""}),b.show(),require(["block_evasys_sync/initialize"],function(b){var c=l.prop("id").split("_")[1];null===h[c]||void 0===h[c]?(h[c]=Date.now()/1e3,i[c]=Date.now()/1e3):a("[name=use_standardtime]").last()[0].checked=!0,b.init(h[c],i[c])})})}),j++}})};return{initialize:h}}); \ No newline at end of file +define ("block_evasys_sync/edit_timeframe",["jquery","core/modal_factory","core/templates","core/str","core/url"],function(a,b,c,d,e){var f=function(){var b=a("[name=minute_start]").last()[0].selectedIndex,c=a("[name=hour_start]").last()[0].selectedIndex,d=a("[name=day_start]").last()[0].selectedIndex,e=a("[name=month_start]").last()[0].selectedIndex,f=a("[name=year_start]").last()[0].selectedIndex+2e3,g=a("[name=minute_end]").last()[0].selectedIndex,h=a("[name=hour_end]").last()[0].selectedIndex,i=a("[name=day_end]").last()[0].selectedIndex,j=a("[name=month_end]").last()[0].selectedIndex,k=a("[name=year_end]").last()[0].selectedIndex+2e3,l=new Date(f,e,d+1,c,b),m=new Date(k,j,i+1,h,g);return{starttime:l.getTime()/1e3,endtime:m.getTime()/1e3}},g=function(){if(4===this.readyState&&200<=this.status&&!(""==this.responseText)){require(["core/notification"],function(a){d.get_string("save_failure","block_evasys_sync").done(function(b){a.alert("Error",b,"OK")})})}};return{initialize:function initialize(h,j){var k=0;d.get_string("edit_time","block_evasys_sync").done(function(i){var l=!0;while(l){var m=a("#timeediturl_"+k);if(0>=m.length){l=!1;break}m.on("click",function(k){var l=a(k.currentTarget);b.create({type:b.types.SAVE_CANCEL,title:i,body:c.render("block_evasys_sync/edittime",{})}).then(function(b){var c=b.getRoot();c.on("modal-save-cancel:save",function(){var b=new URL(l.prop("href")).searchParams.get("id"),c={},i=a("[name=use_standardtime]").last()[0].checked;if(i){c=f()}c.category=b;var k=new XMLHttpRequest;k.onreadystatechange=g;var m=e.relativeUrl("/blocks/evasys_sync/alterstandardtime.php",c,!0);k.open("GET",m);k.send();var n=l.prop("id").split("_")[1];h[n]=c.starttime;j[n]=c.endtime;if(i){d.get_string("time_set","block_evasys_sync").done(function(a){document.getElementById("timehint_"+n).innerHTML=a})}else{document.getElementById("timehint_"+n).innerHTML=""}});b.show();require(["block_evasys_sync/initialize"],function(b){var c=l.prop("id").split("_")[1];if(null===h[c]||h[c]===void 0){h[c]=Date.now()/1e3;j[c]=Date.now()/1e3}else{a("[name=use_standardtime]").last()[0].checked=!0}b.init(h[c],j[c])})})});k++}})}}}); +//# sourceMappingURL=edit_timeframe.min.js.map diff --git a/amd/build/edit_timeframe.min.js.map b/amd/build/edit_timeframe.min.js.map new file mode 100644 index 0000000..a324242 --- /dev/null +++ b/amd/build/edit_timeframe.min.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/edit_timeframe.js"],"names":["define","$","ModalFactory","Templates","str","url","get_timestamp","startmin","last","selectedIndex","starthour","startday","startmonth","startyear","endmin","endhour","endday","endmonth","endyear","startdate","Date","enddate","getTime","ready","readyState","status","responseText","require","notification","get_string","done","s","alert","initialize","startdates","enddates","i","dummy","element","length","on","e","clickedLink","currentTarget","create","type","types","SAVE_CANCEL","title","body","render","then","modal","root","getRoot","saveid","URL","prop","searchParams","get","times","settime","checked","category","xhttp","XMLHttpRequest","onreadystatechange","relativeUrl","open","send","elementNo","split","starttime","endtime","document","getElementById","innerHTML","show","timesetter","now","init"],"mappings":"AAAAA,OAAM,oCAAC,CAAC,QAAD,CAAW,oBAAX,CAAiC,gBAAjC,CAAmD,UAAnD,CAA+D,UAA/D,CAAD,CAA6E,SAAUC,CAAV,CAAaC,CAAb,CAA2BC,CAA3B,CAAsCC,CAAtC,CAA2CC,CAA3C,CAAgD,IAE3HC,CAAAA,CAAa,CAAG,UAAY,IACxBC,CAAAA,CAAQ,CAAGN,CAAC,CAAC,qBAAD,CAAD,CAAyBO,IAAzB,GAAgC,CAAhC,EAAmCC,aADtB,CAExBC,CAAS,CAAGT,CAAC,CAAC,mBAAD,CAAD,CAAuBO,IAAvB,GAA8B,CAA9B,EAAiCC,aAFrB,CAGxBE,CAAQ,CAAGV,CAAC,CAAC,kBAAD,CAAD,CAAsBO,IAAtB,GAA6B,CAA7B,EAAgCC,aAHnB,CAIxBG,CAAU,CAAGX,CAAC,CAAC,oBAAD,CAAD,CAAwBO,IAAxB,GAA+B,CAA/B,EAAkCC,aAJvB,CAKxBI,CAAS,CAAGZ,CAAC,CAAC,mBAAD,CAAD,CAAuBO,IAAvB,GAA8B,CAA9B,EAAiCC,aAAjC,CAAiD,GALrC,CAOxBK,CAAM,CAAGb,CAAC,CAAC,mBAAD,CAAD,CAAuBO,IAAvB,GAA8B,CAA9B,EAAiCC,aAPlB,CAQxBM,CAAO,CAAGd,CAAC,CAAC,iBAAD,CAAD,CAAqBO,IAArB,GAA4B,CAA5B,EAA+BC,aARjB,CASxBO,CAAM,CAAGf,CAAC,CAAC,gBAAD,CAAD,CAAoBO,IAApB,GAA2B,CAA3B,EAA8BC,aATf,CAUxBQ,CAAQ,CAAGhB,CAAC,CAAC,kBAAD,CAAD,CAAsBO,IAAtB,GAA6B,CAA7B,EAAgCC,aAVnB,CAWxBS,CAAO,CAAGjB,CAAC,CAAC,iBAAD,CAAD,CAAqBO,IAArB,GAA4B,CAA5B,EAA+BC,aAA/B,CAA+C,GAXjC,CAYxBU,CAAS,CAAG,GAAIC,CAAAA,IAAJ,CAASP,CAAT,CAAoBD,CAApB,CAAgCD,CAAQ,CAAG,CAA3C,CAA8CD,CAA9C,CAAyDH,CAAzD,CAZY,CAaxBc,CAAO,CAAG,GAAID,CAAAA,IAAJ,CAASF,CAAT,CAAkBD,CAAlB,CAA4BD,CAAM,CAAG,CAArC,CAAwCD,CAAxC,CAAiDD,CAAjD,CAbc,CAc5B,MAAO,CACH,UAAaK,CAAS,CAACG,OAAV,GAAsB,GADhC,CAEH,QAAWD,CAAO,CAACC,OAAR,GAAoB,GAF5B,CAIV,CApB8H,CAsB3HC,CAAK,CAAG,UAAY,CACpB,GAAwB,CAApB,QAAKC,UAAL,EAAwC,GAAf,OAAKC,MAA9B,EAA+C,EAAuB,EAArB,OAAKC,YAAP,CAAnD,CAA+E,CAC3EC,OAAO,CAAC,CAAC,mBAAD,CAAD,CAA0B,SAAUC,CAAV,CAAwB,CACrDxB,CAAG,CAACyB,UAAJ,CAAe,cAAf,CAA+B,mBAA/B,EAAoDC,IAApD,CAAyD,SAAUC,CAAV,CAAa,CAClEH,CAAY,CAACI,KAAb,CAAmB,OAAnB,CAA4BD,CAA5B,CAA+B,IAA/B,CACH,CAFD,CAGH,CAJM,CAKV,CACJ,CA9B8H,CA4F/H,MAAO,CACHE,UAAU,CA7DG,QAAbA,CAAAA,UAAa,CAAUC,CAAV,CAAsBC,CAAtB,CAAgC,CAC7C,GAAIC,CAAAA,CAAC,CAAG,CAAR,CACAhC,CAAG,CAACyB,UAAJ,CAAe,WAAf,CAA4B,mBAA5B,EAAiDC,IAAjD,CAAsD,SAAUC,CAAV,CAAa,CAC/D,GAAIM,CAAAA,CAAK,GAAT,CACA,MAAOA,CAAP,CAAc,CACV,GAAIC,CAAAA,CAAO,CAAGrC,CAAC,CAAC,gBAAkBmC,CAAnB,CAAf,CACA,GAAsB,CAAlB,EAAAE,CAAO,CAACC,MAAZ,CAAyB,CACrBF,CAAK,GAAL,CACA,KACH,CACDC,CAAO,CAACE,EAAR,CAAW,OAAX,CAAoB,SAAUC,CAAV,CAAa,CAC7B,GAAIC,CAAAA,CAAW,CAAGzC,CAAC,CAACwC,CAAC,CAACE,aAAH,CAAnB,CACAzC,CAAY,CAAC0C,MAAb,CAAoB,CAChBC,IAAI,CAAE3C,CAAY,CAAC4C,KAAb,CAAmBC,WADT,CAEhBC,KAAK,CAAEjB,CAFS,CAGhBkB,IAAI,CAAE9C,CAAS,CAAC+C,MAAV,CAAiB,4BAAjB,CAA+C,EAA/C,CAHU,CAApB,EAKKC,IALL,CAKU,SAAUC,CAAV,CAAiB,CACnB,GAAIC,CAAAA,CAAI,CAAGD,CAAK,CAACE,OAAN,EAAX,CACAD,CAAI,CAACb,EAAL,CAAQ,wBAAR,CAAkC,UAAY,IACtCe,CAAAA,CAAM,CAAG,GAAIC,CAAAA,GAAJ,CAAQd,CAAW,CAACe,IAAZ,CAAiB,MAAjB,CAAR,EAAkCC,YAAlC,CAA+CC,GAA/C,CAAmD,IAAnD,CAD6B,CAEtCC,CAAK,CAAG,EAF8B,CAGtCC,CAAO,CAAG5D,CAAC,CAAC,yBAAD,CAAD,CAA6BO,IAA7B,GAAoC,CAApC,EAAuCsD,OAHX,CAI1C,GAAID,CAAJ,CAAa,CACTD,CAAK,CAAGtD,CAAa,EACxB,CACDsD,CAAK,CAACG,QAAN,CAAiBR,CAAjB,CACA,GAAIS,CAAAA,CAAK,CAAG,GAAIC,CAAAA,cAAhB,CACAD,CAAK,CAACE,kBAAN,CAA2B3C,CAA3B,CACA,GAAIQ,CAAAA,CAAC,CAAG1B,CAAG,CAAC8D,WAAJ,CAAgB,2CAAhB,CAA6DP,CAA7D,IAAR,CACAI,CAAK,CAACI,IAAN,CAAW,KAAX,CAAkBrC,CAAlB,EACAiC,CAAK,CAACK,IAAN,GACA,GAAIC,CAAAA,CAAS,CAAG5B,CAAW,CAACe,IAAZ,CAAiB,IAAjB,EAAuBc,KAAvB,CAA6B,GAA7B,EAAkC,CAAlC,CAAhB,CACArC,CAAU,CAACoC,CAAD,CAAV,CAAwBV,CAAK,CAACY,SAA9B,CACArC,CAAQ,CAACmC,CAAD,CAAR,CAAsBV,CAAK,CAACa,OAA5B,CACA,GAAIZ,CAAJ,CAAa,CACTzD,CAAG,CAACyB,UAAJ,CAAe,UAAf,CAA2B,mBAA3B,EAAgDC,IAAhD,CAAqD,SAAUC,CAAV,CAAa,CAC9D2C,QAAQ,CAACC,cAAT,CAAwB,YAAcL,CAAtC,EAAiDM,SAAjD,CAA6D7C,CAChE,CAFD,CAGH,CAJD,IAIO,CACH2C,QAAQ,CAACC,cAAT,CAAwB,YAAcL,CAAtC,EAAiDM,SAAjD,CAA6D,EAChE,CACJ,CAvBD,EAwBAxB,CAAK,CAACyB,IAAN,GACAlD,OAAO,CAAC,CAAC,8BAAD,CAAD,CAAmC,SAASmD,CAAT,CAAqB,CAC3D,GAAIR,CAAAA,CAAS,CAAG5B,CAAW,CAACe,IAAZ,CAAiB,IAAjB,EAAuBc,KAAvB,CAA6B,GAA7B,EAAkC,CAAlC,CAAhB,CACA,GAA8B,IAA1B,GAAArC,CAAU,CAACoC,CAAD,CAAV,EAAkCpC,CAAU,CAACoC,CAAD,CAAV,SAAtC,CAA2E,CACvEpC,CAAU,CAACoC,CAAD,CAAV,CAAwBlD,IAAI,CAAC2D,GAAL,GAAa,GAArC,CACA5C,CAAQ,CAACmC,CAAD,CAAR,CAAsBlD,IAAI,CAAC2D,GAAL,GAAa,GACtC,CAHD,IAGO,CACH9E,CAAC,CAAC,yBAAD,CAAD,CAA6BO,IAA7B,GAAoC,CAApC,EAAuCsD,OAAvC,GACH,CACDgB,CAAU,CAACE,IAAX,CAAgB9C,CAAU,CAACoC,CAAD,CAA1B,CAAuCnC,CAAQ,CAACmC,CAAD,CAA/C,CACH,CATM,CAUV,CA1CL,CA2CH,CA7CD,EA8CAlC,CAAC,EACJ,CACJ,CAxDD,CAyDH,CACM,CAGV,CA/FK,CAAN","sourcesContent":["define(['jquery', 'core/modal_factory', 'core/templates', 'core/str', 'core/url'], function ($, ModalFactory, Templates, str, url) {\n\n var get_timestamp = function () {\n var startmin = $('[name=minute_start]').last()[0].selectedIndex;\n var starthour = $('[name=hour_start]').last()[0].selectedIndex;\n var startday = $('[name=day_start]').last()[0].selectedIndex;\n var startmonth = $('[name=month_start]').last()[0].selectedIndex;\n var startyear = $('[name=year_start]').last()[0].selectedIndex + 2000;\n\n var endmin = $('[name=minute_end]').last()[0].selectedIndex;\n var endhour = $('[name=hour_end]').last()[0].selectedIndex;\n var endday = $('[name=day_end]').last()[0].selectedIndex;\n var endmonth = $('[name=month_end]').last()[0].selectedIndex;\n var endyear = $('[name=year_end]').last()[0].selectedIndex + 2000;\n var startdate = new Date(startyear, startmonth, startday + 1, starthour, startmin);\n var enddate = new Date(endyear, endmonth, endday + 1, endhour, endmin);\n return {\n 'starttime': startdate.getTime() / 1000,\n 'endtime': enddate.getTime() / 1000\n };\n };\n\n var ready = function () {\n if (this.readyState === 4 && this.status >= 200 && !(this.responseText == \"\")) {\n require(['core/notification', ], function (notification) {\n str.get_string('save_failure', 'block_evasys_sync').done(function (s) {\n notification.alert('Error', s, 'OK');\n });\n });\n }\n };\n\n var initialize = function (startdates, enddates) {\n var i = 0;\n str.get_string('edit_time', 'block_evasys_sync').done(function (s) {\n var dummy = true;\n while (dummy) {\n var element = $(\"#timeediturl_\" + i);\n if (element.length <= 0) {\n dummy = false;\n break;\n }\n element.on('click', function (e) {\n var clickedLink = $(e.currentTarget);\n ModalFactory.create({\n type: ModalFactory.types.SAVE_CANCEL,\n title: s,\n body: Templates.render('block_evasys_sync/edittime', {}),\n })\n .then(function (modal) {\n var root = modal.getRoot();\n root.on('modal-save-cancel:save', function () {\n var saveid = new URL(clickedLink.prop('href')).searchParams.get(\"id\");\n var times = {};\n var settime = $('[name=use_standardtime]').last()[0].checked;\n if (settime) {\n times = get_timestamp();\n }\n times.category = saveid;\n var xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = ready;\n var s = url.relativeUrl(\"/blocks/evasys_sync/alterstandardtime.php\", times, true);\n xhttp.open('GET', s);\n xhttp.send();\n var elementNo = clickedLink.prop('id').split(\"_\")[1];\n startdates[elementNo] = times.starttime;\n enddates[elementNo] = times.endtime;\n if (settime) {\n str.get_string('time_set', 'block_evasys_sync').done(function (s) {\n document.getElementById('timehint_' + elementNo).innerHTML = s;\n });\n } else {\n document.getElementById('timehint_' + elementNo).innerHTML = \"\";\n }\n });\n modal.show();\n require(['block_evasys_sync/initialize'], function(timesetter) {\n var elementNo = clickedLink.prop('id').split(\"_\")[1];\n if (startdates[elementNo] === null || startdates[elementNo] === undefined) {\n startdates[elementNo] = Date.now() / 1000;\n enddates[elementNo] = Date.now() / 1000;\n } else {\n $('[name=use_standardtime]').last()[0].checked = true;\n }\n timesetter.init(startdates[elementNo], enddates[elementNo]);\n });\n });\n });\n i++;\n }\n });\n };\n return {\n initialize: initialize,\n };\n});"],"file":"edit_timeframe.min.js"} \ No newline at end of file diff --git a/amd/build/initialize.min.js b/amd/build/initialize.min.js index 5db2ad4..c587358 100644 --- a/amd/build/initialize.min.js +++ b/amd/build/initialize.min.js @@ -1 +1,2 @@ -define(["jquery","core/notification","core/str"],function(a,b,c){var d=function(d,e,f){var g,h=new Date(1e3*d),i=new Date(1e3*e);0!=a("[name=minute_start]").length&&(a("[name=minute_start]").last()[0].selectedIndex=h.getMinutes(),a("[name=hour_start]").last()[0].selectedIndex=h.getHours(),a("[name=day_start]").last()[0].selectedIndex=h.getDate()-1,a("[name=month_start]").last()[0].selectedIndex=h.getMonth(),a("[name=year_start]").last()[0].selectedIndex=h.getFullYear()-2e3,a("[name=minute_end]").last()[0].selectedIndex=i.getMinutes(),a("[name=hour_end]").last()[0].selectedIndex=i.getHours(),a("[name=day_end]").last()[0].selectedIndex=i.getDate()-1,a("[name=month_end]").last()[0].selectedIndex=i.getMonth(),a("[name=year_end]").last()[0].selectedIndex=i.getFullYear()-2e3,a("#reactivate").length>0&&(g=!a("[name=minute_end]")[0].disabled,a(document).on("change","#reactivate",function(){this.checked?c.get_strings([{key:"confirm"},{key:"content_confirm_reactivate_"+f,component:"block_evasys_sync"},{key:"yes"},{key:"no"},{key:"requestagain",component:"block_evasys_sync"}]).done(function(c){b.confirm(c[0],c[1],c[2],c[3],function(){a("[name=minute_start]")[0].disabled=!1,a("[name=hour_start]")[0].disabled=!1,a("[name=day_start]")[0].disabled=!1,a("[name=month_start]")[0].disabled=!1,a("[name=year_start]")[0].disabled=!1,g||(a("[name=minute_end]")[0].disabled=!1,a("[name=hour_end]")[0].disabled=!1,a("[name=day_end]")[0].disabled=!1,a("[name=month_end]")[0].disabled=!1,a("[name=year_end]")[0].disabled=!1),a("#direct_invite").length>0&&a("#direct_invite").prop("disabled",!1),a("#only_end").length>0&&a("#only_end").prop("value",!1),a("#evasyssubmitbutton").length>0&&(a("#evasyssubmitbutton").prop("disabled",!1),a("#evasyssubmitbutton").val(c[4]))},function(){a("#reactivate").prop("checked",!1)})}):(a("[name=minute_start]")[0].disabled=!0,a("[name=hour_start]")[0].disabled=!0,a("[name=day_start]")[0].disabled=!0,a("[name=month_start]")[0].disabled=!0,a("[name=year_start]")[0].disabled=!0,g||(a("[name=minute_end]")[0].disabled=!0,a("[name=hour_end]")[0].disabled=!0,a("[name=day_end]")[0].disabled=!0,a("[name=month_end]")[0].disabled=!0,a("[name=year_end]")[0].disabled=!0),a("#direct_invite").length>0&&a("#direct_invite").prop("disabled",!0),a("#only_end").length>0&&a("#only_end").prop("value",!0),a("#evasyssubmitbutton").length>0&&(g||a("#evasyssubmitbutton").prop("disabled",!0),c.get_strings([{key:"planorstartevaluation",component:"block_evasys_sync"},{key:"invitestudents",component:"block_evasys_sync"}]).done(function(b){a("#direct_invite").length>0?a("#evasyssubmitbutton").val(b[0]):a("#evasyssubmitbutton").val(b[1])})))})),a("#direct_invite").length>0&&a(document).on("change","#direct_invite",function(){this.checked?(a("[name=minute_start]")[0].disabled=!0,a("[name=hour_start]")[0].disabled=!0,a("[name=day_start]")[0].disabled=!0,a("[name=month_start]")[0].disabled=!0,a("[name=year_start]")[0].disabled=!0):(a("[name=minute_start]")[0].disabled=!1,a("[name=hour_start]")[0].disabled=!1,a("[name=day_start]")[0].disabled=!1,a("[name=month_start]")[0].disabled=!1,a("[name=year_start]")[0].disabled=!1)}))};return{init:d}}); \ No newline at end of file +define ("block_evasys_sync/initialize",["jquery","core/notification","core/str"],function(a,b,c){return{init:function init(d,e,f){var g=new Date(1e3*d),h=new Date(1e3*e),i;if(0==a("[name=minute_start]").length){return}a("[name=minute_start]").last()[0].selectedIndex=g.getMinutes();a("[name=hour_start]").last()[0].selectedIndex=g.getHours();a("[name=day_start]").last()[0].selectedIndex=g.getDate()-1;a("[name=month_start]").last()[0].selectedIndex=g.getMonth();a("[name=year_start]").last()[0].selectedIndex=g.getFullYear()-2e3;a("[name=minute_end]").last()[0].selectedIndex=h.getMinutes();a("[name=hour_end]").last()[0].selectedIndex=h.getHours();a("[name=day_end]").last()[0].selectedIndex=h.getDate()-1;a("[name=month_end]").last()[0].selectedIndex=h.getMonth();a("[name=year_end]").last()[0].selectedIndex=h.getFullYear()-2e3;if(0 0) {\n endenabled = !$('[name=minute_end]')[0].disabled;\n $(document).on(\"change\", \"#reactivate\", function() {\n if (this.checked) {\n // Ask for confirmation, then enable all fields related to re-invitation.\n str.get_strings([\n {'key': 'confirm'},\n {'key': 'content_confirm_reactivate_'+mode, component: 'block_evasys_sync'},\n {'key': 'yes'},\n {'key': 'no'},\n {'key': 'requestagain', component: 'block_evasys_sync'}\n ]).done(function(s) {\n notification.confirm(s[0], s[1], s[2], s[3],\n function () {\n // User pressed yes.\n $('[name=minute_start]')[0].disabled = false;\n $('[name=hour_start]')[0].disabled = false;\n $('[name=day_start]')[0].disabled = false;\n $('[name=month_start]')[0].disabled = false;\n $('[name=year_start]')[0].disabled = false;\n if (!endenabled) {\n $('[name=minute_end]')[0].disabled = false;\n $('[name=hour_end]')[0].disabled = false;\n $('[name=day_end]')[0].disabled = false;\n $('[name=month_end]')[0].disabled = false;\n $('[name=year_end]')[0].disabled = false;\n }\n if ($('#direct_invite').length > 0) {\n $('#direct_invite').prop('disabled', false);\n }\n if ($('#only_end').length > 0) {\n $('#only_end').prop(\"value\", false);\n }\n if ($('#evasyssubmitbutton').length > 0) {\n $('#evasyssubmitbutton').prop(\"disabled\", false);\n $('#evasyssubmitbutton').val(s[4]);\n }\n },\n function () {\n // User pressed no.\n $('#reactivate').prop(\"checked\", false);\n });\n });\n } else {\n // Disable all fields related to re-invitation.\n $('[name=minute_start]')[0].disabled = true;\n $('[name=hour_start]')[0].disabled = true;\n $('[name=day_start]')[0].disabled = true;\n $('[name=month_start]')[0].disabled = true;\n $('[name=year_start]')[0].disabled = true;\n if (!endenabled) {\n $('[name=minute_end]')[0].disabled = true;\n $('[name=hour_end]')[0].disabled = true;\n $('[name=day_end]')[0].disabled = true;\n $('[name=month_end]')[0].disabled = true;\n $('[name=year_end]')[0].disabled = true;\n }\n if ($('#direct_invite').length > 0) {\n $('#direct_invite').prop('disabled', true);\n }\n if ($('#only_end').length > 0) {\n $('#only_end').prop(\"value\", true);\n }\n if ($('#evasyssubmitbutton').length > 0) {\n if (!endenabled) {\n $('#evasyssubmitbutton').prop(\"disabled\", true);\n }\n str.get_strings([\n {'key': 'planorstartevaluation', component: 'block_evasys_sync'},\n {'key': 'invitestudents', component: 'block_evasys_sync'}\n ]).done(function(s) {\n if ($('#direct_invite').length > 0) {\n // User can start invitation herself.\n $('#evasyssubmitbutton').val(s[0]);\n } else {\n // User can only request evaluation from the coordinator.\n $('#evasyssubmitbutton').val(s[1]);\n }\n });\n }\n }\n });\n }\n if ($('#direct_invite').length > 0) {\n $(document).on(\"change\", \"#direct_invite\", function () {\n if (this.checked) {\n // Disable startdate as evaluation will start immediately.\n $('[name=minute_start]')[0].disabled = true;\n $('[name=hour_start]')[0].disabled = true;\n $('[name=day_start]')[0].disabled = true;\n $('[name=month_start]')[0].disabled = true;\n $('[name=year_start]')[0].disabled = true;\n } else {\n // Allow user to set startdate.\n $('[name=minute_start]')[0].disabled = false;\n $('[name=hour_start]')[0].disabled = false;\n $('[name=day_start]')[0].disabled = false;\n $('[name=month_start]')[0].disabled = false;\n $('[name=year_start]')[0].disabled = false;\n\n }\n });\n }\n };\n\n return {\n init: init\n };\n});"],"file":"initialize.min.js"} \ No newline at end of file diff --git a/amd/build/invite_manager.min.js b/amd/build/invite_manager.min.js index 3126c3f..48e08ba 100644 --- a/amd/build/invite_manager.min.js +++ b/amd/build/invite_manager.min.js @@ -1 +1,2 @@ -define(["core/str","core/notification","core/url","jquery"],function(a,b,c,d){var e=function(a){var b=d(".block_evasys_participants");b.each(function(){this.innerHTML=a})},f=function(f){var g=new XMLHttpRequest;g.onreadystatechange=function(){if(4===this.readyState&&200===this.status){var c=this.responseText.split("#");"success inviting"===c[0]?(e(c[1]),a.get_strings([{key:"title_success",component:"block_evasys_sync"},{key:"content_success_invite",component:"block_evasys_sync"},{key:"ok"}]).done(function(a){b.alert(a[0],a[1],a[2])})):"success"===c[0]?a.get_strings([{key:"title_success",component:"block_evasys_sync"},{key:"content_success_direct",component:"block_evasys_sync"},{key:"ok"}]).done(function(a){b.alert(a[0],a[1],a[2])}):"Start after end"===c[0]?a.get_strings([{key:"title_date_invalid",component:"block_evasys_sync"},{key:"content_start_after_end",component:"block_evasys_sync"},{key:"ok"}]).done(function(a){b.alert(a[0],a[1],a[2])}):"End in the past"===c[0]?a.get_strings([{key:"title_date_invalid",component:"block_evasys_sync"},{key:"content_invalidend",component:"block_evasys_sync"},{key:"ok"}]).done(function(a){b.alert(a[0],a[1],a[2])}):"wrong mode"===c[0]?a.get_strings([{key:"title_wrong_mode",component:"block_evasys_sync"},{key:"content_wrong_mode",component:"block_evasys_sync"},{key:"ok"}]).done(function(a){b.alert(a[0],a[1],a[2])}):a.get_string("send_error","block_evasys_sync").done(function(a){b.alert("Error",a,"OK")})}else 4===this.readyState&&a.get_string("send_error","block_evasys_sync").done(function(a){b.alert("Error",a,"OK")});4===this.readyState&&d("#evasys_block_form").find(":input[type=submit]").prop("disabled",!1)};var h=c.relativeUrl("/blocks/evasys_sync/invite.php",f,!0);g.open("GET",h),g.send()},g=function(){d("#evasys_block_form").submit(function(a){a.preventDefault(),d("#evasyssubmitbutton").prop("disabled",!0);var b={};d("#evasys_block_form").serializeArray().forEach(function(a){b[a.name]=a.value}),f(b)}),d("#direct_invite").length>0&&a.get_strings([{key:"planorstartevaluation",component:"block_evasys_sync"},{key:"startevaluationnow",component:"block_evasys_sync"}]).done(function(a){d("#direct_invite").change(function(){this.checked?d("#evasyssubmitbutton").val(a[1]):d("#evasyssubmitbutton").val(a[0])})})};return{init:g}}); \ No newline at end of file +define ("block_evasys_sync/invite_manager",["core/str","core/notification","core/url","jquery"],function(a,b,c,d){var e=function(a){var b=d(".block_evasys_participants");b.each(function(){this.innerHTML=a})},f=function(f){var g=new XMLHttpRequest;g.onreadystatechange=function(){if(4===this.readyState&&200===this.status){var c=this.responseText.split("#");if("success inviting"===c[0]){e(c[1]);a.get_strings([{key:"title_success",component:"block_evasys_sync"},{key:"content_success_invite",component:"block_evasys_sync"},{key:"ok"}]).done(function(a){b.alert(a[0],a[1],a[2])})}else if("success"===c[0]){a.get_strings([{key:"title_success",component:"block_evasys_sync"},{key:"content_success_direct",component:"block_evasys_sync"},{key:"ok"}]).done(function(a){b.alert(a[0],a[1],a[2])})}else if("Start after end"===c[0]){a.get_strings([{key:"title_date_invalid",component:"block_evasys_sync"},{key:"content_start_after_end",component:"block_evasys_sync"},{key:"ok"}]).done(function(a){b.alert(a[0],a[1],a[2])})}else if("End in the past"===c[0]){a.get_strings([{key:"title_date_invalid",component:"block_evasys_sync"},{key:"content_invalidend",component:"block_evasys_sync"},{key:"ok"}]).done(function(a){b.alert(a[0],a[1],a[2])})}else if("wrong mode"===c[0]){a.get_strings([{key:"title_wrong_mode",component:"block_evasys_sync"},{key:"content_wrong_mode",component:"block_evasys_sync"},{key:"ok"}]).done(function(a){b.alert(a[0],a[1],a[2])})}else{a.get_string("send_error","block_evasys_sync").done(function(a){b.alert("Error",a,"OK")})}}else if(4===this.readyState){a.get_string("send_error","block_evasys_sync").done(function(a){b.alert("Error",a,"OK")})}if(4===this.readyState){d("#evasys_block_form").find(":input[type=submit]").prop("disabled",!1)}};var h=c.relativeUrl("/blocks/evasys_sync/invite.php",f,!0);g.open("GET",h);g.send()};return{init:function init(){d("#evasys_block_form").submit(function(a){a.preventDefault();d("#evasyssubmitbutton").prop("disabled",!0);var b={};d("#evasys_block_form").serializeArray().forEach(function(a){b[a.name]=a.value});f(b)});if(0 0) {\n str.get_strings([\n {'key': 'planorstartevaluation', component: 'block_evasys_sync'},\n {'key': 'startevaluationnow', component: 'block_evasys_sync'}\n ]).done(function (s) {\n $('#direct_invite').change(function() {\n if(this.checked) {\n $('#evasyssubmitbutton').val(s[1]);\n } else {\n $('#evasyssubmitbutton').val(s[0]);\n }\n });\n });\n }\n };\n\n return {\n init: init\n };\n});"],"file":"invite_manager.min.js"} \ No newline at end of file diff --git a/amd/build/post_dialog.min.js b/amd/build/post_dialog.min.js index 9b73a5a..fc0bd20 100644 --- a/amd/build/post_dialog.min.js +++ b/amd/build/post_dialog.min.js @@ -1 +1,2 @@ -define(["jquery","core/notification","core/str"],function(a,b,c){var d=function(){c.get_strings([{key:"title_success",component:"block_evasys_sync"},{key:"content_success",component:"block_evasys_sync"},{key:"confirm_box",component:"block_evasys_sync"}]).done(function(a){b.alert(a[0],a[1],a[2])}).fail(b.exception)},e=function(){c.get_strings([{key:"title_uptodate",component:"block_evasys_sync"},{key:"content_uptodate",component:"block_evasys_sync"},{key:"confirm_box",component:"block_evasys_sync"}]).done(function(a){b.alert(a[0],a[1],a[2])}).fail(b.exception)},f=function(){c.get_strings([{key:"title_failure",component:"block_evasys_sync"},{key:"content_nostudents",component:"block_evasys_sync"},{key:"confirm_box",component:"block_evasys_sync"}]).done(function(a){b.alert(a[0],a[1],a[2])}).fail(b.exception)},g=function(){c.get_strings([{key:"title_failure",component:"block_evasys_sync"},{key:"content_failure",component:"block_evasys_sync"},{key:"confirm_box",component:"block_evasys_sync"}]).done(function(a){b.alert(a[0],a[1],a[2])}).fail(b.exception)};return{show_dialog_failure:g,show_dialog_no_students:f,show_dialog_success:d,show_dialog_up_to_date:e}}); \ No newline at end of file +define ("block_evasys_sync/post_dialog",["jquery","core/notification","core/str"],function(a,b,c){return{show_dialog_failure:function show_dialog_failure(){c.get_strings([{key:"title_failure",component:"block_evasys_sync"},{key:"content_failure",component:"block_evasys_sync"},{key:"confirm_box",component:"block_evasys_sync"}]).done(function(a){b.alert(a[0],a[1],a[2])}).fail(b.exception)},show_dialog_no_students:function show_dialog_nostudents(){c.get_strings([{key:"title_failure",component:"block_evasys_sync"},{key:"content_nostudents",component:"block_evasys_sync"},{key:"confirm_box",component:"block_evasys_sync"}]).done(function(a){b.alert(a[0],a[1],a[2])}).fail(b.exception)},show_dialog_success:function show_dialog_success(){c.get_strings([{key:"title_success",component:"block_evasys_sync"},{key:"content_success",component:"block_evasys_sync"},{key:"confirm_box",component:"block_evasys_sync"}]).done(function(a){b.alert(a[0],a[1],a[2])}).fail(b.exception)},show_dialog_up_to_date:function show_dialog_up_to_date(){c.get_strings([{key:"title_uptodate",component:"block_evasys_sync"},{key:"content_uptodate",component:"block_evasys_sync"},{key:"confirm_box",component:"block_evasys_sync"}]).done(function(a){b.alert(a[0],a[1],a[2])}).fail(b.exception)}}}); +//# sourceMappingURL=post_dialog.min.js.map diff --git a/amd/build/post_dialog.min.js.map b/amd/build/post_dialog.min.js.map new file mode 100644 index 0000000..ce2317d --- /dev/null +++ b/amd/build/post_dialog.min.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/post_dialog.js"],"names":["define","$","notification","str","show_dialog_failure","get_strings","component","done","s","alert","fail","exception","show_dialog_no_students","show_dialog_nostudents","show_dialog_success","show_dialog_up_to_date"],"mappings":"AAAAA,OAAM,iCAAC,CAAC,QAAD,CAAW,mBAAX,CAAgC,UAAhC,CAAD,CAA8C,SAASC,CAAT,CAAYC,CAAZ,CAA0BC,CAA1B,CAA+B,CA8C/E,MAAO,CACHC,mBAAmB,CAZG,QAAtBA,CAAAA,mBAAsB,EAAW,CACjCD,CAAG,CAACE,WAAJ,CAAgB,CACZ,CAAC,IAAQ,eAAT,CAA0BC,SAAS,CAAE,mBAArC,CADY,CAEZ,CAAC,IAAQ,iBAAT,CAA4BA,SAAS,CAAE,mBAAvC,CAFY,CAGZ,CAAC,IAAQ,aAAT,CAAwBA,SAAS,CAAE,mBAAnC,CAHY,CAAhB,EAIGC,IAJH,CAIQ,SAASC,CAAT,CAAY,CACZN,CAAY,CAACO,KAAb,CAAmBD,CAAC,CAAC,CAAD,CAApB,CAAyBA,CAAC,CAAC,CAAD,CAA1B,CAA+BA,CAAC,CAAC,CAAD,CAAhC,CACP,CAND,EAOEE,IAPF,CAOOR,CAAY,CAACS,SAPpB,CAQH,CAEM,CAEHC,uBAAuB,CAxBE,QAAzBC,CAAAA,sBAAyB,EAAW,CACpCV,CAAG,CAACE,WAAJ,CAAgB,CACZ,CAAC,IAAQ,eAAT,CAA0BC,SAAS,CAAE,mBAArC,CADY,CAEZ,CAAC,IAAQ,oBAAT,CAA+BA,SAAS,CAAE,mBAA1C,CAFY,CAGZ,CAAC,IAAQ,aAAT,CAAwBA,SAAS,CAAE,mBAAnC,CAHY,CAAhB,EAIGC,IAJH,CAIQ,SAASC,CAAT,CAAY,CACZN,CAAY,CAACO,KAAb,CAAmBD,CAAC,CAAC,CAAD,CAApB,CAAyBA,CAAC,CAAC,CAAD,CAA1B,CAA+BA,CAAC,CAAC,CAAD,CAAhC,CACP,CAND,EAOEE,IAPF,CAOOR,CAAY,CAACS,SAPpB,CAQH,CAaM,CAGHG,mBAAmB,CA/CG,QAAtBA,CAAAA,mBAAsB,EAAW,CACjCX,CAAG,CAACE,WAAJ,CAAgB,CACZ,CAAC,IAAQ,eAAT,CAA0BC,SAAS,CAAE,mBAArC,CADY,CAEZ,CAAC,IAAQ,iBAAT,CAA4BA,SAAS,CAAE,mBAAvC,CAFY,CAGZ,CAAC,IAAQ,aAAT,CAAwBA,SAAS,CAAE,mBAAnC,CAHY,CAAhB,EAIGC,IAJH,CAIQ,SAASC,CAAT,CAAY,CACZN,CAAY,CAACO,KAAb,CAAmBD,CAAC,CAAC,CAAD,CAApB,CAAyBA,CAAC,CAAC,CAAD,CAA1B,CAA+BA,CAAC,CAAC,CAAD,CAAhC,CACP,CAND,EAOEE,IAPF,CAOOR,CAAY,CAACS,SAPpB,CAQH,CAmCM,CAIHI,sBAAsB,CArCG,QAAzBA,CAAAA,sBAAyB,EAAW,CACpCZ,CAAG,CAACE,WAAJ,CAAgB,CACZ,CAAC,IAAQ,gBAAT,CAA2BC,SAAS,CAAE,mBAAtC,CADY,CAEZ,CAAC,IAAQ,kBAAT,CAA6BA,SAAS,CAAE,mBAAxC,CAFY,CAGZ,CAAC,IAAQ,aAAT,CAAwBA,SAAS,CAAE,mBAAnC,CAHY,CAAhB,EAIGC,IAJH,CAIQ,SAASC,CAAT,CAAY,CACZN,CAAY,CAACO,KAAb,CAAmBD,CAAC,CAAC,CAAD,CAApB,CAAyBA,CAAC,CAAC,CAAD,CAA1B,CAA+BA,CAAC,CAAC,CAAD,CAAhC,CACP,CAND,EAOEE,IAPF,CAOOR,CAAY,CAACS,SAPpB,CAQH,CAwBM,CAMV,CApDK,CAAN","sourcesContent":["define(['jquery', 'core/notification', 'core/str'], function($, notification, str) {\n\n var show_dialog_success = function() {\n str.get_strings([\n {'key' : 'title_success', component: 'block_evasys_sync'},\n {'key' : 'content_success', component: 'block_evasys_sync'},\n {'key' : 'confirm_box', component: 'block_evasys_sync'},\n ]).done(function(s) {\n notification.alert(s[0], s[1], s[2]);\n }\n ).fail(notification.exception);\n };\n\n var show_dialog_up_to_date = function() {\n str.get_strings([\n {'key' : 'title_uptodate', component: 'block_evasys_sync'},\n {'key' : 'content_uptodate', component: 'block_evasys_sync'},\n {'key' : 'confirm_box', component: 'block_evasys_sync'},\n ]).done(function(s) {\n notification.alert(s[0], s[1], s[2]);\n }\n ).fail(notification.exception);\n };\n\n var show_dialog_nostudents = function() {\n str.get_strings([\n {'key' : 'title_failure', component: 'block_evasys_sync'},\n {'key' : 'content_nostudents', component: 'block_evasys_sync'},\n {'key' : 'confirm_box', component: 'block_evasys_sync'},\n ]).done(function(s) {\n notification.alert(s[0], s[1], s[2]);\n }\n ).fail(notification.exception);\n };\n\n var show_dialog_failure = function() {\n str.get_strings([\n {'key' : 'title_failure', component: 'block_evasys_sync'},\n {'key' : 'content_failure', component: 'block_evasys_sync'},\n {'key' : 'confirm_box', component: 'block_evasys_sync'},\n ]).done(function(s) {\n notification.alert(s[0], s[1], s[2]);\n }\n ).fail(notification.exception);\n };\n\n return {\n show_dialog_failure: show_dialog_failure,\n show_dialog_no_students: show_dialog_nostudents,\n show_dialog_success: show_dialog_success,\n show_dialog_up_to_date: show_dialog_up_to_date\n };\n});"],"file":"post_dialog.min.js"} \ No newline at end of file diff --git a/amd/build/standardtime.min.js b/amd/build/standardtime.min.js index f0e7f35..79f8e2f 100644 --- a/amd/build/standardtime.min.js +++ b/amd/build/standardtime.min.js @@ -1 +1,2 @@ -define(["jquery","core/str"],function(a,b){var c=function(){a("#deactivate_standard").length>0&&(a("#deactivate_standard").prop("disabled",!1),a(document).on("change","#deactivate_standard",function(){this.checked?(a("#inputfieldset").prop("disabled",!1),a("#activate_standard").prop("value",!1),b.get_string("different_period","block_evasys_sync").done(function(b){a("#evaluationperiod").text(b)}),e()):(a("#inputfieldset").prop("disabled",!0),a("#activate_standard").prop("value",!0),b.get_string("standard_period","block_evasys_sync").done(function(b){a("#evaluationperiod").text(b)}),d())}))},d=function(){a("[name=minute_start]")[0].disabled=!0,a("[name=hour_start]")[0].disabled=!0,a("[name=day_start]")[0].disabled=!0,a("[name=month_start]")[0].disabled=!0,a("[name=year_start]")[0].disabled=!0,a("[name=minute_end]")[0].disabled=!0,a("[name=hour_end]")[0].disabled=!0,a("[name=day_end]")[0].disabled=!0,a("[name=month_end]")[0].disabled=!0,a("[name=year_end]")[0].disabled=!0,a("#only_end").val(!1)},e=function(){a("[name=minute_start]")[0].disabled=!1,a("[name=hour_start]")[0].disabled=!1,a("[name=day_start]")[0].disabled=!1,a("[name=month_start]")[0].disabled=!1,a("[name=year_start]")[0].disabled=!1,a("[name=minute_end]")[0].disabled=!1,a("[name=hour_end]")[0].disabled=!1,a("[name=day_end]")[0].disabled=!1,a("[name=month_end]")[0].disabled=!1,a("[name=year_end]")[0].disabled=!1};return{init:c}}); \ No newline at end of file +define ("block_evasys_sync/standardtime",["jquery","core/str"],function(a,b){var c=function(){a("[name=minute_start]")[0].disabled=!0;a("[name=hour_start]")[0].disabled=!0;a("[name=day_start]")[0].disabled=!0;a("[name=month_start]")[0].disabled=!0;a("[name=year_start]")[0].disabled=!0;a("[name=minute_end]")[0].disabled=!0;a("[name=hour_end]")[0].disabled=!0;a("[name=day_end]")[0].disabled=!0;a("[name=month_end]")[0].disabled=!0;a("[name=year_end]")[0].disabled=!0;a("#only_end").val(!1)},d=function(){a("[name=minute_start]")[0].disabled=!1;a("[name=hour_start]")[0].disabled=!1;a("[name=day_start]")[0].disabled=!1;a("[name=month_start]")[0].disabled=!1;a("[name=year_start]")[0].disabled=!1;a("[name=minute_end]")[0].disabled=!1;a("[name=hour_end]")[0].disabled=!1;a("[name=day_end]")[0].disabled=!1;a("[name=month_end]")[0].disabled=!1;a("[name=year_end]")[0].disabled=!1};return{init:function init(){if(0 0) {\n $('#deactivate_standard').prop(\"disabled\", false);\n $(document).on(\"change\", \"#deactivate_standard\", function () {\n if (this.checked) {\n $('#inputfieldset').prop(\"disabled\", false);\n $('#activate_standard').prop(\"value\", false);\n str.get_string('different_period', 'block_evasys_sync').done(function (s) {\n $('#evaluationperiod').text(s);\n });\n enable();\n } else {\n $('#inputfieldset').prop(\"disabled\", true);\n $('#activate_standard').prop(\"value\", true);\n str.get_string('standard_period', 'block_evasys_sync').done(function (s) {\n $('#evaluationperiod').text(s);\n });\n disable();\n }\n });\n }\n };\n\n var disable = function() {\n $('[name=minute_start]')[0].disabled = true;\n $('[name=hour_start]')[0].disabled = true;\n $('[name=day_start]')[0].disabled = true;\n $('[name=month_start]')[0].disabled = true;\n $('[name=year_start]')[0].disabled = true;\n $('[name=minute_end]')[0].disabled = true;\n $('[name=hour_end]')[0].disabled = true;\n $('[name=day_end]')[0].disabled = true;\n $('[name=month_end]')[0].disabled = true;\n $('[name=year_end]')[0].disabled = true;\n $('#only_end').val(false);\n };\n\n var enable = function() {\n $('[name=minute_start]')[0].disabled = false;\n $('[name=hour_start]')[0].disabled = false;\n $('[name=day_start]')[0].disabled = false;\n $('[name=month_start]')[0].disabled = false;\n $('[name=year_start]')[0].disabled = false;\n $('[name=minute_end]')[0].disabled = false;\n $('[name=hour_end]')[0].disabled = false;\n $('[name=day_end]')[0].disabled = false;\n $('[name=month_end]')[0].disabled = false;\n $('[name=year_end]')[0].disabled = false;\n };\n\n return {\n init: init\n };\n});"],"file":"standardtime.min.js"} \ No newline at end of file diff --git a/amd/src/post_dialog.js b/amd/src/post_dialog.js index ef3012a..b79362f 100644 --- a/amd/src/post_dialog.js +++ b/amd/src/post_dialog.js @@ -7,7 +7,7 @@ define(['jquery', 'core/notification', 'core/str'], function($, notification, st {'key' : 'confirm_box', component: 'block_evasys_sync'}, ]).done(function(s) { notification.alert(s[0], s[1], s[2]); - } + } ).fail(notification.exception); }; @@ -18,7 +18,7 @@ define(['jquery', 'core/notification', 'core/str'], function($, notification, st {'key' : 'confirm_box', component: 'block_evasys_sync'}, ]).done(function(s) { notification.alert(s[0], s[1], s[2]); - } + } ).fail(notification.exception); }; @@ -29,7 +29,7 @@ define(['jquery', 'core/notification', 'core/str'], function($, notification, st {'key' : 'confirm_box', component: 'block_evasys_sync'}, ]).done(function(s) { notification.alert(s[0], s[1], s[2]); - } + } ).fail(notification.exception); }; @@ -40,7 +40,7 @@ define(['jquery', 'core/notification', 'core/str'], function($, notification, st {'key' : 'confirm_box', component: 'block_evasys_sync'}, ]).done(function(s) { notification.alert(s[0], s[1], s[2]); - } + } ).fail(notification.exception); }; diff --git a/block_evasys_sync.php b/block_evasys_sync.php index b323edc..9be99b0 100644 --- a/block_evasys_sync.php +++ b/block_evasys_sync.php @@ -34,6 +34,7 @@ public function init() { */ public function get_content() { global $OUTPUT; + $evasyssynccheck = optional_param('evasyssynccheck', 0, PARAM_BOOL); $status = optional_param('status', "", PARAM_TEXT); @@ -60,7 +61,7 @@ public function get_content() { // If we are not in sync mode, we display either the course mapping or the check status button. if ($evasyssynccheck !== 1) { - $inlsf = !empty($this->page->course->idnumber); + $inlsf = (!empty($this->page->course->idnumber) or $this->page->course->idnumber === '0'); $hasextras = \block_evasys_sync\course_evasys_courses_allocation::record_exists_select( "course = {$this->page->course->id} AND NOT evasyscourses = ''"); @@ -82,13 +83,13 @@ public function get_content() { if ($ismodeautomated) { $this->page->requires->js_call_amd('block_evasys_sync/invite_manager', 'init'); } else { - $categoryhasstandardtime = \block_evasys_sync\evasys_synchronizer::get_standard_timemode($this->page->course->category); // Only use standardtime js if no record exists. if (!$record) { $this->page->requires->js_call_amd('block_evasys_sync/standardtime', 'init'); } } + $categoryhasstandardtime = \block_evasys_sync\evasys_synchronizer::get_standard_timemode($this->page->course->category); $evasyssynchronizer = new \block_evasys_sync\evasys_synchronizer($this->page->course->id); try { $evasyscourses = $evasyssynchronizer->get_courses_from_lsf(); @@ -97,7 +98,6 @@ public function get_content() { $this->content->text .= html_writer::div(get_string('syncnotpossible', 'block_evasys_sync')); return $this->content; } - if ($ismodeautomated) { $href = new moodle_url('/course/view.php', array('id' => $this->page->course->id, "evasyssynccheck" => true)); @@ -110,6 +110,7 @@ public function get_content() { $enddisabled = false; $emailsentnotice = false; $periodsetnotice = false; + $wasstarted = false; // Set start to today and end to a week from now. $start = time(); @@ -134,6 +135,8 @@ public function get_content() { // If the persistenceclass exists and the state is automatic and not opened // the period must have been set. $periodsetnotice = true; + } else { + $wasstarted = true; } if ($state >= course_evaluation_allocation::STATE_AUTO_OPENED || $nostudents) { // If the course was already opened, disable the start date. If there are no students disable all controls. @@ -149,7 +152,7 @@ public function get_content() { $end = $record->get('enddate'); $recordhasstandardtime = $record->get('usestandardtime'); } else { - if (!$ismodeautomated && $categoryhasstandardtime) { + if ($categoryhasstandardtime) { $start = $categoryhasstandardtime['start']; $end = $categoryhasstandardtime['end']; $recordhasstandardtime = true; @@ -161,15 +164,27 @@ public function get_content() { $this->page->requires->js_call_amd('block_evasys_sync/initialize', 'init', array($start, $end, $jsmodestring)); // Initialize variables to pass to mustache. + $unknownidnumbercourse = false; + $unknownextracourse = false; $courses = array(); $hassurveys = false; $startoption = ($startdisabled xor $enddisabled); - $warning = false; + $warningnotallclosed = false; + $warningnotallopen = false; $invalidcourses = false; // Query course data (put in function). foreach ($evasyscourses as $evasyscourseinfo) { $course = array(); $course['evasyscoursetitle'] = $evasyssynchronizer->get_course_name($evasyscourseinfo['id']); + if ($course['evasyscoursetitle'] == 'Unknown') { + $couseidnum = $this->page->course->idnumber; + if ($evasyscourseinfo['lsf_id'] == $couseidnum) { + $unknownidnumbercourse = true; + } else { + $unknownextracourse = true; + } + continue; + } $course['technicalid'] = $evasyssynchronizer->get_course_id($evasyscourseinfo['id']); $course['evasyscourseid'] = $evasyscourseinfo['id']; $course['c_participants'] = format_string($evasyssynchronizer->get_amount_participants($evasyscourseinfo['id'])); @@ -184,12 +199,18 @@ public function get_content() { $rawsurvey->surveyStatus == 'open') { // If the evaluation has ended as far as we know, but there are still open evaluations output a warning... // and enable all controls. - $warning = true; + $warningnotallclosed = true; $startdisabled = false; $enddisabled = false; } + if (($record !== false && ($record->get('state') == course_evaluation_allocation::STATE_AUTO_NOTOPENED + || $record->get('state') == course_evaluation_allocation::STATE_AUTO_OPENED) + && $rawsurvey->surveyStatus == 'closed') + or ($ismodeautomated and $record === false and $rawsurvey->surveyStatus == 'closed')) { + $warningnotallopen = true; + } if (($record === false || $record->get('state') == course_evaluation_allocation::STATE_MANUAL) && - $rawsurvey->surveyStatus == 'closed') { + $rawsurvey->surveyStatus == 'closed' && !$ismodeautomated) { // In case of a manual evaluation get the status of the evaluation by... // checking whether the evaluations are closed. $emailsentnotice = false; @@ -211,9 +232,7 @@ public function get_content() { // Append this course. $courses[] = $course; } - - $standardttimemode = (!$ismodeautomated && $recordhasstandardtime && !$record); - + $standardttimemode = ($recordhasstandardtime && !$wasstarted); // Create the data object for the mustache table. $data = array( 'href' => $href, @@ -224,7 +243,7 @@ public function get_content() { * In case of the automated workflow, we require surveys * in order to be able to automatically trigger the evaluation. */ 'showcontrols' => ($hassurveys || !$ismodeautomated) && count($evasyscourses) > 0 && !$invalidcourses, - 'usestandardtimelayout' => (!$ismodeautomated && $recordhasstandardtime && !$record), + 'usestandardtimelayout' => $standardttimemode, // Choose mode. 'direct' => $ismodeautomated, 'startdisabled' => $startdisabled || $standardttimemode, @@ -241,9 +260,15 @@ public function get_content() { // Defines if an lsf course is already mapped to the moodle course. 'optional' => !empty($evasyscourses), // Outputs a warning that there are open course when there shouldn't. - 'warning' => $warning + 'warningnotallclosed' => $warningnotallclosed, + 'warningnotallopen' => $warningnotallopen, + 'invalididnumberwarning' => $unknownidnumbercourse, + 'invalidextrawarning' => $unknownextracourse, + // If there is a internal state that is reserved for auto/manual mode, but the mode doesn't match warn the user. + 'inconsistentmodeswarning' => isset($state) ? + ($state == course_evaluation_allocation::STATE_MANUAL and $ismodeautomated) + or ($state < course_evaluation_allocation::STATE_MANUAL and !$ismodeautomated) : false ); - $this->content->text .= $OUTPUT->render_from_template("block_evasys_sync/block", $data); $this->content->footer = ''; return $this->content; diff --git a/classes/course_evasys_courses_allocation.php b/classes/course_evasys_courses_allocation.php index 5e688d5..8a6f6ca 100644 --- a/classes/course_evasys_courses_allocation.php +++ b/classes/course_evasys_courses_allocation.php @@ -66,4 +66,16 @@ public static function raw_get_evasyscourses($courseid) { array_unique($coursearray); return $coursearray; } + + public static function get_record_by_course(int $course, $exception = true) { + global $DB; + if (!$record = $DB->get_record(self::TABLE, array('course' => $course))) { + if (!$exception) { + return false; + } else { + throw new \dml_missing_record_exception(self::TABLE); + } + } + return new static(0, $record); + } } \ No newline at end of file diff --git a/classes/evasys_api.php b/classes/evasys_api.php new file mode 100644 index 0000000..f82f2b6 --- /dev/null +++ b/classes/evasys_api.php @@ -0,0 +1,329 @@ +. +/** + * Created by PhpStorm. + * User: robintschudi + * Date: 08.11.19 + * Time: 15:56 + */ + +namespace block_evasys_sync; + +defined('MOODLE_INTERNAL') || die(); + +class evasys_api { + + private $soapclient; + private static $instance; + + private function __construct() { + $this->soapclient = $this->init_soap_client(); + } + + public static function get_instance() { + if (defined("BEHAT_SITE_RUNNING")) { + return evasys_api_testable::get_instance(); + } + if (!self::$instance) { + self::$instance = new evasys_api(); + } + return self::$instance; + } + + public function get_course($evasyskennung) { + $soapresult = $this->soapclient->GetCourse($evasyskennung, 'PUBLIC', true, false); + return $soapresult; + } + + public function send_invitation_to_participants_of_survey($surveyid) { + $this->soapclient->SendInvitationToParticipants($surveyid); + } + + public function insert_participants($personlist, $evasyscourse) { + $soapresult = $this->soapclient->InsertParticipants($personlist, $evasyscourse, 'PUBLIC', false); + return $soapresult; + } + + public function create_passwords($evasysid, $pwcount) { + $this->soapclient->GetPswdsBySurvey($evasysid, $pwcount, 1, true, false); + } + + public function insert_close_task($task) { + return $this->soapclient->InsertCloseTask($task); + } + + public function close_survey($surveyid) { + return $this->soapclient->CloseSurvey($surveyid); + } + + public function get_form($formid) { + $soapresult = $this->soapclient->GetForm($formid, 'INTERNAL', false); + return $soapresult; + } + + private function init_soap_client() { + $soapclient = new \SoapClient(get_config('block_evasys_sync', 'evasys_wsdl_url'), [ + 'trace' => 1, + 'exceptions' => 0, + 'location' => get_config('block_evasys_sync', 'evasys_soap_url') + ]); + + $headerbody = new \SoapVar([ + new \SoapVar(get_config('block_evasys_sync', 'evasys_username'), + XSD_STRING, null, null, 'Login', null), + new \SoapVar(get_config('block_evasys_sync', 'evasys_password'), + XSD_STRING, null, null, 'Password', null), + ], SOAP_ENC_OBJECT); + $header = new \SOAPHEADER('soap', 'Header', $headerbody); + $soapclient->__setSoapHeaders($header); + return $soapclient; + } + +} + +class evasys_api_testable extends evasys_api { + private static $instance; + + private function __construct() { + } + + public static function get_instance() { + if (!self::$instance) { + self::$instance = new evasys_api_testable(); + } + return self::$instance; + } + + /* Format: (var dump of SINGLE! survey evasys course) + object(stdClass)[402] + public 'm_nCourseId' => int 166410 + public 'm_sProgramOfStudy' => string '' (length=0) + public 'm_sCourseTitle' => string 'AutoMultiSurvey' (length=15) + public 'm_sRoom' => string '' (length=0) + public 'm_nCourseType' => int 1 + public 'm_sPubCourseId' => string '1002 WS 2018/19' (length=15) + public 'm_sExternalId' => string '' (length=0) + public 'm_nCountStud' => int 2 + public 'm_sCustomFieldsJSON' => string '{}' (length=2) + public 'm_nUserId' => int 73350 + public 'm_nFbid' => int 338 + public 'm_nPeriodId' => int 40 + public 'm_aoParticipants' => + object(stdClass)[404] + public 'm_aoSecondaryInstructors' => + object(stdClass)[401] + public 'm_oSurveyHolder' => + object(stdClass)[411] + public 'm_aSurveys' => + object(stdClass)[412] + public 'Surveys' => + object(stdClass)[413] + public 'm_nSurveyId' => int 330416933 + public 'm_nState' => int 0 + public 'm_sTitle' => string 'AutoMultiSurvey' (length=15) + public 'm_cType' => string 'o' (length=1) + public 'm_nFrmid' => int 832 + public 'm_nStuid' => int 34763 + public 'm_nVerid' => int 166410 + public 'm_nOpenState' => int 1 + public 'm_nFormCount' => int 0 + public 'm_nPswdCount' => int 2 + public 'm_sLastDataCollectionDate' => string '' (length=0) + public 'm_nPageLinkOffset' => int 0 + public 'm_sMaskTan' => string '' (length=0) + public 'm_nMaskState' => int 0 + public 'm_oPeriod' => + object(stdClass)[414] + public 'm_nPeriodId' => int 40 + public 'm_sTitel' => string 'WS 2018/19' (length=10) + public 'm_sStartDate' => string '2018-10-01' (length=10) + public 'm_sEndDate' => string '2019-03-31' (length=10) + */ + /* + * Single survey: + public 'm_aSurveys' => + object(stdClass)[412] + public 'Surveys' => + object(stdClass)[413] + public 'm_nSurveyId' => int 330416933 + public 'm_nState' => int 0 + public 'm_sTitle' => string 'AutoMultiSurvey' (length=15) + public 'm_cType' => string 'o' (length=1) + public 'm_nFrmid' => int 832 + public 'm_nStuid' => int 34763 + public 'm_nVerid' => int 166410 + public 'm_nOpenState' => int 1 + public 'm_nFormCount' => int 0 + public 'm_nPswdCount' => int 2 + public 'm_sLastDataCollectionDate' => string '' (length=0) + public 'm_nPageLinkOffset' => int 0 + public 'm_sMaskTan' => string '' (length=0) + public 'm_nMaskState' => int 0 + public 'm_oPeriod' => + object(stdClass)[414] + public 'm_nPeriodId' => int 40 + public 'm_sTitel' => string 'WS 2018/19' (length=10) + public 'm_sStartDate' => string '2018-10-01' (length=10) + public 'm_sEndDate' => string '2019-03-31' (length=10) + Multi survey: + public 'm_aSurveys' => + object(stdClass)[412] + public 'Surveys' => + array (size=2) + 0 => + object(stdClass)[409] + public 'm_nSurveyId' => int 330416933 + public 'm_nState' => int 0 + public 'm_sTitle' => string 'AutoMultiSurvey' (length=15) + public 'm_cType' => string 'o' (length=1) + public 'm_nFrmid' => int 832 + public 'm_nStuid' => int 34763 + public 'm_nVerid' => int 166410 + public 'm_nOpenState' => int 1 + public 'm_nFormCount' => int 0 + public 'm_nPswdCount' => int 2 + public 'm_sLastDataCollectionDate' => string '' (length=0) + public 'm_nPageLinkOffset' => int 0 + public 'm_sMaskTan' => string '' (length=0) + public 'm_nMaskState' => int 0 + public 'm_oPeriod' => + object(stdClass)[410] + ... + 1 => + object(stdClass)[411] + public 'm_nSurveyId' => int 2114887341 + public 'm_nState' => int 0 + public 'm_sTitle' => string 'AutoMultiSurvey' (length=15) + public 'm_cType' => string 'o' (length=1) + public 'm_nFrmid' => int 784 + public 'm_nStuid' => int 34763 + public 'm_nVerid' => int 166410 + public 'm_nOpenState' => int 1 + public 'm_nFormCount' => int 0 + public 'm_nPswdCount' => int 2 + public 'm_sLastDataCollectionDate' => string '' (length=0) + public 'm_nPageLinkOffset' => int 0 + public 'm_sMaskTan' => string '' (length=0) + public 'm_nMaskState' => int 0 + public 'm_oPeriod' => + object(stdClass)[410] + */ + + public function get_course($evasyskennung) { + // Get data into the structure that would have been returned by the evasys-api SOAP. + if (!$evasyskennung) { + throw new \SoapFault(101, "Testerror"); + } + // If the lsf-course is invalid, it will return null on the details. This will result in the $evasyskennung + // being set to null . " " . null or " " so we need to check for " " here. + if (is_null($evasyskennung) or $evasyskennung == " ") { + $courseclass = new \stdClass(); + $courseclass->m_nCourseId = 'Unknown'; + $courseclass->m_sCourseTitle = 'Unknown'; + return $courseclass; + } + + global $COURSE; + $courseid = $COURSE->id; + $lsfid = \behat_block_evasys_sync::$evalsfkeyassoc[$evasyskennung]; + $fullcoursedata = \behat_block_evasys_sync::get_coursedata_by_courseid($courseid)->evacourses; + + // At the moment this check could be removed, since all cases of invalid links are treated the same, + // so having a working lsf course with a non working evasys course does not get tested. + // This check is here if anyone ever wants to output the debug details of where the conn fails and test that. + if (!isset($fullcoursedata[$lsfid]) or !$fullcoursedata[$lsfid]->valid) { + $courseclass = new \stdClass(); + $courseclass->m_nCourseId = 'Unknown'; + $courseclass->m_sCourseTitle = 'Unknown'; + return $courseclass; + } + $coursedata = $fullcoursedata[$lsfid]; + + $courseclass = new \stdClass(); + $courseclass->m_nCourseId = 1; + $courseclass->m_sCourseTitle = $coursedata->title; + $courseclass->m_Pub_CourseId = intval($coursedata->veranstnr); + $courseclass->m_nCountStud = intval($coursedata->studentcount); + $courseclass->m_aoParticipants = new \stdClass(); + $courseclass->m_aoParticipants->Persons = array(); + for ($i = 0; $i < $coursedata->studentcount; $i++) { + array_push($courseclass->m_aoParticipants->Persons, "I'm a person"); + } + $surveyholder = new \stdClass(); + $surveydata = $coursedata->surveys; + if (count($surveydata) == 1) { + // If it's just one survey it's an object. + $surveys = new \stdClass(); + foreach ($surveydata as $singlesurveydata) { + $surveys->m_nSurveyId = intval($singlesurveydata->num); + $surveys->m_nState = 0; + $surveys->m_sTitle = "Survey" . $singlesurveydata->num; + $surveys->m_nFrmid = intval($singlesurveydata->formid); + $surveys->m_nOpenState = $singlesurveydata->is_open == 't' ? 1 : 0; + $surveys->m_nFormCount = intval($singlesurveydata->form_count); + $surveys->m_nPswdCount = intval($singlesurveydata->pswd_count); + } + } else { + // Otherwise it's an array. Best design ever. + $surveys = array(); + foreach ($surveydata as $singlesurveydata) { + $survey = new \stdClass(); + $survey->m_nSurveyId = intval($singlesurveydata->num); + $survey->m_nState = 0; + $survey->m_sTitle = "Survey" . $singlesurveydata->num; + $survey->m_nFrmid = intval($singlesurveydata->formid); + $survey->m_nOpenState = $singlesurveydata->is_open == 't' ? 1 : 0; + $survey->m_nFormCount = intval($singlesurveydata->form_count); + $survey->m_nPswdCount = intval($singlesurveydata->pswd_count); + array_push($surveys, $survey); + } + } + $surveyobject = new \stdClass(); + $surveyobject->Surveys = $surveys; + $surveyholder->m_aSurveys = $surveyobject; + $courseclass->m_oSurveyHolder = $surveyholder; + return $courseclass; + } + + public function send_invitation_to_participants_of_survey($surveyid) { + return true; + } + + public function insert_participants($personlist, $evasyscourse) { + return true; + } + + public function create_passwords($evasysid, $pwcount) { + return true; + } + + public function insert_close_task($task) { + return true; + } + + public function close_survey($surveyid) { + return true; + } + + + public function get_form($formid) { + $formclass = new \stdClass(); + $formclass->FormId = 1; + $formclass->FormName = "A Form"; + $formclass->FormTitle = "A form title"; + return $formclass; + } +} diff --git a/classes/evasys_inviter.php b/classes/evasys_inviter.php index 6aa1495..d8b2021 100644 --- a/classes/evasys_inviter.php +++ b/classes/evasys_inviter.php @@ -17,7 +17,11 @@ namespace block_evasys_sync; defined('MOODLE_INTERNAL') || die(); -require_once($CFG->dirroot . "/local/lsf_unification/lib_his.php"); +if (!defined('BEHAT_SITE_RUNNING')) { + require_once($CFG->dirroot . "/local/lsf_unification/lib_his.php"); +} else { + require_once($CFG->dirroot . "/blocks/evasys_sync/classes/lsf_api_mock_testable.php"); +} require_once($CFG->libdir . '/adminlib.php'); require_once($CFG->dirroot . '/course/lib.php'); /** @@ -29,10 +33,10 @@ class evasys_inviter { public static $instance = null; - private $soapclient; + private $evasysapi; private function __construct() { - $this->soapclient = $this->init_soap_client(); + $this->evasysapi = evasys_api::get_instance(); } public static function get_instance() { @@ -85,7 +89,7 @@ public static function get_evasysids($courseid) { * @return array IDs of surveys */ public function get_evasys_course_surveys($evasyskennung, $all = true) { - $soapresult = $this->soapclient->GetCourse($evasyskennung, 'PUBLIC', true, false); + $soapresult = $this->evasysapi->get_course($evasyskennung); $surveyids = $soapresult->m_oSurveyHolder->m_aSurveys; if (is_soap_fault($soapresult)) { return array(); @@ -156,7 +160,7 @@ public function open_evasys_surveys($courses) { $surveyids = array_unique($surveyids); foreach ($surveyids as $surveyid) { - $this->soapclient->SendInvitationToParticipants($surveyid); + $this->evasysapi->send_invitation_to_participants_of_survey($surveyid); } } @@ -236,7 +240,7 @@ public function push_users_in_moodlecourse($moodlecourse) { $soapresult = false; foreach ($evasyscourses as $evasyscourse) { - $soapresult = $this->soapclient->InsertParticipants($personlist, $evasyscourse, 'PUBLIC', false); + $soapresult = $this->evasysapi->insert_participants($personlist, $evasyscourse); if (!is_soap_fault($soapresult) && $soapresult) { // Create enough passwords, then try again. $this->make_sure_enough_passwords_are_available($evasyscourse); @@ -248,12 +252,12 @@ public function push_users_in_moodlecourse($moodlecourse) { } public function make_sure_enough_passwords_are_available($evasyscourseid) { - $evasyscourse = $this->soapclient->GetCourse($evasyscourseid, 'PUBLIC' , false, false); + $evasyscourse = $this->evasysapi->get_course($evasyscourseid); if (!is_soap_fault($evasyscourse)) { $usercount = $evasyscourse->m_nCountStud; $surveys = $this->get_evasys_course_surveys($evasyscourseid); foreach ($surveys as $survey) { - $this->soapclient->GetPswdsBySurvey((string)$survey->m_nSurveyId, $usercount, 1, true, false); + $this->evasysapi->create_passwords((string)$survey->m_nSurveyId, $usercount); } } } @@ -270,22 +274,6 @@ public static function get_enrolled_student_email_adresses_from_usernames($moodl return $emailadresses; } - public function init_soap_client() { - $soapclient = new \SoapClient(get_config('block_evasys_sync', 'evasys_wsdl_url'), [ - 'trace' => 1, - 'exceptions' => 0, - 'location' => get_config('block_evasys_sync', 'evasys_soap_url') - ]); - - $headerbody = new \SoapVar([ - new \SoapVar(get_config('block_evasys_sync', 'evasys_username'), XSD_STRING, null, null, 'Login', null), - new \SoapVar(get_config('block_evasys_sync', 'evasys_password'), XSD_STRING, null, null, 'Password', null), - ], SOAP_ENC_OBJECT); - $header = new \SOAPHEADER('soap', 'Header', $headerbody); - $soapclient->__setSoapHeaders($header); - return $soapclient; - } - public function set_close_task($surveyid) { $time = new \DateTime(); $time->add(new \DateInterval("PT10S")); @@ -294,13 +282,13 @@ public function set_close_task($surveyid) { $task->StartTime = $time->format("Y-m-d\TH:i:s"); $task->Status = 3; $task->SendReport = false; - $soapresult = $this->soapclient->InsertCloseTask($task); + $soapresult = $this->evasysapi->insert_close_task($task); if (is_soap_fault($soapresult)) { // The Close Task has already been executed. This can happen if the Survey was reopened for some Reason. // Because of this, we'll still close the survey, however we can't send the result mail. // Also there might be another Error. In any Case we want to make sure the Survey gets closed. // If this was called by the close survey method the evaluationkoordinator will be notified. - $this->soapclient->CloseSurvey($surveyid); + $this->evasysapi->close_survey($surveyid); return false; } return true; diff --git a/classes/evasys_synchronizer.php b/classes/evasys_synchronizer.php index 085c0e3..1218691 100755 --- a/classes/evasys_synchronizer.php +++ b/classes/evasys_synchronizer.php @@ -18,20 +18,24 @@ defined('MOODLE_INTERNAL') || die(); -require_once($CFG->dirroot . "/local/lsf_unification/lib_his.php"); +if (!defined('BEHAT_SITE_RUNNING')) { + require_once($CFG->dirroot . "/local/lsf_unification/lib_his.php"); +} else { + require_once($CFG->dirroot . "/blocks/evasys_sync/classes/lsf_api_mock_testable.php"); +} require_once($CFG->libdir . '/adminlib.php'); require_once($CFG->dirroot . '/course/lib.php'); class evasys_synchronizer { private $courseid; - protected $soapclient; private $blockcontext; private $courseinformation; private $lsfcourses; + private $evasysapi; public function __construct($courseid) { $this->courseid = $courseid; - $this->init_soap_client(); + $this->evasysapi = evasys_api::get_instance(); $this->blockcontext = \context_course::instance($courseid); // TODO Course context or block context? Check caps. $this->courseinformation = $this->get_course_information(); } @@ -42,18 +46,6 @@ public function get_courses_from_lsf() { return $this->lsfcourses; } $course = get_course($this->courseid); - - // Fetch veranstnr from LSF view. - if ($course->idnumber) { - establish_secondary_DB_connection(); - $lsfentry = get_course_by_veranstid(intval($course->idnumber)); - close_secondary_DB_connection(); - - if (!is_object($lsfentry)) { - throw new \Exception('Cannot sync: Connection to LSF could not be established. Please try again later.'); - } - $maincourse = trim($lsfentry->veranstid); - } // Fetch persistent object id. $pid = $DB->get_field('block_evasys_sync_courses', 'id', array('course' => $this->courseid)); // Get all associated courses. @@ -64,45 +56,30 @@ public function get_courses_from_lsf() { $extras = []; } // If noone has associated the course itself, we force that. - if (isset($maincourse) && !empty($maincourse)) { - if (!in_array($maincourse, $extras)) { - $extras[] = $maincourse; + if (!(is_null($course->idnumber)) && !($course->idnumber == '')) { + if (!in_array($course->idnumber, $extras)) { + $extras[] = $course->idnumber; } } - $extras = array_filter($extras); establish_secondary_DB_connection(); // Fetch metadata (id, title) for the courses. $result = array(); - foreach ($extras as $course) { - $courseinfo = get_course_by_veranstid(intval($course)); + foreach ($extras as $lsfcourse) { + $courseinfo = get_course_by_veranstid(intval($lsfcourse)); $result[] = array( 'title' => $courseinfo->titel, - 'id' => trim($courseinfo->veranstnr) . ' ' . trim($courseinfo->semestertxt)); + 'id' => trim($courseinfo->veranstnr) . ' ' . trim($courseinfo->semestertxt), + 'lsf_id' => $lsfcourse); } close_secondary_DB_connection(); $this->lsfcourses = $result; return $this->lsfcourses; } - private function init_soap_client() { - $this->soapclient = new \SoapClient(get_config('block_evasys_sync', 'evasys_wsdl_url'), [ - 'trace' => 1, - 'exceptions' => 0, - 'location' => get_config('block_evasys_sync', 'evasys_soap_url') - ]); - - $headerbody = new \SoapVar([ - new \SoapVar(get_config('block_evasys_sync', 'evasys_username'), XSD_STRING, null, null, 'Login', null), - new \SoapVar(get_config('block_evasys_sync', 'evasys_password'), XSD_STRING, null, null, 'Password', null), - ], SOAP_ENC_OBJECT); - $header = new \SOAPHEADER('soap', 'Header', $headerbody); - $this->soapclient->__setSoapHeaders($header); - } - private function get_course_information() { $result = []; foreach ($this->get_courses_from_lsf() as $course) { - $soapresult = $this->soapclient->GetCourse($course['id'], 'PUBLIC', true, true); + $soapresult = $this->evasysapi->get_course($course['id']); if (is_soap_fault($soapresult)) { // This happens e.g. if there is no corresponding course in EvaSys. return null; @@ -142,15 +119,6 @@ public function get_surveys($courseid) { return $enrichedsurveys; } - public function get_all_surveys() { - // Gets all surveys from the associated evasys courses. - $surveys = []; - foreach ($this->lsfcourses as $course) { - $surveys = array_merge($surveys, $this->get_surveys($course['id'])); - } - return $surveys; - } - public function get_course_name($coursekey) { if (isset($this->courseinformation[$coursekey])) { return $this->courseinformation[$coursekey]->m_sCourseTitle; @@ -178,10 +146,6 @@ private function enrich_survey($rawsurvey) { $enrichedsurvey->formName = $this->get_form_name($rawsurvey->m_nFrmid); $enrichedsurvey->formIdPub = $this->get_public_formid($rawsurvey->m_nFrmid); $enrichedsurvey->formId = $rawsurvey->m_nFrmid; - $start = $rawsurvey->m_oPeriod->m_sStartDate; - $end = $rawsurvey->m_oPeriod->m_sEndDate; - $enrichedsurvey->startDate = $start; - $enrichedsurvey->endDate = $end; return $enrichedsurvey; } @@ -194,13 +158,13 @@ private function get_survey_status($statusnumber) { } private function get_public_formid($formid) { - $soapresult = $this->soapclient->GetForm($formid, 'INTERNAL', false); + $soapresult = $this->evasysapi->get_form($formid); $formidpub = $soapresult->FormName; return $formidpub; } private function get_form_name($formid) { - $soapresult = $this->soapclient->GetForm($formid, 'INTERNAL', false); + $soapresult = $this->evasysapi->get_form($formid); $formname = $soapresult->FormTitle; return $formname; } @@ -252,19 +216,19 @@ public function sync_students() { $personlist = new \SoapVar($students, SOAP_ENC_OBJECT, null, null, 'PersonList', null); $this->courseinformation = $this->get_course_information(); foreach ($this->courseinformation as $course) { - $soapresult = $this->soapclient->InsertParticipants($personlist, $course->m_sPubCourseId, 'PUBLIC', false); - $course = $this->soapclient->GetCourse($course->m_sPubCourseId, 'PUBLIC', true, true); // Update usercount. + $soapresult = $this->evasysapi->insert_participants($personlist, $course->m_sPubCourseId); + $course = $this->evasysapi->get_course($course->m_sPubCourseId); // Update usercount. $usercountnow = $course->m_nCountStud; // The m_aSurveys element might be an empty object! if (!empty((array) $course->m_oSurveyHolder->m_aSurveys)) { if (is_array($course->m_oSurveyHolder->m_aSurveys->Surveys)) { foreach ($course->m_oSurveyHolder->m_aSurveys->Surveys as $survey) { $id = $survey->m_nSurveyId; - $this->soapclient->GetPswdsBySurvey($id, $usercountnow, 1, true, false); + $this->evasysapi->create_passwords($id, $usercountnow); } } else { $id = $course->m_oSurveyHolder->m_aSurveys->Surveys->m_nSurveyId; - $this->soapclient->GetPswdsBySurvey($id, $usercountnow, 1, true, false); // Create new TAN's. + $this->evasysapi->create_passwords($id, $usercountnow); // Create new TAN's. } } if (is_soap_fault($soapresult)) { diff --git a/classes/lsf_api_mock_testable.php b/classes/lsf_api_mock_testable.php new file mode 100644 index 0000000..9ab83c8 --- /dev/null +++ b/classes/lsf_api_mock_testable.php @@ -0,0 +1,72 @@ +. + +/** + * Created by PhpStorm. + * User: robintschudi + * Date: 08.11.19 + * Time: 16:11 + */ + +namespace block_evasys_sync; + +use Behat\Behat\Tester\Exception\PendingException; +use core_privacy\local\deprecated; +use Matrix\Exception; + +defined('MOODLE_INTERNAL') || die(); + +function establish_secondary_DB_connection() { // phpcs:ignore @codingStandardsIgnoreLine + return true; +} + +function close_secondary_DB_connection() { // phpcs:ignore @codingStandardsIgnoreLine + return true; +} + +function get_course_by_veranstid ($courseid) { + // Only return used values. fill the rest with dummys. + global $COURSE; + $moodleid = $COURSE->id; + require_once(__DIR__. './../tests/behat/behat_block_evasys_sync.php'); + $fulldata = \behat_block_evasys_sync::get_coursedata_by_courseid($moodleid); + $coursedata = $fulldata->evacourses[$courseid]; + + $result = new \stdClass(); + if (!$coursedata->valid) { + $result->veranstid = null; + $result->veranstnr = null; + $result->semester = null; + $result->semestertxt = null; + $result->veranstaltungsart = null; + $result->titel = null; + $result->urlveranst = null; + // If the coursedata is not valid we dont assign the evasyskey to lsfkey. + // First this could easily be overwritten because all invalid cousrses have evasyskey " ". + // Second we check for " " being the evasyskey in the evasysapi before ever accessing $coursedata->valid. + } else { + $result->veranstid = 1; + $result->veranstnr = $coursedata->veranstnr; + $result->semester = 1; + $result->semestertxt = $coursedata->semestertxt; + $result->veranstaltungsart = 1; + $result->titel = 1; + $result->urlveranst = 1; + // Associate evasyskey with lsfkey for easier reverse lookup. + \behat_block_evasys_sync::$evalsfkeyassoc[$coursedata->veranstnr . " " . $coursedata->semestertxt] = $courseid; + } + return $result; +} diff --git a/db/install.xml b/db/install.xml index 67f166f..f274c73 100644 --- a/db/install.xml +++ b/db/install.xml @@ -28,6 +28,7 @@ + diff --git a/generator.py b/generator.py new file mode 100644 index 0000000..833acd5 --- /dev/null +++ b/generator.py @@ -0,0 +1,400 @@ +import copy +from steps import * + +PATH = "../fulltest.feature" +CONDENSE_TESTS = True +# parameters +category = 1 +coursename = "C1" +tags = "@block @block_evasys_sync @block_evasys_sync_fulltest" +# options +OPTIONS = { + "automode": ["manual", "auto"], + "standardtimemode": [0, 1], + "students": ["none", "onlytutors", "multi"], + "idnumber": ["none", "invalid", "one"], + "mapped": ["none", "invalid", "one", "multi"], + "internalstate": ["notopened", "opened", "closed", "manual", "none"], + "actualstate": ["open", "closed", "mixed"], + "recordstandardtime": ["recordstandardtimemode", "recordnonstandardtimemode", "norecordstandardtimemode"] +} + +ILLEGALSTATES = [ + {"recordstandardtime": "recordstandardtimemode", "internalstate": "none"}, + {"recordstandardtime": "recordnonstandardtimemode", "internalstate": "none"}, + {"recordstandardtime": "norecordstandardtimemode", "internalstate": "notopened"}, + {"recordstandardtime": "norecordstandardtimemode", "internalstate": "opened"}, + {"recordstandardtime": "norecordstandardtimemode", "internalstate": "closed"}, + {"recordstandardtime": "norecordstandardtimemode", "internalstate": "manual"}, +] + + +def illegal_state(scenario): + for fullillegalstate in ILLEGALSTATES: + illegal = True + for illegalstate in fullillegalstate.keys(): + if scenario[list(OPTIONS.keys()).index(illegalstate)] != fullillegalstate[illegalstate]: + illegal = False + break + if illegal: + return True + if scenario[5] == "none" and scenario[7] != "norecordstandardtimemode": + print(scenario) + return False + + +def get_checks(mode, standardtime, students_state, idnumber_state, mapped_state, internal_state, actual_state, recordstandardtimemode): + """ + This Function will take the scenario parameters and construct the resulting checks. + :return: The combined checks for the parameters. + """ + if not recordstandardtimemode == "norecordstandardtimemode": + standardtime = 1 if recordstandardtimemode == "recordstandardtimemode" else 0 + # If there are no mapped courses the Block not offer the option to "Show surveys" + if (idnumber_state == "none") and (mapped_state == "none"): + return "Then I should see \"Change mapping\"\n And I should not see \"Name:\"\n " + + checks = "" + # In all other cases (even if there are only invalid entries) we need to click the button to start code execution + checks += "And I load the evasys block\n" + + # First we want to check for idnumber and mapped checks. If there are invalid entries in either of these + # there should be a warning. However, it should not disable the ability to request a evaluation or set a timeframe + # in manual mode this was explicitly requested, and there might be an analog usecase in automatic mode. + checks += idnumber_checks[idnumber_state] + checks += mapped_checks[mapped_state] + + no_valid_mappings = ((idnumber_state == "none" or idnumber_state == "invalid") + and (mapped_state == "none" or mapped_state == "invalid")) + # if there is an internal state that is reserved for manual or automode we want to check we want to output + # a warning if this is not in fact the correct mode + if ((internal_state != "manual" and internal_state != "none") and mode == "manual") or ( + internal_state == "manual" and mode == "auto"): + checks += inconsistent_mode + "\n" + else: + # if the internal state isn't conflicting we want to check, if the block is correctly displaying for that state + checks += checks_internalstate(internal_state, actual_state, students_state, no_valid_mappings, mode, standardtime) + # finally if there is no entry yet or the planned date is in the future we want to check that + # there is an option to set the date for the evaluation + if (internal_state == "none" and (not no_valid_mappings or mode == "manual")) \ + or (internal_state == "notopened" and mode == "auto" and not no_valid_mappings): + checks += automode_checks[mode] + "\n" + # If our own states don't match those of evasys we want to output a warning + if mode != "manual" and not no_valid_mappings: + # In manual mode we don't check for matching states because we have no way of knowing what the state should be. + if internal_state == "closed" and actual_state != "closed": + checks += "And I should see \"There are some open surveys, but all surveys should be closed.\"" + "\n" + elif internal_state != "closed" and internal_state != "manual" and actual_state != "open": + checks += "And I should see \"There are some closed surveys, but all surveys should be open.\"" + "\n" + + # if the standardtimemodecheckbox should be present from the start we also want to check that + if not no_valid_mappings: + checks += checks_standardtimemode(standardtime, mode, internal_state, recordstandardtimemode) + "\n" + # if there are no students that are eligible to evaluate we want to output a warning + checks += student_checks[students_state] + checks = checks.replace("\n", "\n ") + return checks +======= + checks = "" + if (idnumber_state == "none" or idnumber_state == "invalid") and (mapped_state == "none" or mapped_state == "invalid"): + if idnumber_state == "invalid" or mapped_state == "invalid": + return "And I press \"Show status of surveys\"\n" + "Then I should see \"Change mapping\"\nAnd I should not see \"Name:\"\n" + return "Then I should see \"Change mapping\"\nAnd I should not see \"Name:\"\n" + + + checks += "And I press \"Show status of surveys\"\n" + checks += idnumber_checks[idnumber_state] + checks += mapped_checks[mapped_state] + if ((internal_state != "manual" and internal_state != "none") and mode == "manual") or (internal_state == "manual" and mode == "auto"): + checks += inconsistent_mode + "\n" + else: + checks += internal_state_checks[internal_state] + if internal_state == "none" or (internal_state == "notopened" and mode == "auto"): + checks += automode_checks[mode] + "\n" + + if internal_state == "closed" and actual_state != "closed": + checks += "And I should see \"There are some open surveys, but all surveys should be closed.\"" + "\n" + elif internal_state != "closed" and actual_state != "open": + checks += "And I should see \"Some of the surveys have been closed ahead of schedule!\"" + "\n" + checks += standardtimemode_checks[standardtime] + "\n" + checks += student_checks[students_state] + return checks +>>>>>>> cc0cc54... corrected mistake + + +def get_postcondensing_checks(idnumber_state, mapped_state): + """ + :return: checks for a scenario that should NOT be considered in the condense step + """ + postchecks = "" + # Check that surveys are actually shown. + # We don't want to include this in the sorting, because it only tests a for loop, but multiplies the tests by 2. + postchecks += postcheck_idnumber(idnumber_state) + postchecks += postcheck_mappedstate(mapped_state) + + postchecks = postchecks.replace("\n", "\n ") + return postchecks + + +def get_combi_sentence(set, dictionary, param_name): + """ + This function takes a set of states for a scenario parameter and checks whether they all result in the same + description based on the provided dictionary. If they do it'll return this shared description. + Otherwise it'll return a description to reflect that the result should be the same for both options. + :param set: Set of states + :param dictionary: dictionary that holds the descriptions for the parametertype + :param param_name: name of the parameter + :return: String description for the set of parameters + """ + set2 = set.copy() + last_response = dictionary[set.pop()] + while 1: + if len(set) == 0: + return last_response + if not last_response == dictionary[set.pop()]: + break + sentence = last_response + sentence += "This should be valid regardless of " + param_name + " being set to " + while len(set2) > 1: + sentence += str(set2.pop()) + ", " + sentence = sentence[:len(sentence) - 2] + sentence += " or " + str(set2.pop()) + "\n" + return sentence + + +def get_combi_description(mode, standardtime, students_state, idnumber_state, mapped_state, internal_state, + actual_state, recordstandardtimemode): + """ + This will construct the description for a scenario that covers multiple states. + :return: String the description of the scenario. + """ + if "none" in mapped_state and "none" in idnumber_state: + return "If there are no related evasys-courses I should not see any.\n " + if not recordstandardtimemode == "norecordstandardtimemode": + standardtime = {1} if recordstandardtimemode == "recordstandardtimemode" else {0} + description = "" + description += get_combi_sentence(standardtime, standardtimemode_descriptions, "standardtime") + description += get_combi_sentence(students_state, students_descriptions, "number of students") + description += get_combi_sentence(idnumber_state, idnumber_descriptions, "idnumber") + description += get_combi_sentence(mapped_state, mapped_descriptions, "mapped courses") + description += description_modeconsistency(mode, internal_state, actual_state) + description = description.replace("\n", "\n ") + return description + + +def get_scenario(mode, standardtime, students_state, idnumber_state, mapped_state, internal_state, actual_state, recordstandardtimemode): + """ + This constructs the actual scenario by building all courses, states etc. + :return: string the combined enviroment specifiing string for a scenario + """ + behat_scenario = step_manual_auto_mode[mode].replace("{{category}}", str(category)) + "\n" + behat_scenario += step_standardtime_mode[standardtime].replace("{{category}}", str(category)) + "\n" + behat_scenario += step_students_state[students_state] + "\n" + behat_scenario += step_idnumberstate(idnumber_state, actual_state) + behat_scenario += step_mappedstate(mapped_state, actual_state) + behat_scenario += step_internal_state[internal_state].replace("{{course}}", str(coursename)) + "\n" + behat_scenario += step_record_standardtimemode[recordstandardtimemode].replace("{{course}}", str(coursename)) + "\n" + behat_scenario += "And I turn editing mode on\n" + behat_scenario += "And I add the \"EvaSys Sync\" block\n" + behat_scenario += "And I turn editing mode off\n" + behat_scenario = behat_scenario.replace("\n", "\n ") + + if actual_state == "mixed" and not ((idnumber_state == "one" and (mapped_state == "multi" or mapped_state == "one")) + or mapped_state == "multi"): + # a mixed state is impossible with less than 2 lsfscourseids, so we skip this. + return False + return behat_scenario + + +def make_scenario(description, scenario, checks): + """ + :return: Scenarion specified by its description, enviroment and checks + """ + return " Scenario: " + description + scenario + checks + "\n" + + +def count_full_scenarios(condesed_array): + """ + Given an array of condenses scenarios (aka. scenarios with sets instead of single values) this function will + compute how many unique scenarios those condensed scenarios hold. + :param condesed_array: array of scenarios with sets of parameters + :return: number of unique scenarios covered by all condensed scenarios. + """ + i = 0 + for array in condesed_array: + j = 1 + for param in array: + j *= len(param) + i += j + return i + + +def array_diff(array1, array2): + """ + :param array1: first array + :param array2: second array + :return: returns the number of missmatches between array1 and 2 aswell as the index of the last missmatch + """ + diff = 0 + position = 0 + for i in range(0, len(array1)): + if not array1[i] == array2[i]: + position = i + diff += 1 + return diff, position + + +def condense_keep_options(fullarray): + """ + Given an array of scenarios this function will combine these into new scenarios that cover the exact same range + of scenarios, but will combine them. + { off, off, on } and { on, off, on } will be combined to { on/off, off, on} + The array of scenarios passed should all have the same result ( checks ) + :param fullarray: array of scenarios + :return: condensed array of scenarios + """ + changed = True + for i in range(0, len(fullarray)): + for j in range(0, len(fullarray[i])): + fullarray[i][j] = set([fullarray[i][j]]) # Do not replace with literal! + while changed: + new_array = copy.deepcopy(fullarray) + changed = False + for array in fullarray: + for array2 in fullarray: + diffcount, index = array_diff(array, array2) + if diffcount == 1: + changed = True + if array2 in new_array: + new_array.remove(array2) + if array in new_array: + new_array.remove(array) + tmp = copy.deepcopy(array) + tmp[index] = array[index].union(array2[index]) + new_array.append(tmp) + break + if changed: + break + fullarray = new_array + + return fullarray + + +def build_cartesian_product(array_dict): + cartesian_product = [] + for key in array_dict: + if len(cartesian_product) == 0: + cartesian_product = [[option] for option in array_dict[key]] + continue + else: + cartesian_product = [old_options + [new_options] + for old_options in cartesian_product + for new_options in array_dict[key]] + return cartesian_product + + +def main(): + # open feature file + behattestfile = open(PATH, "w") + output = "" + i = 0 + # initialize feature data + output += tags + "\n" + output += "Feature: " + feature_desc + "\n\n" + output += background + "\n\n" + + # Build cartesian product of all options + cartesianoptions = build_cartesian_product(OPTIONS) + + # get the checks for all options to be able to condense options with the same expected outcome + uncondensed_dict = {} + for scenario in cartesianoptions: + check = get_checks(scenario[0], scenario[1], scenario[2], scenario[3], scenario[4], scenario[5], scenario[6], scenario[7]) + if not check in uncondensed_dict.keys(): + uncondensed_dict[check] = [] + uncondensed_dict[check].append(scenario) + + # condense those scenarios + condensed_dict = {} + if CONDENSE_TESTS: + i = 0 + for check in uncondensed_dict.keys(): + scenarios = uncondensed_dict[check] + condensed_dict[check] = condense_keep_options(scenarios) + i += 1 + print("Condensed " + str(i) + " of " + str(len(uncondensed_dict.keys()))) + else: + for check in uncondensed_dict.keys(): + fullarray = uncondensed_dict[check] + for i in range(0, len(fullarray)): + for j in range(0, len(fullarray[i])): + fullarray[i][j] = set([fullarray[i][j]]) + condensed_dict[check] = fullarray + + testcases = 0 + endcases = 0 + # check that the number of cases stayed the same + for check in condensed_dict.keys(): + testcases += len(condensed_dict[check]) # get original number of cases + endcases += count_full_scenarios(condensed_dict[check]) # get number of cases that can be built from condesed scenarios + + # finally build the actual behat-suite + for check in condensed_dict.keys(): + for scenario in condensed_dict[check]: + # do a deep-copy of the scenario because sets can only be accessed by pop which alters the set itself + scenario_copy = copy.deepcopy(scenario) + desc = get_combi_description(scenario[0], scenario[1], scenario[2], scenario[3], scenario[4], scenario[5], + scenario[6], scenario[7]) + mode = scenario_copy[0].pop() + standardtime = scenario_copy[1].pop() + students_state = scenario_copy[2].pop() + idnumber_state = scenario_copy[3].pop() + mapped_state = scenario_copy[4].pop() + internal_state = scenario_copy[5].pop() + actual_state = scenario_copy[6].pop() + recordstandardtime = scenario_copy[7].pop() + if actual_state == "mixed" and len(scenario_copy[6]) > 0: + actual_state = scenario_copy[6].pop() + + corrected = True + illegal = False + illegals = [] + while corrected: + corrected = False + if illegal_state([mode, standardtime, students_state, idnumber_state, mapped_state, internal_state, + actual_state, recordstandardtime]): + corrected = True + illegals.append([mode, standardtime, students_state, idnumber_state, mapped_state, internal_state, + actual_state, recordstandardtime]) + if len(scenario_copy[5]) >= 1: + internal_state = scenario_copy[5].pop() + elif len(scenario_copy[7]) >= 1: + recordstandardtime = scenario_copy[7].pop() + else: + if len(illegals) > 1: + print("Illegal multiscenario") + print(illegals) + illegal = True + corrected = False + if illegal: + continue + scen_text = get_scenario(mode, standardtime, students_state, idnumber_state, mapped_state, internal_state, + actual_state, recordstandardtime) + if not scen_text: + print("Warning impossible scenario!!!") + continue + postcheck = get_postcondensing_checks(idnumber_state, mapped_state) + output += make_scenario(desc, scen_text, check + postcheck) + + output = output.replace("\n \n", "\n\n") # remove whitespaces on empty lines + output = output[:len(output) - 1] # remove last newline + # write actual data + behattestfile.write(output) + behattestfile.close() + # output statistics + print("Startcases: %i, Endcases: %i" % (len(cartesianoptions), endcases)) + print("Condensed %i scenarios to %i testcases with %i scenarios" % (len(cartesianoptions), len(condensed_dict), testcases)) + + +if __name__ == "__main__": + main() diff --git a/lang/de/block_evasys_sync.php b/lang/de/block_evasys_sync.php index 10ad74f..b52c71e 100755 --- a/lang/de/block_evasys_sync.php +++ b/lang/de/block_evasys_sync.php @@ -47,6 +47,7 @@ $string['standard_period'] = "Standard-Evaluationszeitraum:"; $string['different_period'] = "Abweichender Evaluationszeitraum:"; $string['time_set'] = "Standard-Evaluationszeitraum gesetzt"; +$string['evasys_sync:modifymapping'] = "Zugeordnete Evasys-Kurse bearbeiten"; // Multi allocation strings. @@ -65,7 +66,7 @@ $string['requestagain'] = 'Erneut einladen oder beauftragen'; $string['title_send_success'] = "Evaluation erfolgreich gestartet"; $string['content_send_success'] = 'Es wurden {$a->sent} von {$a->total} Einladungsmails versendet.
' . - '{$a->queued} Evaluationsperioden wurden festgelegt.'; + '{$a->queued} Evaluationsperioden wurden festgelegt.'; $string['title_send_failure'] = "Fehler beim Versand"; $string['send_error'] = "Es gab einen Fehler beim automatischen Versenden, bitte kontaktieren Sie Ihren Support, oder benutzen Sie den manuellen Versand von EvaSys"; $string['not_enough_dates'] = "Bitte geben Sie Daten für ALLE Umfragen an!"; @@ -118,15 +119,15 @@ $string['title_failure'] = "Evaluation nicht beauftragt"; $string['content_success'] = "Sie haben die Evaluation erfolgreich beantragt.
" . - "!!!DIE EVALUATION HAT NOCH NICHT BEGONNEN!!!
" . - "Sie müssen nichts weiter tun, ". - "Ihr*e Evaluationsbeauftragte*r wird nach den Richtlinien Ihres Fachbereichs weiter verfahren."; + "!!!DIE EVALUATION HAT NOCH NICHT BEGONNEN!!!
" . + "Sie müssen nichts weiter tun, ". + "Ihr*e Evaluationsbeauftragte*r wird nach den Richtlinien Ihres Fachbereichs weiter verfahren."; $string['content_uptodate'] = "Ihr*e Evaluationsbeauftragte*r hat bereist einen Auftrag zum Durchführen der Evaluation von Ihnen erhalten.
" . - "Für Fragen zum Status Ihrer Evaluation kontaktieren Sie bitte Ihre*n Evaluationsbeauftragte*n."; + "Für Fragen zum Status Ihrer Evaluation kontaktieren Sie bitte Ihre*n Evaluationsbeauftragte*n."; $string['content_failure'] = "Leider konnte die Evaluation nicht beauftragt werden.
" . - "Bitte wenden Sie sich an den Support."; + "Bitte wenden Sie sich an den Support."; $string['confirm_box'] = "Verstanden"; $string['content_confirm_reactivate_automated_closed'] = 'Sind Sie sicher, dass Sie die Evaluation erneut beginnen möchten?'; @@ -215,4 +216,9 @@ // Notices. $string['evalperiodsetnotice'] = 'Evaluationszeitraum gesetzt'; -$string['emailsentnotice'] = 'Evaluation beauftragt'; \ No newline at end of file +$string['emailsentnotice'] = 'Evaluation beauftragt'; +$string['warning_invalid_idnumber'] = "Der fest zugeordnete Evasys-kurs ist ungültig!"; +$string['warning_invalid_extra'] = "Einer der zugeordneten Evasys-kurse ist ungültig"; +$string['warning_not_all_closed'] = "Einige Umfragen sind geöffnet, aber alle Umfragen sollten geschlossen sein."; +$string['warning_not_all_open'] = "Einige Umfragen sind geschlossen, aber alle Umfragen sollten offen sein."; +$string['warning_inconsistent_modes'] = "Diese Evaluation wurde bereits in einem anderen Modus gestartet"; \ No newline at end of file diff --git a/lang/en/block_evasys_sync.php b/lang/en/block_evasys_sync.php index 03a097b..22780e1 100755 --- a/lang/en/block_evasys_sync.php +++ b/lang/en/block_evasys_sync.php @@ -46,6 +46,7 @@ $string['different_period'] = "Exceptional evaluationperiod:"; $string['activate_nonstandard_time'] = "Alter evaluationperiod for special courses"; $string['time_set'] = "Standard evaluationperiod set"; +$string['evasys_sync:modifymapping'] = "Map and unmap Evasys courses to moodle courses."; // Multi allocation strings. @@ -64,7 +65,7 @@ $string['requestagain'] = 'Request or invite again'; $string['title_send_success'] = "Evaluation started"; $string['content_send_success'] = '{$a->sent} of {$a->total} emails have been send.
'. - '{$a->queued} jobs have been queued'; + '{$a->queued} jobs have been queued'; $string['send_error'] = "There was an error while trying to send emails. Please contact Your local support, or send the Emails manually via EvaSys"; // Form strings. @@ -103,7 +104,7 @@ $string['confirm_box'] = "OK"; $string['direct_already'] = "You have already sent invitations to all students.". - "No new invitations have been send"; + "No new invitations have been send"; $string['direct_title_info'] = "Invitation already complete"; $string['title_send_rejected'] = "Invalid Date"; @@ -225,3 +226,8 @@ // Notices. $string['evalperiodsetnotice'] = 'Evaluationperiod has been set'; $string['emailsentnotice'] = 'Evaluation has been requested'; +$string['warning_invalid_idnumber'] = "The hard linked evasys-course is invalid!"; +$string['warning_invalid_extra'] = "One of the dynamically mapped evasys-courses is invalid"; +$string['warning_not_all_closed'] = "There are some open surveys, but all surveys should be closed."; +$string['warning_not_all_open'] = "There are some closed surveys, but all surveys should be open."; +$string['warning_inconsistent_modes'] = "This evaluation was already started in another mode"; \ No newline at end of file diff --git a/templates/block.mustache b/templates/block.mustache index f4f1677..dd84f64 100644 --- a/templates/block.mustache +++ b/templates/block.mustache @@ -40,6 +40,8 @@ Example context (json): {{#onlyend}}{{/onlyend}} {{#nostudents}}{{# str}}syncnostudents, block_evasys_sync{{/str}}{{/nostudents}} + {{#invalididnumberwarning}}
{{# str}}warning_invalid_idnumber, block_evasys_sync{{/str}}
{{/invalididnumberwarning}} + {{#invalidextrawarning}}
{{# str}}warning_invalid_extra, block_evasys_sync{{/str}}
{{/invalidextrawarning}} {{#courses}} {{#.}}
-{{#warning}}
{{# str}}warning_inconsistent_states, block_evasys_sync{{/str}}
{{/warning}} +{{#warningnotallopen}}
{{# str}}warning_not_all_open, block_evasys_sync{{/str}}
{{/warningnotallopen}} +{{#warningnotallclosed}}
{{# str}}warning_not_all_closed, block_evasys_sync{{/str}}
{{/warningnotallclosed}} +{{#inconsistentmodeswarning}}
{{# str}}warning_inconsistent_modes, block_evasys_sync{{/str}}
{{/inconsistentmodeswarning}} {{#emailsentnotice}}
{{# str}}emailsentnotice, block_evasys_sync{{/str}}
{{/emailsentnotice}} {{#evaluationperiodsetnotice}}
{{# str}}evalperiodsetnotice, block_evasys_sync{{/str}}
{{/evaluationperiodsetnotice}} {{#showcontrols}} diff --git a/templates/coursemapping.mustache b/templates/coursemapping.mustache index 24d60c6..6bd2af8 100644 --- a/templates/coursemapping.mustache +++ b/templates/coursemapping.mustache @@ -7,7 +7,7 @@ Example context (json): } }} - + {{#pix}}i/edit, core{{/pix}} {{# str}}change_mapping, block_evasys_sync{{/str}} {{#optional}}{{# str}}optional, block_evasys_sync{{/str}}{{/optional}} diff --git a/tests/behat/SelectorNotDisabledException.php b/tests/behat/SelectorNotDisabledException.php new file mode 100644 index 0000000..c08118a --- /dev/null +++ b/tests/behat/SelectorNotDisabledException.php @@ -0,0 +1,21 @@ +. + +namespace behat_block_evasys_sync; +class SelectorNotDisabledException extends \Exception +{ + +} \ No newline at end of file diff --git a/tests/behat/SubmitButtonDisabledException.php b/tests/behat/SubmitButtonDisabledException.php new file mode 100644 index 0000000..48348f6 --- /dev/null +++ b/tests/behat/SubmitButtonDisabledException.php @@ -0,0 +1,21 @@ +. + +namespace behat_block_evasys_sync; +class SubmitButtonDisabledException extends \Exception +{ + +} \ No newline at end of file diff --git a/tests/behat/behat_block_evasys_sync.php b/tests/behat/behat_block_evasys_sync.php new file mode 100644 index 0000000..7b9c2c7 --- /dev/null +++ b/tests/behat/behat_block_evasys_sync.php @@ -0,0 +1,455 @@ +. + +/** + * Steps definitions related with the evasys_sync block. + * + * @package block_evasys_sync + * @category test + * @copyright 2019 Robin Tschudi + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +require_once(__DIR__ . '/../../../../vendor/behat/behat/src/Behat/Behat/Context/Context.php'); +require_once(__DIR__ . '/../../../../vendor/behat/mink-extension/src/Behat/MinkExtension/Context/MinkAwareContext.php'); +require_once(__DIR__ . '/../../../../vendor/behat/mink-extension/src/Behat/MinkExtension/Context/RawMinkContext.php'); +require_once(__DIR__ . '/../../../../lib/behat/behat_base.php'); +require_once(__DIR__. '/SelectorNotDisabledException.php'); +require_once(__DIR__. '/SubmitButtonDisabledException.php'); + +use behat_block_evasys_sync\SelectorNotDisabledException; +use behat_block_evasys_sync\SubmitButtonDisabledException; + +/** + * evasys_sync-related steps definitions. + * + * @package block_evasys_sync + * @category test + * @copyright 2019 Robin Tschudi + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ +class behat_block_evasys_sync extends behat_base { + + private $evasysapi; + private $generator; + public static $coursedata = array(); + public static $evalsfkeyassoc = array(); + public const ERRORSAVEPATH = "/var/www/public/moodle/errorbackend.html"; + + /** + * Store Page content on failure + * + * @AfterStep + */ + public function take_screenshot_after_failed_step (Behat\Behat\Hook\Scope\AfterStepScope $scope) { + $logall = false; + if (99 === $scope->getTestResult()->getResultCode() || $logall) { + if (file_exists(self::ERRORSAVEPATH)) { + $img = $this->getSession()->getDriver()->getContent(); + file_put_contents(self::ERRORSAVEPATH, $img); + } + } + } + + public function __construct() { + // The required classes have a "moodle internal" check. If they are loaded before the Scenario, this will not be set. + require_once(__DIR__ . "/../../classes/lsf_api_mock_testable.php"); + require_once(__DIR__ . '/../../classes/evasys_api.php'); + $this->evasysapi = \block_evasys_sync\evasys_api_testable::get_instance(); + $this->generator = new \behat_data_generators(); + } + + public static function &get_coursedata_by_shortname($shortname) { + $courseid = self::get_courseid_by_shortname($shortname); + $coursedata = &self::get_coursedata_by_courseid($courseid); + return $coursedata; + } + + public static function &get_coursedata_by_courseid($courseid) { + if (!array_key_exists($courseid, self::$coursedata)) { + $jsondata = get_course($courseid)->summary; + $localcoursedata = json_decode($jsondata); + if (!is_object($localcoursedata)) { + $localcoursedata = new \stdClass(); // If there is no data initialize a data object. + } + self::$coursedata[$courseid] = $localcoursedata; + + } + return self::$coursedata[$courseid]; + } + + public static function write_coursedata_to_persistent_storage() { + global $DB; + foreach (self::$coursedata as $courseid => $courseinfo) { + $jsondata = json_encode($courseinfo); + $DB->execute("UPDATE {course} SET summary=? WHERE id=?", array($jsondata, $courseid)); + } + } + + private static function get_courseid_by_shortname($shortname) { + global $DB; + return $DB->get_field("course", "id", array("shortname" => $shortname)); + } + + private function add_lsf_evasys_course($moodlecourse, $valid, $veranstnr = null, $semestertxt = null, $studentcount = null, + $title = null, $surveycount = null, $surveystatus = null) { + if ($surveycount and $surveycount < 2 and $surveystatus == "mixed") { + throw new \Exception("Impossible to satisfy parameters (mixed surveystatus but just one survey)"); + } + + $lsfevasyscourse = new \stdClass(); + $surveys = array(); + + for ($i = 0; $i < $surveycount; $i++) { + $survey = new \stdClass(); + $survey->num = $i; + $survey->formid = 1; + $survey->is_open = ($surveystatus == "open" or ($surveystatus == "mixed" and $i == 0)) ? "t" : "f"; + $survey->form_count = 20; + $survey->pswd_count = 200; + array_push($surveys, $survey); + } + + $lsfevasyscourse->valid = $valid; + $lsfevasyscourse->veranstnr = $veranstnr; + $lsfevasyscourse->semestertxt = $semestertxt; + $lsfevasyscourse->studentcount = $studentcount; + $lsfevasyscourse->title = $title; + $lsfevasyscourse->surveys = $surveys; + + $coursedata = &self::get_coursedata_by_shortname($moodlecourse); + if (!property_exists($coursedata, "evacourses")) { + $coursedata->evacourses = array(); + } + $position = count($coursedata->evacourses); + array_push($coursedata->evacourses, $lsfevasyscourse); + return $position; + } + + /** + * @Given I load the evasys block + */ + public function i_load_the_evasys_block () { + self::write_coursedata_to_persistent_storage(); + $this->execute('behat_general::i_click_on', ["Show status of surveys", 'button']); + } + + /** + * @Given /^there are ([0-9]*) (open|closed|mixed) Evasyscourses mapped to course with shortname ([^"]*)$/ + */ + public function there_are_evasyscourses_mapped_to_course_with_shortname($number, $state, $shortname) { + $count = intval($number); + $lsfids = array(); + for ($i = 0; $i < $count; $i++) { + $surveystatus = $state == "mixed" ? ($i == 0 ? "closed" : "open)") : $state; // If mixed first will be closed, rest open. + $lsfid = $this->add_lsf_evasys_course($shortname, true, $i, "WS 2017/18", 100, + "DynamicSurvey" . $i, 1, $surveystatus); + array_push($lsfids, $lsfid); + } + + global $DB; + $courseid = self::get_courseid_by_shortname($shortname); + $pid = $DB->get_field('block_evasys_sync_courses', 'id', array('course' => $courseid)); + $persistent = \block_evasys_sync\course_evasys_courses_allocation::get_record_by_course($pid, false); + if (!$persistent) { + $persistent = new \block_evasys_sync\course_evasys_courses_allocation(0); + } + $magicstring = implode("#", $lsfids); + // If the mapping is empty, remove it. + if (empty($magicstring) && $persistent->get('id') != 0) { + $persistent->delete(); + } + // Only save the mapping, if the mapping string is not empty. + if (!empty($magicstring)) { + $persistent->set('course', $courseid); + $persistent->set('evasyscourses', $magicstring); + $persistent->save(); + } + } + + /** + * Sets a courses Idnumber + * + * @Given The course :coursename has idnumber :idnum + */ + public function the_course_has_idnumber($name, $idnum) { + global $DB; + $DB->execute("UPDATE {course} SET idnumber=$idnum WHERE shortname='$name'"); + } + /** + * @Given only invalid mappings are present for course :shortname + */ + public function only_invalid_mappings_are_present_for_course ($shortname) { + $courseids = ""; + $courseids .= $this->add_lsf_evasys_course($shortname, false) . "#"; + $courseids .= $this->add_lsf_evasys_course($shortname, false) . "#"; + $courseids .= $this->add_lsf_evasys_course($shortname, false); + $id = $this->get_courseid_by_shortname($shortname); + $record = \block_evasys_sync\course_evasys_courses_allocation::get_record_by_course($id, false); + if (!$record) { + $record = new \block_evasys_sync\course_evasys_courses_allocation(0); + } + $record->set("course", $id); + $record->set("evasyscourses", $courseids); + $record->save(); + } + + /** + * @Given the idnumber of course :shortname links to a :state Evasyscourse + */ + public function the_idnumber_of_course_links_to_a_evasyscourse($shortname, $state) { + // If the state is mixed, the course linked by the idnumber should be "open" because we know there is at least + // one "closed" course mapped. + $surveystatus = $state == "mixed" ? "open" : $state; + $lsfid = $this->add_lsf_evasys_course($shortname, true, 1, "SS 2018", 100, + "IdnumberSurvey", 1, $surveystatus); + $this->the_course_has_idnumber($shortname, $lsfid); + } + + /** + * @Given the idnumber for course :course is invalid + */ + public function the_idnumber_for_course_is_invalid($shortname) { + $courseid = $this->add_lsf_evasys_course($shortname, false); + $this->the_course_has_idnumber($shortname, $courseid); + } + + /** + * @Given there is no idnumber mapped to course :shortname + */ + public function there_is_no_idnumber_mapped($shortname) { + // nothing to be done. But sure reads better. + } + + + // Categorymode manipulation + /** + * @Given category :x is in manual mode + */ + + public function category_is_in_manual_mode ($id) { + if ($cc = \block_evasys_sync\user_cat_allocation::get_record(array("course_category" => $id))) { + $cc->set('category_mode', 0); + $cc->update(); + $cc->save(); + } else { + $record = new stdClass(); + $record->userid = 2; + $record->course_category = $id; + $record->category_mode = 0; + $persistent = new \block_evasys_sync\user_cat_allocation(0, $record); + $persistent->create(); + $persistent->save(); + } + } + + /** + * @Given category :x is in automatic mode + */ + + public function category_is_in_automatic_mode ($id) { + if ($cc = \block_evasys_sync\user_cat_allocation::get_record(array("course_category" => $id))) { + $cc->set('category_mode', 1); + $cc->update(); + $cc->save(); + } else { + $record = new stdClass(); + $record->userid = 1; + $record->course_category = strval($id); + $record->category_mode = 1; + $persistent = new \block_evasys_sync\user_cat_allocation(0, $record); + $persistent->create(); + $persistent->save(); + } + } + + /** + * @Given category :x is in standardtime mode with dates :start :end + */ + + public function category_is_in_standardtime_mode ($cat, $start, $end) { + global $DB; + $sql = 'UPDATE {block_evasys_sync_categories} SET standard_time_start = ?, standard_time_end = ? ' . 'WHERE course_category = ?'; + print($sql); + $DB->execute($sql, array($start, $end, $cat)); + } + + /** + * @Given category :x is not in standardtime mode + */ + + public function category_is_not_in_nonstandard_mode ($cat) { + $this->category_is_in_standardtime_mode($cat, null, null); + } + + /** + * @Given there is no internal record of course :shortname + */ + public function and_there_is_no_internal_record_of_course ($shortname) { + global $DB; + $id = $this->get_courseid_by_shortname($shortname); + $DB->execute("DELETE FROM {block_evasys_sync_courseeval} WHERE course = ?", array($id)); + } + + /** + * @Given the internal state of course :shortname is :mode + */ + public function the_internal_state_of_course_is($shortname, $mode) { + global $DB; + $id = $this->get_courseid_by_shortname($shortname); + $record = \block_evasys_sync\course_evaluation_allocation::get_record_by_course($id, false); + if (!$record) { + $record = new \block_evasys_sync\course_evaluation_allocation(0); + $record->set('course', $id); + } + if ($mode == "manual") { + $record->set('state', \block_evasys_sync\course_evaluation_allocation::STATE_MANUAL); + } else if ($mode == "notopened") { + $record->set('state', \block_evasys_sync\course_evaluation_allocation::STATE_AUTO_NOTOPENED); + } else if ($mode == "opened") { + $record->set('state', \block_evasys_sync\course_evaluation_allocation::STATE_AUTO_OPENED); + } else if ($mode == "closed") { + $record->set('state', \block_evasys_sync\course_evaluation_allocation::STATE_AUTO_CLOSED); + } else { + throw new \Exception("Didnt't recognize state"); + } + $record->set('startdate', 1595714400); + $record->set('enddate', 1595800800); + $record->save(); + } + + /** + * @Given the recordstandardtimemode for course :shortname is set to :value + */ + public function the_recorstandardtime_for_course_is_set($shortname, $mode) { + global $DB; + $id = $this->get_courseid_by_shortname($shortname); + $record = \block_evasys_sync\course_evaluation_allocation::get_record_by_course($id, false); + if (!$record) { + $record = new \block_evasys_sync\course_evaluation_allocation(0); + $record->set('course', $id); + } + $record->set('usestandardtime', $mode == "true"); + $record->save(); + } + + /** + * @Given the recordstandardtimemode for course :shortname is not set + */ + public function the_recordstandardtimemode_for_course_is_not_set($shortname) { + return; + } + + /** + * @Given no courses are mapped to course :shortname + */ + public function no_courses_are_mapped_to_course($shortname) { + global $DB; + $courseid = $this->get_courseid_by_shortname($shortname); + $pid = $DB->get_field('block_evasys_sync_courses', 'id', array('course' => $courseid)); + if (!$pid) { + return; + } + $persistent = new \block_evasys_sync\course_evasys_courses_allocation($pid); + $persistent->delete(); + } + + /** + * @Given no students enrolled in course :course + */ + public function no_students_enrolled_in_course($shortname) { + // nothing to be done. But sure reads better. + } + + /** + * @Given only tutors enrolled in course :shortname + */ + public function only_tutors_enrolled_in_course($shortname) { + $head = array("user", "course", "role"); + $teacher = array("teacher1", $shortname, "editingteacher"); + $student = array("tutor1", $shortname, "teacher"); + $node = new \Behat\Gherkin\Node\TableNode(array($head, $teacher, $student)); + $this->generator->the_following_entities_exist("course enrolments", $node); + } + + /** + * @Given students enrolled in course :shortname + */ + public function students_enrolled_in_course($shortname) { + $head = array("user", "course", "role"); + $teacher = array("teacher1", $shortname, "editingteacher"); + $student = array("student1", $shortname, "student"); + $node = new \Behat\Gherkin\Node\TableNode(array($head, $teacher, $student)); + $this->generator->the_following_entities_exist("course enrolments", $node); + } + + /** + * @Then I should see a button named :name + */ + public function i_should_see_a_button_named($name) { + $this->find_button($name); + } + + /** + * @Given category :category is in auto mode + */ + public function category_is_in_auto_mode ($id) { + $this->category_is_in_automatic_mode($id); + } + + /** + * @Given the startselector should be disabled + */ + public function the_startselector_should_be_disabled () { + try { + $startday = $this->find_field("day_start"); + } catch (\Behat\Mink\Exception\ElementNotFoundException $e) { + // selector can be disabled or not visible + return; + } + if (is_null($startday->getAttribute('disabled'))) { + throw new SelectorNotDisabledException(); + } + } + + /** + * @Given both selectors should be disabled + */ + public function both_selectors_should_be_disabled () { + try { + $startday = $this->find_field("day_start"); + $endday = $this->find_field("day_end"); + } catch (\Behat\Mink\Exception\ElementNotFoundException $e) { + // selector can be disabled or not visible + return; + } + if (is_null($startday->getAttribute('disabled')) or is_null($endday->getAttribute('disabled'))) { + throw new SelectorNotDisabledException(); + } + } + + /** + * @Given the submitbutton should be enabled + */ + public function the_submitbutton_should_be_enabled () { + $button = $this->find_button("evasyssubmitbutton"); + if (! is_null($button->getAttribute('disabled'))) { + throw new SubmitButtonDisabledException(); + } + } + + +} \ No newline at end of file diff --git a/tests/behat/fulltest.feature b/tests/behat/fulltest.feature new file mode 100644 index 0000000..b4f9d36 --- /dev/null +++ b/tests/behat/fulltest.feature @@ -0,0 +1,6356 @@ +@block @block_evasys_sync @block_evasys_sync_fulltest +Feature: Tests all use-cases of the Evasys-block + + Background: + Given the following "users" exist: + | username | firstname | lastname | email | + | teacher1 | Teacher | 1 | teacher1@example.com | + | student1 | Student | 1 | student1@example.com | + | tutor1 | Tutor | 1 | tutor1@example.com | + And the following "courses" exist: + | fullname | shortname | category | + | Course 1 | C1 | 0 | + And the following "course enrolments" exist: + | user | course | role | + | teacher1 | C1 | editingteacher | + And I log in as "teacher1" + And I am on "Course 1" course homepage + + Scenario: If there are no related evasys-courses I should not see any. + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And there is no idnumber mapped to course C1 + And no courses are mapped to course C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + Then I should see "Change mapping" + And I should not see "Name:" + And I should not see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there are invalid mappings I should see a warning + If there are inconsistent modes I should see a warning + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And there is no idnumber mapped to course C1 + And only invalid mappings are present for course C1 + And the internal state of course C1 is "manual" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + Then I should see "This evaluation was already started in another mode" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there are invalid mappings I should see a warning + If there are inconsistent modes I should see a warning + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And there is no idnumber mapped to course C1 + And only invalid mappings are present for course C1 + And the internal state of course C1 is "opened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + Then I should see "This evaluation was already started in another mode" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there are invalid mappings I should see a warning + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And there is no idnumber mapped to course C1 + And only invalid mappings are present for course C1 + And the internal state of course C1 is "manual" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + And both selectors should be disabled + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there are invalid mappings I should see a warning + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And there is no idnumber mapped to course C1 + And only invalid mappings are present for course C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + And both selectors should be disabled + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there are invalid mappings I should see a warning + Given category 1 is in manual mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And only tutors enrolled in course C1 + And there is no idnumber mapped to course C1 + And only invalid mappings are present for course C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + And both selectors should be disabled + And I should see a button named "Request evaluation" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there are invalid mappings I should see a warning + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And there is no idnumber mapped to course C1 + And only invalid mappings are present for course C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + And I should see a button named "Request evaluation" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there are any mapped courses I should see those + If there are inconsistent modes I should see a warning + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And there is no idnumber mapped to course C1 + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to true + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "This evaluation was already started in another mode" + And I should see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an idnumber I should see this evasys-course + If there are any mapped courses I should see those + This should be valid regardless of mapped courses being set to one, multi or none + If there are inconsistent modes I should see a warning + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to true + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "This evaluation was already started in another mode" + And I should see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there are any mapped courses I should see those + If there are inconsistent modes I should see a warning + Given category 1 is in manual mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And only tutors enrolled in course C1 + And there is no idnumber mapped to course C1 + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to true + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "This evaluation was already started in another mode" + And I should see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an idnumber I should see this evasys-course + If there are any mapped courses I should see those + This should be valid regardless of mapped courses being set to one, multi or none + If there are inconsistent modes I should see a warning + Given category 1 is in manual mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And only tutors enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to true + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "This evaluation was already started in another mode" + And I should see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there are any mapped courses I should see those + If there are inconsistent modes I should see a warning + Given category 1 is in manual mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And only tutors enrolled in course C1 + And there is no idnumber mapped to course C1 + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "This evaluation was already started in another mode" + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an idnumber I should see this evasys-course + If there are any mapped courses I should see those + This should be valid regardless of mapped courses being set to one, multi or none + If there are inconsistent modes I should see a warning + Given category 1 is in manual mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And only tutors enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "This evaluation was already started in another mode" + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an idnumber I should see this evasys-course + If there are any mapped courses I should see those + This should be valid regardless of mapped courses being set to one, multi or none + If there are inconsistent modes I should see a warning + Given category 1 is in manual mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And only tutors enrolled in course C1 + And the idnumber of course C1 links to a mixed Evasyscourse + And there are 1 mixed Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "This evaluation was already started in another mode" + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an idnumber I should see this evasys-course + If there are any mapped courses I should see those + This should be valid regardless of mapped courses being set to one, multi or none + If there are inconsistent modes I should see a warning + If there are surveys that don't match the internal state I should see a warning + Given category 1 is in manual mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And only tutors enrolled in course C1 + And the idnumber of course C1 links to a mixed Evasyscourse + And there are 1 mixed Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "opened" + And the recordstandardtimemode for course C1 is set to true + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "This evaluation was already started in another mode" + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an idnumber I should see this evasys-course + If there are any mapped courses I should see those + This should be valid regardless of mapped courses being set to one, multi or none + If there are inconsistent modes I should see a warning + If there are surveys that don't match the internal state I should see a warning + Given category 1 is in manual mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And only tutors enrolled in course C1 + And the idnumber of course C1 links to a mixed Evasyscourse + And there are 1 mixed Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "closed" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "This evaluation was already started in another mode" + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there are any mapped courses I should see those + If there are inconsistent modes I should see a warning + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And there is no idnumber mapped to course C1 + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "This evaluation was already started in another mode" + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an idnumber I should see this evasys-course + If there are any mapped courses I should see those + This should be valid regardless of mapped courses being set to one, multi or none + If there are inconsistent modes I should see a warning + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "This evaluation was already started in another mode" + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an idnumber I should see this evasys-course + If there are any mapped courses I should see those + This should be valid regardless of mapped courses being set to one, multi or none + If there are inconsistent modes I should see a warning + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And the idnumber of course C1 links to a mixed Evasyscourse + And there are 1 mixed Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "closed" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "This evaluation was already started in another mode" + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there are any mapped courses I should see those + If there are inconsistent modes I should see a warning + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And there is no idnumber mapped to course C1 + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "opened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "This evaluation was already started in another mode" + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there are any mapped courses I should see those + If there are inconsistent modes I should see a warning + Given category 1 is in manual mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And only tutors enrolled in course C1 + And there is no idnumber mapped to course C1 + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "closed" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "This evaluation was already started in another mode" + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there are any mapped courses I should see those + If there are inconsistent modes I should see a warning + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And there is no idnumber mapped to course C1 + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "manual" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "This evaluation was already started in another mode" + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an idnumber I should see this evasys-course + If there are any mapped courses I should see those + This should be valid regardless of mapped courses being set to one, multi or none + If there are inconsistent modes I should see a warning + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "manual" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "This evaluation was already started in another mode" + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an idnumber I should see this evasys-course + If there are any mapped courses I should see those + This should be valid regardless of mapped courses being set to one, multi or none + If there are inconsistent modes I should see a warning + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "opened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "This evaluation was already started in another mode" + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there are any mapped courses I should see those + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And there is no idnumber mapped to course C1 + And there are 1 closed Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "closed" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And both selectors should be disabled + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an idnumber I should see this evasys-course + If there are any mapped courses I should see those + This should be valid regardless of mapped courses being set to one, multi or none + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And the idnumber of course C1 links to a closed Evasyscourse + And there are 1 closed Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "closed" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And both selectors should be disabled + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there are any mapped courses I should see those + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And there is no idnumber mapped to course C1 + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "manual" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And both selectors should be disabled + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an idnumber I should see this evasys-course + If there are any mapped courses I should see those + This should be valid regardless of mapped courses being set to one, multi or none + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "manual" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And both selectors should be disabled + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there are any mapped courses I should see those + Given category 1 is in manual mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And only tutors enrolled in course C1 + And there is no idnumber mapped to course C1 + And there are 1 open Evasyscourses mapped to course with shortname C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And both selectors should be disabled + And I should see a button named "Request evaluation" + And I should see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an idnumber I should see this evasys-course + If there are any mapped courses I should see those + This should be valid regardless of mapped courses being set to one, multi or none + Given category 1 is in manual mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And only tutors enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And there are 1 open Evasyscourses mapped to course with shortname C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And both selectors should be disabled + And I should see a button named "Request evaluation" + And I should see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there are any mapped courses I should see those + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And there is no idnumber mapped to course C1 + And there are 1 open Evasyscourses mapped to course with shortname C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And I should see a button named "Request evaluation" + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an idnumber I should see this evasys-course + If there are any mapped courses I should see those + This should be valid regardless of mapped courses being set to one, multi or none + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And there are 1 open Evasyscourses mapped to course with shortname C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And I should see a button named "Request evaluation" + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there are any mapped courses I should see those + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And there is no idnumber mapped to course C1 + And there are 1 closed Evasyscourses mapped to course with shortname C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And both selectors should be disabled + And I should see a button named "Request evaluation" + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an idnumber I should see this evasys-course + If there are any mapped courses I should see those + This should be valid regardless of mapped courses being set to one, multi or none + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And the idnumber of course C1 links to a closed Evasyscourse + And there are 1 closed Evasyscourses mapped to course with shortname C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And both selectors should be disabled + And I should see a button named "Request evaluation" + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an invalid idnumber I should see a warning + If there are inconsistent modes I should see a warning + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And the idnumber for course C1 is invalid + And no courses are mapped to course C1 + And the internal state of course C1 is "manual" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + Then I should see "This evaluation was already started in another mode" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an invalid idnumber I should see a warning + If there are inconsistent modes I should see a warning + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And the idnumber for course C1 is invalid + And no courses are mapped to course C1 + And the internal state of course C1 is "opened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + Then I should see "This evaluation was already started in another mode" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an invalid idnumber I should see a warning + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And the idnumber for course C1 is invalid + And no courses are mapped to course C1 + And the internal state of course C1 is "manual" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + And both selectors should be disabled + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an invalid idnumber I should see a warning + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And the idnumber for course C1 is invalid + And no courses are mapped to course C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + And both selectors should be disabled + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an invalid idnumber I should see a warning + Given category 1 is in manual mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And only tutors enrolled in course C1 + And the idnumber for course C1 is invalid + And no courses are mapped to course C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + And both selectors should be disabled + And I should see a button named "Request evaluation" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an invalid idnumber I should see a warning + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And the idnumber for course C1 is invalid + And no courses are mapped to course C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + And I should see a button named "Request evaluation" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an invalid idnumber I should see a warning + If there are invalid mappings I should see a warning + If there are inconsistent modes I should see a warning + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And the idnumber for course C1 is invalid + And only invalid mappings are present for course C1 + And the internal state of course C1 is "manual" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + Then I should see "One of the dynamically mapped evasys-courses is invalid" + Then I should see "This evaluation was already started in another mode" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an invalid idnumber I should see a warning + If there are invalid mappings I should see a warning + If there are inconsistent modes I should see a warning + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And the idnumber for course C1 is invalid + And only invalid mappings are present for course C1 + And the internal state of course C1 is "opened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + Then I should see "One of the dynamically mapped evasys-courses is invalid" + Then I should see "This evaluation was already started in another mode" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an invalid idnumber I should see a warning + If there are invalid mappings I should see a warning + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And the idnumber for course C1 is invalid + And only invalid mappings are present for course C1 + And the internal state of course C1 is "manual" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + Then I should see "One of the dynamically mapped evasys-courses is invalid" + And both selectors should be disabled + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an invalid idnumber I should see a warning + If there are invalid mappings I should see a warning + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And the idnumber for course C1 is invalid + And only invalid mappings are present for course C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + Then I should see "One of the dynamically mapped evasys-courses is invalid" + And both selectors should be disabled + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an invalid idnumber I should see a warning + If there are invalid mappings I should see a warning + Given category 1 is in manual mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And only tutors enrolled in course C1 + And the idnumber for course C1 is invalid + And only invalid mappings are present for course C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + Then I should see "One of the dynamically mapped evasys-courses is invalid" + And both selectors should be disabled + And I should see a button named "Request evaluation" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an invalid idnumber I should see a warning + If there are invalid mappings I should see a warning + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And the idnumber for course C1 is invalid + And only invalid mappings are present for course C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + Then I should see "One of the dynamically mapped evasys-courses is invalid" + And I should see a button named "Request evaluation" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an invalid idnumber I should see a warning + If there are any mapped courses I should see those + If there are inconsistent modes I should see a warning + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And the idnumber for course C1 is invalid + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to true + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + Then I should see "This evaluation was already started in another mode" + And I should see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an invalid idnumber I should see a warning + If there are any mapped courses I should see those + If there are inconsistent modes I should see a warning + Given category 1 is in manual mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And only tutors enrolled in course C1 + And the idnumber for course C1 is invalid + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to true + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + Then I should see "This evaluation was already started in another mode" + And I should see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an invalid idnumber I should see a warning + If there are any mapped courses I should see those + If there are inconsistent modes I should see a warning + Given category 1 is in manual mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And only tutors enrolled in course C1 + And the idnumber for course C1 is invalid + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + Then I should see "This evaluation was already started in another mode" + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an invalid idnumber I should see a warning + If there are any mapped courses I should see those + If there are inconsistent modes I should see a warning + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And the idnumber for course C1 is invalid + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + Then I should see "This evaluation was already started in another mode" + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an invalid idnumber I should see a warning + If there are any mapped courses I should see those + If there are inconsistent modes I should see a warning + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And the idnumber for course C1 is invalid + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "opened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + Then I should see "This evaluation was already started in another mode" + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an invalid idnumber I should see a warning + If there are any mapped courses I should see those + If there are inconsistent modes I should see a warning + Given category 1 is in manual mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And only tutors enrolled in course C1 + And the idnumber for course C1 is invalid + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "opened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + Then I should see "This evaluation was already started in another mode" + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an invalid idnumber I should see a warning + If there are any mapped courses I should see those + If there are inconsistent modes I should see a warning + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And the idnumber for course C1 is invalid + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "manual" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + Then I should see "This evaluation was already started in another mode" + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an invalid idnumber I should see a warning + If there are any mapped courses I should see those + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And the idnumber for course C1 is invalid + And there are 1 closed Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "closed" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + And both selectors should be disabled + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an invalid idnumber I should see a warning + If there are any mapped courses I should see those + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And the idnumber for course C1 is invalid + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "manual" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + And both selectors should be disabled + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an invalid idnumber I should see a warning + If there are any mapped courses I should see those + Given category 1 is in manual mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And only tutors enrolled in course C1 + And the idnumber for course C1 is invalid + And there are 1 open Evasyscourses mapped to course with shortname C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + And both selectors should be disabled + And I should see a button named "Request evaluation" + And I should see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an invalid idnumber I should see a warning + If there are any mapped courses I should see those + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And the idnumber for course C1 is invalid + And there are 1 open Evasyscourses mapped to course with shortname C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + And I should see a button named "Request evaluation" + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an invalid idnumber I should see a warning + If there are any mapped courses I should see those + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And the idnumber for course C1 is invalid + And there are 1 closed Evasyscourses mapped to course with shortname C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + And both selectors should be disabled + And I should see a button named "Request evaluation" + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an idnumber I should see this evasys-course + If there are invalid mappings I should see a warning + If there are inconsistent modes I should see a warning + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And only invalid mappings are present for course C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to true + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + Then I should see "This evaluation was already started in another mode" + And I should see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an idnumber I should see this evasys-course + If there are invalid mappings I should see a warning + If there are inconsistent modes I should see a warning + Given category 1 is in manual mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And only tutors enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And only invalid mappings are present for course C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to true + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + Then I should see "This evaluation was already started in another mode" + And I should see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an idnumber I should see this evasys-course + If there are invalid mappings I should see a warning + If there are inconsistent modes I should see a warning + Given category 1 is in manual mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And only tutors enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And only invalid mappings are present for course C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + Then I should see "This evaluation was already started in another mode" + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an idnumber I should see this evasys-course + If there are invalid mappings I should see a warning + If there are inconsistent modes I should see a warning + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And only invalid mappings are present for course C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + Then I should see "This evaluation was already started in another mode" + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an idnumber I should see this evasys-course + If there are invalid mappings I should see a warning + If there are inconsistent modes I should see a warning + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And only invalid mappings are present for course C1 + And the internal state of course C1 is "opened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + Then I should see "This evaluation was already started in another mode" + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an idnumber I should see this evasys-course + If there are invalid mappings I should see a warning + If there are inconsistent modes I should see a warning + Given category 1 is in manual mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And only tutors enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And only invalid mappings are present for course C1 + And the internal state of course C1 is "closed" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + Then I should see "This evaluation was already started in another mode" + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an idnumber I should see this evasys-course + If there are invalid mappings I should see a warning + If there are inconsistent modes I should see a warning + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And only invalid mappings are present for course C1 + And the internal state of course C1 is "manual" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + Then I should see "This evaluation was already started in another mode" + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an idnumber I should see this evasys-course + If there are invalid mappings I should see a warning + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And the idnumber of course C1 links to a closed Evasyscourse + And only invalid mappings are present for course C1 + And the internal state of course C1 is "closed" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + And both selectors should be disabled + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an idnumber I should see this evasys-course + If there are invalid mappings I should see a warning + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And only invalid mappings are present for course C1 + And the internal state of course C1 is "manual" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + And both selectors should be disabled + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an idnumber I should see this evasys-course + If there are invalid mappings I should see a warning + Given category 1 is in manual mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And only tutors enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And only invalid mappings are present for course C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + And both selectors should be disabled + And I should see a button named "Request evaluation" + And I should see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an idnumber I should see this evasys-course + If there are invalid mappings I should see a warning + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And only invalid mappings are present for course C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + And I should see a button named "Request evaluation" + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an idnumber I should see this evasys-course + If there are invalid mappings I should see a warning + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And the idnumber of course C1 links to a closed Evasyscourse + And only invalid mappings are present for course C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + And both selectors should be disabled + And I should see a button named "Request evaluation" + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are invalid mappings I should see a warning + If there are inconsistent modes I should see a warning + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And there is no idnumber mapped to course C1 + And only invalid mappings are present for course C1 + And the internal state of course C1 is "manual" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + Then I should see "This evaluation was already started in another mode" + And I should not see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are invalid mappings I should see a warning + If there are inconsistent modes I should see a warning + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And there is no idnumber mapped to course C1 + And only invalid mappings are present for course C1 + And the internal state of course C1 is "closed" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + Then I should see "This evaluation was already started in another mode" + And I should not see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are invalid mappings I should see a warning + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And there is no idnumber mapped to course C1 + And only invalid mappings are present for course C1 + And the internal state of course C1 is "manual" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + And I should not see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are invalid mappings I should see a warning + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And there is no idnumber mapped to course C1 + And only invalid mappings are present for course C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + And I should not see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are invalid mappings I should see a warning + Given category 1 is in manual mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And students enrolled in course C1 + And there is no idnumber mapped to course C1 + And only invalid mappings are present for course C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + And both selectors should be disabled + And I should see a button named "Request evaluation" + And I should not see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are invalid mappings I should see a warning + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And there is no idnumber mapped to course C1 + And only invalid mappings are present for course C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + And I should see a button named "Request evaluation" + And I should not see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an idnumber I should see this evasys-course + If there are any mapped courses I should see those + If there are inconsistent modes I should see a warning + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And there are 2 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to true + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "This evaluation was already started in another mode" + And I should see "Alter evaluationperiod for special courses" + And I should see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an idnumber I should see this evasys-course + If there are any mapped courses I should see those + If there are inconsistent modes I should see a warning + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber of course C1 links to a mixed Evasyscourse + And there are 2 mixed Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to true + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "This evaluation was already started in another mode" + And I should see "Alter evaluationperiod for special courses" + And I should see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are any mapped courses I should see those + If there are inconsistent modes I should see a warning + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And there is no idnumber mapped to course C1 + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to true + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "This evaluation was already started in another mode" + And I should see "Alter evaluationperiod for special courses" + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an idnumber I should see this evasys-course + If there are any mapped courses I should see those + This should be valid regardless of mapped courses being set to one or none + If there are inconsistent modes I should see a warning + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to true + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "This evaluation was already started in another mode" + And I should see "Alter evaluationperiod for special courses" + And I should see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an idnumber I should see this evasys-course + If there are any mapped courses I should see those + If there are inconsistent modes I should see a warning + Given category 1 is in manual mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And students enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And there are 2 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to true + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "This evaluation was already started in another mode" + And I should see "Alter evaluationperiod for special courses" + And I should see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are any mapped courses I should see those + If there are inconsistent modes I should see a warning + Given category 1 is in manual mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And students enrolled in course C1 + And there is no idnumber mapped to course C1 + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to true + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "This evaluation was already started in another mode" + And I should see "Alter evaluationperiod for special courses" + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an idnumber I should see this evasys-course + If there are any mapped courses I should see those + This should be valid regardless of mapped courses being set to one or none + If there are inconsistent modes I should see a warning + Given category 1 is in manual mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And students enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to true + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "This evaluation was already started in another mode" + And I should see "Alter evaluationperiod for special courses" + And I should see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are any mapped courses I should see those + If there are inconsistent modes I should see a warning + Given category 1 is in manual mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And students enrolled in course C1 + And there is no idnumber mapped to course C1 + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "This evaluation was already started in another mode" + And I should not see "Alter evaluationperiod for special courses" + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an idnumber I should see this evasys-course + If there are any mapped courses I should see those + This should be valid regardless of mapped courses being set to one, multi or none + If there are inconsistent modes I should see a warning + Given category 1 is in manual mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And students enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "This evaluation was already started in another mode" + And I should not see "Alter evaluationperiod for special courses" + And I should see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an idnumber I should see this evasys-course + If there are any mapped courses I should see those + This should be valid regardless of mapped courses being set to one, multi or none + If there are inconsistent modes I should see a warning + Given category 1 is in manual mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And students enrolled in course C1 + And the idnumber of course C1 links to a mixed Evasyscourse + And there are 1 mixed Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "This evaluation was already started in another mode" + And I should not see "Alter evaluationperiod for special courses" + And I should see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an idnumber I should see this evasys-course + If there are any mapped courses I should see those + This should be valid regardless of mapped courses being set to one, multi or none + If there are inconsistent modes I should see a warning + If there are surveys that don't match the internal state I should see a warning + Given category 1 is in manual mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And students enrolled in course C1 + And the idnumber of course C1 links to a mixed Evasyscourse + And there are 1 mixed Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "opened" + And the recordstandardtimemode for course C1 is set to true + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "This evaluation was already started in another mode" + And I should not see "Alter evaluationperiod for special courses" + And I should see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an idnumber I should see this evasys-course + If there are any mapped courses I should see those + This should be valid regardless of mapped courses being set to one, multi or none + If there are inconsistent modes I should see a warning + If there are surveys that don't match the internal state I should see a warning + Given category 1 is in manual mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And students enrolled in course C1 + And the idnumber of course C1 links to a mixed Evasyscourse + And there are 1 mixed Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "closed" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "This evaluation was already started in another mode" + And I should not see "Alter evaluationperiod for special courses" + And I should see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are any mapped courses I should see those + If there are inconsistent modes I should see a warning + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And there is no idnumber mapped to course C1 + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "This evaluation was already started in another mode" + And I should not see "Alter evaluationperiod for special courses" + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an idnumber I should see this evasys-course + If there are any mapped courses I should see those + This should be valid regardless of mapped courses being set to one, multi or none + If there are inconsistent modes I should see a warning + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "This evaluation was already started in another mode" + And I should not see "Alter evaluationperiod for special courses" + And I should see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an idnumber I should see this evasys-course + If there are any mapped courses I should see those + This should be valid regardless of mapped courses being set to one, multi or none + If there are inconsistent modes I should see a warning + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber of course C1 links to a mixed Evasyscourse + And there are 1 mixed Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "opened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "This evaluation was already started in another mode" + And I should not see "Alter evaluationperiod for special courses" + And I should see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are any mapped courses I should see those + If there are inconsistent modes I should see a warning + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And there is no idnumber mapped to course C1 + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "closed" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "This evaluation was already started in another mode" + And I should not see "Alter evaluationperiod for special courses" + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are any mapped courses I should see those + If there are inconsistent modes I should see a warning + Given category 1 is in manual mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And students enrolled in course C1 + And there is no idnumber mapped to course C1 + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "opened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "This evaluation was already started in another mode" + And I should not see "Alter evaluationperiod for special courses" + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are any mapped courses I should see those + If there are inconsistent modes I should see a warning + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And there is no idnumber mapped to course C1 + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "manual" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "This evaluation was already started in another mode" + And I should not see "Alter evaluationperiod for special courses" + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an idnumber I should see this evasys-course + If there are any mapped courses I should see those + This should be valid regardless of mapped courses being set to one, multi or none + If there are inconsistent modes I should see a warning + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "manual" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "This evaluation was already started in another mode" + And I should not see "Alter evaluationperiod for special courses" + And I should see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an idnumber I should see this evasys-course + If there are any mapped courses I should see those + This should be valid regardless of mapped courses being set to one, multi or none + If there are inconsistent modes I should see a warning + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "opened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "This evaluation was already started in another mode" + And I should not see "Alter evaluationperiod for special courses" + And I should see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are any mapped courses I should see those + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And there is no idnumber mapped to course C1 + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "manual" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And I should see "Evaluation has been requested" + And the submitbutton should be enabled + And I should not see "Alter evaluationperiod for special courses" + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an idnumber I should see this evasys-course + If there are any mapped courses I should see those + This should be valid regardless of mapped courses being set to one, multi or none + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "manual" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And I should see "Evaluation has been requested" + And the submitbutton should be enabled + And I should not see "Alter evaluationperiod for special courses" + And I should see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are any mapped courses I should see those + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And there is no idnumber mapped to course C1 + And there are 1 closed Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "closed" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And both selectors should be disabled + And I should not see "Alter evaluationperiod for special courses" + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an idnumber I should see this evasys-course + If there are any mapped courses I should see those + This should be valid regardless of mapped courses being set to one, multi or none + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber of course C1 links to a closed Evasyscourse + And there are 1 closed Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "closed" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And both selectors should be disabled + And I should not see "Alter evaluationperiod for special courses" + And I should see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are any mapped courses I should see those + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And there is no idnumber mapped to course C1 + And there are 1 closed Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "manual" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And both selectors should be disabled + And I should not see "Alter evaluationperiod for special courses" + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an idnumber I should see this evasys-course + If there are any mapped courses I should see those + This should be valid regardless of mapped courses being set to one, multi or none + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber of course C1 links to a closed Evasyscourse + And there are 1 closed Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "manual" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And both selectors should be disabled + And I should not see "Alter evaluationperiod for special courses" + And I should see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an idnumber I should see this evasys-course + If there are any mapped courses I should see those + Given category 1 is in manual mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And students enrolled in course C1 + And the idnumber of course C1 links to a mixed Evasyscourse + And there are 2 mixed Evasyscourses mapped to course with shortname C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And both selectors should be disabled + And I should see a button named "Request evaluation" + And I should see "Alter evaluationperiod for special courses" + And I should see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an idnumber I should see this evasys-course + If there are any mapped courses I should see those + Given category 1 is in manual mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And students enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And there are 2 open Evasyscourses mapped to course with shortname C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And both selectors should be disabled + And I should see a button named "Request evaluation" + And I should see "Alter evaluationperiod for special courses" + And I should see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are any mapped courses I should see those + Given category 1 is in manual mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And students enrolled in course C1 + And there is no idnumber mapped to course C1 + And there are 1 open Evasyscourses mapped to course with shortname C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And both selectors should be disabled + And I should see a button named "Request evaluation" + And I should see "Alter evaluationperiod for special courses" + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an idnumber I should see this evasys-course + If there are any mapped courses I should see those + This should be valid regardless of mapped courses being set to one or none + Given category 1 is in manual mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And students enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And there are 1 open Evasyscourses mapped to course with shortname C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And both selectors should be disabled + And I should see a button named "Request evaluation" + And I should see "Alter evaluationperiod for special courses" + And I should see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are any mapped courses I should see those + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And there is no idnumber mapped to course C1 + And there are 1 open Evasyscourses mapped to course with shortname C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And the submitbutton should be enabled + And I should see a button named "Request evaluation" + And I should not see "Alter evaluationperiod for special courses" + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an idnumber I should see this evasys-course + If there are any mapped courses I should see those + This should be valid regardless of mapped courses being set to one, multi or none + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And there are 1 open Evasyscourses mapped to course with shortname C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And the submitbutton should be enabled + And I should see a button named "Request evaluation" + And I should not see "Alter evaluationperiod for special courses" + And I should see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are any mapped courses I should see those + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And there is no idnumber mapped to course C1 + And there are 1 closed Evasyscourses mapped to course with shortname C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And both selectors should be disabled + And I should see a button named "Request evaluation" + And I should not see "Alter evaluationperiod for special courses" + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an idnumber I should see this evasys-course + If there are any mapped courses I should see those + This should be valid regardless of mapped courses being set to one, multi or none + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber of course C1 links to a closed Evasyscourse + And there are 1 closed Evasyscourses mapped to course with shortname C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And both selectors should be disabled + And I should see a button named "Request evaluation" + And I should not see "Alter evaluationperiod for special courses" + And I should see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an invalid idnumber I should see a warning + If there are inconsistent modes I should see a warning + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber for course C1 is invalid + And no courses are mapped to course C1 + And the internal state of course C1 is "manual" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + Then I should see "This evaluation was already started in another mode" + And I should not see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an invalid idnumber I should see a warning + If there are inconsistent modes I should see a warning + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber for course C1 is invalid + And no courses are mapped to course C1 + And the internal state of course C1 is "closed" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + Then I should see "This evaluation was already started in another mode" + And I should not see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an invalid idnumber I should see a warning + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber for course C1 is invalid + And no courses are mapped to course C1 + And the internal state of course C1 is "manual" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + And I should not see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an invalid idnumber I should see a warning + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber for course C1 is invalid + And no courses are mapped to course C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + And I should not see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an invalid idnumber I should see a warning + Given category 1 is in manual mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And students enrolled in course C1 + And the idnumber for course C1 is invalid + And no courses are mapped to course C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + And both selectors should be disabled + And I should see a button named "Request evaluation" + And I should not see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an invalid idnumber I should see a warning + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber for course C1 is invalid + And no courses are mapped to course C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + And I should see a button named "Request evaluation" + And I should not see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an invalid idnumber I should see a warning + If there are invalid mappings I should see a warning + If there are inconsistent modes I should see a warning + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber for course C1 is invalid + And only invalid mappings are present for course C1 + And the internal state of course C1 is "manual" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + Then I should see "One of the dynamically mapped evasys-courses is invalid" + Then I should see "This evaluation was already started in another mode" + And I should not see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an invalid idnumber I should see a warning + If there are invalid mappings I should see a warning + If there are inconsistent modes I should see a warning + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber for course C1 is invalid + And only invalid mappings are present for course C1 + And the internal state of course C1 is "closed" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + Then I should see "One of the dynamically mapped evasys-courses is invalid" + Then I should see "This evaluation was already started in another mode" + And I should not see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an invalid idnumber I should see a warning + If there are invalid mappings I should see a warning + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber for course C1 is invalid + And only invalid mappings are present for course C1 + And the internal state of course C1 is "manual" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + Then I should see "One of the dynamically mapped evasys-courses is invalid" + And I should not see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an invalid idnumber I should see a warning + If there are invalid mappings I should see a warning + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber for course C1 is invalid + And only invalid mappings are present for course C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + Then I should see "One of the dynamically mapped evasys-courses is invalid" + And I should not see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an invalid idnumber I should see a warning + If there are invalid mappings I should see a warning + Given category 1 is in manual mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And students enrolled in course C1 + And the idnumber for course C1 is invalid + And only invalid mappings are present for course C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + Then I should see "One of the dynamically mapped evasys-courses is invalid" + And both selectors should be disabled + And I should see a button named "Request evaluation" + And I should not see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an invalid idnumber I should see a warning + If there are invalid mappings I should see a warning + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber for course C1 is invalid + And only invalid mappings are present for course C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + Then I should see "One of the dynamically mapped evasys-courses is invalid" + And I should see a button named "Request evaluation" + And I should not see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an invalid idnumber I should see a warning + If there are any mapped courses I should see those + If there are inconsistent modes I should see a warning + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber for course C1 is invalid + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to true + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + Then I should see "This evaluation was already started in another mode" + And I should see "Alter evaluationperiod for special courses" + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an invalid idnumber I should see a warning + If there are any mapped courses I should see those + If there are inconsistent modes I should see a warning + Given category 1 is in manual mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And students enrolled in course C1 + And the idnumber for course C1 is invalid + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to true + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + Then I should see "This evaluation was already started in another mode" + And I should see "Alter evaluationperiod for special courses" + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an invalid idnumber I should see a warning + If there are any mapped courses I should see those + If there are inconsistent modes I should see a warning + Given category 1 is in manual mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And students enrolled in course C1 + And the idnumber for course C1 is invalid + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + Then I should see "This evaluation was already started in another mode" + And I should not see "Alter evaluationperiod for special courses" + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an invalid idnumber I should see a warning + If there are any mapped courses I should see those + If there are inconsistent modes I should see a warning + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber for course C1 is invalid + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + Then I should see "This evaluation was already started in another mode" + And I should not see "Alter evaluationperiod for special courses" + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an invalid idnumber I should see a warning + If there are any mapped courses I should see those + If there are inconsistent modes I should see a warning + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber for course C1 is invalid + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "opened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + Then I should see "This evaluation was already started in another mode" + And I should not see "Alter evaluationperiod for special courses" + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an invalid idnumber I should see a warning + If there are any mapped courses I should see those + If there are inconsistent modes I should see a warning + Given category 1 is in manual mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And students enrolled in course C1 + And the idnumber for course C1 is invalid + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "closed" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + Then I should see "This evaluation was already started in another mode" + And I should not see "Alter evaluationperiod for special courses" + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an invalid idnumber I should see a warning + If there are any mapped courses I should see those + If there are inconsistent modes I should see a warning + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber for course C1 is invalid + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "manual" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + Then I should see "This evaluation was already started in another mode" + And I should not see "Alter evaluationperiod for special courses" + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an invalid idnumber I should see a warning + If there are any mapped courses I should see those + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber for course C1 is invalid + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "manual" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + And I should see "Evaluation has been requested" + And the submitbutton should be enabled + And I should not see "Alter evaluationperiod for special courses" + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an invalid idnumber I should see a warning + If there are any mapped courses I should see those + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber for course C1 is invalid + And there are 1 closed Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "closed" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + And both selectors should be disabled + And I should not see "Alter evaluationperiod for special courses" + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an invalid idnumber I should see a warning + If there are any mapped courses I should see those + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber for course C1 is invalid + And there are 1 closed Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "manual" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + And both selectors should be disabled + And I should not see "Alter evaluationperiod for special courses" + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an invalid idnumber I should see a warning + If there are any mapped courses I should see those + Given category 1 is in manual mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And students enrolled in course C1 + And the idnumber for course C1 is invalid + And there are 1 open Evasyscourses mapped to course with shortname C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + And both selectors should be disabled + And I should see a button named "Request evaluation" + And I should see "Alter evaluationperiod for special courses" + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an invalid idnumber I should see a warning + If there are any mapped courses I should see those + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber for course C1 is invalid + And there are 1 open Evasyscourses mapped to course with shortname C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + And the submitbutton should be enabled + And I should see a button named "Request evaluation" + And I should not see "Alter evaluationperiod for special courses" + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an invalid idnumber I should see a warning + If there are any mapped courses I should see those + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber for course C1 is invalid + And there are 1 closed Evasyscourses mapped to course with shortname C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + And both selectors should be disabled + And I should see a button named "Request evaluation" + And I should not see "Alter evaluationperiod for special courses" + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an idnumber I should see this evasys-course + If there are invalid mappings I should see a warning + If there are inconsistent modes I should see a warning + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And only invalid mappings are present for course C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to true + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + Then I should see "This evaluation was already started in another mode" + And I should see "Alter evaluationperiod for special courses" + And I should see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an idnumber I should see this evasys-course + If there are invalid mappings I should see a warning + If there are inconsistent modes I should see a warning + Given category 1 is in manual mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And students enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And only invalid mappings are present for course C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to true + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + Then I should see "This evaluation was already started in another mode" + And I should see "Alter evaluationperiod for special courses" + And I should see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an idnumber I should see this evasys-course + If there are invalid mappings I should see a warning + If there are inconsistent modes I should see a warning + Given category 1 is in manual mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And students enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And only invalid mappings are present for course C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + Then I should see "This evaluation was already started in another mode" + And I should not see "Alter evaluationperiod for special courses" + And I should see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an idnumber I should see this evasys-course + If there are invalid mappings I should see a warning + If there are inconsistent modes I should see a warning + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And only invalid mappings are present for course C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + Then I should see "This evaluation was already started in another mode" + And I should not see "Alter evaluationperiod for special courses" + And I should see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an idnumber I should see this evasys-course + If there are invalid mappings I should see a warning + If there are inconsistent modes I should see a warning + If there are surveys that don't match the internal state I should see a warning + Given category 1 is in manual mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And students enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And only invalid mappings are present for course C1 + And the internal state of course C1 is "opened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + Then I should see "This evaluation was already started in another mode" + And I should not see "Alter evaluationperiod for special courses" + And I should see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an idnumber I should see this evasys-course + If there are invalid mappings I should see a warning + If there are inconsistent modes I should see a warning + If there are surveys that don't match the internal state I should see a warning + Given category 1 is in manual mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And students enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And only invalid mappings are present for course C1 + And the internal state of course C1 is "closed" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + Then I should see "This evaluation was already started in another mode" + And I should not see "Alter evaluationperiod for special courses" + And I should see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an idnumber I should see this evasys-course + If there are invalid mappings I should see a warning + If there are inconsistent modes I should see a warning + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And only invalid mappings are present for course C1 + And the internal state of course C1 is "closed" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + Then I should see "This evaluation was already started in another mode" + And I should not see "Alter evaluationperiod for special courses" + And I should see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an idnumber I should see this evasys-course + If there are invalid mappings I should see a warning + If there are inconsistent modes I should see a warning + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And only invalid mappings are present for course C1 + And the internal state of course C1 is "manual" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + Then I should see "This evaluation was already started in another mode" + And I should not see "Alter evaluationperiod for special courses" + And I should see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an idnumber I should see this evasys-course + If there are invalid mappings I should see a warning + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And only invalid mappings are present for course C1 + And the internal state of course C1 is "manual" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + And I should see "Evaluation has been requested" + And the submitbutton should be enabled + And I should not see "Alter evaluationperiod for special courses" + And I should see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an idnumber I should see this evasys-course + If there are invalid mappings I should see a warning + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber of course C1 links to a closed Evasyscourse + And only invalid mappings are present for course C1 + And the internal state of course C1 is "closed" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + And both selectors should be disabled + And I should not see "Alter evaluationperiod for special courses" + And I should see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an idnumber I should see this evasys-course + If there are invalid mappings I should see a warning + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber of course C1 links to a closed Evasyscourse + And only invalid mappings are present for course C1 + And the internal state of course C1 is "manual" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + And both selectors should be disabled + And I should not see "Alter evaluationperiod for special courses" + And I should see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an idnumber I should see this evasys-course + If there are invalid mappings I should see a warning + Given category 1 is in manual mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And students enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And only invalid mappings are present for course C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + And both selectors should be disabled + And I should see a button named "Request evaluation" + And I should see "Alter evaluationperiod for special courses" + And I should see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an idnumber I should see this evasys-course + If there are invalid mappings I should see a warning + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And only invalid mappings are present for course C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + And the submitbutton should be enabled + And I should see a button named "Request evaluation" + And I should not see "Alter evaluationperiod for special courses" + And I should see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an idnumber I should see this evasys-course + If there are invalid mappings I should see a warning + Given category 1 is in manual mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber of course C1 links to a closed Evasyscourse + And only invalid mappings are present for course C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + And both selectors should be disabled + And I should see a button named "Request evaluation" + And I should not see "Alter evaluationperiod for special courses" + And I should see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there are invalid mappings I should see a warning + If there are surveys that don't match the internal state I should see a warning + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And there is no idnumber mapped to course C1 + And only invalid mappings are present for course C1 + And the internal state of course C1 is "opened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + And the startselector should be disabled + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there are invalid mappings I should see a warning + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And there is no idnumber mapped to course C1 + And only invalid mappings are present for course C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there are any mapped courses I should see those + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And there is no idnumber mapped to course C1 + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to true + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And both selectors should be disabled + And I should see a button named "Set evaluation period" + And I should see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an idnumber I should see this evasys-course + If there are any mapped courses I should see those + This should be valid regardless of mapped courses being set to one, multi or none + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to true + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And both selectors should be disabled + And I should see a button named "Set evaluation period" + And I should see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there are any mapped courses I should see those + Given category 1 is in auto mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And only tutors enrolled in course C1 + And there is no idnumber mapped to course C1 + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to true + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And both selectors should be disabled + And I should see a button named "Set evaluation period" + And I should see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an idnumber I should see this evasys-course + If there are any mapped courses I should see those + This should be valid regardless of mapped courses being set to one, multi or none + Given category 1 is in auto mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And only tutors enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to true + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And both selectors should be disabled + And I should see a button named "Set evaluation period" + And I should see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there are any mapped courses I should see those + Given category 1 is in auto mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And only tutors enrolled in course C1 + And there is no idnumber mapped to course C1 + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And both selectors should be disabled + And I should see a button named "Set evaluation period" + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an idnumber I should see this evasys-course + If there are any mapped courses I should see those + This should be valid regardless of mapped courses being set to one, multi or none + Given category 1 is in auto mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And only tutors enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And both selectors should be disabled + And I should see a button named "Set evaluation period" + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there are any mapped courses I should see those + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And there is no idnumber mapped to course C1 + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And both selectors should be disabled + And I should see a button named "Set evaluation period" + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an idnumber I should see this evasys-course + If there are any mapped courses I should see those + This should be valid regardless of mapped courses being set to one, multi or none + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And both selectors should be disabled + And I should see a button named "Set evaluation period" + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there are any mapped courses I should see those + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And there is no idnumber mapped to course C1 + And there are 1 closed Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to true + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And both selectors should be disabled + And I should see a button named "Set evaluation period" + And I should see "There are some closed surveys, but all surveys should be open." + And I should see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an idnumber I should see this evasys-course + If there are any mapped courses I should see those + This should be valid regardless of mapped courses being set to one, multi or none + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And the idnumber of course C1 links to a closed Evasyscourse + And there are 1 closed Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to true + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And both selectors should be disabled + And I should see a button named "Set evaluation period" + And I should see "There are some closed surveys, but all surveys should be open." + And I should see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there are any mapped courses I should see those + Given category 1 is in auto mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And only tutors enrolled in course C1 + And there is no idnumber mapped to course C1 + And there are 1 closed Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to true + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And both selectors should be disabled + And I should see a button named "Set evaluation period" + And I should see "There are some closed surveys, but all surveys should be open." + And I should see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an idnumber I should see this evasys-course + If there are any mapped courses I should see those + This should be valid regardless of mapped courses being set to one, multi or none + Given category 1 is in auto mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And only tutors enrolled in course C1 + And the idnumber of course C1 links to a closed Evasyscourse + And there are 1 closed Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to true + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And both selectors should be disabled + And I should see a button named "Set evaluation period" + And I should see "There are some closed surveys, but all surveys should be open." + And I should see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there are any mapped courses I should see those + Given category 1 is in auto mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And only tutors enrolled in course C1 + And there is no idnumber mapped to course C1 + And there are 1 closed Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And both selectors should be disabled + And I should see a button named "Set evaluation period" + And I should see "There are some closed surveys, but all surveys should be open." + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an idnumber I should see this evasys-course + If there are any mapped courses I should see those + This should be valid regardless of mapped courses being set to one, multi or none + Given category 1 is in auto mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And only tutors enrolled in course C1 + And the idnumber of course C1 links to a closed Evasyscourse + And there are 1 closed Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And both selectors should be disabled + And I should see a button named "Set evaluation period" + And I should see "There are some closed surveys, but all surveys should be open." + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there are any mapped courses I should see those + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And there is no idnumber mapped to course C1 + And there are 1 closed Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And both selectors should be disabled + And I should see a button named "Set evaluation period" + And I should see "There are some closed surveys, but all surveys should be open." + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an idnumber I should see this evasys-course + If there are any mapped courses I should see those + This should be valid regardless of mapped courses being set to one, multi or none + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And the idnumber of course C1 links to a closed Evasyscourse + And there are 1 closed Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And both selectors should be disabled + And I should see a button named "Set evaluation period" + And I should see "There are some closed surveys, but all surveys should be open." + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there are any mapped courses I should see those + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And there is no idnumber mapped to course C1 + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "opened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And the startselector should be disabled + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an idnumber I should see this evasys-course + If there are any mapped courses I should see those + This should be valid regardless of mapped courses being set to one, multi or none + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "opened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And the startselector should be disabled + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there are any mapped courses I should see those + If there are surveys that don't match the internal state I should see a warning + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And there is no idnumber mapped to course C1 + And there are 1 closed Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "opened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And the startselector should be disabled + And I should see "There are some closed surveys, but all surveys should be open." + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an idnumber I should see this evasys-course + If there are any mapped courses I should see those + This should be valid regardless of mapped courses being set to one, multi or none + If there are surveys that don't match the internal state I should see a warning + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And the idnumber of course C1 links to a closed Evasyscourse + And there are 1 closed Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "opened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And the startselector should be disabled + And I should see "There are some closed surveys, but all surveys should be open." + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there are any mapped courses I should see those + If there are surveys that don't match the internal state I should see a warning + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And there is no idnumber mapped to course C1 + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "closed" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And I should see "There are some open surveys, but all surveys should be closed." + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an idnumber I should see this evasys-course + If there are any mapped courses I should see those + This should be valid regardless of mapped courses being set to one, multi or none + If there are surveys that don't match the internal state I should see a warning + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "closed" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And I should see "There are some open surveys, but all surveys should be closed." + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there are any mapped courses I should see those + Given category 1 is in auto mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And only tutors enrolled in course C1 + And there is no idnumber mapped to course C1 + And there are 1 open Evasyscourses mapped to course with shortname C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And I should see a button named "Set evaluation period" + And I should see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an idnumber I should see this evasys-course + If there are any mapped courses I should see those + This should be valid regardless of mapped courses being set to one, multi or none + Given category 1 is in auto mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And only tutors enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And there are 1 open Evasyscourses mapped to course with shortname C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And I should see a button named "Set evaluation period" + And I should see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there are any mapped courses I should see those + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And there is no idnumber mapped to course C1 + And there are 1 open Evasyscourses mapped to course with shortname C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And I should see a button named "Set evaluation period" + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an idnumber I should see this evasys-course + If there are any mapped courses I should see those + This should be valid regardless of mapped courses being set to one, multi or none + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And there are 1 open Evasyscourses mapped to course with shortname C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And I should see a button named "Set evaluation period" + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there are any mapped courses I should see those + Given category 1 is in auto mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And only tutors enrolled in course C1 + And there is no idnumber mapped to course C1 + And there are 1 closed Evasyscourses mapped to course with shortname C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And I should see a button named "Set evaluation period" + And I should see "There are some closed surveys, but all surveys should be open." + And I should see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an idnumber I should see this evasys-course + If there are any mapped courses I should see those + This should be valid regardless of mapped courses being set to one, multi or none + Given category 1 is in auto mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And only tutors enrolled in course C1 + And the idnumber of course C1 links to a closed Evasyscourse + And there are 1 closed Evasyscourses mapped to course with shortname C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And I should see a button named "Set evaluation period" + And I should see "There are some closed surveys, but all surveys should be open." + And I should see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there are any mapped courses I should see those + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And there is no idnumber mapped to course C1 + And there are 1 closed Evasyscourses mapped to course with shortname C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And I should see a button named "Set evaluation period" + And I should see "There are some closed surveys, but all surveys should be open." + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an idnumber I should see this evasys-course + If there are any mapped courses I should see those + This should be valid regardless of mapped courses being set to one, multi or none + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And the idnumber of course C1 links to a closed Evasyscourse + And there are 1 closed Evasyscourses mapped to course with shortname C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And I should see a button named "Set evaluation period" + And I should see "There are some closed surveys, but all surveys should be open." + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an invalid idnumber I should see a warning + If there are surveys that don't match the internal state I should see a warning + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And the idnumber for course C1 is invalid + And no courses are mapped to course C1 + And the internal state of course C1 is "opened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + And the startselector should be disabled + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an invalid idnumber I should see a warning + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And the idnumber for course C1 is invalid + And no courses are mapped to course C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an invalid idnumber I should see a warning + If there are invalid mappings I should see a warning + If there are surveys that don't match the internal state I should see a warning + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And the idnumber for course C1 is invalid + And only invalid mappings are present for course C1 + And the internal state of course C1 is "opened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + Then I should see "One of the dynamically mapped evasys-courses is invalid" + And the startselector should be disabled + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an invalid idnumber I should see a warning + If there are invalid mappings I should see a warning + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And the idnumber for course C1 is invalid + And only invalid mappings are present for course C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + Then I should see "One of the dynamically mapped evasys-courses is invalid" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an invalid idnumber I should see a warning + If there are any mapped courses I should see those + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And the idnumber for course C1 is invalid + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to true + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + And both selectors should be disabled + And I should see a button named "Set evaluation period" + And I should see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an invalid idnumber I should see a warning + If there are any mapped courses I should see those + Given category 1 is in auto mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And only tutors enrolled in course C1 + And the idnumber for course C1 is invalid + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to true + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + And both selectors should be disabled + And I should see a button named "Set evaluation period" + And I should see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an invalid idnumber I should see a warning + If there are any mapped courses I should see those + Given category 1 is in auto mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And only tutors enrolled in course C1 + And the idnumber for course C1 is invalid + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + And both selectors should be disabled + And I should see a button named "Set evaluation period" + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an invalid idnumber I should see a warning + If there are any mapped courses I should see those + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And the idnumber for course C1 is invalid + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + And both selectors should be disabled + And I should see a button named "Set evaluation period" + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an invalid idnumber I should see a warning + If there are any mapped courses I should see those + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And the idnumber for course C1 is invalid + And there are 1 closed Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to true + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + And both selectors should be disabled + And I should see a button named "Set evaluation period" + And I should see "There are some closed surveys, but all surveys should be open." + And I should see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an invalid idnumber I should see a warning + If there are any mapped courses I should see those + Given category 1 is in auto mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And only tutors enrolled in course C1 + And the idnumber for course C1 is invalid + And there are 1 closed Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to true + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + And both selectors should be disabled + And I should see a button named "Set evaluation period" + And I should see "There are some closed surveys, but all surveys should be open." + And I should see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an invalid idnumber I should see a warning + If there are any mapped courses I should see those + Given category 1 is in auto mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And only tutors enrolled in course C1 + And the idnumber for course C1 is invalid + And there are 1 closed Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + And both selectors should be disabled + And I should see a button named "Set evaluation period" + And I should see "There are some closed surveys, but all surveys should be open." + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an invalid idnumber I should see a warning + If there are any mapped courses I should see those + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And the idnumber for course C1 is invalid + And there are 1 closed Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + And both selectors should be disabled + And I should see a button named "Set evaluation period" + And I should see "There are some closed surveys, but all surveys should be open." + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an invalid idnumber I should see a warning + If there are any mapped courses I should see those + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And the idnumber for course C1 is invalid + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "opened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + And the startselector should be disabled + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an invalid idnumber I should see a warning + If there are any mapped courses I should see those + If there are surveys that don't match the internal state I should see a warning + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And the idnumber for course C1 is invalid + And there are 1 closed Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "opened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + And the startselector should be disabled + And I should see "There are some closed surveys, but all surveys should be open." + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an invalid idnumber I should see a warning + If there are any mapped courses I should see those + If there are surveys that don't match the internal state I should see a warning + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And the idnumber for course C1 is invalid + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "closed" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + And I should see "There are some open surveys, but all surveys should be closed." + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an invalid idnumber I should see a warning + If there are any mapped courses I should see those + Given category 1 is in auto mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And only tutors enrolled in course C1 + And the idnumber for course C1 is invalid + And there are 1 open Evasyscourses mapped to course with shortname C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + And I should see a button named "Set evaluation period" + And I should see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an invalid idnumber I should see a warning + If there are any mapped courses I should see those + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And the idnumber for course C1 is invalid + And there are 1 open Evasyscourses mapped to course with shortname C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + And I should see a button named "Set evaluation period" + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an invalid idnumber I should see a warning + If there are any mapped courses I should see those + Given category 1 is in auto mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And only tutors enrolled in course C1 + And the idnumber for course C1 is invalid + And there are 1 closed Evasyscourses mapped to course with shortname C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + And I should see a button named "Set evaluation period" + And I should see "There are some closed surveys, but all surveys should be open." + And I should see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an invalid idnumber I should see a warning + If there are any mapped courses I should see those + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And the idnumber for course C1 is invalid + And there are 1 closed Evasyscourses mapped to course with shortname C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + And I should see a button named "Set evaluation period" + And I should see "There are some closed surveys, but all surveys should be open." + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an idnumber I should see this evasys-course + If there are invalid mappings I should see a warning + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And only invalid mappings are present for course C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to true + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + And both selectors should be disabled + And I should see a button named "Set evaluation period" + And I should see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an idnumber I should see this evasys-course + If there are invalid mappings I should see a warning + Given category 1 is in auto mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And only tutors enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And only invalid mappings are present for course C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to true + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + And both selectors should be disabled + And I should see a button named "Set evaluation period" + And I should see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an idnumber I should see this evasys-course + If there are invalid mappings I should see a warning + Given category 1 is in auto mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And only tutors enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And only invalid mappings are present for course C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + And both selectors should be disabled + And I should see a button named "Set evaluation period" + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an idnumber I should see this evasys-course + If there are invalid mappings I should see a warning + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And only invalid mappings are present for course C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + And both selectors should be disabled + And I should see a button named "Set evaluation period" + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an idnumber I should see this evasys-course + If there are invalid mappings I should see a warning + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And the idnumber of course C1 links to a closed Evasyscourse + And only invalid mappings are present for course C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to true + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + And both selectors should be disabled + And I should see a button named "Set evaluation period" + And I should see "There are some closed surveys, but all surveys should be open." + And I should see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an idnumber I should see this evasys-course + If there are invalid mappings I should see a warning + Given category 1 is in auto mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And only tutors enrolled in course C1 + And the idnumber of course C1 links to a closed Evasyscourse + And only invalid mappings are present for course C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to true + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + And both selectors should be disabled + And I should see a button named "Set evaluation period" + And I should see "There are some closed surveys, but all surveys should be open." + And I should see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an idnumber I should see this evasys-course + If there are invalid mappings I should see a warning + Given category 1 is in auto mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And only tutors enrolled in course C1 + And the idnumber of course C1 links to a closed Evasyscourse + And only invalid mappings are present for course C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + And both selectors should be disabled + And I should see a button named "Set evaluation period" + And I should see "There are some closed surveys, but all surveys should be open." + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an idnumber I should see this evasys-course + If there are invalid mappings I should see a warning + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And the idnumber of course C1 links to a closed Evasyscourse + And only invalid mappings are present for course C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + And both selectors should be disabled + And I should see a button named "Set evaluation period" + And I should see "There are some closed surveys, but all surveys should be open." + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an idnumber I should see this evasys-course + If there are invalid mappings I should see a warning + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And only invalid mappings are present for course C1 + And the internal state of course C1 is "opened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + And the startselector should be disabled + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an idnumber I should see this evasys-course + If there are invalid mappings I should see a warning + If there are surveys that don't match the internal state I should see a warning + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And the idnumber of course C1 links to a closed Evasyscourse + And only invalid mappings are present for course C1 + And the internal state of course C1 is "opened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + And the startselector should be disabled + And I should see "There are some closed surveys, but all surveys should be open." + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an idnumber I should see this evasys-course + If there are invalid mappings I should see a warning + If there are surveys that don't match the internal state I should see a warning + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And only invalid mappings are present for course C1 + And the internal state of course C1 is "closed" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + And I should see "There are some open surveys, but all surveys should be closed." + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an idnumber I should see this evasys-course + If there are invalid mappings I should see a warning + Given category 1 is in auto mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And only tutors enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And only invalid mappings are present for course C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + And I should see a button named "Set evaluation period" + And I should see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an idnumber I should see this evasys-course + If there are invalid mappings I should see a warning + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And only invalid mappings are present for course C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + And I should see a button named "Set evaluation period" + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an idnumber I should see this evasys-course + If there are invalid mappings I should see a warning + Given category 1 is in auto mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And only tutors enrolled in course C1 + And the idnumber of course C1 links to a closed Evasyscourse + And only invalid mappings are present for course C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + And I should see a button named "Set evaluation period" + And I should see "There are some closed surveys, but all surveys should be open." + And I should see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are only tutors I should see a warning + This should be valid regardless of number of students being set to onlytutors or none + If there is an idnumber I should see this evasys-course + If there are invalid mappings I should see a warning + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And only tutors enrolled in course C1 + And the idnumber of course C1 links to a closed Evasyscourse + And only invalid mappings are present for course C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + And I should see a button named "Set evaluation period" + And I should see "There are some closed surveys, but all surveys should be open." + And I should not see "Alter evaluationperiod for special courses" + And I should see "This course does not contain any students that can evaluate it." + And I should see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are invalid mappings I should see a warning + If there are surveys that don't match the internal state I should see a warning + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And there is no idnumber mapped to course C1 + And only invalid mappings are present for course C1 + And the internal state of course C1 is "opened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + And the startselector should be disabled + And I should not see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are invalid mappings I should see a warning + If there are surveys that don't match the internal state I should see a warning + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And there is no idnumber mapped to course C1 + And only invalid mappings are present for course C1 + And the internal state of course C1 is "closed" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + And both selectors should be disabled + And I should not see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are any mapped courses I should see those + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And there is no idnumber mapped to course C1 + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to true + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And I should see "Evaluationperiod has been set" + And the submitbutton should be enabled + And I should see a button named "Set evaluation period" + And I should see "Alter evaluationperiod for special courses" + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an idnumber I should see this evasys-course + If there are any mapped courses I should see those + This should be valid regardless of mapped courses being set to one or none + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to true + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And I should see "Evaluationperiod has been set" + And the submitbutton should be enabled + And I should see a button named "Set evaluation period" + And I should see "Alter evaluationperiod for special courses" + And I should see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an idnumber I should see this evasys-course + If there are any mapped courses I should see those + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And there are 2 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to true + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And I should see "Evaluationperiod has been set" + And the submitbutton should be enabled + And I should see a button named "Set evaluation period" + And I should see "Alter evaluationperiod for special courses" + And I should see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are any mapped courses I should see those + Given category 1 is in auto mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And students enrolled in course C1 + And there is no idnumber mapped to course C1 + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to true + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And I should see "Evaluationperiod has been set" + And the submitbutton should be enabled + And I should see a button named "Set evaluation period" + And I should see "Alter evaluationperiod for special courses" + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an idnumber I should see this evasys-course + If there are any mapped courses I should see those + This should be valid regardless of mapped courses being set to one or none + Given category 1 is in auto mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And students enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to true + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And I should see "Evaluationperiod has been set" + And the submitbutton should be enabled + And I should see a button named "Set evaluation period" + And I should see "Alter evaluationperiod for special courses" + And I should see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are any mapped courses I should see those + Given category 1 is in auto mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And students enrolled in course C1 + And there is no idnumber mapped to course C1 + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And I should see "Evaluationperiod has been set" + And the submitbutton should be enabled + And I should see a button named "Set evaluation period" + And I should not see "Alter evaluationperiod for special courses" + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an idnumber I should see this evasys-course + If there are any mapped courses I should see those + This should be valid regardless of mapped courses being set to one, multi or none + Given category 1 is in auto mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And students enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And I should see "Evaluationperiod has been set" + And the submitbutton should be enabled + And I should see a button named "Set evaluation period" + And I should not see "Alter evaluationperiod for special courses" + And I should see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are any mapped courses I should see those + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And there is no idnumber mapped to course C1 + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And I should see "Evaluationperiod has been set" + And the submitbutton should be enabled + And I should see a button named "Set evaluation period" + And I should not see "Alter evaluationperiod for special courses" + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an idnumber I should see this evasys-course + If there are any mapped courses I should see those + This should be valid regardless of mapped courses being set to one, multi or none + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And I should see "Evaluationperiod has been set" + And the submitbutton should be enabled + And I should see a button named "Set evaluation period" + And I should not see "Alter evaluationperiod for special courses" + And I should see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are any mapped courses I should see those + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And there is no idnumber mapped to course C1 + And there are 1 closed Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to true + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And I should see "Evaluationperiod has been set" + And the submitbutton should be enabled + And I should see a button named "Set evaluation period" + And I should see "There are some closed surveys, but all surveys should be open." + And I should see "Alter evaluationperiod for special courses" + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an idnumber I should see this evasys-course + If there are any mapped courses I should see those + This should be valid regardless of mapped courses being set to one, multi or none + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber of course C1 links to a closed Evasyscourse + And there are 1 closed Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to true + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And I should see "Evaluationperiod has been set" + And the submitbutton should be enabled + And I should see a button named "Set evaluation period" + And I should see "There are some closed surveys, but all surveys should be open." + And I should see "Alter evaluationperiod for special courses" + And I should see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are any mapped courses I should see those + Given category 1 is in auto mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And students enrolled in course C1 + And there is no idnumber mapped to course C1 + And there are 1 closed Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to true + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And I should see "Evaluationperiod has been set" + And the submitbutton should be enabled + And I should see a button named "Set evaluation period" + And I should see "There are some closed surveys, but all surveys should be open." + And I should see "Alter evaluationperiod for special courses" + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an idnumber I should see this evasys-course + If there are any mapped courses I should see those + This should be valid regardless of mapped courses being set to one, multi or none + Given category 1 is in auto mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And students enrolled in course C1 + And the idnumber of course C1 links to a closed Evasyscourse + And there are 1 closed Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to true + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And I should see "Evaluationperiod has been set" + And the submitbutton should be enabled + And I should see a button named "Set evaluation period" + And I should see "There are some closed surveys, but all surveys should be open." + And I should see "Alter evaluationperiod for special courses" + And I should see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are any mapped courses I should see those + Given category 1 is in auto mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And students enrolled in course C1 + And there is no idnumber mapped to course C1 + And there are 1 closed Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And I should see "Evaluationperiod has been set" + And the submitbutton should be enabled + And I should see a button named "Set evaluation period" + And I should see "There are some closed surveys, but all surveys should be open." + And I should not see "Alter evaluationperiod for special courses" + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an idnumber I should see this evasys-course + If there are any mapped courses I should see those + This should be valid regardless of mapped courses being set to one, multi or none + Given category 1 is in auto mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And students enrolled in course C1 + And the idnumber of course C1 links to a closed Evasyscourse + And there are 1 closed Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And I should see "Evaluationperiod has been set" + And the submitbutton should be enabled + And I should see a button named "Set evaluation period" + And I should see "There are some closed surveys, but all surveys should be open." + And I should not see "Alter evaluationperiod for special courses" + And I should see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are any mapped courses I should see those + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And there is no idnumber mapped to course C1 + And there are 1 closed Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And I should see "Evaluationperiod has been set" + And the submitbutton should be enabled + And I should see a button named "Set evaluation period" + And I should see "There are some closed surveys, but all surveys should be open." + And I should not see "Alter evaluationperiod for special courses" + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an idnumber I should see this evasys-course + If there are any mapped courses I should see those + This should be valid regardless of mapped courses being set to one, multi or none + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber of course C1 links to a closed Evasyscourse + And there are 1 closed Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And I should see "Evaluationperiod has been set" + And the submitbutton should be enabled + And I should see a button named "Set evaluation period" + And I should see "There are some closed surveys, but all surveys should be open." + And I should not see "Alter evaluationperiod for special courses" + And I should see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are any mapped courses I should see those + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And there is no idnumber mapped to course C1 + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "opened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And the startselector should be disabled + And the submitbutton should be enabled + And I should not see "Alter evaluationperiod for special courses" + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an idnumber I should see this evasys-course + If there are any mapped courses I should see those + This should be valid regardless of mapped courses being set to one, multi or none + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "opened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And the startselector should be disabled + And the submitbutton should be enabled + And I should not see "Alter evaluationperiod for special courses" + And I should see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are any mapped courses I should see those + If there are surveys that don't match the internal state I should see a warning + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And there is no idnumber mapped to course C1 + And there are 1 closed Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "opened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And the startselector should be disabled + And the submitbutton should be enabled + And I should see "There are some closed surveys, but all surveys should be open." + And I should not see "Alter evaluationperiod for special courses" + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an idnumber I should see this evasys-course + If there are any mapped courses I should see those + This should be valid regardless of mapped courses being set to one, multi or none + If there are surveys that don't match the internal state I should see a warning + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber of course C1 links to a closed Evasyscourse + And there are 1 closed Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "opened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And the startselector should be disabled + And the submitbutton should be enabled + And I should see "There are some closed surveys, but all surveys should be open." + And I should not see "Alter evaluationperiod for special courses" + And I should see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are any mapped courses I should see those + If there are surveys that don't match the internal state I should see a warning + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And there is no idnumber mapped to course C1 + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "closed" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And I should see "There are some open surveys, but all surveys should be closed." + And I should not see "Alter evaluationperiod for special courses" + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an idnumber I should see this evasys-course + If there are any mapped courses I should see those + This should be valid regardless of mapped courses being set to one, multi or none + If there are surveys that don't match the internal state I should see a warning + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "closed" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And I should see "There are some open surveys, but all surveys should be closed." + And I should not see "Alter evaluationperiod for special courses" + And I should see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an idnumber I should see this evasys-course + If there are any mapped courses I should see those + Given category 1 is in auto mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And students enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And there are 2 open Evasyscourses mapped to course with shortname C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And the submitbutton should be enabled + And I should see a button named "Set evaluation period" + And I should see "Alter evaluationperiod for special courses" + And I should see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are any mapped courses I should see those + Given category 1 is in auto mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And students enrolled in course C1 + And there is no idnumber mapped to course C1 + And there are 1 open Evasyscourses mapped to course with shortname C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And the submitbutton should be enabled + And I should see a button named "Set evaluation period" + And I should see "Alter evaluationperiod for special courses" + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an idnumber I should see this evasys-course + If there are any mapped courses I should see those + This should be valid regardless of mapped courses being set to one or none + Given category 1 is in auto mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And students enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And there are 1 open Evasyscourses mapped to course with shortname C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And the submitbutton should be enabled + And I should see a button named "Set evaluation period" + And I should see "Alter evaluationperiod for special courses" + And I should see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are any mapped courses I should see those + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And there is no idnumber mapped to course C1 + And there are 1 open Evasyscourses mapped to course with shortname C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And the submitbutton should be enabled + And I should see a button named "Set evaluation period" + And I should not see "Alter evaluationperiod for special courses" + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an idnumber I should see this evasys-course + If there are any mapped courses I should see those + This should be valid regardless of mapped courses being set to one, multi or none + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And there are 1 open Evasyscourses mapped to course with shortname C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And the submitbutton should be enabled + And I should see a button named "Set evaluation period" + And I should not see "Alter evaluationperiod for special courses" + And I should see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are any mapped courses I should see those + Given category 1 is in auto mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And students enrolled in course C1 + And there is no idnumber mapped to course C1 + And there are 1 closed Evasyscourses mapped to course with shortname C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And I should see a button named "Set evaluation period" + And I should see "There are some closed surveys, but all surveys should be open." + And I should see "Alter evaluationperiod for special courses" + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an idnumber I should see this evasys-course + If there are any mapped courses I should see those + This should be valid regardless of mapped courses being set to one, multi or none + Given category 1 is in auto mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And students enrolled in course C1 + And the idnumber of course C1 links to a closed Evasyscourse + And there are 1 closed Evasyscourses mapped to course with shortname C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And I should see a button named "Set evaluation period" + And I should see "There are some closed surveys, but all surveys should be open." + And I should see "Alter evaluationperiod for special courses" + And I should see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there are any mapped courses I should see those + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And there is no idnumber mapped to course C1 + And there are 1 closed Evasyscourses mapped to course with shortname C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And I should see a button named "Set evaluation period" + And I should see "There are some closed surveys, but all surveys should be open." + And I should not see "Alter evaluationperiod for special courses" + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an idnumber I should see this evasys-course + If there are any mapped courses I should see those + This should be valid regardless of mapped courses being set to one, multi or none + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber of course C1 links to a closed Evasyscourse + And there are 1 closed Evasyscourses mapped to course with shortname C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + And I should see a button named "Set evaluation period" + And I should see "There are some closed surveys, but all surveys should be open." + And I should not see "Alter evaluationperiod for special courses" + And I should see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an invalid idnumber I should see a warning + If there are surveys that don't match the internal state I should see a warning + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber for course C1 is invalid + And no courses are mapped to course C1 + And the internal state of course C1 is "opened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + And the startselector should be disabled + And I should not see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an invalid idnumber I should see a warning + If there are surveys that don't match the internal state I should see a warning + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber for course C1 is invalid + And no courses are mapped to course C1 + And the internal state of course C1 is "closed" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + And both selectors should be disabled + And I should not see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an invalid idnumber I should see a warning + If there are invalid mappings I should see a warning + If there are surveys that don't match the internal state I should see a warning + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber for course C1 is invalid + And only invalid mappings are present for course C1 + And the internal state of course C1 is "opened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + Then I should see "One of the dynamically mapped evasys-courses is invalid" + And the startselector should be disabled + And I should not see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an invalid idnumber I should see a warning + If there are invalid mappings I should see a warning + If there are surveys that don't match the internal state I should see a warning + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber for course C1 is invalid + And only invalid mappings are present for course C1 + And the internal state of course C1 is "closed" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + Then I should see "One of the dynamically mapped evasys-courses is invalid" + And both selectors should be disabled + And I should not see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an invalid idnumber I should see a warning + If there are any mapped courses I should see those + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber for course C1 is invalid + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to true + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + And I should see "Evaluationperiod has been set" + And the submitbutton should be enabled + And I should see a button named "Set evaluation period" + And I should see "Alter evaluationperiod for special courses" + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an invalid idnumber I should see a warning + If there are any mapped courses I should see those + Given category 1 is in auto mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And students enrolled in course C1 + And the idnumber for course C1 is invalid + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to true + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + And I should see "Evaluationperiod has been set" + And the submitbutton should be enabled + And I should see a button named "Set evaluation period" + And I should see "Alter evaluationperiod for special courses" + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an invalid idnumber I should see a warning + If there are any mapped courses I should see those + Given category 1 is in auto mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And students enrolled in course C1 + And the idnumber for course C1 is invalid + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + And I should see "Evaluationperiod has been set" + And the submitbutton should be enabled + And I should see a button named "Set evaluation period" + And I should not see "Alter evaluationperiod for special courses" + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an invalid idnumber I should see a warning + If there are any mapped courses I should see those + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber for course C1 is invalid + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + And I should see "Evaluationperiod has been set" + And the submitbutton should be enabled + And I should see a button named "Set evaluation period" + And I should not see "Alter evaluationperiod for special courses" + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an invalid idnumber I should see a warning + If there are any mapped courses I should see those + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber for course C1 is invalid + And there are 1 closed Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to true + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + And I should see "Evaluationperiod has been set" + And the submitbutton should be enabled + And I should see a button named "Set evaluation period" + And I should see "There are some closed surveys, but all surveys should be open." + And I should see "Alter evaluationperiod for special courses" + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an invalid idnumber I should see a warning + If there are any mapped courses I should see those + Given category 1 is in auto mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And students enrolled in course C1 + And the idnumber for course C1 is invalid + And there are 1 closed Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to true + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + And I should see "Evaluationperiod has been set" + And the submitbutton should be enabled + And I should see a button named "Set evaluation period" + And I should see "There are some closed surveys, but all surveys should be open." + And I should see "Alter evaluationperiod for special courses" + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an invalid idnumber I should see a warning + If there are any mapped courses I should see those + Given category 1 is in auto mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And students enrolled in course C1 + And the idnumber for course C1 is invalid + And there are 1 closed Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + And I should see "Evaluationperiod has been set" + And the submitbutton should be enabled + And I should see a button named "Set evaluation period" + And I should see "There are some closed surveys, but all surveys should be open." + And I should not see "Alter evaluationperiod for special courses" + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an invalid idnumber I should see a warning + If there are any mapped courses I should see those + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber for course C1 is invalid + And there are 1 closed Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + And I should see "Evaluationperiod has been set" + And the submitbutton should be enabled + And I should see a button named "Set evaluation period" + And I should see "There are some closed surveys, but all surveys should be open." + And I should not see "Alter evaluationperiod for special courses" + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an invalid idnumber I should see a warning + If there are any mapped courses I should see those + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber for course C1 is invalid + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "opened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + And the startselector should be disabled + And the submitbutton should be enabled + And I should not see "Alter evaluationperiod for special courses" + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an invalid idnumber I should see a warning + If there are any mapped courses I should see those + If there are surveys that don't match the internal state I should see a warning + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber for course C1 is invalid + And there are 1 closed Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "opened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + And the startselector should be disabled + And the submitbutton should be enabled + And I should see "There are some closed surveys, but all surveys should be open." + And I should not see "Alter evaluationperiod for special courses" + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an invalid idnumber I should see a warning + If there are any mapped courses I should see those + If there are surveys that don't match the internal state I should see a warning + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber for course C1 is invalid + And there are 1 open Evasyscourses mapped to course with shortname C1 + And the internal state of course C1 is "closed" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + And I should see "There are some open surveys, but all surveys should be closed." + And I should not see "Alter evaluationperiod for special courses" + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an invalid idnumber I should see a warning + If there are any mapped courses I should see those + Given category 1 is in auto mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And students enrolled in course C1 + And the idnumber for course C1 is invalid + And there are 1 open Evasyscourses mapped to course with shortname C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + And the submitbutton should be enabled + And I should see a button named "Set evaluation period" + And I should see "Alter evaluationperiod for special courses" + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an invalid idnumber I should see a warning + If there are any mapped courses I should see those + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber for course C1 is invalid + And there are 1 open Evasyscourses mapped to course with shortname C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + And the submitbutton should be enabled + And I should see a button named "Set evaluation period" + And I should not see "Alter evaluationperiod for special courses" + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an invalid idnumber I should see a warning + If there are any mapped courses I should see those + Given category 1 is in auto mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And students enrolled in course C1 + And the idnumber for course C1 is invalid + And there are 1 closed Evasyscourses mapped to course with shortname C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + And I should see a button named "Set evaluation period" + And I should see "There are some closed surveys, but all surveys should be open." + And I should see "Alter evaluationperiod for special courses" + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an invalid idnumber I should see a warning + If there are any mapped courses I should see those + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber for course C1 is invalid + And there are 1 closed Evasyscourses mapped to course with shortname C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "The hard linked evasys-course is invalid!" + And I should see a button named "Set evaluation period" + And I should see "There are some closed surveys, but all surveys should be open." + And I should not see "Alter evaluationperiod for special courses" + And I should not see "IdnumberSurvey" + And I should see "DynamicSurvey0" + And I should not see "DynamicSurvey1" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an idnumber I should see this evasys-course + If there are invalid mappings I should see a warning + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And only invalid mappings are present for course C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to true + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + And I should see "Evaluationperiod has been set" + And the submitbutton should be enabled + And I should see a button named "Set evaluation period" + And I should see "Alter evaluationperiod for special courses" + And I should see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an idnumber I should see this evasys-course + If there are invalid mappings I should see a warning + Given category 1 is in auto mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And students enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And only invalid mappings are present for course C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + And I should see "Evaluationperiod has been set" + And the submitbutton should be enabled + And I should see a button named "Set evaluation period" + And I should not see "Alter evaluationperiod for special courses" + And I should see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an idnumber I should see this evasys-course + If there are invalid mappings I should see a warning + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And only invalid mappings are present for course C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + And I should see "Evaluationperiod has been set" + And the submitbutton should be enabled + And I should see a button named "Set evaluation period" + And I should not see "Alter evaluationperiod for special courses" + And I should see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an idnumber I should see this evasys-course + If there are invalid mappings I should see a warning + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber of course C1 links to a closed Evasyscourse + And only invalid mappings are present for course C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to true + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + And I should see "Evaluationperiod has been set" + And the submitbutton should be enabled + And I should see a button named "Set evaluation period" + And I should see "There are some closed surveys, but all surveys should be open." + And I should see "Alter evaluationperiod for special courses" + And I should see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an idnumber I should see this evasys-course + If there are invalid mappings I should see a warning + Given category 1 is in auto mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And students enrolled in course C1 + And the idnumber of course C1 links to a closed Evasyscourse + And only invalid mappings are present for course C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to true + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + And I should see "Evaluationperiod has been set" + And the submitbutton should be enabled + And I should see a button named "Set evaluation period" + And I should see "There are some closed surveys, but all surveys should be open." + And I should see "Alter evaluationperiod for special courses" + And I should see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an idnumber I should see this evasys-course + If there are invalid mappings I should see a warning + Given category 1 is in auto mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And students enrolled in course C1 + And the idnumber of course C1 links to a closed Evasyscourse + And only invalid mappings are present for course C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + And I should see "Evaluationperiod has been set" + And the submitbutton should be enabled + And I should see a button named "Set evaluation period" + And I should see "There are some closed surveys, but all surveys should be open." + And I should not see "Alter evaluationperiod for special courses" + And I should see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an idnumber I should see this evasys-course + If there are invalid mappings I should see a warning + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber of course C1 links to a closed Evasyscourse + And only invalid mappings are present for course C1 + And the internal state of course C1 is "notopened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + And I should see "Evaluationperiod has been set" + And the submitbutton should be enabled + And I should see a button named "Set evaluation period" + And I should see "There are some closed surveys, but all surveys should be open." + And I should not see "Alter evaluationperiod for special courses" + And I should see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an idnumber I should see this evasys-course + If there are invalid mappings I should see a warning + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And only invalid mappings are present for course C1 + And the internal state of course C1 is "opened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + And the startselector should be disabled + And the submitbutton should be enabled + And I should not see "Alter evaluationperiod for special courses" + And I should see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an idnumber I should see this evasys-course + If there are invalid mappings I should see a warning + If there are surveys that don't match the internal state I should see a warning + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber of course C1 links to a closed Evasyscourse + And only invalid mappings are present for course C1 + And the internal state of course C1 is "opened" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + And the startselector should be disabled + And the submitbutton should be enabled + And I should see "There are some closed surveys, but all surveys should be open." + And I should not see "Alter evaluationperiod for special courses" + And I should see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an idnumber I should see this evasys-course + If there are invalid mappings I should see a warning + If there are surveys that don't match the internal state I should see a warning + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And only invalid mappings are present for course C1 + And the internal state of course C1 is "closed" + And the recordstandardtimemode for course C1 is set to false + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + And I should see "There are some open surveys, but all surveys should be closed." + And I should not see "Alter evaluationperiod for special courses" + And I should see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an idnumber I should see this evasys-course + If there are invalid mappings I should see a warning + Given category 1 is in auto mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And students enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And only invalid mappings are present for course C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + And the submitbutton should be enabled + And I should see a button named "Set evaluation period" + And I should see "Alter evaluationperiod for special courses" + And I should see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an idnumber I should see this evasys-course + If there are invalid mappings I should see a warning + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber of course C1 links to a open Evasyscourse + And only invalid mappings are present for course C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + And the submitbutton should be enabled + And I should see a button named "Set evaluation period" + And I should not see "Alter evaluationperiod for special courses" + And I should see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an idnumber I should see this evasys-course + If there are invalid mappings I should see a warning + Given category 1 is in auto mode + And category 1 is in standardtime mode with dates 1581043586 1582043586 + And students enrolled in course C1 + And the idnumber of course C1 links to a closed Evasyscourse + And only invalid mappings are present for course C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + And I should see a button named "Set evaluation period" + And I should see "There are some closed surveys, but all surveys should be open." + And I should see "Alter evaluationperiod for special courses" + And I should see "IdnumberSurvey" + And I should not see "DynamicSurvey" + + Scenario: If there is no standardtimemode I should not see the option to use it + If there is an idnumber I should see this evasys-course + If there are invalid mappings I should see a warning + Given category 1 is in auto mode + And category 1 is not in standardtime mode + And students enrolled in course C1 + And the idnumber of course C1 links to a closed Evasyscourse + And only invalid mappings are present for course C1 + And there is no internal record of course C1 + And the recordstandardtimemode for course C1 is not set + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + And I load the evasys block + Then I should see "One of the dynamically mapped evasys-courses is invalid" + And I should see a button named "Set evaluation period" + And I should see "There are some closed surveys, but all surveys should be open." + And I should not see "Alter evaluationperiod for special courses" + And I should see "IdnumberSurvey" + And I should not see "DynamicSurvey" diff --git a/tests/behat/generator/steps.py b/tests/behat/generator/steps.py new file mode 100644 index 0000000..cff2f81 --- /dev/null +++ b/tests/behat/generator/steps.py @@ -0,0 +1,237 @@ +from generator import coursename +import random +# Background +background = ' Background:\n\ + Given the following "users" exist:\n\ + | username | firstname | lastname | email |\n\ + | teacher1 | Teacher | 1 | teacher1@example.com |\n\ + | student1 | Student | 1 | student1@example.com |\n\ + | tutor1 | Tutor | 1 | tutor1@example.com |\n\ + And the following "courses" exist:\n\ + | fullname | shortname | category |\n\ + | Course 1 | C1 | 0 |\n\ + And the following "course enrolments" exist:\n\ + | user | course | role |\n\ + | teacher1 | C1 | editingteacher |\n\ + And I log in as "teacher1"\n\ + And I am on "Course 1" course homepage' + +feature_desc = "Tests all use-cases of the Evasys-block" + +# Descriptions +students_descriptions = { + "none": "If there are no students I should see a warning\n", + "onlytutors": "If there are only tutors I should see a warning\n", + "multi": "" +} + +standardtimemode_descriptions = { + 0: "If there is no standardtimemode I should not see the option to use it\n", + 1: "If there is a standartimemode I should see the option to use it\n" +} + +idnumber_descriptions = { + "none": "", + "invalid": "If there is an invalid idnumber I should see a warning\n", + "one": "If there is an idnumber I should see this evasys-course\n" +} + +mapped_descriptions = { + "none": "", + "invalid": "If there are invalid mappings I should see a warning\n", + "one": "If there are any mapped courses I should see those\n", + "multi": "If there are any mapped courses I should see those\n" +} + +# Environment configuration + +step_manual_auto_mode = { + "manual": "Given category {{category}} is in manual mode", + "auto": "Given category {{category}} is in auto mode" +} + +step_standardtime_mode = { + 0: "And category {{category}} is not in standardtime mode", + 1: "And category {{category}} is in standardtime mode with dates 1581043586 1582043586" +} + +step_internal_state = { + "notopened": "And the internal state of course {{course}} is \"notopened\"", + "opened": "And the internal state of course {{course}} is \"opened\"", + "closed": "And the internal state of course {{course}} is \"closed\"", + "manual": "And the internal state of course {{course}} is \"manual\"", + "none": "And there is no internal record of course {{course}}" +} + +step_record_standardtimemode = { + "norecordstandardtimemode": "And the recordstandardtimemode for course {{course}} is not set", + "recordstandardtimemode": "And the recordstandardtimemode for course {{course}} is set to true", + "recordnonstandardtimemode": "And the recordstandardtimemode for course {{course}} is set to false", +} + +step_students_state = { + "none": "And no students enrolled in course " + coursename, + "onlytutors": "And only tutors enrolled in course " + coursename, + "multi": "And students enrolled in course " + coursename +} + +inconsistent_mode = "Then I should see \"This evaluation was already started in another mode\"" + +# Checks + +automode_checks = { + "manual": "And I should see a button named \"Request evaluation\"", + "auto": 'And I should see a button named "Set evaluation period"' +} + +standardtimemode_checks = { + 0: "And I should not see \"Alter evaluationperiod for special courses\"", + 1: 'And I should see "Alter evaluationperiod for special courses"' +} + +student_checks = { + "none": "And I should see \"This course does not contain any students that can evaluate it.\"\n", + "onlytutors": 'And I should see \"This course does not contain any students that can evaluate it.\"\n', + "multi": "" +} + +idnumber_checks = { + "none": "", + "invalid": "Then I should see \"The hard linked evasys-course is invalid!\"\n", + "one": "" +} + +mapped_checks = { + "none": "", + "invalid": "Then I should see \"One of the dynamically mapped evasys-courses is invalid\"\n", + "one": "", + "multi": "" +} + +internal_state_checks = { + "notopened": "And I should see \"Evaluationperiod has been set\"\n", + "opened": "And the startselector should be disabled\n", + "closed": "And both selectors should be disabled\n", + "manual": "And I should see \"Evaluation has been requested\"\n", + "none": "" +} + +selector_disabled_checks = { + "both": "And both selectors should be disabled\n", + "start": "And the startselector should be disabled\n", + "none": "" +} + + +# The following Methods help to construct Behat steps. +# There are only methods when using a dict (like above) is either unnecessarry complicated +# needs preparation (from a state like "multi" to an array of surveys) +# or something has to be added programatically (like coursenames or ids) + + +def step_idnumberstate(state, openstate): + """ + :param state: idnumber state (none/invalid/one) + :return: String either creating none, an invalid or one evasys-course - moodle-course link via idnumber + """ + if state == "none": + return "And there is no idnumber mapped to course " + coursename + "\n" + elif state == "invalid": + return "And the idnumber for course " + coursename + " is invalid\n" + elif state == "one": + x = "And the idnumber of course " + coursename + " links to a " + openstate + " Evasyscourse" + "\n" + return x + + +def step_mappedstate(state, openstate): + """ + :param state: mapped state (none/invalid/one/multi) + :return: a string creating none, only invalid, one or multiple mappings of a moodle-course to evasys-courses + """ + if state == "none": + return "And no courses are mapped to course " + coursename + "\n" + elif state == "invalid": + return "And only invalid mappings are present for course " + coursename + "\n" + elif state == "one": + x = "And there are 1 " + openstate + " Evasyscourses mapped to course with shortname " + coursename + "\n" + return x + elif state == "multi": + x = "And there are 2 " + openstate + " Evasyscourses mapped to course with shortname " + coursename + "\n" + return x + + +def checks_standardtimemode(standardtime, auto_mode, internal_state, recordstandardtimemode): + """ + The standardtimemode check is a little tricky since the checkbox showing is dependent on 3 states + :param standardtime: standardtimemode + :param recordstandardtimemode: the recordstandardtimemode may overwrite the standardtimemode for the category + :param internal_state: internal state + :return: A string checking for the presence or absence of the standardtime checkbox + """ + if not recordstandardtimemode == "norecordstandardtimemode": + standardtime = 1 if recordstandardtimemode == "recordstandardtimemode" else 0 + if standardtime == 1 and (internal_state == "none" or internal_state == "notopened"): + return standardtimemode_checks[1] + return standardtimemode_checks[0] + + +def checks_internalstate(internal_state, actual_state, student_state, no_valid_mappings, mode, standardtime): + checks = "" + if standardtime and mode == "manual" and internal_state == "none": + return selector_disabled_checks["both"] + if no_valid_mappings: + actual_state = "does_never_get_called" + if ((internal_state == "opened" or internal_state == "closed" or (student_state == "none" or student_state == "onlytutors") + and internal_state != "none") + and not (internal_state == "closed" and (actual_state == "mixed" or actual_state == "open"))): + if internal_state == "opened": + checks += selector_disabled_checks["start"] + if not (student_state == "none" or student_state == "onlytutors") and not no_valid_mappings: + checks += "And the submitbutton should be enabled\n" + else: + checks += selector_disabled_checks["both"] + elif (internal_state == "manual" or internal_state == "none") and \ + (actual_state == "mixed" or actual_state == "closed") and mode == "manual": + checks += selector_disabled_checks["both"] + if not actual_state == "closed" and not actual_state == "mixed": + checks += internal_state_checks[internal_state] + elif not no_valid_mappings and (internal_state == "notopened" or internal_state == "manual" or internal_state == "none"): + if (internal_state == "manual" or internal_state == "none") and (actual_state == "closed" or actual_state == "mixed"): + return "" + checks += internal_state_checks[internal_state] + if not (student_state == "none" or student_state == "onlytutors") and not no_valid_mappings: + checks += "And the submitbutton should be enabled\n" + return checks + + +def postcheck_idnumber(idnumber_state): + if idnumber_state == "one": + return 'And I should see "IdnumberSurvey"\n' + else: + return 'And I should not see "IdnumberSurvey"\n' + + +def postcheck_mappedstate(mapped_state): + postchecks = "" + if mapped_state == "one": + postchecks += 'And I should see "DynamicSurvey0"\n' + postchecks += 'And I should not see "DynamicSurvey1"\n' + elif mapped_state == "multi": + postchecks += 'And I should see "DynamicSurvey0"\n' + postchecks += 'And I should see "DynamicSurvey1"\n' + else: + postchecks += 'And I should not see "DynamicSurvey"\n' + return postchecks + + +def description_modeconsistency(mode, internal_state, actual_state): + description = "" + # check if there is a mismatch in internal_state and mode (i.E. auto mode but manually opened internal state) + if ("manual" not in internal_state and "none" not in internal_state) and mode == {"manual"} or ( + internal_state == {"manual"} and mode != {"manual"}): + description += "If there are inconsistent modes I should see a warning\n" + # check if there is a mismatch between the internal state and the actual state (i.E. internal opened actually closed) + if (actual_state != {"open"} and internal_state == {"opened"}) or ( + internal_state == {"closed"} and actual_state != {"closed"}): + description += "If there are surveys that don't match the internal state I should see a warning\n" + return description diff --git a/tests/behat/show_block.feature b/tests/behat/show_block.feature new file mode 100644 index 0000000..f130fbe --- /dev/null +++ b/tests/behat/show_block.feature @@ -0,0 +1,35 @@ +@block @block_evasys_sync @block_evasys_sync_basictests +Feature: Show the evasys block + In order to use the evasys_block + as a teacher + I need to be able to show the evasys block + + Background: + Given the following "users" exist: + | username | firstname | lastname | email | + | teacher1 | Teacher | 1 | teacher1@example.com | + | student1 | Student | 1 | student1@example.com | + And the following "courses" exist: + | fullname | shortname | category | + | Course 1 | C1 | 0 | + And the following "course enrolments" exist: + | user | course | role | + | teacher1 | C1 | editingteacher | + | student1 | C1 | student | + And I log in as "teacher1" + And I am on "Course 1" course homepage + + Scenario: Add a block with no idnum + Given I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + Then I should see "Change mapping" + And I should not see "Name:" + + Scenario: Add a block with invalid idnum + Given The course C1 has idnumber 1 + And I turn editing mode on + And I add the "EvaSys Sync" block + And I turn editing mode off + Then I should not see "Change mapping" + And I should not see "Name:" \ No newline at end of file diff --git a/version.php b/version.php index ce1e0b4..9a5ea8d 100755 --- a/version.php +++ b/version.php @@ -18,7 +18,7 @@ defined('MOODLE_INTERNAL') || die(); $plugin->component = 'block_evasys_sync'; -$plugin->version = 2019203100; // YYYYMMDDHH (year, month, day, 24-hr time). +$plugin->version = 2020230410; // YYYYMMDDHH (year, month, day, 24-hr time). $plugin->requires = 2017111300; // YYYmoYMMDDHH (This is the release version for Moodle 2.0). $plugin->maturity = MATURITY_RC;