WeBWorK Main Forum

Remove Preview option from gateway quiz?

Remove Preview option from gateway quiz?

by Lars Jensen -
Number of replies: 3
Dear Colleagues,

Is there a way to remove the Preview problem and Preview Test options from a gateway quiz. If students click these, they may have some trouble getting out of the preview screen, and since my gateway quizzes are all multiple choice, I'd rather remove these options.

Thanks,
Lars.
In reply to Lars Jensen

Re: Remove Preview option from gateway quiz?

by Gavin LaRose -
Hi Lars,

There is no built-in mechanism for this. If you want to edit the source code, I think if you change line 2088-2090 of webwork2/lib/WeBWorK/ContentGenerator/GatewayQuiz.pm from

    print CGI::p({class=>"gwPreview"},
      CGI::a({-href=>"$jsprevlink        "},
      "preview problems"));
to
#    print CGI::p({class=>"gwPreview"},
#      CGI::a({-href=>"$jsprevlink        "},
#      "preview problems"));

and similarly change lines 2156-2158 from

    print CGI::p( CGI::submit( -name=>"previewAnswers",
      -label=>"Preview Test" ),
      ($can{recordAnswersNextTime} ?
to
    print CGI::p( # CGI::submit( -name=>"previewAnswers",
      # -label=>"Preview Test" ),
      ($can{recordAnswersNextTime} ?

it will avoid showing the preview button and links on the gateways.

I hope that's useful,
Gavin

In reply to Gavin LaRose

Re: Remove Preview option from gateway quiz?

by Lars Jensen -
Hi Gavin,

Thanks for your reply. Your solution would affect all gateway tests of all instructors, right? I was thinking that it would be helpful to have a turn on/off switch of preview at the individual test level. The reason is that for a multiple choice test preview is unnecessary, but some students will nevertheless click on the links and get lost. Could this possibly be made one of the parameters to be set when configuring a gateway test? Just a suggestion.

Thanks,
Lars.
In reply to Lars Jensen

Re: Remove Preview option from gateway quiz?

by Gavin LaRose -
Hi Lars,

You're correct; my work-around would affect all gateway tests. I've thought about the desirability of removing the preview option for multiple-choice tests before and not bothered with it; I'll add it to the list of things to think about as a feature enhancement.

Gavin