Giter Site home page Giter Site logo

marcusgreen / moodle-qtype_wordselect Goto Github PK

View Code? Open in Web Editor NEW
2.0 7.0 10.0 1.57 MB

langHighlight words by clicking e.g. select all nouns in this sentence

PHP 66.10% JavaScript 9.34% CSS 3.28% Gherkin 19.98% HTML 1.31%
moodle moodle-plugin moodle-quiz moodle-question-type question quiz language-learning

moodle-qtype_wordselect's Introduction

Wordselect Moodle Question type Moodle Plugin CI GitHub Release

A very easy to use "select the words" Moodle question type. The question creator enters text and puts square braces around the correct ones. So if the objective was to select the verb, the phrase "The cat [sat] on the mat" would have square braces around sat. The user/student can select any word and on submission the question can indicate which select was correct or incorrect. Read more about this question type here

https://github.com/marcusgreen/moodle-qtype_wordselect/wiki

and

https://docs.moodle.org/en/Wordselect_question_type

See change log at https://github.com/marcusgreen/moodle-qtype_wordselect/blob/master/changelog.md To install from the plugins database go to https://moodle.org/plugins/qtype_wordselect

The latest source can be found here

https://github.com/marcusgreen/moodle-qtype_wordselect

Installing

Place the files in a directory

moodle\question\type\wordselect

Where moodle is webroot for your install.

Go to Site Administration/Notifications

moodle-qtype_wordselect's People

Contributors

anupamasarjoshi avatar huongnv13 avatar lethevinh avatar marcusgreen avatar nashtechdev01 avatar timhunt avatar tituslearning avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

moodle-qtype_wordselect's Issues

One incorrect choice cuts marks to zero

Copying this from a regular contributor message

"When you use the question type in combination with the option "interactive with multiple tries" as soon as you choose one word you shouldn't mark in the text, the score is set to 0%.

In the older versions of your question type, the question type worked as expected. That's why I think the problem is related to the new scoring option for wrong answers."
I seem to have reproduced this issue and will investigate

cannot upgrade to version 2018122800

cannot upgrade to version 2018122800 I get a bunch of warnings:
Warning: mkdir(): Permission denied in C:\xampp\htdocs\moodle\lib\classes\update\code_manager.php on line 555

Warning: rename(C:\xampp\moodledata/localcache\c590b509-b5a4-4f0b-b08e-30a1062b323b\15ac7258-b9f4-4e9a-ae00-44cb187d0363/wordselect/questiontype.php,C:\xampp\htdocs\moodle/question/type/wordselect/questiontype.php): Acc�s refus�. (code: 5) in C:\xampp\htdocs\moodle\lib\classes\update\code_manager.php on line 557

Warning: mkdir(): Permission denied in C:\xampp\htdocs\moodle\lib\classes\update\code_manager.php on line 555
... and many more

Use of no-wrap for placehodlers can break the layout

Try creating this example question

Which parts of the following paragraph are evidence for the belief expressed?

[She had not gone much farther before she came in sight of the house of the March Hare:] [she thought it must be the right house], because [[the chimneys were shaped like ears]] and [[the roof was thatched with fur]]. [It was so large a house,] that [she did not like to go nearer till she had nibbled some more of the lefthand bit of mushroom, and raised herself to about two feet high]: [even then she walked up towards it rather timidly,] saying to herself “[Suppose it should be raving mad after all!] [I almost wish I’d gone to see the Hatter instead!]”

Note that the display is then very weird because of the white-space: nowrap; CSS https://github.com/marcusgreen/moodle-qtype_wordselect/blob/master/styles.css#L16 (and a few other lines). This is particuarly true at mobile screen-sizes.
image

For this question at least, it would be better to remove that rule.

Word Select is not marking correct answers as correct for Students

Hi @marcusgreen,

We are using the latest plugin version on Moodle 3.7.
After the last version was released, we discovered the following issue.

While Word Select allows students to select an answer(s), it is not marking those that are correct, as correct. This issue happens only with the questions 1 and 3 that have additional HTML added to them (like <br> or &nbsp;).

Here is how the question 1 looks like when I open an HTML editor (it has
tags):
​​
2020-02-28_1429
[John Smith]<br> [Jane Smith]<br> John Smith, Jr.<br>[Sally Smith]<br>

Here is my updated version - question 2 (without additional HTML):
2020-02-28_1434
<p>[John Smith]</p><p>[Jane Smith]</p><p>John Smith, Jr</p><p>[Sally Smith]</p>

Here is how the 3 question looks like when I open an HTML editor:
2020-02-28_1503
<p>Select the car that Sally Smith is allowed to drive under the policy.</p><p>&nbsp;Porsche</p><p>&nbsp;Mercedes</p><p>&nbsp;[Cabriolet]<br></p>

Here is my updated version - question 4 (without additional HTML):
2020-02-28_15032
<p>Select the car that Sally Smith is allowed to drive under the policy.</p><p>Porsche</p<p>Mercedes</p><p>[Cabriolet]</p>

When an Admin attempts this quiz, Word Select works as it should. Even with the additional HTML tags added:
2020-02-28_1511

However, here is what the Student role gets:
2020-02-28_1512

The text looks the same visually, however, the main difference is in HTML. The text was probably copied from an external editor and pasted into the Moodle Atto editor.

Please let me know if you need more details.

Thank you,
Valeriia

Behat .feature files have the wrong tags

This is the qtype_wordselect plugin.

It is not part of Moodle core, so the @core tag should not be present in any of the .feature files.

This is not mod_quiz or part of it, so the tags @mod @mod_quiz should not be in any of the feature files.

Teach Log In As Student causes issues

Using the latest version of Moodle 3.9+ and the most recent version of the Word Select plugin 2.44, the selecting of the words does not work correctly if a teacher uses the 'Log In As' functionality of Moodle and logs in as a student. The question displays correctly and hovering the cursor over the words changes it to the pointer icon, but when you click on a word, nothing happens. No selection highlight appears, the css does not change from 'selectable' to 'selected' and when you finish the quiz, the review shows that the question has not been answered.

When previewing the question as a teacher, everything works correctly, and when a student actually logs in and takes the quiz, everything works correctly as well. Hopefully this is an easy fix as checking to see how the question looks from a students view is important, and making sure everything works as intended from the students point of view is important as well. Not being able to have the question function correctly while logging in as a student is definitely a bummer.

Wordselect doesn´t show images

I have a question using images but when I upload them into moodle the images are broken. here the screeenshots and the code.
Thanjs
BEFORE PREVIEW
imagen1
IN PREVIEW AND TEST MODE
imagen2

CODE OF QUESTION:


1. 1
A.
[B.]
C.
in a shop
in a library
in a hotel

2. 2
A.
B.
[C.]
in a museum
in a hotel
at a market
3. 3
[A.]
B.
C.
in a classroom
in a museum
in an office
4. 4
A.
B.
[C.]
in a school
in a hospital
in a department store
5. 5
A.
B.
[C.]
in a theater
in an airport
in a station



MLang2 filter is not being processed

The multilanguage 2 filter is not being processed as expected.

See this ticket on the repository for that filter
iarenaza/moodle-filter_multilang2#27

An update will need to be checked with other filters and with images. It would also be useful if the included xml file of sample questions had ones that can be tested against those filters.

Will add text that shows this issue in action at some point.

Compatibility problem with multimedia filter

In Moodle 3.9, this question type breakes the multimedia filter that is commonly used to integrate medias in questions.
To reproduce the bug :

  • activate multimedia filter in contents
    Administration > Site administration > Plugins > Filters > Manage filters
  • create a wordselect question
  • place some marked words as question type supposes to
  • use the link button to add a link towards a loaded mp3 file in question text
  • save and preview

In other question types, the edition form shows a link toward the file.
In word select edition form, the multimedia filter seems to be loaded.
In other question types, the preview shows a player for the audio file that plays the audio.
In word select, the preview shows the same player but the audio does not play and an unending loading circle appears.

Allow phrase with space to be selected.

There should be a method to bind words into a phrase by escaping a space or providing an alternate character for spaces. Parser could recognize backslash space or _ or ~ as a space betweens words that are bound together rather than a separation between them

Activity appears with tickable boxes

Describe the bug
Activity appears different under different theme. Words are clickable but they have boxes in front of them at the same time. (Screenshot below)

To Reproduce
Steps to reproduce the behavior:

  1. Change theme to Edwiser/Default
  2. Preview activity

Expected behavior
Clickable words, no boxes

Screenshots
image

  • Windows
  • tested on Chrome, Edge
  • Moodle 4.1.8

Tried with different delimiters

Enhancement - Select AND define words

Dear Marcus,

thank you for your excellent plugin, which is very useful for our gramar teachers.
I often hear that they would like a precious feature : identify words according to some categories.

For exemple : in a sentence, we must seek and find pronouns and articles. But we must characterize each answer, that is not possible with Word Select.
As I know we can use several signs to surrond answers, do you think it would possible :

  • to define some categories of words ?
  • to make that each answer can be caracterized ? For exemple : do ONE click for first category, TWO clicks for second categories... ?

I didn't study all your codings, so I don't know if such a feature could be implemented easily.

Best regards,
Olivier

Minor typo in English language string

Hi,

When I was trying your new wordselect plugin, I noticed a tiny typo in the English language string for pluginnamesummary:

'All words can be selected by clicking on them. Correct words are defined by surrounding with dlimiters e.g. The cat [sat] on the mat'

'dlimiters' should be 'delimiters ', I think.

Thanks for a very nice plugin.

Typo in the @copyright year

The questiontype.php has the year 2017 in its copyright label. Not that it matters that much but you may want to fix it.

Support multiple types of selection (e.g. verbs and nouns)

Marcus, if you remember I asked you about this at the Global Moot in Barcelona, and you did not immediately reject the idea. The idea is to let the qusetion author set up more than one kind of highlight, so, for example, you could create the question:

Introduction: In the following sentence, highlight the [verbs] like this, and the {nouns} like this.

Question text: The {cat} [sat] on the {mat}.

With a question like this, when the person attempting the question clicks on a word, it does not just toggle on/off, but instead goes through off -> highlight 1 -> highlight 2 -> off. (For doing visual styling in an accessible way, I would copy the colours and rounded corner conventions from https://tracker.moodle.org/browse/MDL-66563 - there are some screen-grabs there.)

Thinking about how this might look on the editing form, it could be something like this mock-up:

image

... for an existing question with just one group, or for an extreme example:

image

I am not very happy with my choice of words there, so improvement suggestions welcome. (One thing I like about suggested design is that it makes it easier for people to discover the feature for how to group mulitiple words that are not part of the right answer - and also it gives more flexibility for which delimiters are used for that.

What do you think of this concept? If you think it is OK, then it might be a nice little project to entertain me while I am stuck at home.

Wordselect breaks if Moodle option 'forceclean' is turned on (e.g. View as Student)

Hi @marcusgreen,

I found an issue related to this question type as below:

The WordSelect will be break if Moodle option 'forceclean' is turned on. Now, it's only the experimental setting, but in the future, Moodle is going to turn it on by default.
See: https://tracker.moodle.org/browse/MDL-62352

Also, if you use the Moodle Log in as feature, the option will be forced on.
See: https://tracker.moodle.org/browse/MDL-63786

So, if we use Log in as feature, or we turn that option on in the Admin setting, WordSelect will be broken.

Thanks,

Mix non selectable text.

It would be good to have more flexibility in the syntax to mix selectable words with non selectable. For example

Select the mammals from the animals in the sentence:
The cat chased a bird and a butterfly.

Bug in the edit form if you try to blank the combined feedback

To reproduce:

  1. Rename the attached file to .xml (why won't github let you attach a .xml file?!) wordselect-example.txt
  2. Import it into a Moodle question bank.
  3. Preview the question.
  4. Check all the review options are on.
  5. Get the question right.
  6. Note there is no feedback, when you expect there to be.
  7. To try to diagnose, find the question in the question bank, and edit it.
  8. Note that the Combined feedback -> For any correct response says "Your answer is correct."
  9. Get really, really confused.
  10. Look at the source of the XML file you imported. Ah! in fact the Correct feedback is blank! That explains it.

So, in summary:

Expected result: if the question has not combined feedback, then when you edit the question, the combined feedback box should be empty.

Actual result: the combined feedback box contains the default text.

Suggested fix: in qtype_wordselect_edit_form::data_preprocessing you should have a call to $question = $this->data_preprocessing_combined_feedback($question, true); (like in qtype_multichoice, etc.)

However: if you do that, you get Notice: Undefined property: stdClass::$shownumcorrect in .../question/type/edit_question_form.php

Since the fix is not completely trivial, I can't send you a pull request now, but I thought I would log the issue.

User cannot click to select the word (created by wordselect)

Describe the bug
For the activity "Word Select", the users cannot click to choose the word(s).

Expected behavior
One or a few students are facing this problem, and I don't know how to solve it. They cannot click on the word to select the choices.

** Clip **
https://drive.google.com/file/d/1ZQwO8dNpSE9oF-csWsUtEhe3IqTRFZwn/view?usp=sharing

Desktop :

  • OS: [e.g. Windows]
  • Browser [EDGE]
  • Version [not known]

Additional context
For me, I have tried "Chrome, Firefox, MS Edge" and never found such issue.

Glossary Auto Linking Filter Interference?

Hello,
I've created a world select instance where the student has to click all 8 instances of the word "you" or "your" This is how I have it set up:

[You] shouldn't argue with people on the Internet. It is a waste of time and energy. Do [you] want to spend [your] precious life energy trying to type sense into someone who will only hate [you] for [your] efforts? No, [you] don't. The next time someone makes some outlandish claim that infuriates [you], [you] should either ignore them, unfriend them, or block them.

What I noticed when students were taking the quiz is that the very last two "you"s were not being recognized as correct answers. I thought maybe the comma in between was an issue, but nothing I did seemed to get the last two you's to be recognized as correct despite having the brackets around it.

incorrect 6

Then, I thought to turn off my Glossary Auto Linking filter and all of a sudden it worked fine.

correct 8

I turned the Glossary Auto linking back On and the issue reappeared. Off again, and then resolved. The course glossary doesn't have any terms with the word "you" in the title, so I'm not sure how to trouble shoot this. Is this some type of buggy behavior?

Word Select question when attempted, the Response history displays the submitted words in random order and without delimiters

Hi Marcus,

We have seen the following issue. Could you please have a look? Thanks.

Describe the bug
When the WordSelect question is attempted as Admin, the Response history shows the submitted words in Random order and also there is no delimiter around the words to separate each one of them. This seems to be confusing when the submitted words have punctuation marks in them.

To Reproduce
Steps to reproduce the behaviour:

  1. Login as Admin. Go to 'Question bank' and create a new Wordselect question
  2. Preview and set the 'Response history' to Shown.
  3. Attempt the question and select some words and click on 'Submit and finish'
  4. Notice that in the Response history, the submitted words are displayed in Random order and also there is no delimiter around the words to separate each one of them.

Expected behaviour
In the Response history the submitted words should be in order to the question text and also the words should be displayed within braces { } to clearly separate out the words selected.

Screenshots
image

Desktop (please complete the following information):

  • OS: [e.g. iOS] Windows
  • Browser Chrome
  • Wordselect Version: 2.48 on Moodle 3.11

Qurstion type on app not supported

Describe the bug
I installed your question type (last version) on my Moodle instance 3.9.6. I created a test quiz using you question and viaweb it works well, but when tested it on Moodle App (last releases on Google Play) and it say: This quiz can't be attempted in the app because it only contains question not supported by the app: wordselect

Weird html output

Hello,
This fabulous question type stopped working for us. An investigation showed that phpQuery, that we use to modify the DOM before it is sent to the client, can not process the DOM correctly, when a wordselect-question is shown.

Checking the output of the question I realized that there seem to be an error with the nesting of elements. Many html elements are written as start- and endtag (like you have in
), but I think that they should be nested, here are two examples:

  • </div />

    <input type="checkbox" ...

  • ****

As far as I understand your plugin this should be something produced by your renderer: https://github.com/marcusgreen/moodle-qtype_wordselect/blob/master/renderer.php#L43 In line 52 you open the div, in line 53 you apply filters to the question text and in line 54 you close the div.

Is it possible that Moodle closes the div from line 52 before it prints the output of $question->format_text, and then prints a </div /> when you just want to "close" a div that was never opened?

Kind regards

'Missed' right answers

Hi Marcus,

This is some feedback from our activity designers.

Here's a dummy example I've just slung together to demonstrate the 'issue': students see the 'missed' right answers in square brackets.

WS Moodle Core

So the suggestion for improvement is that 'missed' right answers are shown in maybe blue 'answer' boxes consistent with the correct/incorrect letters. Just my example, but the 8ED1FF background with black text seems to pass WCAG 2 AAA compliance for contrast:

WS Moodle Core desired

Best wishes,

Chris.

Moodle 3.8.2 & Wordquiz

Hello,
using latest version of Moodle, installed the plugin (module) via installer, can open the options in the administration, but I am not able to select this type of test.
Maybe I have overseen some and you could point me in the right direction?
Or are there any issues with the latest moodle version?

thx

Undefined Offset on line 284 in question.php

Notice: Undefined offset: 26 in /var/www/data/pvschools/public_html/moodle/question/type/wordselect/question.php on line 286
Exception - Call to a member function get_without_delim() on null

As per line:

$summary .= " " . $allwords[substr($index, 1)]->get_without_delim() . " ";

Should be something more similar to this:

if (isset($allwords[substr($index, 1)])) {
          $summary .= " " . $allwords[substr($index, 1)]->get_without_delim() . " ";
} else {
          return '';
}

Where the assumption that the item exists in the array - if it doesn't it faults out.

Show count of selectables

See this forum post for description
https://moodle.org/mod/forum/discuss.php?d=404036#p1639448
My idea for implementation.
A checkbox that says something like 'Show count of selectables'
Then show a count of how many items can be selected (are surrounded by braces) as a student attempts the question.
Then as a nice to have.
Have some javascript that decrements/increments a count as the student selects items.
No timeframe/promises on this one.

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.