diff --git a/.gitignore b/.gitignore index 67f0e883..a249b3c7 100644 --- a/.gitignore +++ b/.gitignore @@ -34,4 +34,4 @@ NonRepoFiles/* /amd/src/ui_blockly.json /amd/src/.eslintrc.js .grunt - +.vscode diff --git a/classes/jobesandbox.php b/classes/jobesandbox.php index 5a001712..810d349a 100644 --- a/classes/jobesandbox.php +++ b/classes/jobesandbox.php @@ -307,7 +307,7 @@ private function get_main_class($prog) { } } - + // Return the sandbox error code corresponding to the given httpcode. private function get_error_code($httpcode) { diff --git a/tests/behat/backup_and_restore.feature b/tests/behat/backup_and_restore.feature index 87065833..8d3d7355 100644 --- a/tests/behat/backup_and_restore.feature +++ b/tests/behat/backup_and_restore.feature @@ -5,7 +5,7 @@ Feature: Duplicate a course containing a CodeRunner question I need to be able to back them up and restore them Background: - And the following "courses" exist: + Given the following "courses" exist: | fullname | shortname | category | | Course 1 | C1 | 0 | And the following "question categories" exist: diff --git a/tests/behat/behat_coderunner.php b/tests/behat/behat_coderunner.php index 2ecaa8c2..a1066f2f 100644 --- a/tests/behat/behat_coderunner.php +++ b/tests/behat/behat_coderunner.php @@ -33,11 +33,30 @@ class behat_coderunner extends behat_base { * @Given /^the CodeRunner sandbox is enabled/ */ public function the_coderunner_sandbox_is_enabled() { - set_config('wsenabled', 1, 'qtype_coderunner'); set_config('jobesandbox_enabled', 1, 'qtype_coderunner'); - set_config('jobe_host', '172.17.0.1:4000', 'qtype_coderunner'); } + + /** + * Sets the webserver scratchpad to enabled for testing purposes. + * + * @Given /^the CodeRunner scratchpad is enabled/ + */ + public function the_coderunner_scratchpad_is_enabled() { + set_config('wsenabled', 1, 'qtype_coderunner'); + } + + + /** + * Sets the webserver scratchpad to disabled for testing purposes. + * + * @Given /^the CodeRunner scratchpad is disabled/ + */ + public function the_coderunner_scratchpad_is_disabled() { + set_config('wsenabled', 0, 'qtype_coderunner'); + } + + /** * Checks that a given string appears within answer textarea. * Intended for checking UI serialization diff --git a/tests/behat/scratchpad_ui_params.feature b/tests/behat/scratchpad_ui_params.feature index 2dd3d811..312f4889 100644 --- a/tests/behat/scratchpad_ui_params.feature +++ b/tests/behat/scratchpad_ui_params.feature @@ -5,7 +5,8 @@ Feature: Test the Scratchpad UI, UI Params I should be able specify the UI Parameters to change the Scratchpad UI Background: - Given the following "users" exist: + Given the CodeRunner scratchpad is enabled + And the following "users" exist: | username | firstname | lastname | email | | teacher1 | Teacher | 1 | teacher1@asd.com | And the following "courses" exist: @@ -20,7 +21,6 @@ Feature: Test the Scratchpad UI, UI Params And the following "questions" exist: | questioncategory | qtype | name | template | | Test questions | coderunner | Print answer | printans | - And the CodeRunner sandbox is enabled And I am on the "Print answer" "core_question > edit" page logged in as teacher1 And I set the field "id_validateonsave" to ""