marcusgreen / moodle-qtype_wordselect

langHighlight words by clicking e.g. select all nouns in this sentence
2 stars 10 forks source link

Allow phrase with special to be selected #9

Closed lethevinh closed 6 years ago

lethevinh commented 6 years ago

attachfilehandler

lethevinh commented 6 years ago

-All Words are formatting as Bold/Italic...Font Color..and all are not affected when using WordSelect . should we fix issue

marcusgreen commented 6 years ago

I don't quiet understand, are you saying you want them formatted and they are not formatted, or that they are formatted and you don't want them formatted?

lethevinh commented 6 years ago

i want them formatted and they are not formatted.

marcusgreen commented 6 years ago

OK I understand what you are asking now. You want selectable correct and incorrect text to be formatting as in the example you give. I am currently working on a version 2 of the plugin that I hope will support that possibility. The current code comes closer to that and I will bear you request in mind as I develop. My most recent work was to try to ensure that mathjax (maths) formatted text would be selectable.

lethevinh commented 6 years ago

Please , Review code and let me know what you think.

marcusgreen commented 6 years ago

I was reviewing it and creating a Unit test just as your message came in. I have taken your pad_angle_brackets modified it and added it to the branch I have been working on and it looks good. I will be adding text to the sample questions that demonstrates this capability.

lethevinh commented 6 years ago

Yes, thank you very much. Please let me know immediately the feedback or bug you found. I will fix them.

marcusgreen commented 6 years ago

I have just noticed you created a behat test, that is wonderful!

marcusgreen commented 6 years ago

Will be adding this unit test public function test_pad_angle_brackets(){ $questiontext = '

The cat [sat]'; $question = qtype_wordselect_test_helper::make_question('wordselect', $questiontext); $paddedquestiontext= $question::pad_angle_brackets($questiontext); /note the gap added between

and The / $this->assertEquals($paddedquestiontext,"

The cat [sat]",'padding of html tags failed'); / tags retained are 'sub', 'sup', 'i', 'u', 'b' / $this->assertContains("[sat]",$paddedquestiontext,'formatting tags not retained '); }

lethevinh commented 6 years ago

I have run your behat and unit test and smoke test. everything is fine.

marcusgreen commented 6 years ago

I have added big sections of your code and a credit for your work in the release notes file https://github.com/marcusgreen/moodle-qtype_wordselect/blob/master/releasenotes.md

lethevinh commented 6 years ago

Please let me know what features you upgrade to the next version and what are your plans ?

marcusgreen commented 6 years ago

Hi My current plan is to update the little icon for the plugin and then release to the Moodle plugins database. I am not certain of the timescale yet. I have set up a course with the current code for people to experiment with.

http://vledevelop.co.uk/moodle/ You can log in as a teacher as username:t1 password:test

marcusgreen commented 6 years ago

Would you email me directly at marcusavgreen at gmail dot com, as there is a question I would like to ask you.

lethevinh commented 6 years ago

current , not support the word from the colour format and format attribute html other, <span class="" style="color: rgb(0, 61, 245);">text</span> text, please review my code part.

https://github.com/marcusgreen/moodle-qtype_wordselect/blob/14e4ab5567d937cb77814f9f3ff8f61e8c116aba/question.php#L188

$questiontext = preg_replace_callback('/<([a-zA-Z]*)[ ]*([a-zA-Z0-9\# =\'\"\:\(\,\;\)]*)\>/', function($a) use ($tags) {

marcusgreen commented 6 years ago

That looks very interesting. I will review and get back to you.

marcusgreen commented 6 years ago

Do you have an idea for how to support color?

lethevinh commented 6 years ago

I will use the regular expressions php to the identifier the selectword has html attribute. Tell me your idea?

lethevinh commented 6 years ago

I am waiting for your review, please let me know your feedback. please help me. thank you.

marcusgreen commented 6 years ago

CWhat am I reviewing, can you create a new pull?

marcusgreen commented 6 years ago

Ok, I have seen your pull. I am travelling at the moment (writing this on mobile phone). Will look more closely when I get home. What is kbd by the way?

lethevinh commented 6 years ago

kbd tag is keyboard input, I want handle case end user copy and paste content to editor.

marcusgreen commented 6 years ago

Did a small amount of testing and accepted your pull. Will update the example questions and and do some more testing before releasing a version 2.1. Excellent work. The travis testing is broken because I have not set up the jshint correctly. Will work on configuring that.

lethevinh commented 6 years ago

thank you so much

lethevinh commented 6 years ago

thank you so much

marcusgreen commented 6 years ago

I am impressed with your contributions, could you email me at marcusavgreen@gmail.com. I may have something of interest to you.

marcusgreen commented 6 years ago

this code is now in the v2.1 release available from the plugins database at moodle org https://moodle.org/plugins/qtype_wordselect

marcusgreen commented 5 years ago

Could you email me at marcusavgreen@gmail.com, I may have an opportunity for some paid Moodle work for you.