WeBWorK Problems

Multiple Choice with Fill in the Blank

Multiple Choice with Fill in the Blank

by Brittni Lorton -
Number of replies: 7

I tried to find something like this in the forum but I was coming up blank.

Is is possible to have a question be multiple choice (i.e. Raidio or Checkbox ) and ALSO include fill in the blank. Something that would look like:

Determine the solution to the given system of equations.

  • The system has one unique solution at ____(student would have to select this one AND fill in the blank of the solution point)
  • The system has no solutions
  • The system has infinitely many solutions.

 

Any thoughts?

Thank you,

*Brittni

In reply to Brittni Lorton

Re: Multiple Choice with Fill in the Blank

by Glenn Rice -

Yes it is possible.  It is not easy though.  I have a macro that I use for this that makes it a little easier.  It works much like the multi answer macro, and you have to provide a checker routine.  It takes a little more work to set up the problem as well.  Due to the nature of the structure used the checker is a little more complex.  At some point I plan to add it to the PG macros.

I have attached the macro and an example if you would like to try it out.  There is documentation in the file.  Feel free to ask if you need additional help.

In reply to Glenn Rice

Re: Multiple Choice with Fill in the Blank

by Glenn Rice -
Here is another example that uses the macro in a simpler way. The format and tex_format options are not required.

I realized that both this example and the previously attached example use the default checker, and to not need to provide one. For some simpler problems this is possible.
In reply to Glenn Rice

Re: Multiple Choice with Fill in the Blank

by Brittni Lorton -

This is very helpful! The examples are really helping me understand the concepts, so I appreciate it. I am wondering what would be best for me in terms of including the macro on my server. I do not have server access so I will reach out to our sys admin and see where he puts all the macros and if this one proves to be helpful then I'll have him add it where the other ones are - unless someone has a different suggestion? This will be the first time I've had to use an additional macro not already included so I am unfamiliar with best practices here.

Thank you!

In reply to Brittni Lorton

Re: Multiple Choice with Fill in the Blank

by Paul Seeburger -

Hi, Brittni!

You should be able to add new or adjusted macros to your macros folder in the templates folder for your course.  They will only affect problems in your course this way, but it will allow you to make use of them.

Paul

In reply to Paul Seeburger

Re: Multiple Choice with Fill in the Blank

by Brittni Lorton -

Hi Paul! Yes I am doing that right now but I am thinking of best practices if we want to use this for all of our courses and colleges here, where is the best location for these additional macros? Maybe each school does it a little differently but I was just curious if there was a best practices in terms of where to put these on teh servers so that we dont have to upload them separately to each course.

In reply to Brittni Lorton

Re: Multiple Choice with Fill in the Blank

by Alex Jordan -

You have a lot of options for where you could put a common version of a macro file, assuming you have access to the server side of things.

In localOverrides.conf, you have this line:

https://github.com/openwebwork/webwork2/blob/cfb690ade3d3c55527d522ed1a8f1defd5e19f6a/conf/localOverrides.conf.dist#L267

You can add a path to the list of paths that are searched for macro library files. So (this is just one option) you could make a course that is for development purposes only, and put new macro library files there in its macros folder. Then add that folder to the list of paths with something like:

$pg{directories}{macrosPath} = [@{$pg{directories}{macrosPath}},"/opt/webwork/courses/developmentCourse/templates/macros"];

Then all courses will be able to use whatever is in that macro library folder.