-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #220 from lucaboesch/fixci
Fix Moodle Plugin CI integration.
- Loading branch information
Showing
42 changed files
with
168 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,8 +21,8 @@ | |
* | ||
* This class is copied to CAPQuiz from the Core Quiz, without | ||
* modification (as of Fri 9 Sep 08:29:48 UTC 2022 ). | ||
* | ||
* @package mod_capquiz/mod_quiz | ||
* | ||
* @package mod_capquiz | ||
* @category question | ||
* @copyright 2009 Tim Hunt | ||
* @author 2021 Safat Shahin <[email protected]> | ||
|
@@ -33,15 +33,30 @@ class add_action_column extends \core_question\local\bank\action_column_base { | |
/** @var string caches a lang string used repeatedly. */ | ||
protected $stradd; | ||
|
||
/** | ||
* A chance for subclasses to initialise themselves, for example to load lang strings, | ||
* without having to override the constructor. | ||
*/ | ||
public function init(): void { | ||
parent::init(); | ||
$this->stradd = get_string('addtoquiz', 'quiz'); | ||
} | ||
|
||
/** | ||
* Get the internal name for this column. Used as a CSS class name, | ||
* and to store information about the current sort. Must match PARAM_ALPHA. | ||
* | ||
* @return string column name. | ||
*/ | ||
public function get_name() { | ||
return 'addtoquizaction'; | ||
} | ||
|
||
/** | ||
* Output the contents of this column. | ||
* @param object $question the row from the $question table, augmented with extra information. | ||
* @param string $rowclasses CSS class names that should be applied to this row of output. | ||
*/ | ||
protected function display_content($question, $rowclasses) { | ||
if (!question_has_capability_on($question, 'use')) { | ||
return; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,8 +23,8 @@ | |
* | ||
* This class is copied to CAPQuiz from the Core Quiz, without | ||
* modification (as of Fri 9 Sep 08:29:48 UTC 2022 ). | ||
* | ||
* @package mod_capquiz/mod_quiz | ||
* | ||
* @package mod_capquiz | ||
* @category question | ||
* @copyright 2009 Tim Hunt | ||
* @author 2021 Safat Shahin <[email protected]> | ||
|
@@ -37,14 +37,31 @@ class question_name_column extends \core_question\local\bank\column_base { | |
*/ | ||
protected $checkboxespresent = null; | ||
|
||
/** | ||
* Get the internal name for this column. Used as a CSS class name, | ||
* and to store information about the current sort. Must match PARAM_ALPHA. | ||
* | ||
* @return string column name. | ||
*/ | ||
public function get_name(): string { | ||
return 'questionname'; | ||
} | ||
|
||
/** | ||
* Title for this column. Not used if is_sortable returns an array. | ||
* | ||
* @return string column title. | ||
*/ | ||
public function get_title(): string { | ||
return get_string('question'); | ||
} | ||
|
||
/** | ||
* Lable for this column. | ||
* | ||
* @param object $question the row from the $question table, augmented with extra information. | ||
* @return string column label. | ||
*/ | ||
protected function label_for($question): string { | ||
if (is_null($this->checkboxespresent)) { | ||
$this->checkboxespresent = $this->qbank->has_column('core_question\local\bank\checkbox_column'); | ||
|
@@ -56,6 +73,11 @@ protected function label_for($question): string { | |
} | ||
} | ||
|
||
/** | ||
* Output the contents of this column. | ||
* @param object $question the row from the $question table, augmented with extra information. | ||
* @param string $rowclasses CSS class names that should be applied to this row of output. | ||
*/ | ||
protected function display_content($question, $rowclasses): void { | ||
$labelfor = $this->label_for($question); | ||
if ($labelfor) { | ||
|
@@ -67,10 +89,29 @@ protected function display_content($question, $rowclasses): void { | |
} | ||
} | ||
|
||
/** | ||
* Use table alias 'q' for the question table, or one of the | ||
* ones from get_extra_joins. Every field requested must specify a table prefix. | ||
* | ||
* @return array fields required. | ||
*/ | ||
public function get_required_fields(): array { | ||
return ['q.id', 'q.name']; | ||
} | ||
|
||
/** | ||
* Can this column be sorted on? You can return either: | ||
* + false for no (the default), | ||
* + a field name, if sorting this column corresponds to sorting on that datbase field. | ||
* + an array of subnames to sort on as follows | ||
* return [ | ||
* 'firstname' => ['field' => 'uc.firstname', 'title' => get_string('firstname')], | ||
* 'lastname' => ['field' => 'uc.lastname', 'title' => get_string('lastname')], | ||
* ]; | ||
* As well as field, and field, you can also add 'revers' => 1 if you want the default sort | ||
* order to be DESC. | ||
* @return mixed as above. | ||
*/ | ||
public function is_sortable() { | ||
return 'q.name'; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.