Proposal for advanced answer analysis & more complete feedback display

Proposal for advanced answer analysis & more complete feedback display

by Joseph Rézeau -
Number of replies: 18
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hello!

I am glad to announce a modest proposal for advanced student-answer analysis in the short-answer type of questions in the Lesson (and Quiz*) modules. *Sorry for the double posting.

This proposal uses the so-called Regular Expressions system, powerfulsmile but complexthoughtful.

The proposed analysis system is very similar in the Lesson and Quiz modules. However, for the Lesson module I am also proposing changes with a view to display a more complete environement when feedback is shown after a student's answer.

I have put on my test site all the necessary explanations, a few sample lessons (and quizzes) and, for anyone wanting to try it out on their own test site, the modified files for download.

Go to http://rezeau.info/moodle, log in as moodler, password moodler and select the Sandbox Course.

I am looking forward to people's comments and especially invite moodler developers in charge of this module to comment upon the feasibility of integrating my proposed changes to the current (or forthcoming) version of Moodle (subjected to further amendments). I do not have CVS permissions myself.

I will answer e-mails, but for the benefit of the Moodle community it would be better if exchanges about my proposal took place in this thread.

Enjoy!

Joseph

Average of ratings: -
In reply to Joseph Rézeau

Re: Proposal for advanced answer analysis & more complete feedback display

by Michael Penney -

This looks like very nice work, Joseph! How complete is the work in the lesson module? Are you coding against 1.6?

Can you provide us a patch against lesson 1.6?

In reply to Michael Penney

Re: Proposal for advanced answer analysis & more complete feedback display

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Hi Michael,
Thanks for your interest. There aren't many changes between 1.5.3 stable and current 1.6 dev versions of the \mod\lesson\action\continue.php file, which is the file I have hacked for advanced answer analysis & FB display of the Lesson module.
I have no knowledge of how diffs and patches work, but I have produced a version of continue.php for 1.6 dev. and am attaching it to this message. All you have to do is use it instead of the current continue.php file. Every single change I've made to the distribution file is clearly commented.
For general instructions on my hacks, please go to my site (mentioned in my previous message). I'll be glad to hear of your tests and comments.
TIA
Joseph
In reply to Joseph Rézeau

Re: Proposal for advanced answer analysis & more complete feedback display

by Mark Nielsen -
Hey Joseph,

The work that you have done sounds great from what I hear from Michael Penney.  Your code changes do not seem to be too extensive, but a review of the code is still needed before we stick this into 1.6.  Also, the questiontypes.html help file for short answer question type needs to be updated (perhaps also have a link to a writing regular expressions help file).  Could you compile the necessary information needed to use your updated short answer question?

Cheers,
Mark
In reply to Joseph Rézeau

Re: Proposal for advanced answer analysis & more complete feedback display

by Michael Penney -

Hi Joseph, it you can provide the help files we'll put this into 1.6 for folks to hammer on.

In reply to Michael Penney

Re: Proposal for advanced answer analysis & more complete feedback display

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi Michael (and Mark),

I've done my homework and am now providing the required help files (English version only) alongwith the whole set of modified files for quiz and lesson modules using short answer type questions.

Both archives for version 1.5.3 STABLE and 1.6 DEV are available on my test site, as well as all the necessary explanations & test quizzes and lessons. On my test site: user moodler, password moodler, enter Sandbox course.

Looking forward to testers' comments, suggestions, etc.

All the best,

Joseph


In reply to Michael Penney

Re: Proposal for advanced answer analysis & more complete feedback display

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Hi Michael (and Mark),
Any chance of seeing my modified Lesson files making it to 1.6 any time soon?
All the best,
Joseph
In reply to Joseph Rézeau

Re: Proposal for advanced answer analysis & more complete feedback display

by Michael Penney -
Hi Joseph, as soon as we get the necessary help files from you, we'll put the code in lesson 1.6.

I'm a regular expression appreciator, but not an expert, so I really need you to write the help filessmile.
In reply to Michael Penney

Re: Proposal for advanced answer analysis & more complete feedback display

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi Michael,

I had indeed "done my homework" and written the necessary help file for my modified lesson question types (see my message dated 5 of February in this thread).

The help files are included in the archives of modified files available on my test site, as explained in that message. However, if that is more convenient, I am also attaching them to this message.

All the best,

Joseph

In reply to Joseph Rézeau

Re: Proposal for advanced answer analysis & more complete feedback display

by Michael Penney -
Hi Joseph, sorry for being denseblack eye, thanks for sending the help filesbig grin. This should be in 1.6 early next week unless we find some unforseen issue.

Thanks!
In reply to Joseph Rézeau

Re: Proposal for advanced answer analysis & more complete feedback display

by Mark Nielsen -
Hey Joseph,

I added your code to 1.6 with minor modifications.  Let me know what you think.  Thanks for your contribution!  big grin

Cheers,
Mark
In reply to Mark Nielsen

Re: Proposal for advanced answer analysis & more complete feedback display

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi Mark,

Thanks for tidying up my code and putting it in 1.6dev! It seems to work pretty well. So far I've just noted one bug.

In order to single out the presence of "wrong unwanted" words within the student's reponse, the teacher can prefix the expected answer regular expression with a double plus ++. As a result of matching the student's response with that expected answer, those wrong unwanted words will be displayed with the "incorrect" class style.

This is done in file \moodle\mod\lesson\action\continue.php around lines 212:

$fontStart = '<span class="incorrect">';
$fontEnd = '</span>';
for ($i = 0; $i < $nb; $i++) {
array_push($original,$matches[0][$i]);
array_push($marked,$fontStart.$matches[0][$i].$fontEnd);
}
$useranswer = str_replace($original, $marked, $useranswer);

Unfortunately, the "string interpretation mechanism" must have changed between Moodle 1.5.3 and 1.6, because now the tag markers <> are "translated" to &lt; and &gt; so that instead of displaying:

What are the colors of the French flag?
Your answer : blue white red green and orange
One or more colors are wrong...

we are getting:

Your answer : blue white red <span class="incorrect">green</span> and <span class="incorrect">orange</span>

And for the same reason we are getting the same problem with the displaying of the <br /> tag in the MULTICHOICE question in file continue.php, line 306: $studentanswer .= '<br />'.$answer->answer;

I hope you can find a solution (and post it here, please). Thanks in advance.

Joseph

PS.- Various label strings are not finalized yet, but that is depending on language files, and it can wait.

In reply to Joseph Rézeau

Re: Proposal for advanced answer analysis & more complete feedback display

by Mark Nielsen -
Fixed in 1.6 smile

The style for those is defined as <span class="incorrect matches"> and you will have to define the colors in the styles.php for lesson.  No default colors right now.

Cheers,
Mark
In reply to Mark Nielsen

Re: Proposal for advanced answer analysis & more complete feedback display

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Thanks Mark.

Everything is perfect now.approve I notice you removed the htmlentities "filter" which removed the angle brackets and caused the tags to be printed as plain text and not as html tags. And the language strings are OK now too.

I do hope we get positive feedback from people testing 1.6dev and that these modifications will make it to 1.6beta and stable distribution later on.

All the best,

Joseph

In reply to Joseph Rézeau

Re: Proposal for advanced answer analysis & more complete feedback display

by Judy Lo -
Dear Joseph and all,

Thank you (and everyone who has contributed to the development of this Regular Expressions Systems) for your contributions.  Really appreciate it.

I have installed this Regular Expressions System to my test server and it works very well with the "short-answer" question type (as it intended to be ^^)

However, as most of my questions are created using "embedded answer(cloze)" question type (with short-answer sub-questions).  Would you and the team consider expanding the system for use with "embedded answer(cloze)" question type also?

In fact, I have tried adding "answer written in regular expression" to cloze.  The results returned are partially correct/incorrect as follows:
-----------------------
Q: Type either A or B to answer this question.
{2:SHORTANSWER:=A|B}
-----------------------
if answer "A" ->
(i) text feedback: incorrect
(ii) color feedback: green indicating correct
(iii) mark: 0 mark indicating incorrect
-----------------------
answer "B" ->
(i) text feedback: incorrect
(ii) color feedback: green indicating correct
(iii) mark: 0 mark indicating incorrect
-----------------------
answer "A|B" ->
(i) text feedback: incorrect
(ii) color feedback: green indicating correct
(iii) mark: full mark indicating correct
-----------------------

Hope to hear from you soon.

Best regards,
Judy
In reply to Judy Lo

Re: Proposal for advanced answer analysis & more complete feedback display

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi Judy,

1. There is no cloze-type question in the Lesson module. I expect you mean the Quiz module.wink

2. At the moment my proposed advanced reg exp system is not yet part of the 1.6 distribution, but I have been working hard on it lately, and, yes, I have provided for it to be available to the Cloze-type question. Just be patient.smile If you want to test it on a test installation of Moodle 1.6, send me a private message (see my profile).

Here is a preview of the code:

Q: Type either A or B to answer this question.
{2:REGEXP:=(A|B)#Great! you typed A or B~.*#No way!}

and see the result in attached screen shot. Please note that the regexp syntax for "either A or B" needs parenthesis: (A|B)

All the best,

Joseph

Attachment Image1.jpg
In reply to Joseph Rézeau

Re: Proposal for advanced answer analysis & more complete feedback display

by George Tiger -

I suspect that by removing htmlentities, it is causing a rather annoying problem in student short answers and essays for the lessons module.  I have been trying to solve this problem and in researching it found out that this might be the root cause.  Here is what I am encountering:

I am preparing a series of programming courses.  In the case of C++, I would like my students to provide short answers and essay answers that contain the insertion operator which is represented as a couple of consecutive opening angle brackets as in the following examples:

cout << "Hello, World";

cout << "Hello " << name << " how are you doing today?\n";

The problem is that when the students type any of these answers, all I see is the following

cout

cout

Everything after cout gets cut out! 

Is there anyway, to allow this kind of responses?  Can you tell me how to put back htmlentities in the PHP code and where?

Thanks in advance,

G.Tiger

In reply to Joseph Rézeau

Re: Proposal for advanced answer analysis & more complete feedback display

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hello!

I am glad to announce that it is now possible to log into my test site as a teacher in order to experiment with the question-making interface and to create lessons (and quizzes).

Anyone interested just send me an e-mail (preferably stating your institution, etc.) to require a username and password and I will enrol you into the Sandbox course with (limited) teacher rights immediately.

Looking forward to intriguing and effective regexp formulae being devised by daredevil moodlers,cool

Joseph