File tree Expand file tree Collapse file tree
ted_sws/notice_validator/resources/templates Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ {% macro increment (dictionary , key , increment_by =1) %}
2+ {% if dictionary .update ({key : dictionary [key ] + increment_by }) %} {% endif %}
3+ {% endmacro %}
4+
15<!DOCTYPE html>
26<html lang =" en" >
37 <head >
4549 </tr >
4650 </thead >
4751 <tbody >
52+ {% set counter = {
53+ 'true_executions' : 0,
54+ 'false_executions' : 0,
55+ 'error_executions' : 0,
56+ } %}
4857 {% for result in validation_results %}
4958 <tr >
5059 <td >{{ result.query.title }}</td >
5362 <td {% if result.result == " True" %} class =" success" {% else %} class =" error" {% endif %} >{{ result.result }}</td >
5463 <td >{{ result.error }}</td >
5564 </tr >
65+ {% if result .result == "True" %}
66+ {{ increment(counter, 'true_executions') }}
67+ {% elif result .error %}
68+ {{ increment(counter, 'error_executions') }}
69+ {% else %}
70+ {{ increment(counter, 'false_executions') }}
71+ {% endif %}
72+
5673 {% endfor %}
5774 </tbody >
5875 </table >
76+ <h2 >Results summary</h2 >
77+ <table class =" display" >
78+ <thead class =" center aligned" >
79+ <tr >
80+ <th >Result type</th >
81+ <th >Number of</th >
82+ <th >Ratio</th >
83+ </tr >
84+ </thead >
85+ <tbody >
86+ <tr >
87+ <td >{{ "True" }}</td >
88+ <td >{{ counter.true_executions }}</td >
89+ <td >{{ counter.true_executions / (counter.true_executions + counter.false_executions + counter.error_executions) }}</td >
90+ </tr >
91+ <tr >
92+ <td >{{ "False" }}</td >
93+ <td >{{ counter.false_executions }}</td >
94+ <td >{{ counter.false_executions / (counter.true_executions + counter.false_executions + counter.error_executions) }}</td >
95+ </tr >
96+ <tr >
97+ <td >{{ "Error" }}</td >
98+ <td >{{ counter.error_executions }}</td >
99+ <td >{{ counter.error_executions / (counter.true_executions + counter.false_executions + counter.error_executions) }}</td >
100+ </tr >
101+ </tbody >
102+ </table >
59103 </body >
60104</html >
61105<script type =" text/javascript" src =" https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js" ></script >
You can’t perform that action at this time.
0 commit comments