# HG changeset patch # User Nicholas Jillings # Date 1458147150 0 # Node ID ce24c304f93c4d6dace2f983be8871da4694e208 # Parent ce01a65af160dd6315492160a7af6f68fa4997ee comment/score _parser.php updated to match 'ref' 'name' attribute changes. diff -r ce01a65af160 -r ce24c304f93c scripts/comment_parser.php --- a/scripts/comment_parser.php Wed Mar 16 16:16:05 2016 +0000 +++ b/scripts/comment_parser.php Wed Mar 16 16:52:30 2016 +0000 @@ -37,14 +37,14 @@ $page_struct = null; foreach($comment_struct as $comment_struct_page) { - if ($pageInstance['id'] == $comment_struct_page->id) + if ($pageInstance['ref'] == $comment_struct_page->id) { $page_struct = $comment_struct_page; break; } } if ($page_struct == null) { - array_push($comment_struct,new testPage($pageInstance['id'])); + array_push($comment_struct,new testPage($pageInstance['ref'])); $page_struct = $comment_struct[count($comment_struct)-1]; } // Get the audioelements of the page @@ -54,14 +54,14 @@ $element_struct = null; foreach($page_struct->elements as $page_struct_element) { - if ($fragment['id'] == $page_struct_element->id) + if ($fragment['name'] == $page_struct_element->id) { $element_struct = $page_struct_element; break; } } if ($element_struct == null) { - array_push($page_struct->elements,new audioElement($fragment['id'])); + array_push($page_struct->elements,new audioElement($fragment['name'])); $element_struct = $page_struct->elements[count($page_struct->elements)-1]; } $element_struct->addComment($fragment->comment->response); diff -r ce01a65af160 -r ce24c304f93c scripts/score_parser.php --- a/scripts/score_parser.php Wed Mar 16 16:16:05 2016 +0000 +++ b/scripts/score_parser.php Wed Mar 16 16:52:30 2016 +0000 @@ -64,7 +64,7 @@ foreach($xml_object->page as $pageInstance) { // Find in the nest - $pageInstanceId = $pageInstance['id']; + $pageInstanceId = $pageInstance['ref']; $page_nest = $root->findChild($pageInstanceId); if ($page_nest == null) { $page_nest = $root->addNewChild($pageInstanceId); @@ -73,7 +73,7 @@ // Iterate over each $element node foreach($pageInstance->audioelement as $element) { // Find our specific element tag - $elementId = $element['id']; + $elementId = $element['name']; $element_nest = $page_nest->findChild($elementId); if ($element_nest == null) { $element_nest = $page_nest->addNewChild($elementId);