DOCUMENT();

loadMacros(
    'PGstandard.pl',     'PGML.pl',
    'PGchoicemacros.pl', 'PGgraders.pl',
    'unionTables.pl',    'PGcourse.pl'
);

$showPartialCorrectAnswers = 0;

# Incremental grader
install_problem_grader(~~&custom_problem_grader_fluid);
$ENV{grader_numright} = [ 2,   4,   6 ];
$ENV{grader_scores}   = [ 0.3, 0.6, 1 ];
$ENV{grader_message} =
    'You can earn '
    . '30% partial credit for 2 - 3 correct answers, and '
    . '60% partial credit for 4 - 5 correct answers.';

# All or nothing grader
# install_problem_grader(~~&std_problem_grader);

# Create a matching list and use pop ups
$ml = new_match_list();
$ml->rf_print_q(~~&pop_up_list_print_q);
$ml->ra_pop_up_list([
    'No answer' => '?',
    'A'         => 'A',
    'B'         => 'B',
    'C'         => 'C',
    'D'         => 'D',
    'E'         => 'E',
    'F'         => 'F',
    'G'         => 'G',
    'H'         => 'H',
    'I'         => 'I',
]);

# Add correct questions and answers
$ml->qa(
    'Question a?',
    'Answer a',
    'Question b?',
    'Answer b',
    'Question c?',
    'Answer c',
    'Question d?',
    'Answer d',
    'Question e?',
    'Answer e',
    'Question f?',
    'Answer f',
);
$ml->choose(6);

# Add extra incorrect answers
$ml->extra('Extra answer 1', 'Extra answer 2',);
$ml->choose_extra(2);

$ml->makeLast('None of the above');

BEGIN_PGML
Match each question with its answer.

[@ ColumnMatchTable($ml) @]***
END_PGML

ANS(str_cmp($ml->ra_correct_ans));

BEGIN_PGML_SOLUTION
The correct answers are [@ join(', ', @{ $ml->ra_correct_ans() }) @].
END_PGML_SOLUTION

ENDDOCUMENT();