Any way to get percentages as scores?

MuAppDevNetwork
MuAppDevNetwork
  • MuAppDevNetwork
  • 12 months ago
Hello,

I was wondering if there is a way to get percentages for the quizzes?

I modified my code in the following way to do it manually:
  • in the quiz_results.php template, i added $outof++ to each of the switch cases except the free text ones
  • then after the for each i did this:
     $score = 0;
    $correct = QuizAnswerManager::get_score();
    if($correct > 0 && $outof > 0)
    {
    $score = ($correct / $outof);
    }
    $score = number_format($score * 100, 2, '.', '');

  • then i changed the score section to this:
    <div class="score"><?php echo JText::_('TXT_YOUR_SCORE');?>:&nbsp;<?php echo $correct;?>  out of <?php echo $outof; ?> 
    (<?php echo $score; ?>%)</div>


I ask because my client would like the percentage to also show up in the csv file. thats a little more tricky and wanted to ask if there is anything built already to get this info?

Access to viewing replies is restricted.
Showing 1 of 1 replies
You do not have permissions for replying to this topic.
Loading...
Confirm delete? This action is irreversible and the data will be deleted permanently. Do you want to continue? Confirm Add New Delete Unpublish Cancel Import Uninstall The selected item successfully deleted.
Shondalai