GithubHelp home page GithubHelp logo

moodleou / moodle-filter_embedquestion Goto Github PK

View Code? Open in Web Editor NEW
11.0 11.0 13.0 295 KB

A Moodle text filter plugin that displays questions from the question bank embedded in the page.

JavaScript 2.55% PHP 92.34% CSS 0.52% Gherkin 3.54% Mustache 1.04%

moodle-filter_embedquestion's People

Contributors

ewout avatar gustavobazzo avatar huongnv13 avatar jason-platts avatar mkassaei avatar timhunt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

moodle-filter_embedquestion's Issues

"Drag and Drop into Text" questions not randomized when embedded

Issue

When embedding a question of Type "Drag and Drop into Text", the answers are not randomized and appear in the same order every time.

Steps to reproduce

create a question of type "Drag and Drop into Text" with an id. Make sure the shuffle-checkbox is clicked. Then embed it in a text page.

Resulting Behaviour:

Every time you open the page with the embedded question, the answers appear in the same order.
When using the preview function this the does not occur.

Expected Behaviour:

The answers should be shuffled evertime the page is reloaded.

Comment

This issue is especially annoying when one forgets to check "shuffle" when creating the question. The order of the answers is then locked in and they always appear in original order even after checking "shuffle"

M4.1 | Shows completion setting twice

Moodle version: M4.1.x
Theme: Boost
Format: Topic

We don't experience any real issues with the filter in M4.1 though we noticed that the activity completion criteria is shown twice on the page

We solved it for now by adding to the css:

.embedded-main .completion-info {
display:none!important;
}

image

No submit button for embedded essay type question

Hi, first of all, thank you for this plugin - very useful! I recently installed the Embed questions filter and it's been working really well, until I tried to embed an essay type question. It embeds the text box, but there's no submit button (as indicated in the image)
image Is this a bug, or am I missing something?

Can't use random question from category if not all questions have idnumbers

If a category is chosen for random questions, but not all questions in the category have idnumbers, I get an questionidmismatch error (after the Check button).

I think this is because the questions are chosen using the regular random_question_loader: https://github.com/moodleou/moodle-filter_embedquestion/blob/master/showquestion.php#L72

I'm not sure why a question needs to have an idnumber, but given that the code enforces it, we should only choose from questions that have them.

Not working as described in 3.6

Note that, although Moodle 3.6 has proper idnumber fields for questions and categories - and we added that to standard Moodle to help this pluging work. Actually, we ahve not yet made teh change so that this plugin uses the idnumber field. You still have to put [ID:someid] in the category/question name.

We really must find time to change this plugin to use the real idnumbers, but I don't know when that will be.

Originally posted by @timhunt in #4 (comment)

From what I'm seeing in Moodle 3.6.2+ and plugin version 2018111900, this issue still has not been fixed. Is this correct?
If so, is there any estimated timeline for the plugin to work as expected?
Alternatively, is there a place in the code you can point our developers to look at to try to implement this behavior ourselves?

Embedded question iframe grows indefinitely in Safari

Hi Tim - this is a great plugin, thank you! As you may (probably don't) remember, I've asked you about something like this at a couple of MoodleMoots :)

I've added the id numbers to categories and questions. Using the Atto embed plugin to embed the question seems to cause the page to scroll indefinitely - see video at https://www.dropbox.com/s/wxo4zp2mds9hbbo/Recording%20%2310.mp4?dl=0. No error messages are visible with developer debugging on.

This is using v1.2 (2018071300) of the plugin on Moodle 3.5+ (Build: 20180621), running the Boost theme on a LAMP server with php 7.2.9 / mysql (10.0.34-MariaDB-cll-lve).

Any thoughts?

Failing test

Failed test 1
/var/www/html/filter/embedquestion/tests/behat/filter_embedquestion.feature:26

Debug info (from local test run):

"Failed steps:
Scenario: Test using the helper script - embed a specific question
Line 44: And I reload the page
Error message: Dismissed user prompt dialog: To display this page, Firefox must send information that will repeat any action (such as a search or order confirmation) that was performed earlier. (Facebook\WebDriver\Exception\UnexpectedAlertOpenException)"

Failed test 2
/var/www/html/filter/embedquestion/tests/behat/filter_embedquestion.feature:69

Debug info (from local test run):
After line 78:
"In WebDriverException.php line 139:
TypeError: browsingContext.currentWindowGlobal is null"

syntax error on PHP <7.1

There is a syntax error in plugin on PHP 7.0:
filter/embedquestion/filter.php line 183

public static function parse_options(array $parts): ?array {

Plugin version: 2019091600
PHP version: 7.0
Moodle version: 3.6

Backup and restore between Moodle instances

When backup content with embededquestion filter from one site and restore in another the question will not load.
Optional solution:
Add secrete configuration to admin settings

Not working with moodle 3.6

Using version 1.4 for Moodle 3.4+ (2018111900)Moodle 3.4, 3.5, 3.6
That worked OK with moodle 3.5.3. Just upgraded to moodle 3.6.1 and it does not work. I do get the Embed question icon on the ATTO toolbar, I do have questions with an IDNUMBER in my questions bank, but the categories list is empty.

No atto integration...?

After installing this plugin no atto plugin is included or installed and therefore I can not add 'embedquestion' to the "insert =" block of the editor's toolbar config. When I try to save this:

"The plugin 'embedquestion' cannot be used; it does not appear to be installed."

I installed Version 1.4 for Moodle 3.4, 3.5, 3.6 at my local Moodle 3.6 XAMP.

Improvements for adaptive mode

My observation is that you can't select a random question from a category with adaptive mode.

Even though adaptive mode can be selected and obviously is conveyed in the embedding code, the actual behaviour is not adaptive. Rather the question demands all inputs to be done before Check can be done and there is no chance to retry. Bad for formative assessment.

Also, currently there is no access to the general feedback for questions in adaptive mode, be it randomly selected or not.

My proposal is to:

  • Keep the button "Start again" alive all time for questions in adaptive mode.
  • Add a button "Get hints" or "Submit" which would show the general feedback (if enabled in the embedding code)

image
image

This question may not be embedded here.

Hi all,
I think I followed the workflow to embed a question, but I get this message and not question: "This question may not be embedded here."
Any idea why? Thanks for your support.
Regards,
J.

Shows "reset user tour on this page" link twice

Moodle version: M4.1
Theme: Catawesome
Format: Collapsed Topics

The "reset user tour on this page" link appears twice, once in the footer where intended and once below the embedded question:

image

It also doesn't re-trigger the relevant user tour.

Failing Behat test - filter_embedquestion.feature

Hi, the test stated above is failing.

Environment details:
MySQL 5.7
PHP 7.4
Moodle latest MOODLE_400_STABLE

Error details:
Scenario: Test using the helper script - embed a specific question
And I reload the page: Dismissed user prompt dialog: To display this page, Firefox must send information that will repeat any action (such as a search or order confirmation) that was performed earlier. (Facebook\WebDriver\Exception\UnexpectedAlertOpenException)

Scenario: Links to and from the question bank
Then I should see "Editing a True/False question": "Editing a True/False question" text was not found in the page (Behat\Mink\Exception\ExpectationException)

EmbedQuestion Breaks Recycle Bin

Moodle: 3.9.2
EmbedQuestion: master
Behat scenario: Delete and restore a quiz with user data # /var/www/html/admin/tool/recyclebin/tests/behat/backup_user_data.feature:24

Manual testing of this, encounters the following:

Debug info:
Error code: generalexceptionmessage
Stack trace:
line 33 of /backup/moodle2/backup_stepslib.php: Error thrown
line 26 of /report/embedquestion/backup/moodle2/backup_report_embedquestion_plugin.class.php: call to require_once()
line 283 of /backup/util/plan/restore_structure_step.class.php: call to require_once()
line 4237 of /backup/moodle2/restore_stepslib.php: call to restore_structure_step->add_plugin_structure()
line 84 of /backup/util/plan/restore_structure_step.class.php: call to restore_module_structure_step->define_structure()
line 181 of /backup/util/plan/base_task.class.php: call to restore_structure_step->execute()
line 210 of /backup/moodle2/restore_activity_task.class.php: call to base_task->execute()
line 178 of /backup/util/plan/base_plan.class.php: call to restore_activity_task->execute()
line 168 of /backup/util/plan/restore_plan.class.php: call to base_plan->execute()
line 384 of /backup/controller/restore_controller.class.php: call to restore_plan->execute()
line 265 of /admin/tool/recyclebin/classes/course_bin.php: call to restore_controller->execute_plan()
line 101 of /admin/tool/recyclebin/index.php: call to tool_recyclebin\course_bin->restore_item()
Output buffer:

Did you remember to make the first column something unique in your call to get_records? Duplicate value 'value-removed-for-github' found in column 'concat(stamp, ' ', version)'.
  • line 1282 of /lib/dml/mysqli_native_moodle_database.php: call to debugging()
  • line 1548 of /lib/dml/moodle_database.php: call to mysqli_native_moodle_database->get_records_sql()
  • line 680 of /backup/util/dbops/restore_dbops.class.php: call to moodle_database->get_records_sql_menu()
  • line 518 of /backup/util/dbops/restore_dbops.class.php: call to restore_dbops::prechek_precheck_qbanks_by_level()
  • line 178 of /backup/util/helper/restore_prechecks_helper.class.php: call to restore_dbops::precheck_categories_and_questions()
  • line 427 of /backup/controller/restore_controller.class.php: call to restore_prechecks_helper::execute_prechecks()
  • line 248 of /admin/tool/recyclebin/classes/course_bin.php: call to restore_controller->execute_precheck()
  • line 101 of /admin/tool/recyclebin/index.php: call to tool_recyclebin\course_bin->restore_item()

Embed By Shortcode or Template URL?

Hello,

I would like to create pages with many embedded questions. Those pages would be created by a generator (e.g. combining all questions of a specific topic). Is it possible to use some kind of shortcode, like {{embedquestion:2:question123}}, paste this into the html and I am done?

Or would it be possible to have an URL like .../freefloatingquestion.php?course=2&question=question123, which shows the question123 from category 2? Similar to the "preview question" page in the question bank?

This would be very helpful!

3.9 - require.js breaks site

Moodle: 3.9.1
embedquestion plugins: latest master branch on 29/07/20
Having the filter plugin installed (& disabled) breaks all the dropdown option on our site
Bunch of errors about require.js in the console

Screenshot 2020-07-29 at 21 44 11

https://requirejs.org/docs/errors.html#mismatch

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.