http://www.atutor.ca/atutor/mantis/view.php?id=4325
authorCindy Li <cli@ocad.ca>
Wed, 16 Jun 2010 14:04:05 +0000 (14:04 -0000)
committerCindy Li <cli@ocad.ca>
Wed, 16 Jun 2010 14:04:05 +0000 (14:04 -0000)
docs/home/editor/import_export_content.php
docs/home/ims/domainProfile_4/ims_qtiasiv1p2_localised.xsd
docs/home/ims/ims_import.php
docs/include/classes/QTI/QTIImport.class.php
docs/include/classes/QTI/QTIParser.class.php
docs/tests/dd.php

index 35b10ff..7b046d5 100644 (file)
@@ -136,7 +136,9 @@ function print_menu_sections(&$menu, $only_print_content_folder = false, $parent
                <input type="checkbox" name="allow_test_import" id="allow_test_import" checked="checked" />
                <label for="allow_test_import"><?php echo _AT('test_import_package'); ?></label> <br />
                <input type="checkbox" name="allow_a4a_import" id="allow_a4a_import" checked="checked" />
-               <label for="allow_a4a_import"><?php echo _AT('a4a_import_package'); ?></label>          
+               <label for="allow_a4a_import"><?php echo _AT('a4a_import_package'); ?></label><br />
+               <input type="checkbox" name="ignore_validation" id="ignore_validation" value="1" />
+               <label for="ignore_validation"><?php echo _AT('ignore_validation'); ?></label> <br />
        </div>
        
        <div class="row">
index 13e07f4..0777fa8 100644 (file)
                        <xs:element name="response_xy" type="response_xyType" minOccurs="0" maxOccurs="0" />\r
                        <xs:element name="response_str" type="response_strType" />\r
                        <xs:element name="response_num" type="response_numType" minOccurs="0" maxOccurs="0" />\r
-                       <xs:element name="response_grp" type="response_grpType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="response_grp" type="response_grpType" />\r
                        <xs:element ref="response_extension" minOccurs="0" maxOccurs="0" />\r
                </xs:choice>\r
                <xs:attribute name="class" type="xs:string" default="Block" />\r
index b0c265c..85bcab0 100644 (file)
@@ -1001,6 +1001,10 @@ if (file_exists($import_path . $glossary_path . 'glossary.xml')){
 */
 // Check if all the files exists in the manifest, iff it's a IMS CC package.
 if ($content_type == 'IMS Common Cartridge') {
+       //If user chooses to ignore validation.
+       if(isset($_POST['ignore_validation']) && $_POST['ignore_validation']==1) {
+               $skip_ims_validation = true;
+       }
        checkResources($import_path);
 }
 
index ba9a54f..f145666 100644 (file)
@@ -140,12 +140,14 @@ class QTIImport {
                                        if (is_array($xml->choices[$loopcounter])){             
                                                foreach ($xml->choices[$loopcounter] as $choiceNum=>$choiceOpt){
                                                        if (sizeof($test_obj['groups'] )>0 && is_array($xml->answers[$loopcounter])) {
-                                                               foreach ($xml->answers[$loopcounter] as $ansNum=>$ansOpt){
-                                                                       if ($choiceNum == $ansOpt){
-                                                                               //Not exactly efficient, worst case N^2
-                                                                               $test_obj['answers'][$ansNum] = $i;
-                                                                       }                       
-                                                               }               
+                                                               if (!empty($xml->answers[$loopcounter])){
+                                                                       foreach ($xml->answers[$loopcounter] as $ansNum=>$ansOpt){
+                                                                               if ($choiceNum == $ansOpt){
+                                                                                       //Not exactly efficient, worst case N^2
+                                                                                       $test_obj['answers'][$ansNum] = $i;
+                                                                               }                       
+                                                                       }
+                                                               }
                                                        } else {
                                                                //save answer(s)
                                                                if (is_array($xml->answers[$loopcounter]) && in_array($choiceNum, $xml->answers[$loopcounter])){
index 25a228b..6777235 100644 (file)
@@ -345,6 +345,9 @@ class QTIParser {
                        case 'FIB-string':
                                return 3;
                                break;
+                       case 'Drag-and-drop':
+                               return 5;
+                               break;
                        case 'Multiple-response':
                                return 7;
                                break;
index 3619b20..9aded42 100644 (file)
@@ -117,7 +117,7 @@ li.answer {
                                                <?php endfor; ?>
                                        </select>
                                
-                               <?php echo $row['choice_'.$i]; ?></li>
+                               <?php echo AT_print($row['choice_'.$i], 'tests_questions.question'); ?></li>
                        <?php endif; ?>
                <?php endfor; ?>
        </ul>
@@ -125,7 +125,7 @@ li.answer {
        <ol style="position: absolute; list-style-type: upper-alpha; top: 10px; left: 310px" id="a">
                <?php for ($i=0; $i < 10; $i++): ?>
                        <?php if ($row['option_'. $i] != ''): ?>
-                               <li class="answer" id="a<?php echo $i; ?>" value="<?php echo $i; ?>"><?php echo $_letters[$i]; ?>. <?php echo $row['option_'.$i]; ?></li>
+                               <li class="answer" id="a<?php echo $i; ?>" value="<?php echo $i; ?>"><?php echo $_letters[$i]; ?>. <?php echo AT_print($row['option_'.$i], 'tests_questions.question'); ?></li>
                        <?php endif; ?>
                <?php endfor; ?>
        </ol>