HEX
Server: Apache
System: Linux webm010.cluster103.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64
User: iestorre (46869)
PHP: 8.0.30
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/iestorre/moodleAW/moodle310/question/format/webct/tests/behat/importcalculated.feature
@qformat @qformat_webct
Feature: Test importing calculated question from WebCT format.
  In order to reuse calculated questions from a commercial LMS
  As a teacher
  I need to be able to import them in WebCT format.

  Background:
    Given the following "courses" exist:
      | fullname | shortname | format |
      | Course 1 | C1        | topics |
    And the following "users" exist:
      | username | firstname |
      | teacher  | Teacher   |
    And the following "course enrolments" exist:
      | user    | course | role           |
      | teacher | C1     | editingteacher |
    And I log in as "teacher"
    And I am on "Course 1" course homepage

  @javascript @_file_upload
  Scenario: import a WebCT calculated question
    When I navigate to "Import" node in "Course administration > Question bank"
    And I set the field "id_format_webct" to "1"
    And I upload "question/format/webct/tests/fixtures/sample_calculated_webct.txt" file to "Import" filemanager
    And I press "id_submitbutton"
    Then I should see "Parsing questions from import file."
    And I should see "Importing 1 questions from file"
    And I should see "Find the area in m2 of a square with sides of length {l} m."
    When I press "Continue"
    Then I should see "calculated: Square area"