From fe8b2a5088132f1c72fdf20ac52dfceda066c4d0 Mon Sep 17 00:00:00 2001 From: Kasra Habib Date: Wed, 30 Nov 2022 17:04:41 +0100 Subject: [PATCH] plug-in renamed to slidefinder --- README.md | 22 +- ...erence_finder.php => block_slidefinder.php | 12 +- db/access.php | 6 +- db/services.php | 10 +- externallib.php | 24 +-- ...rence_finder.php => block_slidefinder.php} | 4 +- ...rence_finder.php => block_slidefinder.php} | 4 +- locallib.php | 22 +- .../.github/workflows/coding-standards.yml | 37 ++++ .../workflows/continuous-integration.yml | 197 ++++++++++++++++++ pdfparser/.github/workflows/performance.yml | 30 +++ renderer.php | 4 +- templates/lrf_drop_down.mustache | 6 +- templates/lrf_search.mustache | 14 +- version.php | 6 +- 15 files changed, 331 insertions(+), 67 deletions(-) rename block_lecture_reference_finder.php => block_slidefinder.php (90%) rename lang/de/{block_lecture_reference_finder.php => block_slidefinder.php} (88%) rename lang/en/{block_lecture_reference_finder.php => block_slidefinder.php} (92%) create mode 100644 pdfparser/.github/workflows/coding-standards.yml create mode 100644 pdfparser/.github/workflows/continuous-integration.yml create mode 100644 pdfparser/.github/workflows/performance.yml diff --git a/README.md b/README.md index c0ec1a0..43bc31f 100644 --- a/README.md +++ b/README.md @@ -4,18 +4,18 @@ **English version please see below** -Das Plugin wurde entwickelt, um ein Suchfeld für die Textsuche nach Begriffen in Moodle-Büchern mit bildbasierten Folien bereitzustellen. Es erfordert, dass zu jedem Buch ein durchsuchbares PDF (fast) gleichen Namens bereit gestellt wird, dessen Seiten 1:1 zu den Seiten im Buch passen. Das PDF muss im selben Abschnitt wie das Buch liegen. Die Namen von Buch und PDF müssen identisch sein, ausgenommen ist in Klammern spezifizierter Text innerhalb der Namen. +Das Plugin wurde entwickelt, um ein Suchfeld für die Textsuche nach Begriffen in Moodle-Büchern mit bildbasierten Folien bereitzustellen. Es erfordert, dass zu jedem Buch ein durchsuchbares PDF (fast) gleichen Namens bereit gestellt wird, dessen Seiten 1:1 zu den Seiten im Buch passen. Das PDF muss im selben Abschnitt wie das Buch liegen. Die Namen von Buch und PDF müssen identisch sein, ausgenommen ist in Klammern spezifizierter Text innerhalb der Namen. -Das Plugin sucht in allen PDFs nach den Begriffen und zeigt die Resultate als eine Liste von Links an. Durch Klicken auf den gewünschten Link wird die Seite mit der entsprechenden Seitennummer im Buch angezeigt. +Das Plugin sucht in allen PDFs nach den Begriffen und zeigt die Resultate als eine Liste von Links an. Durch Klicken auf den gewünschten Link wird die Seite mit der entsprechenden Seitennummer im Buch angezeigt. -Die Suchfunktion steht zur Verfügung, wenn man einen entsprechenden Block konfiguriert (s.u.). Alternativ kann sie über einen Webservice erreicht werden. Die Konfiguration des Web Service ist ebenfalls unten beschrieben. +Die Suchfunktion steht zur Verfügung, wenn man einen entsprechenden Block konfiguriert (s.u.). Alternativ kann sie über einen Webservice erreicht werden. Die Konfiguration des Web Service ist ebenfalls unten beschrieben. ## English description -The plugin was developed to provide a search field for text search in Moodle books with image-based slides. The plugin requires that a PDF of (almost) the same name is present in the same course section. The pages of the PDF need to correspond 1-1 to the pages in the book. Names of book and PDF need to be identical, except for text specified in brackets inside their names. - - The plugin searches all PDFs for the text and then displays the search results as a list of links. Clicking on a link shows the respective page with the corresponding number inside the book. - +The plugin was developed to provide a search field for text search in Moodle books with image-based slides. The plugin requires that a PDF of (almost) the same name is present in the same course section. The pages of the PDF need to correspond 1-1 to the pages in the book. Names of book and PDF need to be identical, except for text specified in brackets inside their names. + + The plugin searches all PDFs for the text and then displays the search results as a list of links. Clicking on a link shows the respective page with the corresponding number inside the book. + # Usage and API configuration @@ -40,13 +40,13 @@ This involves the following steps: 2. Enable protocols: Her, enable the REST protocol if not already enabled. 3. Create a specified user 4. Check user capability: The specified user has to have at least the __webservice/rest:use__ capability. -5. Select a service: Add the "Lecture Reference Finder" to custom services. -6. Add functions: Add the "block_lecture_reference_finder_get_searched_locations" function to the "Lecture Reference Finder" service. +5. Select a service: Add the "Slide Finder" to custom services. +6. Add functions: Add the "block_slidefinder_get_searched_locations" function to the "Slide Finder" service. 7. Select a specified user: Add the web services user as an authorised user. 8. Create a token for a user: Create a token for the web services user. Test it by sending an http GET request to -'http://[yourmoodle]/webservice/rest/server.php?wstoken=[user-token]&wsfunction=block_lecture_reference_finder_get_searched_locations&moodlewsrestformat=json&search_string=[search_string]&course_id=[course_id]&context_length=[context_length]' +'http://[yourmoodle]/webservice/rest/server.php?wstoken=[user-token]&wsfunction=block_slidefinder_get_searched_locations&moodlewsrestformat=json&search_string=[search_string]&course_id=[course_id]&context_length=[context_length]' where - yourmoodle: domain of your moodle installation (as developer: probably localhost) - user-token: token received from moodle for a user which is allowed to use the web service @@ -80,7 +80,7 @@ Alternatively, you can run to complete the installation from the command line. ## Third-party APIs ## -Slide Finder plug-in relies on [pdfparser](https://github.com/smalot/pdfparser) package to extract data from PDF files. Pdfparser is a standalone PHP package under LGPLv3 license (see above: [thirdpartylibs.xml](https://github.com/SE-Stuttgart/kib3_moodleplugin_slidefinder/blob/main/thirdpartylibs.xml) for more details). +Slide Finder plug-in relies on [pdfparser](https://github.com/smalot/pdfparser) package to extract data from PDF files. Pdfparser is a standalone PHP package under LGPLv3 license (see above: [thirdpartylibs.xml](https://github.com/SE-Stuttgart/kib3_moodleplugin_slidefinder/blob/main/thirdpartylibs.xml) for more details). ## License ## diff --git a/block_lecture_reference_finder.php b/block_slidefinder.php similarity index 90% rename from block_lecture_reference_finder.php rename to block_slidefinder.php index f1f03f3..369a6eb 100644 --- a/block_lecture_reference_finder.php +++ b/block_slidefinder.php @@ -17,7 +17,7 @@ /** * Block core and UI * - * @package block_lecture_reference_finder + * @package block_slidefinder * @copyright University of Stuttgart * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -26,7 +26,7 @@ require_once(__DIR__ . '/../../config.php'); require_once(__DIR__ . '/locallib.php'); -class block_lecture_reference_finder extends block_base +class block_slidefinder extends block_base { /** * Set the initial properties for the block @@ -78,14 +78,14 @@ public function get_content() if ($view_course_selection) { - $text .= $renderer->render_from_template('block_lecture_reference_finder/lrf_drop_down', [ + $text .= $renderer->render_from_template('block_slidefinder/lrf_drop_down', [ 'action' => $PAGE->url, 'course_selector_param_name' => 'lrf_cid', 'course_selector_options' => block_lrf_select_course_options($course_id, $USER->id), ]); } if ($view_selected_course) { - $text .= $renderer->render_from_template('block_lecture_reference_finder/lrf_search', [ + $text .= $renderer->render_from_template('block_slidefinder/lrf_search', [ 'action' => $PAGE->url, 'cid' => $cid, 'lrf_cid' => $lrf_cid, @@ -107,9 +107,9 @@ public function get_content() /** * Returns the PDFs and their content (splitted in pages) for all eligable PDFs in the given course. - * + * * @param mixed $course course to search in. - * + * * @return array array of objects each holding one pdf page on content and some metadata */ function get_pdfs_content_from_course($course): array diff --git a/db/access.php b/db/access.php index 2e22266..7014ffe 100644 --- a/db/access.php +++ b/db/access.php @@ -17,7 +17,7 @@ /** * Capability definitions for this module. * - * @package block_lecture_reference_finder + * @package block_slidefinder * @copyright University of Stuttgart * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -25,7 +25,7 @@ $capabilities = array( - 'block/lecture_reference_finder:myaddinstance' => array( + 'block/slidefinder:myaddinstance' => array( 'captype' => 'write', 'contextlevel' => CONTEXT_SYSTEM, 'archetypes' => array( @@ -34,7 +34,7 @@ 'clonepermissionsfrom' => 'moodle/my:manageblocks' ), - 'block/lecture_reference_finder:addinstance' => array( + 'block/slidefinder:addinstance' => array( //'riskbitmask' => RISK_PERSONAL, 'captype' => 'write', 'contextlevel' => CONTEXT_BLOCK, diff --git a/db/services.php b/db/services.php index ed4bb9d..e9fb160 100644 --- a/db/services.php +++ b/db/services.php @@ -17,7 +17,7 @@ /** * Describes WebServices * - * @package block_lecture_reference_finder + * @package block_slidefinder * @copyright University of Stuttgart * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -25,19 +25,19 @@ $functions = array( // local_PLUGINNAME_FUNCTIONNAME is the name of the web service function that the client will call. - 'block_lecture_reference_finder_get_searched_locations' => array( + 'block_slidefinder_get_searched_locations' => array( //class containing the external function - 'classname' => 'block_lecture_reference_finder_external', + 'classname' => 'block_slidefinder_external', //external function name 'methodname' => 'get_searched_locations', //file containing the class/external function - not required if using namespaced auto-loading classes. // defaults to the service's externalib.php - 'classpath' => 'block/lecture_reference_finder/externallib.php', + 'classpath' => 'blocks/slidefinder/externallib.php', - // This documentation will be displayed in the generated API documentation + // This documentation will be displayed in the generated API documentation // (Administration > Plugins > Webservices > API documentation) 'description' => 'This is a web service for the chatbot from the University of Stuttgart.', diff --git a/externallib.php b/externallib.php index 7e470f6..bdecfb1 100644 --- a/externallib.php +++ b/externallib.php @@ -17,7 +17,7 @@ /** * Function for the WebService * - * @package block_lecture_reference_finder + * @package block_slidefinder * @copyright University of Stuttgart * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -25,7 +25,7 @@ require_once("$CFG->libdir/externallib.php"); -class block_lecture_reference_finder_external extends external_api +class block_slidefinder_external extends external_api { /** * Returns description of method parameter @@ -55,11 +55,11 @@ public static function get_searched_locations_parameters() /** * Get all occurences, their context and a link to the chapter of $search_string in the eligable $PDF-Book lectures in the given course. - * + * * @param string $search_string the string to search for * @param int $course_id id of the course to search in * @param int $context_length the size of the context snippet on each side of the found @param $seach_string occurences in words - * + * * @return string json encoded array of arrays holding the 'filename', 'page_number', 'book_chapter_url' and 'context' of each chapter/pdf-page the $search_term was found * @return string return '' the $course_id was incorrect */ @@ -123,11 +123,11 @@ public static function get_searched_locations_returns() /** * Searches for the $search_term in the given $page->content and returns the page with a $page->context context snippet if it was found. returns null if not. - * + * * @param stdClass $page object that holds the $page->content and gets returned containing the $page->context * @param string $search_term the string to seach for in the $page->content * @param int $context_length word count returned as context snippet on each side of the found $search_term - * + * * @return stdClass|null the given @param $page object with the additional $page->context or null if nothing was found */ private static function lrf_search_content($page, $search_term, $context_length) @@ -177,11 +177,11 @@ private static function lrf_search_content($page, $search_term, $context_length) /** * Alternate function to PHPs substr() to put it more in line with the javascript equivalent. Returns the substring of a given string with start and end index given. - * + * * @param string $string source string to extract from * @param int $start the starting index for the extraction * @param int $end the ending index for the extraction - * + * * @return string the extracted substring */ private static function substring($string, $start, $end) @@ -198,11 +198,11 @@ private static function substring($string, $start, $end) /** * Alternate function to PHPs stripos() to put it more in line with the javascript equivalent. Left to right search returning the index of the first occurence of the needle in the given haystack starting at index offset. - * + * * @param string $haystack string to search in * @param string $needle string to search for * @param int $offset starting index of right-wards search - * + * * @return int index of the first occurence found or -1 if nothing was found */ private static function indexOf($haystack, $needle, $offset) @@ -217,11 +217,11 @@ private static function indexOf($haystack, $needle, $offset) /** * Alternate function to PHPs strripos() to put it more in line with the javascript equivalent. Right to left search returning the index of the first occurence of the needle in the given haystack starting at index offset. - * + * * @param string $haystack string to search in * @param string $needle string to search for * @param int $offset starting index of left-wards search - * + * * @return int index of the first occurence found or -1 if nothing was found */ private static function lastIndexOf($haystack, $needle, $offset) diff --git a/lang/de/block_lecture_reference_finder.php b/lang/de/block_slidefinder.php similarity index 88% rename from lang/de/block_lecture_reference_finder.php rename to lang/de/block_slidefinder.php index 7156d9e..0bd8b8f 100644 --- a/lang/de/block_lecture_reference_finder.php +++ b/lang/de/block_slidefinder.php @@ -17,7 +17,7 @@ /** * Language settings german. * - * @package block_lecture_reference_finder + * @package block_slidefinder * @copyright University of Stuttgart * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -25,7 +25,7 @@ // Config -$string['pluginname'] = 'Lecture Reference Finder'; +$string['pluginname'] = 'Foliensuche'; // Block $string['search_term'] = 'Gesucht: '; diff --git a/lang/en/block_lecture_reference_finder.php b/lang/en/block_slidefinder.php similarity index 92% rename from lang/en/block_lecture_reference_finder.php rename to lang/en/block_slidefinder.php index 86817d7..f1ce789 100644 --- a/lang/en/block_lecture_reference_finder.php +++ b/lang/en/block_slidefinder.php @@ -16,7 +16,7 @@ /** * Language settings english. - * + * * @package block_lecture_reference_finder * @copyright University of Stuttgart * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later @@ -25,7 +25,7 @@ // Config -$string['pluginname'] = 'Lecture Reference Finder'; +$string['pluginname'] = 'Slide Finder'; // Block $string['search_term'] = 'Search Term: '; diff --git a/locallib.php b/locallib.php index 505faa1..c065353 100644 --- a/locallib.php +++ b/locallib.php @@ -15,9 +15,9 @@ // along with Moodle. If not, see . /** - * Helper functions for the block_lecture_reference_finder Plugin + * Helper functions for the block_slidefinder Plugin * - * @package block_lecture_reference_finder + * @package block_slidefinder * @copyright University of Stuttgart * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -27,9 +27,9 @@ /** * Return a list of all eligable book-pdf matches in a given course. - * + * * @param mixed $course course to search in - * + * * @return array list of matches as objects containing pdf file information and book_id */ function block_lrf_get_all_book_pdf_matches_from_course($course) @@ -56,7 +56,7 @@ function block_lrf_get_all_book_pdf_matches_from_course($course) $r->pathnamehash = $file->get_pathnamehash(); $r->filename = $file->get_filename(); $r->section = $resource->section; - $r->resourcename = preg_replace('/\s*\[[^]]*\](?![^[]*\[)/', '', preg_replace('/\s*\([^)]*\)(?![^(]*\()/', '', $resource->name)); + $r->resourcename = trim(preg_replace('/\s*\[[^]]*\](?![^[]*\[)/', '', preg_replace('/\s*\([^)]*\)(?![^(]*\()/', '', $resource->name))); $pdfs[] = $r; } @@ -64,7 +64,7 @@ function block_lrf_get_all_book_pdf_matches_from_course($course) $sectioned_books = array(); $books = get_all_instances_in_course('book', $course); foreach ($books as $book) { - $sectioned_books[$book->section][$book->id] = preg_replace('/\s*\[[^]]*\](?![^[]*\[)/', '', preg_replace('/\s*\([^)]*\)(?![^(]*\()/', '', $book->name)); + $sectioned_books[$book->section][$book->id] = trim(preg_replace('/\s*\[[^]]*\](?![^[]*\[)/', '', preg_replace('/\s*\([^)]*\)(?![^(]*\()/', '', $book->name))); } // Get all book-PDF matches @@ -80,9 +80,9 @@ function block_lrf_get_all_book_pdf_matches_from_course($course) /** * Return an array of objects each containing the content and some metadata of one PDF page of a given pdf-book match. - * + * * @param mixed $match an object containing metadata of one pdf-book match. - * + * * @return array list of objects containing the content and some metadata of one PDF page. */ function block_lrf_get_content_as_chapters($match) @@ -117,10 +117,10 @@ function block_lrf_get_content_as_chapters($match) /** * Create and return an url linking to a specific book chapter. - * + * * @param int $book_id id of the book * @param int $pagenum chapter number / pdf page num - * + * * @return string url linking to the book chapter */ function block_lrf_get_book_chapter_url($book_id, $pagenum) @@ -181,7 +181,7 @@ function block_lrf_select_course_options(int $selected_course_id, int $user_id) $courses_html[0] = (object)['id' => $selected_course_id, 'value' => $courses_shown[$selected_course_id]]; unset($courses_shown[$selected_course_id]); } else { - $courses_html[0] = (object)['id' => 0, 'value' => get_string('select_course', 'block_lecture_reference_finder')]; + $courses_html[0] = (object)['id' => 0, 'value' => get_string('select_course', 'block_slidefinder')]; } foreach ($courses_shown as $key => $value) { diff --git a/pdfparser/.github/workflows/coding-standards.yml b/pdfparser/.github/workflows/coding-standards.yml new file mode 100644 index 0000000..351e3f8 --- /dev/null +++ b/pdfparser/.github/workflows/coding-standards.yml @@ -0,0 +1,37 @@ +name: "CS" + +on: + pull_request: + push: + branches: + - master + +jobs: + coding-standards: + name: "CS Fixer & PHPStan" + runs-on: ubuntu-20.04 + steps: + - + name: Checkout + uses: actions/checkout@v2 + - + env: + COMPOSER_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + name: "Install PHP" + uses: shivammathur/setup-php@v2 + with: + coverage: none + php-version: "7.4" + tools: "composer:v2" + - + name: Install dependencies with Composer + uses: ramsey/composer-install@v1 + - + name: Install dev tools + run: make install-dev-tools + - + name: Run PHP CS Fixer + run: 'make run-php-cs-fixer ARGS="--verbose --dry-run"' + - + name: Run PHPStan + run: 'make run-phpstan ARGS="--no-progress"' diff --git a/pdfparser/.github/workflows/continuous-integration.yml b/pdfparser/.github/workflows/continuous-integration.yml new file mode 100644 index 0000000..4914088 --- /dev/null +++ b/pdfparser/.github/workflows/continuous-integration.yml @@ -0,0 +1,197 @@ +name: "CI" + +on: + pull_request: + push: + branches: + - master + +env: + fail-fast: true + +jobs: + phpunit: + name: "PHPUnit (PHP ${{ matrix.php }})" + runs-on: "ubuntu-20.04" + + strategy: + matrix: + php: + - "7.2" + - "7.3" + - "7.4" + - "8.0" + + steps: + - name: "Checkout" + uses: "actions/checkout@v2" + + - name: "Install PHP" + uses: "shivammathur/setup-php@v2" + with: + php-version: "${{ matrix.php }}" + coverage: "none" + tools: composer:v2 + env: + COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: "Install dependencies with Composer" + uses: "ramsey/composer-install@v1" + + - name: "Install dev tools" + run: "make install-dev-tools" + + - name: "Run PHPUnit" + run: "make run-phpunit" + + phpunit-lower-php: + name: "PHPUnit (PHP ${{ matrix.php }})" + runs-on: "ubuntu-20.04" + + strategy: + matrix: + php: + - "7.1" + + steps: + - name: "Checkout" + uses: "actions/checkout@v2" + + - name: "Install PHP" + uses: "shivammathur/setup-php@v2" + with: + php-version: "${{ matrix.php }}" + coverage: "none" + tools: composer:v2 + env: + COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: "Install dependencies with Composer" + uses: "ramsey/composer-install@v1" + + - name: "Install dev tools" + run: "make install-dev-tools" + + - name: "Run PHPUnit" + run: "make run-phpunit" + + phpunit-coverage: + name: "PHPUnit coverage (PHP ${{ matrix.php }})" + runs-on: "ubuntu-20.04" + + strategy: + matrix: + php: + - "7.4" + + steps: + - name: "Checkout" + uses: "actions/checkout@v2" + + - name: "Install PHP with PCOV" + uses: "shivammathur/setup-php@v2" + with: + php-version: "${{ matrix.php }}" + coverage: "xdebug" + tools: composer:v2 + env: + COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: "Install dependencies with Composer" + uses: "ramsey/composer-install@v1" + + - name: "Install dev tools" + run: "make install-dev-tools" + + - name: "Run PHPUnit" + run: make run-phpunit ARGS="-v --coverage-clover coverage/clover.xml" + + phpunit-composerv2: + name: "PHPUnit Composer v2 (PHP ${{ matrix.php }})" + runs-on: "ubuntu-20.04" + + strategy: + matrix: + php: + - "7.4" + + steps: + - name: "Checkout" + uses: "actions/checkout@v2" + + - name: "Install PHP" + uses: "shivammathur/setup-php@v2" + with: + php-version: "${{ matrix.php }}" + coverage: "none" + tools: composer:v2 + env: + COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: "Install dependencies with Composer" + uses: "ramsey/composer-install@v1" + + - name: "Install dev tools" + run: "make install-dev-tools" + + - name: "Run PHPUnit" + run: "make run-phpunit" + + alt-autoload: + name: "Tests alternative autoloader (PHP ${{ matrix.php }})" + runs-on: "ubuntu-20.04" + + strategy: + matrix: + php: + - "7.1" + - "7.2" + - "7.3" + - "7.4" + - "8.0" + + steps: + - name: "Checkout" + uses: "actions/checkout@v2" + + - name: "Install PHP" + uses: "shivammathur/setup-php@v2" + with: + php-version: "${{ matrix.php }}" + coverage: "none" + + - name: "Test alt-autoload" + run: "php tests/AltAutoloadTest.php" + + phpunit-lowest: + name: "PHPUnit lowest deps (PHP ${{ matrix.php }})" + runs-on: "ubuntu-20.04" + + strategy: + matrix: + php: + - "7.3" + + steps: + - name: "Checkout" + uses: "actions/checkout@v2" + + - name: "Install PHP" + uses: "shivammathur/setup-php@v2" + with: + php-version: "${{ matrix.php }}" + coverage: "none" + tools: composer:v2 + env: + COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: "Install dependencies with Composer" + uses: "ramsey/composer-install@v1" + with: + dependency-versions: "lowest" + + - name: "Install dev tools" + run: "make install-dev-tools" + + - name: "Run PHPUnit" + run: "make run-phpunit" diff --git a/pdfparser/.github/workflows/performance.yml b/pdfparser/.github/workflows/performance.yml new file mode 100644 index 0000000..75f0590 --- /dev/null +++ b/pdfparser/.github/workflows/performance.yml @@ -0,0 +1,30 @@ +name: "Performance Tests" + +on: + pull_request: + push: + branches: + - "master" + +env: + fail-fast: true + +jobs: + performance-tests: + name: "Tests for the performance testing the PDF parsing" + runs-on: "ubuntu-20.04" + + strategy: + matrix: + php: + - "7.4" + + steps: + - name: "Checkout" + uses: "actions/checkout@v2" + + - name: "Run composer for further autoloading" + run: "composer update" + + - name: "Run performance tests" + run: "php tests/Performance/runPerformanceTests.php" diff --git a/renderer.php b/renderer.php index 1eb59d3..2182fcf 100644 --- a/renderer.php +++ b/renderer.php @@ -17,13 +17,13 @@ /** * Renderer * - * @package block_lecture_reference_finder + * @package block_slidefinder * @copyright University of Stuttgart * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die(); -class block_lecture_reference_finder_renderer extends plugin_renderer_base +class block_slidefinder_renderer extends plugin_renderer_base { } diff --git a/templates/lrf_drop_down.mustache b/templates/lrf_drop_down.mustache index 2325093..471c3a5 100644 --- a/templates/lrf_drop_down.mustache +++ b/templates/lrf_drop_down.mustache @@ -15,7 +15,7 @@ along with Moodle. If not, see . }} {{! - @template block_lecture_reference_finder/lrf_drop_down + @template block_slidefinder/lrf_drop_down Complex Lecture Search @@ -31,7 +31,7 @@ {{^inform}}
{{/inform}} - +
\ No newline at end of file + diff --git a/templates/lrf_search.mustache b/templates/lrf_search.mustache index bdbaa74..2b410dd 100644 --- a/templates/lrf_search.mustache +++ b/templates/lrf_search.mustache @@ -15,7 +15,7 @@ along with Moodle. If not, see . }} {{! - @template block_lecture_reference_finder/lrf_search + @template block_slidefinder/lrf_search Complex Lecture Search @@ -26,13 +26,13 @@ "cid": 0, "lrf_cid": 0, "course_selector_param_name": "lrf_cid", - + "search_term_param_name" : "search", "search_term_placeholder": "Search", - + "search_term_label": "Search Term:", "search_term": "?", - + "chapter_label": "chapter", "content": ?, @@ -42,7 +42,7 @@ {{^inform}}
{{/inform}} - + {{#cid}}{{/cid}} {{#lrf_cid}}{{/lrf_cid}} @@ -117,7 +117,7 @@ /** * searches one pdf-page/book-chapter using the lrf_search_term and if found ads it with context to lrf_searched_content - * @param {*} page + * @param {*} page */ function lrfSearchContent(page) { var _content = ' ' + page.content.toLowerCase() + ' '; @@ -182,4 +182,4 @@ document.getElementById("lrf-content-{{uniqid}}").innerHTML = display; } - \ No newline at end of file + diff --git a/version.php b/version.php index 0a95575..6c9cb47 100644 --- a/version.php +++ b/version.php @@ -17,15 +17,15 @@ /** * Version Details * - * @package block_lecture_reference_finder + * @package block_slidefinder * @copyright University of Stuttgart * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2022111500; // The current plugin version (Date: YYYYMMDDXX). +$plugin->version = 2022113000; // The current plugin version (Date: YYYYMMDDXX). $plugin->requires = 2020061510; // Requires this Moodle version. -$plugin->component = 'block_lecture_reference_finder'; // Full name of the plugin (used for diagnostics) +$plugin->component = 'block_slidefinder'; // Full name of the plugin (used for diagnostics) $plugin->release = '0.1.3'; $plugin->maturity = MATURITY_BETA;