Commit 3af824369676a6ce7c1e2ec4bcbe900f59df1b70
1 parent
e403dc30
Exists in
master
and in
1 other branch
marcação
git-svn-id: https://svn.bento.ifrs.edu.br/default/ASES/ASES%20-%20Web/ASES%20-%20Web/Fontes/avaliador-api@10446 c2178572-b5ca-4887-91d2-9e3a90c7d55b
Showing
1 changed file
with
11 additions
and
3 deletions
Show diff stats
src/main/java/br/com/checker/emag/core/MarkEvaluation.java
... | ... | @@ -259,8 +259,12 @@ public class MarkEvaluation extends Evaluation { |
259 | 259 | |
260 | 260 | } |
261 | 261 | |
262 | + List<Integer> linhasImg = new ArrayList<Integer>(); | |
263 | + tags = Arrays.asList("Doctype","script","meta","style","head","h1","h2","h3","h4","h5","h6","a","p"); | |
264 | + | |
262 | 265 | for (Element element : getDocument().getAllElements()) { |
263 | 266 | if(!tags.contains(element.getName())){ |
267 | + | |
264 | 268 | if(element != null){ |
265 | 269 | |
266 | 270 | String endTag = element.getEndTag() == null ? "" : element.getEndTag().toString(); |
... | ... | @@ -268,12 +272,16 @@ public class MarkEvaluation extends Evaluation { |
268 | 272 | Element img = element.getFirstElement("img"); |
269 | 273 | |
270 | 274 | if(img != null){ |
271 | - if(img.getAttributes().get("alt") != null && img.getAttributes().get("alt").getValue().isEmpty()) | |
272 | - occurrences.add(this.buildOccurrence("1.2", false, img.toString(), element, "1")); | |
275 | + if(img.getAttributes().get("alt") != null && img.getAttributes().get("alt").getValue().isEmpty()){ | |
276 | + if(!linhasImg.contains(this.getRow(img))); | |
277 | + occurrences.add(this.buildOccurrence("1.2", false, img.toString(), img, "1")); | |
278 | + linhasImg.add(this.getRow(img)); | |
279 | + } | |
273 | 280 | |
274 | 281 | }else{ |
275 | - if(element.getContent().toString().isEmpty() || element.getContent().toString().trim().equals("")) | |
282 | + if(element.getContent().toString().isEmpty() || element.getContent().toString().trim().equals("")){ | |
276 | 283 | occurrences.add(this.buildOccurrence("1.2", false, element.getStartTag().toString() + endTag, element, "1")); |
284 | + } | |
277 | 285 | |
278 | 286 | } |
279 | 287 | } | ... | ... |