-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlistar_perg_sugeridas.php
38 lines (34 loc) · 1.08 KB
/
listar_perg_sugeridas.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
require 'class_quiz.php';
$sugeridas = $Quiz->perguntas_sugeridas();
function reescreve($valor,$alt){
if(stripos($valor,'(certa)')>0){
return "<span class='text-success'>$alt: ". str_replace('(certa)','',$valor) ."</span>";
}else{
return "<span class='text-danger'>$alt: $valor</span>";
}
}
while($sugerida = $sugeridas->fetch_object()){
$altA = reescreve($sugerida->A,'A');
$altB = reescreve($sugerida->B,'B');
$altC = reescreve($sugerida->C,'C');
$altD = reescreve($sugerida->D,'D');
if($sugerida->origem == 2){
$class = 'bg-danger';
}else{
$class = 'bg-warning';
}
echo "
<tr>
<td>$sugerida->pergunta</td>
<td class='td_alts'>
$altA
$altB
$altC
$altD
</td>
<td style='text-align: center;'><span class='bloco $class' data-id='$sugerida->id' data-estado='$sugerida->origem'></span></td>
</tr>
";
}
?>