Can I turn off scoring entirely?

Events happening in the community are now at Drupal community events on www.drupal.org.
IKN's picture

I'm using quiz question types (Drupal 7), but don't want scoring. Can someone tell me how to turn off all evaluation and just say thanks?

Right now, users are getting this error:

"Parts of this Registration have not been evaluated yet. The score below is not final."

But I want to tell them "Thanks for the info."

Thank you,

David

Comments

String overrides

joel_osc's picture

A quick solution may be to just use the String Overrides module to alter that text.

Create a 'show score' field

hakeem's picture

Another quick, but not recommended, solution:

I created a 'Show score' field (field_quiz_show_score) in quiz content type, and added the following condition to quiz.pages.inc (function theme_quiz_take_summary):

<?php
    $thisnode
= node_load(arg(1));
    if (
$thisnode->field_quiz_show_score['und'][0]['value']) {
     
$output .= '<div id="quiz_score_possible">' . t('You got %num_correct of %question_count possible points.', array('%num_correct' => $score['numeric_score'], '%question_count' => $score['possible_score'])) . '</div>' . "\n";
     
$output .= '<div id="quiz_score_percent">' . t('Your score: %score %', array('%score' => $score['percentage_score'])) . '</div>' . "\n";
    }
?>

Tried stringoverrides

IKN's picture

Thank you Joel and Hakeem,
I tried stringoverrides, but, so far, it doesn't seem to have an effect (it does fix other types of strings, I noticed, such as the "Start quiz" button -- so I edited the actual string (in quiz.pages.inc): not a good thing, I'm sure, but good for appearances.

Hakeem, I didn't try to add your field as I don't want a score (or anything about one) to show. (Let me know if I missed the point.)

Thank you, both.

David

http://FlossEd.org - Free & Open Source Schools -- Free & Open Minds

Did you try?

joel_osc's picture

Since the call to the t function in quiz.pages.inc is as follows:

$msg = t('Parts of this @quiz have not been evaluated yet. The score below is not final.', array('@quiz' => QUIZ_NAME));

You need to make sure your string to replace contains the placeholder like this:

"Parts of this @quiz have not been evaluated yet. The score below is not final."

Flush the caches and it should work.

If all else fails (although should not be necessary) you can always copy the function theme_quiz_take_summary() to your theme template.php file, rename it to mytheme_quiz_take_summary and then change the text. This solution will also require flushing the caches to rebuild the theme registry. If haven't seen it already, you can look at the help (admin/help/stringoverrides) it shows examples of replacing strings with placeholders, so stringoverrides would be the best solution.

Yes, I tried, but without the placeholder

IKN's picture

So, now it works. Thank you -- I had put that place-holder in when I edited the code manually, but figured I couldn't when using the module. Thanks again.

http://FlossEd.org - Free & Open Source Schools -- Free & Open Minds

Quiz

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week