This patch is based on http://drupal.org/node/77792. It is currently a generic patch with no reference to the cvs versions until #77792 is committed.

This patch fixes several related items concerning the quiz taking interface. Normally I try to make my patches small and clean, but given the current state of development and the nature of some of the current code, these things all made sense to fix while I was in there.

Here is a punch-list of the things that this patch addresses:

  • Reworked the logic of take_quiz_take in order to allow the resulting html to be passed to two themes. These theme functions are called theme_quiz_quesiton and theme_quiz_result.
  • Added a drupal_set_title call in both theme functions so that the page title now shows the title of the quiz. Note that this is in the theme, allowing theme developers to customize the page titles.
  • Added a "Question x out of y" line to the question pages. This is also in the theme so it can be customized.
  • Reworked the function quiz_calculate_score so that it passes back an array with the number of correct answers, the total number of answer and the percentage score.
  • Reworked the basic score message so that it responds with the format "You got x out of y correct. Your score: z%." This is in theme_quiz_result, so it can be customized by theme developers.

Comments

seanbfuller’s picture

StatusFileSize
new5.85 KB

Here is hopefully a more unix friendly version. I was able to patch the current cvs with the command:

patch -p1 < quiz_percents.patch

seanbfuller’s picture

Sorry, the rest of the command got stripped. Here it is again in a code block:

patch -p0 < quiz_percents.patch
seanbfuller’s picture

Status: Needs review » Closed (duplicate)

Most of this was covered in http://drupal.org/node/85983. Anything else will be a new issue.