Hi,

I recently wanted to provide difference scoring for a multichoice question. When I added different score in the 'score if not chosen' I came to know that the default score in quiz scoring got saved.

This looked like a bug to me because only when the 'score if not chosen' is left empty the default score must be saved, if not the entered score must be saved. I am here with adding a patch which might solve this issue.

Thank you

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Sivaji_Ganesh_Jojodae’s picture

Sabareesh,

Thanks for the patch. But it is not solving the issue.

In insertAlternative() and updateAlternative() methods I'm receiving the score_if_not_chosen if not chosen as 0. I'm not 100% sure about the scoring, as I see in forgive() method it is intentionally changed to 0, off course there is a comment line too regarding the same.

Respective code is snip below

private function forgive() {
    else {
      // For questions with one, and only one, correct answer, there will be no points awarded for alternatives
      // not chosen.
      for ($i = 0; isset($this->node->alternatives[$i]); $i++) {
        $short = &$this->node->alternatives[$i];
        $short['score_if_not_chosen'] = 0;
        if (isset($short['correct']) && $short['correct'] == 1 && !_quiz_is_int($short['score_if_chosen'], 1)) {
          $short['score_if_chosen'] = 1;
        }
      }
    }
sandra@digitalworldbiology.com’s picture

Issue summary: View changes
FileSize
17.92 KB

I can confirm that this is not working in 7x.5 alpha 8.

Here's how to test this:

1. Create a multiple choice question.

2. Add an option for an incorrect answer.

3. Open the ADVANCED OPTIONS link below the answer field.

4. By default, the value in the "Score if chosen" field will be -1.

5. Change the value to 0 and save the question.

6. Open the question again, the new value should appear in the field, but instead the value will still be -1.

djdevin’s picture

Status: Active » Closed (duplicate)
Related issues: +#1638116: Add zero-scoring option for incorrect answers in multichoice question

Dupe