This commit is contained in:
Huong Nguyen
2024-05-21 09:43:31 +07:00
2 changed files with 11 additions and 6 deletions
@@ -53,6 +53,8 @@ class edit_action_bar extends base_action_bar {
* @return array
*/
public function get_items(): array {
global $DB;
$url = new moodle_url('/mod/feedback/view.php', ['id' => $this->cmid]);
$items['left'][]['actionlink'] = new action_link($url, get_string('back'), null, ['class' => 'btn btn-secondary']);
@@ -82,12 +84,14 @@ class edit_action_bar extends base_action_bar {
'typ', feedback_load_feedback_items_options());
$items['left'][]['singleselect'] = $select;
$exporturl = new moodle_url('/mod/feedback/export.php', $this->urlparams + ['action' => 'exportfile']);
$items['export'] = new action_link(
$exporturl,
get_string('export_questions', 'feedback'),
null,
['class' => 'btn btn-secondary']);
if ($DB->record_exists('feedback_item', ['feedback' => $this->feedback->id])) {
$items['export'] = new action_link(
new moodle_url('/mod/feedback/export.php', $this->urlparams + ['action' => 'exportfile']),
get_string('export_questions', 'feedback'),
null,
['class' => 'btn btn-secondary'],
);
}
}
}
@@ -24,6 +24,7 @@ Feature: Exporting and importing feedbacks
Scenario: Export sample feedback and compare with the fixture
When I am on the "Learning experience" "feedback activity" page logged in as teacher
And I click on "Edit questions" "link" in the "[role=main]" "css_element"
And "Export questions" "link" should not exist in the ".tertiary-navigation" "css_element"
And I add a "Information" question to the feedback with:
| Question | this is an information question |
| Label | info |