• Resolved Islo

    (@nuytun)


    Hi
    Can you tell me what page the results are listed (i.e. results.php) and in what folder? I can’t find it.

    I see you have percentages in the graph and want to move those to the category line.

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor ustimenko

    (@ustimenko)

    Thread Starter Islo

    (@nuytun)

    Hi

    Does anyone know where the code below might be placed to get the % score results to show on the category line?

    I found the % code:
    <span style="width: <?php echo $scale->getValueAsRatio()*100 ?>%"></span>

    I am not sure where or how to place it.

    Here is the code snippet from getresults.php:

    <?php if ($isShowScales): ?>
    
        <?php foreach ($scales as $i => $scale): /* @var $scale WpTesting_Model_Scale */ ?>
    
            <h3 class="<?php echo $scale->getCssClass($i) ?> title"><?php echo $scale->getTitle() ?></h4>
    
            <div class="<?php echo $scale->getCssClass($i) ?> scores">
                <?php echo $scale->formatValueAsOutOf() ?>
            </div>
            <div class="<?php echo $scale->getCssClass($i) ?> meter">
                <span style="width: <?php echo $scale->getValueAsRatio()*100 ?>%"></span>
            </div>
    
            <div class="<?php echo $scale->getCssClass($i) ?> description"><?php echo $renderer->renderWithMoreSplitted($renderer->renderTextAsHtml($scale->getDescription())) ?></div>
    
        <?php endforeach ?>
    
    <?php endif ?>
    Thread Starter Islo

    (@nuytun)

    Ok, found the solution:

    Find the file get-results.php
    (in the folder: :src/Template/Test/Passer/get-results.php)

    take this line:
    <?php echo $scale->formatValueAsOutOf() ?>

    and change it to this:
    <?php echo $scale->formatValueAsOutOf() . ” – ” . $scale->getValueAsRatio()*100 . “%”; ?>

    The percentage will now be displayed after the score on the results page.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Results %’ is closed to new replies.