PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > php.general > Parsing Poor XML into to PHP
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Parsing Poor XML into to PHP

Réponse
 
LinkBack Outils de la discussion
Vieux 17/09/2007, 06h16   #1
John Taylor-Johnston
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Parsing Poor XML into to PHP

Pour examples of xml, but this is what I want to do. I have a quiz.

BASICALLY How do EXTRACT THE Contents and Values of these tags into
strings and arrays I can work with.

Depending upon the students answer, compared to the criterion below, I
need to calculate a value = x/1. The score could very well be rounded
down to 1/1, but at least each student will get the feedback, if a
particular piece of feedback applies to the, If not, it will not appear
on their evaluation sheet.
I can pseudo cod ehtis in my head, but am wondering where to get
started. Can someone me take <Instructions</Instrudtions> into a
string for example?
Then take <Criterion[0]> through nmax = [5] into two arrays:
CriterionValue and CriterionComment, as well as <feedback> 0=5 and
organised the into arrays.

The rest, I think I can do.

John

<Instructions>Take the sentence below and transform it into a
Information Question.</Instructions>
<Question>Harry Potter went to Hogwarts School of Wizardry.</Question>
<Answer>Where did Harry Potter go? </Answer>



<Criterion name=Criterion[0] value="1">Where did Harry Potter go to
school?<Criterion>
<Feedback>The answer was the exact answer we expected.)</Feedback>
<Criterion name=Criterion[1] value=".9">Where did Harry Potter go to
school ?<Criterion>
<Feedback>There was a syntax error using the "?" question mark.)</Feedback>
<Criterion name=Criterion[2] value=".2">Where <Criterion>
<Feedback>The answer contained the correct Question word.
$Criterion[2].</Feedback>
<Criterion name=Criterion[3] value=".2">Where did<Criterion>
<Feedback>The answer contained in $Criterion[3].</Feedback>
<Criterion name=Criterion[4] value=".2">Where did Harry<Criterion>
<Feedback>The answer contained in $Criterion[4].</Feedback>
<Criterion name=Criterion[5] value=".2">Where did Harry go<Criterion>
<Feedback>The answer contained in $Criterion[5].</Feedback>



Unforgivable stuff:



<Criterion name=Criterion[6] value="-.2>Hogwarts School of
Wizardry<Criterion>

<Feedback>No need to include the complement in a question that requires
a complement.</Feedback>

<Criterion name=Criterion[7] value="-.2>go at school<Criterion>

<Feedback>"Go to school" not "go at school"</Feedback>







  Réponse avec citation
Vieux 17/09/2007, 12h39   #2
Gavin M. Roy
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] Parsing Poor XML into to PHP

I'm not sure, but perhaps tidy can fix the broken elements of the xml
file... I don't remember if it will close your quotes or just drop the
element from the tag.

On 9/17/07, John Taylor-Johnston <jt.johnston@usherbrooke.ca> wrote:
>
> Pour examples of xml, but this is what I want to do. I have a quiz.
>
> BASICALLY How do EXTRACT THE Contents and Values of these tags into
> strings and arrays I can work with.
>
> Depending upon the students answer, compared to the criterion below, I
> need to calculate a value = x/1. The score could very well be rounded
> down to 1/1, but at least each student will get the feedback, if a
> particular piece of feedback applies to the, If not, it will not appear
> on their evaluation sheet.
> I can pseudo cod ehtis in my head, but am wondering where to get
> started. Can someone me take <Instructions</Instrudtions> into a
> string for example?
> Then take <Criterion[0]> through nmax = [5] into two arrays:
> CriterionValue and CriterionComment, as well as <feedback> 0=5 and
> organised the into arrays.
>
> The rest, I think I can do.
>
> John
>
> <Instructions>Take the sentence below and transform it into a
> Information Question.</Instructions>
> <Question>Harry Potter went to Hogwarts School of Wizardry.</Question>
> <Answer>Where did Harry Potter go? </Answer>
>
>
>
> <Criterion name=Criterion[0] value="1">Where did Harry Potter go to
> school?<Criterion>
> <Feedback>The answer was the exact answer we expected.)</Feedback>
> <Criterion name=Criterion[1] value=".9">Where did Harry Potter go to
> school ?<Criterion>
> <Feedback>There was a syntax error using the "?" question
> mark.)</Feedback>
> <Criterion name=Criterion[2] value=".2">Where <Criterion>
> <Feedback>The answer contained the correct Question word.
> $Criterion[2].</Feedback>
> <Criterion name=Criterion[3] value=".2">Where did<Criterion>
> <Feedback>The answer contained in $Criterion[3].</Feedback>
> <Criterion name=Criterion[4] value=".2">Where did Harry<Criterion>
> <Feedback>The answer contained in $Criterion[4].</Feedback>
> <Criterion name=Criterion[5] value=".2">Where did Harry go<Criterion>
> <Feedback>The answer contained in $Criterion[5].</Feedback>
>
>
>
> Unforgivable stuff:
>
>
>
> <Criterion name=Criterion[6] value="-.2>Hogwarts School of
> Wizardry<Criterion>
>
> <Feedback>No need to include the complement in a question that requires
> a complement.</Feedback>
>
> <Criterion name=Criterion[7] value="-.2>go at school<Criterion>
>
> <Feedback>"Go to school" not "go at school"</Feedback>
>
>
>
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 07h36.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,11358 seconds with 10 queries