2017-09-30 1 views
0

Das Problem Ich tritt in den ATutor QTI ParserPHP7 xml_parse() ändert sich, abgeschnittene Arrays?

mit der xml_parse() Funktion, ich hoffe jemand kann darauf hinweisen, was ich fehle, oder vielleicht mit einer Arbeit um für PHP kommen 7.1.1 .

Ich habe keine Dokumentation oder Beiträge hier gefunden, die Änderungen an der PHP-Funktion xml_parse() von 5.6 auf 7.1 vorschlagen, obwohl die beiden Versionen XML anders zu analysieren scheinen. Das zu analysierende XML wird unten angezeigt.

Insbesondere für die Frage Array in den Beispielen 5.6.30 gibt ein Array von Fragen, wie:

[question] => Array 
    (
     [0] => graphic matching 
     [1] => LIKERT 
     [2] => multi choice question 
     [3] => Mutliple question 
     [4] => open ended 
     [5] => ordering 
     [6] => Simple match 
     [7] => true 
    ) 

Während mit PHP 7.1.1, alles andere gleich ist, es gibt nur die erste Buchstaben von jedem der obigen Array-Elemente als String.

[question] => gLmMooSt 

Die XML-Datei ist ein IMS QTI 1.2.1 manifest, aus einem QTI Test (das heißt Quiz) Paket.

Das Element, bei dem die Abschneidung auftritt, ist der Fragetitel (die Frage selbst), der im folgenden Element gefunden wird und bei Verwendung von PHP5.6 als erstes Element im Array zurückkehrt ([0] => Grafikabgleich). und kehrt als erster Buchstabe "g", in der Frage Zeichenfolge bei der Verwendung von PHP7.1.1 ([Frage] => gLmMooSt)

<material> 
     <mattext texttype="text/html">graphic matching</mattext> 
</material> 

<?xml version="1.0" encoding="utf-8"?> 
 

 
<questestinterop 
 
    xmlns="http://www.imsglobal.org/xsd/ims_qtiasiv1p2" 
 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
 
    xsi:schemaLocation="http://www.imsglobal.org/xsd/ims_qtiasiv1p2 http://www.imsglobal.org/profile/cc/ccv1p0/derived_schema/domainProfile_4/ims_qtiasiv1p2_localised.xsd" 
 
> 
 
\t <assessment title="Simple test" ident="d41d8cd98f00b204e9800998ecf8427e"> 
 
       
 
\t \t <section ident="ATUTOR-8" title="Simple test"> 
 
\t \t <!-- matching question with partial marks --> 
 
\t \t <item title="Mathcing question" ident="ITEM_2"> 
 
\t \t \t <itemmetadata> 
 
\t \t \t \t <qtimetadata> 
 
\t \t \t \t \t <qtimetadatafield> 
 
\t \t \t \t \t \t <fieldlabel>qmd_itemtype</fieldlabel> 
 
\t \t \t \t \t \t <fieldentry>Logical Groups</fieldentry> 
 
\t \t \t \t \t </qtimetadatafield> 
 
\t \t \t \t \t <qtimetadatafield> 
 
\t \t \t \t \t \t <fieldlabel>qmd_questiontype</fieldlabel> 
 
\t \t \t \t \t \t <fieldentry>Drag-and-drop</fieldentry> 
 
\t \t \t \t \t </qtimetadatafield> 
 
        <qtimetadatafield> 
 
         <fieldlabel>cc_profile</fieldlabel> 
 
         <fieldentry>cc.pattern_match.v0p1</fieldentry> 
 
        </qtimetadatafield> 
 
        <qtimetadatafield> 
 
         <fieldlabel>cc_weighting</fieldlabel> 
 
         <fieldentry>5</fieldentry> 
 
        </qtimetadatafield> 
 
\t \t \t \t </qtimetadata> 
 
\t \t \t </itemmetadata> 
 
\t \t \t <presentation> 
 
\t \t \t \t <flow> 
 
\t \t \t \t \t <material> 
 
\t \t \t \t \t \t <mattext texttype="text/html">graphic matching</mattext> 
 
\t \t \t \t \t </material> 
 
\t \t \t \t \t \t \t 
 
\t \t \t \t \t <response_lid ident="RESPONSE-98f13708210194c475687be6106a3b84" rcardinality="Multiple"> 
 
\t \t \t \t \t \t <material> 
 
\t \t \t \t \t \t \t <mattext texttype="text/html">a</mattext> 
 
\t \t \t \t \t \t </material> 
 
\t \t \t \t \t \t <render_choice shuffle="No"> 
 
\t \t \t \t \t \t \t \t \t \t \t \t \t <response_label ident="Option0"> \t 
 
\t \t \t \t \t \t \t \t <flow_mat> 
 
\t \t \t \t \t \t \t \t \t <material> 
 
\t \t \t \t \t \t \t \t \t \t <mattext texttype="text/html">A</mattext> 
 
\t \t \t \t \t \t \t \t \t </material> 
 
\t \t \t \t \t \t \t \t </flow_mat> 
 
\t \t \t \t \t \t \t </response_label> 
 
\t \t \t \t \t \t \t \t \t \t \t \t \t <response_label ident="Option1"> \t 
 
\t \t \t \t \t \t \t \t <flow_mat> 
 
\t \t \t \t \t \t \t \t \t <material> 
 
\t \t \t \t \t \t \t \t \t \t <mattext texttype="text/html">B</mattext> 
 
\t \t \t \t \t \t \t \t \t </material> 
 
\t \t \t \t \t \t \t \t </flow_mat> 
 
\t \t \t \t \t \t \t </response_label> 
 
\t \t \t \t \t \t \t \t \t \t \t \t </render_choice> 
 
\t \t \t \t \t </response_lid> 
 
\t \t \t \t \t \t \t 
 
\t \t \t \t \t <response_lid ident="RESPONSE-3c59dc048e8850243be8079a5c74d079" rcardinality="Multiple"> 
 
\t \t \t \t \t \t <material> 
 
\t \t \t \t \t \t \t <mattext texttype="text/html">b</mattext> 
 
\t \t \t \t \t \t </material> 
 
\t \t \t \t \t \t <render_choice shuffle="No"> 
 
\t \t \t \t \t \t \t \t \t \t \t \t \t <response_label ident="Option0"> \t 
 
\t \t \t \t \t \t \t \t <flow_mat> 
 
\t \t \t \t \t \t \t \t \t <material> 
 
\t \t \t \t \t \t \t \t \t \t <mattext texttype="text/html">A</mattext> 
 
\t \t \t \t \t \t \t \t \t </material> 
 
\t \t \t \t \t \t \t \t </flow_mat> 
 
\t \t \t \t \t \t \t </response_label> 
 
\t \t \t \t \t \t \t \t \t \t \t \t \t <response_label ident="Option1"> \t 
 
\t \t \t \t \t \t \t \t <flow_mat> 
 
\t \t \t \t \t \t \t \t \t <material> 
 
\t \t \t \t \t \t \t \t \t \t <mattext texttype="text/html">B</mattext> 
 
\t \t \t \t \t \t \t \t \t </material> 
 
\t \t \t \t \t \t \t \t </flow_mat> 
 
\t \t \t \t \t \t \t </response_label> 
 
\t \t \t \t \t \t \t \t \t \t \t \t </render_choice> 
 
\t \t \t \t \t </response_lid> 
 
\t \t \t \t \t \t \t \t \t </flow> 
 
\t \t \t </presentation> 
 

 
\t \t \t <resprocessing> 
 
\t \t \t \t <outcomes> 
 
\t \t \t \t \t <decvar varname="SCORE" /> 
 
\t \t \t \t </outcomes> 
 
\t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t </resprocessing> 
 
\t \t \t \t </item> 
 

 

 
<!-- likert question (aka multiple choice with no correct answer) --> 
 
\t \t <item title="Multiple choice question" ident="ITEM_1"> 
 
\t \t \t <itemmetadata> 
 
\t \t \t \t <qtimetadata> 
 
\t \t \t \t \t <qtimetadatafield> 
 
\t \t \t \t \t \t <fieldlabel>qmd_itemtype</fieldlabel> 
 
\t \t \t \t \t \t <fieldentry>Logical Identifier</fieldentry> 
 
\t \t \t \t \t </qtimetadatafield> 
 
\t \t \t \t \t <qtimetadatafield> 
 
\t \t \t \t \t \t <fieldlabel>qmd_questiontype</fieldlabel> 
 
\t \t \t \t \t \t <fieldentry>Multiple-choice</fieldentry> 
 
\t \t \t \t \t </qtimetadatafield> 
 
        <qtimetadatafield> 
 
         <fieldlabel>cc_profile</fieldlabel> 
 
         <fieldentry>cc.mutliple_choice.v0p1</fieldentry> 
 
        </qtimetadatafield> 
 
\t \t \t \t </qtimetadata> 
 
\t \t \t </itemmetadata> 
 
\t \t \t <presentation> 
 
\t \t \t \t <flow> 
 
\t \t \t \t \t <material> 
 
\t \t \t \t \t \t <mattext texttype="text/html">LIKERT</mattext> 
 
\t \t \t \t \t </material> 
 
\t \t \t \t \t <response_lid ident="RESPONSE1" rcardinality="Single"> 
 
\t \t \t \t \t \t <render_choice shuffle="No" minnumber="1" maxnumber="1"> 
 
\t \t \t \t \t \t \t <flow_label> 
 
\t \t \t \t \t \t \t \t \t \t \t \t \t \t \t <response_label ident="Choice0"> \t 
 
\t \t \t \t \t \t \t \t \t <material> 
 
\t \t \t \t \t \t \t \t \t \t <mattext texttype="text/html">A LITTLE</mattext> 
 
\t \t \t \t \t \t \t \t \t </material> 
 
\t \t \t \t \t \t \t \t </response_label> 
 
\t \t \t \t \t \t \t \t \t \t \t \t \t \t \t <response_label ident="Choice1"> \t 
 
\t \t \t \t \t \t \t \t \t <material> 
 
\t \t \t \t \t \t \t \t \t \t <mattext texttype="text/html">A lot</mattext> 
 
\t \t \t \t \t \t \t \t \t </material> 
 
\t \t \t \t \t \t \t \t </response_label> 
 
\t \t \t \t \t \t \t \t \t \t \t \t \t \t </flow_label> 
 
\t \t \t \t \t \t </render_choice> 
 
\t \t \t \t \t </response_lid> 
 
\t \t \t \t </flow> 
 
\t \t \t </presentation> 
 

 
\t \t \t <resprocessing> 
 
\t \t \t \t \t \t \t \t <respcondition title="CorrectResponse"> 
 
\t \t \t \t \t <conditionvar> \t \t \t \t \t 
 
\t \t \t \t \t \t <varequal respident="RESPONSE1">Choice0</varequal> 
 
\t \t \t \t \t </conditionvar> 
 
\t \t \t \t \t <setvar varname="que_score" action="Set">0</setvar> 
 
\t \t \t \t </respcondition> 
 
\t \t \t \t \t \t \t \t <respcondition title="CorrectResponse"> 
 
\t \t \t \t \t <conditionvar> \t \t \t \t \t 
 
\t \t \t \t \t \t <varequal respident="RESPONSE1">Choice1</varequal> 
 
\t \t \t \t \t </conditionvar> 
 
\t \t \t \t \t <setvar varname="que_score" action="Set">0</setvar> 
 
\t \t \t \t </respcondition> 
 
\t \t \t \t \t \t \t </resprocessing> 
 
\t \t </item> 
 

 

 
<!-- single answer multiple choice question --> 
 
\t \t <item title="Multiple choice question" ident="ITEM_5"> 
 
\t \t \t <itemmetadata> 
 
\t \t \t \t <qtimetadata> 
 
\t \t \t \t \t <qtimetadatafield> 
 
\t \t \t \t \t \t <fieldlabel>qmd_itemtype</fieldlabel> 
 
\t \t \t \t \t \t <fieldentry>Logical Identifier</fieldentry> 
 
\t \t \t \t \t </qtimetadatafield> 
 
\t \t \t \t \t <qtimetadatafield> 
 
\t \t \t \t \t \t <fieldlabel>qmd_questiontype</fieldlabel> 
 
\t \t \t \t \t \t <fieldentry>Multiple-choice</fieldentry> 
 
\t \t \t \t \t </qtimetadatafield> 
 
        <qtimetadatafield> 
 
         <fieldlabel>cc_profile</fieldlabel> 
 
         <fieldentry>cc.mutliple_choice.v0p1</fieldentry> 
 
        </qtimetadatafield> 
 
        <qtimetadatafield> 
 
         <fieldlabel>cc_weighting</fieldlabel> 
 
         <fieldentry>5</fieldentry> 
 
        </qtimetadatafield> 
 
\t \t \t \t </qtimetadata> 
 
\t \t \t </itemmetadata> 
 
\t \t \t <presentation> 
 
\t \t \t \t <flow> 
 
\t \t \t \t \t <material> 
 
\t \t \t \t \t \t <mattext texttype="text/html">multi choice question</mattext> 
 
\t \t \t \t \t </material> 
 
\t \t \t \t \t <response_lid ident="RESPONSE5" rcardinality="Single"> 
 
\t \t \t \t \t \t <render_choice shuffle="No" minnumber="1" maxnumber="1"> 
 
\t \t \t \t \t \t \t \t \t \t \t \t \t <response_label ident="Choice0"> 
 
\t \t \t \t \t \t \t \t <flow_mat> 
 
\t \t \t \t \t \t \t \t \t <material> 
 
\t \t \t \t \t \t \t \t \t \t <mattext texttype="text/html">this is correct</mattext> 
 
\t \t \t \t \t \t \t \t \t </material> 
 
\t \t \t \t \t \t \t \t </flow_mat> 
 
\t \t \t \t \t \t \t </response_label> 
 
\t \t \t \t \t \t \t \t \t \t \t \t \t <response_label ident="Choice1"> 
 
\t \t \t \t \t \t \t \t <flow_mat> 
 
\t \t \t \t \t \t \t \t \t <material> 
 
\t \t \t \t \t \t \t \t \t \t <mattext texttype="text/html">this is wrong</mattext> 
 
\t \t \t \t \t \t \t \t \t </material> 
 
\t \t \t \t \t \t \t \t </flow_mat> 
 
\t \t \t \t \t \t \t </response_label> 
 
\t \t \t \t \t \t \t \t \t \t \t \t \t <response_label ident="Choice2"> 
 
\t \t \t \t \t \t \t \t <flow_mat> 
 
\t \t \t \t \t \t \t \t \t <material> 
 
\t \t \t \t \t \t \t \t \t \t <mattext texttype="text/html">this is wrong</mattext> 
 
\t \t \t \t \t \t \t \t \t </material> 
 
\t \t \t \t \t \t \t \t </flow_mat> 
 
\t \t \t \t \t \t \t </response_label> 
 
\t \t \t \t \t \t \t \t \t \t \t \t </render_choice> 
 
\t \t \t \t \t </response_lid> 
 
\t \t \t \t </flow> 
 
\t \t \t </presentation> 
 
\t \t \t <resprocessing> 
 
\t \t \t \t <outcomes> 
 
\t \t \t \t \t <decvar varname="SCORE" /> 
 
\t \t \t \t </outcomes> 
 
\t \t \t \t \t \t \t \t \t \t \t \t \t <respcondition title="CorrectResponse"> 
 
\t \t \t \t \t <conditionvar> \t \t \t \t \t \t 
 
\t \t \t \t \t \t <varequal respident="RESPONSE5">Choice0</varequal> 
 
\t \t \t \t \t </conditionvar> 
 
\t \t \t \t \t <setvar varname="que_score" action="Set">5</setvar> 
 
\t \t \t \t </respcondition> 
 
\t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t 
 
\t \t \t </resprocessing> 
 
\t \t \t \t </item> 
 

 
<!-- multi answer multiple choice question with partial marks --> 
 
\t \t <item title="Multiple answer question" ident="ITEM_4"> 
 
\t \t \t <itemmetadata> 
 
\t \t \t \t <qtimetadata> 
 
\t \t \t \t \t <qtimetadatafield> 
 
\t \t \t \t \t \t <fieldlabel>qmd_itemtype</fieldlabel> 
 
\t \t \t \t \t \t <fieldentry>Logical Identifier</fieldentry> 
 
\t \t \t \t \t </qtimetadatafield> 
 
\t     <qtimetadatafield> 
 
         <fieldlabel>qmd_questiontype</fieldlabel> 
 
         <fieldentry>Multiple-response</fieldentry> 
 
        </qtimetadatafield> 
 
        <qtimetadatafield> 
 
         <fieldlabel>cc_profile</fieldlabel> 
 
         <fieldentry>cc.mutliple_response.v0p1</fieldentry> 
 
        </qtimetadatafield> 
 
        <qtimetadatafield> 
 
         <fieldlabel>cc_weighting</fieldlabel> 
 
         <fieldentry>5</fieldentry> 
 
        </qtimetadatafield> 
 
\t \t \t \t </qtimetadata> 
 
\t \t \t </itemmetadata> 
 
\t \t \t <presentation> 
 
\t \t \t \t <flow> 
 
\t \t \t \t \t <material> 
 
\t \t \t \t \t \t <mattext texttype="text/html">Mutliple question</mattext> 
 
\t \t \t \t \t </material> 
 
\t \t \t \t \t <response_lid ident="RESPONSE4" rcardinality="Multiple"> 
 
\t \t \t \t \t \t <render_choice shuffle="No"> 
 
\t \t \t \t \t \t \t \t \t \t \t \t \t <response_label ident="Choice0"> 
 
\t \t \t \t \t \t \t \t <flow_mat> 
 
\t \t \t \t \t \t \t \t \t <material> 
 
\t \t \t \t \t \t \t \t \t \t <mattext texttype="text/html">coorect</mattext> 
 
\t \t \t \t \t \t \t \t \t </material> 
 
\t \t \t \t \t \t \t \t </flow_mat> 
 
\t \t \t \t \t \t \t </response_label> 
 
\t \t \t \t \t \t \t \t \t \t \t \t \t \t <response_label ident="Choice1"> 
 
\t \t \t \t \t \t \t \t <flow_mat> 
 
\t \t \t \t \t \t \t \t \t <material> 
 
\t \t \t \t \t \t \t \t \t \t <mattext texttype="text/html">coorect</mattext> 
 
\t \t \t \t \t \t \t \t \t </material> 
 
\t \t \t \t \t \t \t \t </flow_mat> 
 
\t \t \t \t \t \t \t </response_label> 
 
\t \t \t \t \t \t \t \t \t \t \t \t \t \t <response_label ident="Choice2"> 
 
\t \t \t \t \t \t \t \t <flow_mat> 
 
\t \t \t \t \t \t \t \t \t <material> 
 
\t \t \t \t \t \t \t \t \t \t <mattext texttype="text/html">icorrect</mattext> 
 
\t \t \t \t \t \t \t \t \t </material> 
 
\t \t \t \t \t \t \t \t </flow_mat> 
 
\t \t \t \t \t \t \t </response_label> 
 
\t \t \t \t \t \t \t \t \t \t \t \t \t \t <response_label ident="Choice3"> 
 
\t \t \t \t \t \t \t \t <flow_mat> 
 
\t \t \t \t \t \t \t \t \t <material> 
 
\t \t \t \t \t \t \t \t \t \t <mattext texttype="text/html">icorrect</mattext> 
 
\t \t \t \t \t \t \t \t \t </material> 
 
\t \t \t \t \t \t \t \t </flow_mat> 
 
\t \t \t \t \t \t \t </response_label> 
 
\t \t \t \t \t \t \t \t \t \t \t \t \t </render_choice> 
 
\t \t \t \t \t </response_lid> 
 
\t \t \t \t </flow> 
 
\t \t \t </presentation> 
 
\t \t \t <resprocessing> 
 
\t \t \t \t <outcomes> 
 
\t \t \t \t \t <decvar varname="SCORE" /> 
 
\t \t \t \t </outcomes> 
 
\t \t \t \t \t \t \t \t \t \t \t <respcondition title="CorrectResponse"> 
 
\t \t \t \t \t <conditionvar> \t \t \t \t \t \t 
 
\t \t \t \t \t \t <varequal respident="RESPONSE4">Choice0</varequal> 
 
\t \t \t \t \t </conditionvar> 
 
\t \t \t \t \t <setvar varname="Respondus_Correct">5</setvar> 
 
\t \t \t \t </respcondition> 
 
\t \t \t \t \t \t \t \t \t \t \t \t \t \t \t <respcondition title="CorrectResponse"> 
 
\t \t \t \t \t <conditionvar> \t \t \t \t \t \t 
 
\t \t \t \t \t \t <varequal respident="RESPONSE4">Choice1</varequal> 
 
\t \t \t \t \t </conditionvar> 
 
\t \t \t \t \t <setvar varname="Respondus_Correct">5</setvar> 
 
\t \t \t \t </respcondition> 
 
\t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t </resprocessing> 
 
\t \t \t \t </item> 
 

 

 
<!-- open ended (free text) question --> 
 
\t \t <item title="Open ended question" ident="ITEM_6"> 
 
\t \t \t <itemmetadata> 
 
\t \t \t \t <qtimetadata> 
 
\t \t \t \t \t <qtimetadatafield> 
 
\t \t \t \t \t \t <fieldlabel>qmd_itemtype</fieldlabel> 
 
\t \t \t \t \t \t <fieldentry>String</fieldentry> 
 
\t \t \t \t \t </qtimetadatafield> 
 
\t \t \t \t \t <qtimetadatafield> 
 
\t \t \t \t \t \t <fieldlabel>qmd_questiontype</fieldlabel> 
 
\t \t \t \t \t \t <fieldentry>FIB-string</fieldentry> 
 
\t \t \t \t \t </qtimetadatafield> 
 
        <qtimetadatafield> 
 
         <fieldlabel>cc_profile</fieldlabel> 
 
         <fieldentry>cc.fib.v0p1</fieldentry> 
 
        </qtimetadatafield> 
 
        <qtimetadatafield> 
 
         <fieldlabel>cc_weighting</fieldlabel> 
 
         <fieldentry>5</fieldentry> 
 
        </qtimetadatafield> 
 
\t \t \t \t </qtimetadata> 
 
\t \t \t </itemmetadata> 
 
\t \t \t <presentation> 
 
\t \t \t \t <flow> 
 
\t \t \t \t \t <material> 
 
\t \t \t \t \t \t <mattext texttype="text/html">open ended</mattext> 
 
\t \t \t \t \t </material> 
 
\t \t \t \t \t <response_str ident="RESPONSE6" rcardinality="Single"> 
 
\t \t \t \t \t \t \t \t \t \t \t \t <render_fib rows="1" columns="5"> 
 
\t \t \t \t \t \t \t <response_label ident="Choice" /> 
 
\t \t \t \t \t \t </render_fib> 
 
\t \t \t \t \t </response_str> 
 
\t \t \t \t </flow> 
 
\t \t \t </presentation> 
 
\t \t \t \t </item> 
 

 

 
<!-- ordering question --> 
 
\t \t <item title="Ordering question" ident="ITEM_7"> 
 
\t \t \t <itemmetadata> 
 
\t \t \t \t <qtimetadata> 
 
\t \t \t \t \t <qtimetadatafield> 
 
\t \t \t \t \t \t <fieldlabel>qmd_itemtype</fieldlabel> 
 
\t \t \t \t \t \t <fieldentry>Logical Identifier</fieldentry> 
 
\t \t \t \t \t </qtimetadatafield> 
 
\t \t \t \t </qtimetadata> 
 
\t \t \t </itemmetadata> 
 
\t \t \t <presentation> 
 
\t \t \t \t <flow> 
 
\t \t \t \t \t <material> 
 
\t \t \t \t \t \t <mattext texttype="text/html">ordering</mattext> 
 
\t \t \t \t \t </material> 
 
\t \t \t \t \t <response_lid ident="RESPONSE7" rcardinality="Ordered"> 
 
\t \t \t \t \t \t <render_choice shuffle="Yes" minnumber="4" maxnumber="4"> 
 
\t \t \t \t \t \t \t \t \t \t \t \t \t \t <response_label ident="Choice0"> \t 
 
\t \t \t \t \t \t \t \t <flow_mat> 
 
\t \t \t \t \t \t \t \t \t <material> 
 
\t \t \t \t \t \t \t \t \t \t <mattext texttype="text/html">item1</mattext> 
 
\t \t \t \t \t \t \t \t \t </material> 
 
\t \t \t \t \t \t \t \t </flow_mat> 
 
\t \t \t \t \t \t \t </response_label> 
 
\t \t \t \t \t \t \t \t \t \t \t \t \t \t <response_label ident="Choice1"> \t 
 
\t \t \t \t \t \t \t \t <flow_mat> 
 
\t \t \t \t \t \t \t \t \t <material> 
 
\t \t \t \t \t \t \t \t \t \t <mattext texttype="text/html">itms2</mattext> 
 
\t \t \t \t \t \t \t \t \t </material> 
 
\t \t \t \t \t \t \t \t </flow_mat> 
 
\t \t \t \t \t \t \t </response_label> 
 
\t \t \t \t \t \t \t \t \t \t \t \t \t \t <response_label ident="Choice2"> \t 
 
\t \t \t \t \t \t \t \t <flow_mat> 
 
\t \t \t \t \t \t \t \t \t <material> 
 
\t \t \t \t \t \t \t \t \t \t <mattext texttype="text/html">item 3</mattext> 
 
\t \t \t \t \t \t \t \t \t </material> 
 
\t \t \t \t \t \t \t \t </flow_mat> 
 
\t \t \t \t \t \t \t </response_label> 
 
\t \t \t \t \t \t \t \t \t \t \t \t \t \t <response_label ident="Choice3"> \t 
 
\t \t \t \t \t \t \t \t <flow_mat> 
 
\t \t \t \t \t \t \t \t \t <material> 
 
\t \t \t \t \t \t \t \t \t \t <mattext texttype="text/html">items 4</mattext> 
 
\t \t \t \t \t \t \t \t \t </material> 
 
\t \t \t \t \t \t \t \t </flow_mat> 
 
\t \t \t \t \t \t \t </response_label> 
 
\t \t \t \t \t \t \t \t \t \t \t \t \t </render_choice> 
 
\t \t \t \t \t </response_lid> 
 
\t \t \t \t </flow> 
 
\t \t \t </presentation> 
 
\t \t \t <resprocessing> 
 
\t \t \t \t <outcomes> 
 
\t \t \t \t \t <decvar varname="SCORE" /> 
 
\t \t \t \t </outcomes> 
 
\t \t \t \t \t \t \t \t <respcondition title="CorrectResponse"> 
 
\t \t \t \t \t <conditionvar> \t \t \t \t \t 
 
\t \t \t \t \t \t <varequal respident="RESPONSE7">Choice0</varequal> 
 
\t \t \t \t \t </conditionvar> 
 
\t \t \t \t \t <setvar varname="Respondus_Correct">1.25</setvar> 
 
\t \t \t \t </respcondition> 
 
\t \t \t \t \t \t \t \t <respcondition title="CorrectResponse"> 
 
\t \t \t \t \t <conditionvar> \t \t \t \t \t 
 
\t \t \t \t \t \t <varequal respident="RESPONSE7">Choice1</varequal> 
 
\t \t \t \t \t </conditionvar> 
 
\t \t \t \t \t <setvar varname="Respondus_Correct">1.25</setvar> 
 
\t \t \t \t </respcondition> 
 
\t \t \t \t \t \t \t \t <respcondition title="CorrectResponse"> 
 
\t \t \t \t \t <conditionvar> \t \t \t \t \t 
 
\t \t \t \t \t \t <varequal respident="RESPONSE7">Choice2</varequal> 
 
\t \t \t \t \t </conditionvar> 
 
\t \t \t \t \t <setvar varname="Respondus_Correct">1.25</setvar> 
 
\t \t \t \t </respcondition> 
 
\t \t \t \t \t \t \t \t <respcondition title="CorrectResponse"> 
 
\t \t \t \t \t <conditionvar> \t \t \t \t \t 
 
\t \t \t \t \t \t <varequal respident="RESPONSE7">Choice3</varequal> 
 
\t \t \t \t \t </conditionvar> 
 
\t \t \t \t \t <setvar varname="Respondus_Correct">1.25</setvar> 
 
\t \t \t \t </respcondition> 
 
\t \t \t \t \t \t \t </resprocessing> 
 
\t \t \t \t </item> 
 

 

 
<!-- matching question with partial marks --> 
 
\t \t <item title="Mathcing question" ident="ITEM_3"> 
 
\t \t \t <itemmetadata> 
 
\t \t \t \t <qtimetadata> 
 
\t \t \t \t \t <qtimetadatafield> 
 
\t \t \t \t \t \t <fieldlabel>qmd_itemtype</fieldlabel> 
 
\t \t \t \t \t \t <fieldentry>Logical Groups</fieldentry> 
 
\t \t \t \t \t </qtimetadatafield> 
 
\t \t \t \t \t <qtimetadatafield> 
 
\t \t \t \t \t \t <fieldlabel>qmd_questiontype</fieldlabel> 
 
\t \t \t \t \t \t <fieldentry>Drag-and-drop</fieldentry> 
 
\t \t \t \t \t </qtimetadatafield> 
 
        <qtimetadatafield> 
 
         <fieldlabel>cc_profile</fieldlabel> 
 
         <fieldentry>cc.pattern_match.v0p1</fieldentry> 
 
        </qtimetadatafield> 
 
        <qtimetadatafield> 
 
         <fieldlabel>cc_weighting</fieldlabel> 
 
         <fieldentry>5</fieldentry> 
 
        </qtimetadatafield> 
 
\t \t \t \t </qtimetadata> 
 
\t \t \t </itemmetadata> 
 
\t \t \t <presentation> 
 
\t \t \t \t <flow> 
 
\t \t \t \t \t <material> 
 
\t \t \t \t \t \t <mattext texttype="text/html">Simple match</mattext> 
 
\t \t \t \t \t </material> 
 
\t \t \t \t \t \t \t 
 
\t \t \t \t \t <response_lid ident="RESPONSE-34173cb38f07f89ddbebc2ac9128303f" rcardinality="Multiple"> 
 
\t \t \t \t \t \t <material> 
 
\t \t \t \t \t \t \t <mattext texttype="text/html">A</mattext> 
 
\t \t \t \t \t \t </material> 
 
\t \t \t \t \t \t <render_choice shuffle="No"> 
 
\t \t \t \t \t \t \t \t \t \t \t \t \t <response_label ident="Option0"> \t 
 
\t \t \t \t \t \t \t \t <flow_mat> 
 
\t \t \t \t \t \t \t \t \t <material> 
 
\t \t \t \t \t \t \t \t \t \t <mattext texttype="text/html">A</mattext> 
 
\t \t \t \t \t \t \t \t \t </material> 
 
\t \t \t \t \t \t \t \t </flow_mat> 
 
\t \t \t \t \t \t \t </response_label> 
 
\t \t \t \t \t \t \t \t \t \t \t \t \t <response_label ident="Option1"> \t 
 
\t \t \t \t \t \t \t \t <flow_mat> 
 
\t \t \t \t \t \t \t \t \t <material> 
 
\t \t \t \t \t \t \t \t \t \t <mattext texttype="text/html">B</mattext> 
 
\t \t \t \t \t \t \t \t \t </material> 
 
\t \t \t \t \t \t \t \t </flow_mat> 
 
\t \t \t \t \t \t \t </response_label> 
 
\t \t \t \t \t \t \t \t \t \t \t \t </render_choice> 
 
\t \t \t \t \t </response_lid> 
 
\t \t \t \t \t \t \t 
 
\t \t \t \t \t <response_lid ident="RESPONSE-c16a5320fa475530d9583c34fd356ef5" rcardinality="Multiple"> 
 
\t \t \t \t \t \t <material> 
 
\t \t \t \t \t \t \t <mattext texttype="text/html">B</mattext> 
 
\t \t \t \t \t \t </material> 
 
\t \t \t \t \t \t <render_choice shuffle="No"> 
 
\t \t \t \t \t \t \t \t \t \t \t \t \t <response_label ident="Option0"> \t 
 
\t \t \t \t \t \t \t \t <flow_mat> 
 
\t \t \t \t \t \t \t \t \t <material> 
 
\t \t \t \t \t \t \t \t \t \t <mattext texttype="text/html">A</mattext> 
 
\t \t \t \t \t \t \t \t \t </material> 
 
\t \t \t \t \t \t \t \t </flow_mat> 
 
\t \t \t \t \t \t \t </response_label> 
 
\t \t \t \t \t \t \t \t \t \t \t \t \t <response_label ident="Option1"> \t 
 
\t \t \t \t \t \t \t \t <flow_mat> 
 
\t \t \t \t \t \t \t \t \t <material> 
 
\t \t \t \t \t \t \t \t \t \t <mattext texttype="text/html">B</mattext> 
 
\t \t \t \t \t \t \t \t \t </material> 
 
\t \t \t \t \t \t \t \t </flow_mat> 
 
\t \t \t \t \t \t \t </response_label> 
 
\t \t \t \t \t \t \t \t \t \t \t \t </render_choice> 
 
\t \t \t \t \t </response_lid> 
 
\t \t \t \t \t \t \t \t \t </flow> 
 
\t \t \t </presentation> 
 

 
\t \t \t <resprocessing> 
 
\t \t \t \t <outcomes> 
 
\t \t \t \t \t <decvar varname="SCORE" /> 
 
\t \t \t \t </outcomes> 
 
\t \t \t \t \t \t \t \t \t \t \t <respcondition title="CorrectResponse"> 
 
\t \t \t \t \t <conditionvar> \t \t \t \t \t \t 
 
\t \t \t \t \t \t <varequal respident="RESPONSE-34173cb38f07f89ddbebc2ac9128303f">Option0</varequal> 
 
\t \t \t \t \t </conditionvar> 
 
\t \t \t \t \t <setvar varname="Respondus_Correct">5</setvar> 
 
\t \t \t \t </respcondition> 
 
\t \t \t \t \t \t \t \t \t \t \t \t \t \t \t <respcondition title="CorrectResponse"> 
 
\t \t \t \t \t <conditionvar> \t \t \t \t \t \t 
 
\t \t \t \t \t \t <varequal respident="RESPONSE-c16a5320fa475530d9583c34fd356ef5">Option1</varequal> 
 
\t \t \t \t \t </conditionvar> 
 
\t \t \t \t \t <setvar varname="Respondus_Correct">5</setvar> 
 
\t \t \t \t </respcondition> 
 
\t \t \t \t \t \t \t \t \t \t </resprocessing> 
 
\t \t \t \t \t <itemfeedback ident="FEEDBACK"> 
 
\t \t \t \t <solution> 
 
\t \t \t \t \t <solutionmaterial> 
 
\t \t \t \t \t \t <flow_mat> 
 
\t \t \t \t \t \t \t <material> 
 
\t \t \t \t \t \t \t \t <mattext texttype="text/html">Optional Feedback</mattext> 
 
\t \t \t \t \t \t \t </material> 
 
\t \t \t \t \t \t </flow_mat> 
 
\t \t \t \t \t </solutionmaterial> 
 
\t \t \t \t </solution> 
 
\t \t \t </itemfeedback> 
 
\t \t \t \t </item> 
 

 

 
<!-- true or false question (aka multiple choice with two choices) --> 
 
\t \t <item title="True or False question" ident="ITEM_8"> 
 
\t \t \t <itemmetadata> 
 
\t \t \t \t <qtimetadata> 
 
\t \t \t \t \t <qtimetadatafield> 
 
\t \t \t \t \t \t <fieldlabel>qmd_itemtype</fieldlabel> 
 
\t \t \t \t \t \t <fieldentry>Logical Identifier</fieldentry> 
 
\t \t \t \t \t </qtimetadatafield> 
 
        <qtimetadatafield> 
 
\t \t \t \t \t \t <fieldlabel>qmd_questiontype</fieldlabel> 
 
\t \t \t \t \t \t <fieldentry>True/false</fieldentry> 
 
\t \t \t \t \t </qtimetadatafield> 
 
        <qtimetadatafield> 
 
\t \t \t \t \t \t <fieldlabel>cc_profile</fieldlabel> 
 
\t \t \t \t \t \t <fieldentry>cc.true_false.v0p1</fieldentry> 
 
\t \t \t \t \t </qtimetadatafield> 
 
        <qtimetadatafield> 
 
\t \t \t \t \t \t <fieldlabel>cc_weighting</fieldlabel> 
 
\t \t \t \t \t \t <fieldentry>5</fieldentry> 
 
\t \t \t \t \t </qtimetadatafield> 
 
\t \t \t \t </qtimetadata> 
 
\t \t \t </itemmetadata> 
 
\t \t \t <presentation> 
 
\t \t \t \t <flow> 
 
\t \t \t \t \t <material> 
 
\t \t \t \t \t \t <mattext texttype="text/html">true</mattext> 
 
\t \t \t \t \t </material> 
 
\t \t \t \t \t <response_lid ident="RESPONSE8" rcardinality="Single"> 
 
\t \t \t \t \t \t <render_choice shuffle="No"> 
 
\t \t \t \t \t \t \t <response_label ident="ChoiceT"> \t 
 
\t \t \t \t \t \t \t \t <flow_mat> 
 
\t \t \t \t \t \t \t \t \t <material> 
 
\t \t \t \t \t \t \t \t \t \t <mattext texttype="text/html">True</mattext> 
 
\t \t \t \t \t \t \t \t \t </material> 
 
\t \t \t \t \t \t \t \t </flow_mat> 
 
\t \t \t \t \t \t \t </response_label> 
 
\t \t \t \t \t \t \t <response_label ident="ChoiceF"> \t 
 
\t \t \t \t \t \t \t \t <flow_mat> 
 
\t \t \t \t \t \t \t \t \t <material> 
 
\t \t \t \t \t \t \t \t \t \t <mattext texttype="text/html">False</mattext> 
 
\t \t \t \t \t \t \t \t \t </material> 
 
\t \t \t \t \t \t \t \t </flow_mat> 
 
\t \t \t \t \t \t \t </response_label> 
 
\t \t \t \t \t \t </render_choice> 
 
\t \t \t \t \t </response_lid> 
 
\t \t \t \t </flow> 
 
\t \t \t </presentation> 
 
\t \t \t <resprocessing> 
 
\t \t \t \t <outcomes> 
 
\t \t \t \t \t <decvar varname="SCORE" /> 
 
\t \t \t \t </outcomes> 
 
\t \t \t \t <respcondition title="CorrectResponse"> 
 
\t \t \t \t \t <conditionvar> 
 
\t \t \t \t \t \t <varequal respident="RESPONSE8"> 
 
\t \t \t \t \t \t \t ChoiceT \t \t \t \t \t \t </varequal> 
 
\t \t \t \t \t </conditionvar> 
 
\t \t \t \t \t <setvar varname="que_score" action="Set">5</setvar> 
 
\t \t \t \t </respcondition> 
 
\t \t \t </resprocessing> 
 
\t \t \t \t </item> \t \t </section> 
 
\t </assessment> 
 
</questestinterop>

Antwort

1

Dieses Problem wird verursacht durch die , die Variable $question zum Halten eines Arrays wird als leere Zeichenfolge eingeleitet.

PHP7 hat eine sehr strenge Variablentyp-Validierung. Vor PHP7, wenn eine Variable als ein anderer Typ im Code behandelt wird als der Typ, den sie initiiert, konvertiert PHP ihn stillschweigend in den neuen Typ. Mit PHP7 wird die Variable im gesamten Code als initialisierter Typ behandelt. In diesem Fall werden Array-Werte, die $question zugewiesen sind, abgeschnitten, um einen String zu bilden, indem nur das erste Zeichen aus jedem Array-Wert genommen wird.