Mercurial > hg > webaudioevaluationtool
comparison scripts/comment_parser.php @ 1256:4fb8222b96ae
comment/score _parser.php updated to match 'ref' 'name' attribute changes.
author | Nicholas Jillings <n.g.r.jillings@se14.qmul.ac.uk> |
---|---|
date | Wed, 16 Mar 2016 16:52:30 +0000 |
parents | 9ee921c8cdd3 |
children | f22a6240fb51 |
comparison
equal
deleted
inserted
replaced
1255:dcbf87684e99 | 1256:4fb8222b96ae |
---|---|
35 { | 35 { |
36 // Find the page in the comment_struct | 36 // Find the page in the comment_struct |
37 $page_struct = null; | 37 $page_struct = null; |
38 foreach($comment_struct as $comment_struct_page) | 38 foreach($comment_struct as $comment_struct_page) |
39 { | 39 { |
40 if ($pageInstance['id'] == $comment_struct_page->id) | 40 if ($pageInstance['ref'] == $comment_struct_page->id) |
41 { | 41 { |
42 $page_struct = $comment_struct_page; | 42 $page_struct = $comment_struct_page; |
43 break; | 43 break; |
44 } | 44 } |
45 } | 45 } |
46 if ($page_struct == null) { | 46 if ($page_struct == null) { |
47 array_push($comment_struct,new testPage($pageInstance['id'])); | 47 array_push($comment_struct,new testPage($pageInstance['ref'])); |
48 $page_struct = $comment_struct[count($comment_struct)-1]; | 48 $page_struct = $comment_struct[count($comment_struct)-1]; |
49 } | 49 } |
50 // Get the audioelements of the page | 50 // Get the audioelements of the page |
51 foreach($pageInstance->audioelement as $fragment) | 51 foreach($pageInstance->audioelement as $fragment) |
52 { | 52 { |
53 // Find the page in the comment_struct | 53 // Find the page in the comment_struct |
54 $element_struct = null; | 54 $element_struct = null; |
55 foreach($page_struct->elements as $page_struct_element) | 55 foreach($page_struct->elements as $page_struct_element) |
56 { | 56 { |
57 if ($fragment['id'] == $page_struct_element->id) | 57 if ($fragment['name'] == $page_struct_element->id) |
58 { | 58 { |
59 $element_struct = $page_struct_element; | 59 $element_struct = $page_struct_element; |
60 break; | 60 break; |
61 } | 61 } |
62 } | 62 } |
63 if ($element_struct == null) { | 63 if ($element_struct == null) { |
64 array_push($page_struct->elements,new audioElement($fragment['id'])); | 64 array_push($page_struct->elements,new audioElement($fragment['name'])); |
65 $element_struct = $page_struct->elements[count($page_struct->elements)-1]; | 65 $element_struct = $page_struct->elements[count($page_struct->elements)-1]; |
66 } | 66 } |
67 $element_struct->addComment($fragment->comment->response); | 67 $element_struct->addComment($fragment->comment->response); |
68 } | 68 } |
69 } | 69 } |