This commit is contained in:
Andrew Nicols 2022-12-08 07:53:09 +08:00
commit 1e594c9777
4 changed files with 30 additions and 24 deletions

View file

@ -52,7 +52,7 @@
{{#questions}} {{#questions}}
<li class="list-group-item text-truncate"> <li class="list-group-item text-truncate">
{{#icon}}{{#pix}} {{key}}, {{component}}, {{{alttext}}} {{/pix}}{{/icon}} {{#icon}}{{#pix}} {{key}}, {{component}}, {{{alttext}}} {{/pix}}{{/icon}}
{{name}} {{{name}}}
</li> </li>
{{/questions}} {{/questions}}
</ul> </ul>

View file

@ -30,12 +30,14 @@ Feature: Adding random questions to a quiz based on category and tags
| Questions Category 1 | essay | question 2 name | teacher1 | Question 2 text | | Questions Category 1 | essay | question 2 name | teacher1 | Question 2 text |
| Subcategory | essay | question 3 name | teacher1 | Question 3 text | | Subcategory | essay | question 3 name | teacher1 | Question 3 text |
| Subcategory | essay | question 4 name | teacher1 | Question 4 text | | Subcategory | essay | question 4 name | teacher1 | Question 4 text |
| Questions Category 1 | essay | "listen" & "answer" | teacher1 | Question 5 text |
And the following "core_question > Tags" exist: And the following "core_question > Tags" exist:
| question | tag | | question | tag |
| question 1 name | foo | | question 1 name | foo |
| question 2 name | bar | | question 2 name | bar |
| question 3 name | foo | | question 3 name | foo |
| question 4 name | bar | | question 4 name | bar |
| "listen" & "answer" | foo |
Scenario: Available tags are shown in the autocomplete tag field Scenario: Available tags are shown in the autocomplete tag field
Given I am on the "Quiz 1" "mod_quiz > Edit" page logged in as "teacher1" Given I am on the "Quiz 1" "mod_quiz > Edit" page logged in as "teacher1"
@ -80,6 +82,8 @@ Feature: Adding random questions to a quiz based on category and tags
And I click on "(See questions)" "link" And I click on "(See questions)" "link"
Then I should see "Questions Category 1" Then I should see "Questions Category 1"
And I should see "foo" And I should see "foo"
And I should see "question 1 name"
And I should see "\"listen\" & \"answer\""
Scenario: Teacher without moodle/question:useall should not see the add a random question menu item Scenario: Teacher without moodle/question:useall should not see the add a random question menu item
Given the following "permission overrides" exist: Given the following "permission overrides" exist:

View file

@ -33,7 +33,7 @@
<b> <b>
<a title="{{#str}}editquestions, question{{/str}}" href="{{{questionbankurl}}}"> <a title="{{#str}}editquestions, question{{/str}}" href="{{{questionbankurl}}}">
{{categoryname}} {{{categoryname}}}
{{#idnumber}} {{#idnumber}}
<span class="badge badge-primary"> <span class="badge badge-primary">
<span class="accesshide"> <span class="accesshide">

View file

@ -20,6 +20,7 @@ Feature: A teacher can put questions in categories in the question bank
| Course | C1 | top | Default for C1 | | Course | C1 | top | Default for C1 |
| Course | C1 | Default for C1 | Subcategory | | Course | C1 | Default for C1 | Subcategory |
| Course | C1 | top | Used category | | Course | C1 | top | Used category |
| Course | C1 | top | Default & testing |
And the following "questions" exist: And the following "questions" exist:
| questioncategory | qtype | name | questiontext | | questioncategory | qtype | name | questiontext |
| Used category | essay | Test question to be moved | Write about whatever you want | | Used category | essay | Test question to be moved | Write about whatever you want |
@ -30,18 +31,18 @@ Feature: A teacher can put questions in categories in the question bank
When I am on the "Course 1" "core_question > course question categories" page When I am on the "Course 1" "core_question > course question categories" page
And I follow "Add category" And I follow "Add category"
And I set the following fields to these values: And I set the following fields to these values:
| Name | New Category 1 | | Name | 'Test' & 'display' |
| Parent category | Top | | Parent category | Default & testing |
| Category info | Created as a test | | Category info | Created for testing category, HTML entity & its encoding |
| ID number | newcatidnumber | | ID number | newcatidnumber |
And I press "submitbutton" And I press "submitbutton"
Then I should see "New Category 1" Then I should see "Default & testing"
And I should see "ID number" And I should see "ID number"
And I should see "newcatidnumber" And I should see "newcatidnumber"
And I should see "(0)" And I should see "(0)"
And I should see "Created as a test" in the "New Category 1" "list_item" And I should see "Created for testing category, HTML entity & its encoding" in the "'Test' & 'display'" "list_item"
And I follow "Add category" And I follow "Add category"
And "New Category 1 [newcatidnumber]" "option" should exist in the "Parent category" "select" And "'Test' & 'display' [newcatidnumber]" "option" should exist in the "Parent category" "select"
Scenario: A question category can be edited Scenario: A question category can be edited
When I am on the "Course 1" "core_question > course question categories" page When I am on the "Course 1" "core_question > course question categories" page
@ -63,6 +64,7 @@ Feature: A teacher can put questions in categories in the question bank
When I am on the "Course 1" "core_question > course question categories" page When I am on the "Course 1" "core_question > course question categories" page
And I click on "Delete" "link" in the "Used category" "list_item" And I click on "Delete" "link" in the "Used category" "list_item"
And I should see "The category 'Used category' contains 1 questions" And I should see "The category 'Used category' contains 1 questions"
And I select "Default for C1" from the "Category" singleselect
And I press "Save in category" And I press "Save in category"
Then I should not see "Used category" Then I should not see "Used category"
And I follow "Add category" And I follow "Add category"