I am currently working on a project where I aim to display the percentage of marks obtained using a progress bar.
I have the percentage value and I am trying to pass this value in the style: "width:{{$percentage}}" so that the progress bar width changes according to the marks obtained, but it is not working. Here is my code:
Take a look at $percentage at the end of the table data->{{round($percentage, 2)}}
<tr>
<td>1</td>
<td>{{$q->name}}</td>
<td>{{$totalQuestions}}</td>
<td>{{$attemptQuestions}}</td>
<td>{{$userCorrectAnswer}}</td>
<td>{{$userWrongAnswer}}</td>
<td>{{round($percentage, 2)}}</td>
</tr>
@endforeach
</tbody>
</table>
<p>
<strong>Percentage</strong> <span class="pull-right small muted">{{round($percentage, 2)}}</span>
</p>
<div class="progress">
<div class="progress-bar" role="progressbar" aria-valuenow="{{$percentage}}" aria-valuemin="0" aria-valuemax="100" style="width : {{$percentage}}">
<span class="sr-only">{{round($percentage, 2)}} Obtained</span>
</div>