Quiz

Multiple fill-in-the-blanks graded together

 
Picture of George Franz
Multiple fill-in-the-blanks graded together
 

I am trying to write chemistry quiz questions, where the student must balance an equation by filling in integer numbers (coefficients) in front of products and reactants in an equation.

For example:

   1 CH4 + 2 O2 --> 1 CO2 + 2 H2O

the cloze type works, but I want to give an all or nothing grade.  The student either balanced it correctly or they didn't.  I cannot find any way to grade them together as an all or nothing fill-in-the-blank,  I've searched the forums and have only found a few ideas for other question types i'll be needing soon, but nothing useful for this. I am using Moodle 2.6.

Does anyone have any ideas? 

 
Average of ratings: -
Tim at Lone Pine Koala Sanctuary
Re: Multiple fill-in-the-blanks graded together
Core developersDocumentation writersParticularly helpful MoodlersPlugin developers

I can't think of a good way to do this using any of the standard question types. Sorry.

STACK question type could do it, but that is major overkill. https://moodle.org/plugins/view/qtype_formulas might also be able to do it, but I am not sure.

 
Average of ratings: -
Picture of Jean-Michel Védrine
Re: Multiple fill-in-the-blanks graded together
Core developersParticularly helpful MoodlersPlugin developers

Yes I think that the formulas question type could do the job if you only use one subpart with multiple coordinates.

I will try to post an example using the equation you provided.

 
Average of ratings: -
Picture of Daniel Thies
Re: Multiple fill-in-the-blanks graded together
Core developersParticularly helpful MoodlersPlugin developersTesters

I have written a couple question behaviour plugins to do this adaptiveallnothing and deferredallnothing.  They will work with cloze as long as all questions in the quiz are supposed to be all or nothing with one of these behaviours.

 
Average of ratings: Useful (2)
Tim at Lone Pine Koala Sanctuary
Re: Multiple fill-in-the-blanks graded together
Core developersDocumentation writersParticularly helpful MoodlersPlugin developers

Thanks for making that Daniel, and sharing it. It is really neat. I nice example of what you can do with with a new behaviour plugin, and a very small amount of code.

If I might offer some unsolicited code-review, I think there is a slightly better way to do it. Instead of copying the whole method from qbehaviour_deferredfeedback to modify it, you could also do

class qbehaviour_deferredallnothing extends qbehaviour_deferredfeedback {
    public function process_finish(question_attempt_pending_step $pendingstep) {
        $keep = parent::process_finish($pendingstep);
if ($keep == question_attempt::KEEP && $pendingstep->get_fraction($fraction) != 1) { $pendingstep->set_fraction(0); } return $keep; } }

The reason for preferring this method, is that it is more likely to go on working correctly even if the deferred feedback method is changed a bit (e.g. to fix a bug).

I am also failing to work out what the disregarded_info method in the renderer is for. Please can you put my out of my misery by explaining.

 
Average of ratings: Useful (1)
Tim at Lone Pine Koala Sanctuary
Re: Multiple fill-in-the-blanks graded together
Core developersDocumentation writersParticularly helpful MoodlersPlugin developers

Oops! I may have missed something important. The if statement may also need to check

&& $pendingstep->get_fraction($fraction) !== null
 
Average of ratings: Useful (1)
Picture of George Franz
Re: Multiple fill-in-the-blanks graded together
 

Thanks Tim

The formula question type was an excellent suggestion.  I was initially very enthusiastic about it.  It works exactly the way I would like with one exception.  The input boxes are so large, that a simple 2 inch formula wraps onto 2 or 3 lines.  I couldn't find any way to make the inputs smaller, even by altering the css styles for the different formula types.  I did find a workaround, which was to add 'size' => 3, in render.php.


This is of course a horrible idea, and breaks the type for everything else it was intended for.  I thought about adding a new type.  Formula has "number", "numeric"... etc.  Maybe if I added "integer", I could add a switch to reduce the size of the input box.  It's too bad there isn't some way to make the question input more wysisyg.

I'm looking forward to working with Daniel's question behaviors.  They may be good for some other things I'm looking for.  Chemistry equations are a bit like some of these math enhancements there and in the formula question type.


Anyone up for a challenge?

 
Average of ratings: -
Picture of Daniel Thies
Re: Multiple fill-in-the-blanks graded together
Core developersParticularly helpful MoodlersPlugin developersTesters

Thank you very much for the review Tim.  I will test your changes and update them.  I initially started working with adaptivenopenalty behaviour which overrides disregarded_info as it is unnecessary.  I agree it probably does not makes sense to do this with these behaviours now.

 
Average of ratings: -