Embedded questions & Multiple correct answers

Embedded questions & Multiple correct answers

by John Hellaby -
Number of replies: 18
Hi All,

Currently we're trying to do an embedded question that is short answer in format and has multiple possibile answers for each embedded box. But can't seem to get it working.

Could anyone give help out, or just point us in the right direction if this question has been asked before.

Example Question:

Please spell the name john in as many different ways you can

Possible answers: John, Jon, Jean, Jonn etc

But we want this in an embedded format.
Average of ratings: -
In reply to John Hellaby

Re: Embedded questions & Multiple correct answers

by Dr S Bhatia -
ok, first things first....which version of moodle are u using.
i'm using 1.6.1
First i'll mention what moodle says and then show you your example
This question consists of some text with an answer embedded right here {1:MULTICHOICE:Wrong answer#Feedback for this wrong answer~Another wrong answer#Feedback for the other wrong answer~=Correct answer#Feedback for correct answer~%50%Answer that gives half the credit#Feedback for half credit answer} and right after that you will have to deal with this short answer {1:SHORTANSWER:Wrong answer#Feedback for this wrong answer~=Correct answer#Feedback for correct answer~%50%Answer that gives half the credit#Feedback for half credit answer} and finally we have a floating point number {2:NUMERICAL:=23.8:0.1#Feedback for correct answer 23.8~%50%23.8:2#Feedback for half credit answer in the nearby region of the correct answer}.

Note that addresses like www.moodle.org and smileys smile all work as normal:
 a) How good is this? {:MULTICHOICE:=Yes#Correct~No#We have a different opinion}
 b) What grade would you give it? {3:NUMERICAL:=3:2}

Good luck!

Now the
above is the format.

i used your example:also see screenshot below(if you type what i have typed below in embedded question's main window, you'll get it right)


Please spell the name john in as many different ways you can
? {1:SHORTANSWER:Jan# feedback is wrong answer~=Jon#Feedback for correct answer~%50%Jaun#Feedback for half credit answer}
Attachment embed.JPG
In reply to Dr S Bhatia

Re: Embedded questions & Multiple correct answers

by Dr S Bhatia -
see the working screenshot

Attachment embed_screenshot.JPG
In reply to Dr S Bhatia

Re: Embedded questions & Multiple correct answers

by John Hellaby -

The problem we face is when there are multiple 100% correct answers. For the one box.

Typically our code has looked as follows:

(1.SHORTANSWER:=john#correct~=jean#correct~=jon#correct~)

Obviously this doesn't work as we would hope, but we definately need to have 3 answers that give full marks.

 

In reply to John Hellaby

Re: Embedded questions & Multiple correct answers

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

Hi John,

Not sure I understand your problem, but what you want to achieve is really easy. There are several syntax errors in the example in your last post.

(1.SHORTANSWER:=john#correct~=jean#correct~=jon#correct~)

should be:

{1:SHORTANSWER:=john#correct~=jean#correct~=jon#correct}

The following embedded question works fine for me, see attached screenshot. What more do you want?

What are the Diminutives used for John in English? {:SHORTANSWER:=Jack#OK~=Johnnie#OK~=Johnny#OK~Jeannot#No, that is a French diminutive.~Juanito#No, that's a Spanish diminutive.}
NOTE.- See this Web page.
Joseph
Attachment image00.jpg
Average of ratings: Useful (1)
In reply to John Hellaby

Re: Embedded questions & Multiple correct answers

by Dr S Bhatia -
Obviously your code won't work coz the brackets are all wrong.

secondly, moodle doesn't care tuppence how many correct answers you want.
You will HAVE to have them in right syntax, as Joseph has shown. Moodle's software definitely caters for more than 1 correct answers.

Quad Erat Demonstrandum
if you still are unable to get it right, send me 10 of your questions.
I'll write the code for them, test run them and if it works fine i'll send you the file for using as the standard reference. ok. smile

p.s. for someone not very used to writing such codes, this can occasionally look daunting because computers, like maths teachers (and some english teachers like J.R. wink ) are very unforgiving about your punctuation etc. A single mistake in code and the whole question looks wonky.
In reply to Dr S Bhatia

Re: Embedded questions & Multiple correct answers

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

That's right, Dr S Bathia, most teachers (including English teachers) are real nitpickers when it comes to spelling, punctuation, etc. Well, that's the way we were trained and that's how we make a living.

However, as Sir Winston Churchill once put it, "We make a living by what we get, we make a life by what we give." Thanks to Moodle we can give a lot.

JR

PS.- As regards the daunting task of coding embedded (aka Cloze) type questions, may I point to my modest contribution to a slightly more user-friendly interface to be found here?

In reply to Joseph Rézeau

Re: Embedded questions & Multiple correct answers

by Dr S Bhatia -
In reply to Dr S Bhatia

Re: Embedded questions & Multiple correct answers

by John Hellaby -
I have absolutely no problem with nitpicking English teachers, or coders :D

It is how I learn.

Unfortunately do to a confidentiality agreement I can't reveal the exact questions to anyone. So I am doing my best to create similar questions that fit the same template.

The code that I put together after your last post J.R is as follows:

{1:SHORTANSWER:=option one#correct~=option two#correct~=option three#correct~=option four#correct~=option six#correct~incorrect option#incorrect}


The error i receive is below:


Error: Cloze question 81 is missing question options!

 
 

Error: Could not start a new attempt at the quiz

I'm wondering if there is any common language or punctuation that could be in the answers that is conflicting with the moodle code engine.


In reply to John Hellaby

Re: Embedded questions & Multiple correct answers

by Dr S Bhatia -
smile

once again:
i EXACTLY copied and pasted your code above and the result was a normal cloze question except that since you did not write any question, only options, so there was no question in preview too. See screenshot.

Error: Cloze question 81 is missing question options!
 How many questions were you loading. This means it had accepted the first 80 questions and 81st had some syntax error. you gottacheck that.


Attachment preview_cloze.JPG
In reply to John Hellaby

Re: Embedded questions & Multiple correct answers

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

Hi John,

Apart from abiding to the exact syntax for coding embedded (Cloze) type questions, you have to be very careful not to have any "hidden" carriage returns (or line-breaks) within your question text. Do you actually type your embedded questions in the provided Embedded question HTML editor in Moodle? Or do you do any copy-and-paste from another text editor, or from (horror!) MS Word? If you do, then you risk all sorts of formatting errors.

Unfortunately, due to your confidentiality agreement you cannot post here the exact contents of one of your problem-causing questions, so we cannot see exactly what the problem is. Anyway, do check that you have no hidden line breaks in your questions (use the HTML toggle source button to make sure.

Joseph

In reply to Joseph Rézeau

Re: Embedded questions & Multiple correct answers

by John Hellaby -

I have just obtained permission to post the entire question that is causing problems.

Complete with code it is as below:

 

Benefits of RSA reforms or improvements for the community and the enterprise include

  • Improved patronage
  • Reduced government intervention i.e police, Liquor Licensing Division, local council
  • Improved image of premises
  • Improved attitudes and approaches to alcohol consumption
  • Better health status

Please list two other benefits below
{1:SHORTANSWER:=Increased Profits#Correct~=Safer Premises#Correct~=Reduced Operational Costs#Correct~=Satisfied staff and patrons#Correct~=Reduced community complaints#Correct}

the error recieved is

 Error: Cloze question 82 is missing question options!

In reply to John Hellaby

Re: Embedded questions & Multiple correct answers

by Dr S Bhatia -

The following code worked perfectly. If this doesn't work in your moodle, then problem is somewhere else. Just copy and paste the code below to the embedded question window.


Benefits of RSA reforms or improvements for the community and the enterprise include

  • Improved patronage
  • Reduced government intervention i.e police, Liquor Licensing Division, local council
  • Improved image of premises
  • Improved attitudes and approaches to alcohol consumption
  • Better health status
{1:SHORTANSWER:~=Increased Profits#Correct ~=Safer Premises#Correct ~=Reduced Operational Costs#Correct ~=Satisfied staff and patrons#Correct ~=Reduced community complaints#Correct}
In reply to Dr S Bhatia

Re: Embedded questions & Multiple correct answers

by John Hellaby -

I've copied and pasted exactly as you suggested and i get the same error.

I've deleted the question and re-created it - again copying and pasting exactly what you have suggested and i still get the same error.

Where abouts could the problem be if its not within the question?

 

In reply to John Hellaby

Re: Embedded questions & Multiple correct answers

by Dr S Bhatia -
Frankly John, This is as much as my knowledge goes. If there is some problem under the hood then JR or Tim Hunt are more qualified to comment. Let's hope they read this and suggest something.

p.s. i was wondering one thing. Why does it say question no 81 or 82 everytime. This means first 80 questions were OK. were they not cloze type questions?
and secondly, it might be worthwhile to ask exactly 'how do you create this cloze question'........Please do not think that i am doubting your ability. I am trying to rule out human error. sometimes we all keep making a very common mistake.
It would be worth your while to attach a screen shot of this particular question with all the things filled in and also the screen shot that gives the message.
Lastly, we never asked your moodle version and versions of php and mysql. would you please include them too. we gotto widen the net now wink
regards
In reply to Dr S Bhatia

Re: Embedded questions & Multiple correct answers

by John Hellaby -

Hi Dr S,

I most certainly will never worry about you questioning my moodle ability :D I am new to moodle as you've probably gathered and have been working through the documentation and learning as I go.

The version of Moodle is 1.6 and the SQL version is  MySQL 5.0.16-max-log (cut and paste from the my PHPadmin screen.

The only extra module i had installed at the time was Activity Locking 2.0.

I've just removed the moodle site files and reinstalled it - so i'm going to reattempt the question with the code posted by yourself above to see if maybe it was an issue in the AL module.

*update* still the same issue after the reinstall - even using the code you had above Dr S, cut and pasted directly into the cloze question editor.

In reply to John Hellaby

Re: Embedded questions & Multiple correct answers

by David Edwards -

Hi was just reading the messages and took your question and put it in my moodle version 1.6.3 in a cloz question and it worked for me. This is what I have done.

 

Benefits of RSA reforms or improvements for the community and the enterprise include

  • Improved patronage
  • Reduced government intervention i.e police, Liquor Licensing Division, local council
  • Improved image of premises
  • Improved attitudes and approaches to alcohol consumption
  • Better health status

Please list two other benefits below

{1:SHORTANSWER:~=Increased Profits#Correct~=Safer Premises#Correct~=Reduced Operational Costs#Correct~=Satisfied staff and patrons#Correct~=Reduced community complaints#Correct}

{2:SHORTANSWER:~=Increased Profits#Correct~=Safer Premises#Correct~=Reduced Operational Costs#Correct~=Satisfied staff and patrons#Correct~=Reduced community complaints#Correct}

 

If you wonder why two number 1 this gives you to boxes for the answers.

Just copy everything into a cloze question.

Hope this helps.

In reply to David Edwards

Re: Embedded questions & Multiple correct answers

by Dr S Bhatia -
haha

David, Now watch the fun in this screen shot.

I created this question by your code. Can you spot whats wrong with it?
Attachment rsa2box.JPG
In reply to David Edwards

Re: Embedded questions & Multiple correct answers

by Dr S Bhatia -
You cant use two similar boxes.

students will write the same answer in both and get away with it.

see the discussion here (with you?)