Merge branch 'wip-MDL-40430-master' of git://github.com/abgreeve/moodle
authorDan Poltawski <dan@moodle.com>
Tue, 9 Jul 2013 08:57:07 +0000 (16:57 +0800)
committerDan Poltawski <dan@moodle.com>
Tue, 9 Jul 2013 08:57:07 +0000 (16:57 +0800)
172 files changed:
admin/tool/installaddon/yui/permcheck/permcheck.js
badges/renderer.php
calendar/tests/externallib_test.php [moved from calendar/tests/externallib_tests.php with 98% similarity]
grade/grading/pick.php
grade/report/grader/lib.php
grade/report/upgrade.txt
lib/formslib.php
lib/upgrade.txt
mod/assign/gradingtable.php
mod/assign/lang/en/assign.php
mod/quiz/report/overview/overview_form.php
pix/c/course.gif [deleted file]
pix/c/course.png [deleted file]
pix/c/course.svg [deleted file]
pix/c/group.gif [deleted file]
pix/c/group.png [deleted file]
pix/c/group.svg [deleted file]
pix/c/site.gif [deleted file]
pix/c/site.png [deleted file]
pix/c/site.svg [deleted file]
pix/c/user.gif [deleted file]
pix/c/user.png [deleted file]
pix/c/user.svg [deleted file]
pix/i/agg_mean.gif [deleted file]
pix/i/agg_sum.gif [deleted file]
pix/i/approve.gif [deleted file]
pix/i/approve.png [deleted file]
pix/i/approve.svg [deleted file]
pix/i/backup.gif [deleted file]
pix/i/calc.gif [deleted file]
pix/i/calendar.gif [deleted file]
pix/i/checkpermissions.gif [deleted file]
pix/i/cohort.gif [deleted file]
pix/i/configlock.gif [deleted file]
pix/i/course.gif [deleted file]
pix/i/cross_red_big.gif [deleted file]
pix/i/cross_red_big.png [deleted file]
pix/i/cross_red_big.svg [deleted file]
pix/i/cross_red_small.gif [deleted file]
pix/i/cross_red_small.png [deleted file]
pix/i/cross_red_small.svg [deleted file]
pix/i/db.gif [deleted file]
pix/i/edit.gif [deleted file]
pix/i/enrolmentsuspended.gif [deleted file]
pix/i/filter.gif [deleted file]
pix/i/grades.gif [deleted file]
pix/i/group.gif [deleted file]
pix/i/hide.gif [deleted file]
pix/i/hierarchylock.gif [deleted file]
pix/i/info.gif [deleted file]
pix/i/item.gif [deleted file]
pix/i/marked.gif [deleted file]
pix/i/marker.gif [deleted file]
pix/i/mnethost.gif [deleted file]
pix/i/move_2d.gif [deleted file]
pix/i/outcomes.gif [deleted file]
pix/i/permissionlock.gif [deleted file]
pix/i/permissions.gif [deleted file]
pix/i/reload.gif [deleted file]
pix/i/report.gif [deleted file]
pix/i/restore.gif [deleted file]
pix/i/return.gif [deleted file]
pix/i/risk_config.gif [deleted file]
pix/i/risk_dataloss.gif [deleted file]
pix/i/risk_managetrust.gif [deleted file]
pix/i/risk_personal.gif [deleted file]
pix/i/risk_spam.gif [deleted file]
pix/i/risk_xss.gif [deleted file]
pix/i/roles.gif [deleted file]
pix/i/roles.png [deleted file]
pix/i/roles.svg [deleted file]
pix/i/rss.gif [deleted file]
pix/i/scales.gif [deleted file]
pix/i/search.gif [deleted file]
pix/i/settings.gif [deleted file]
pix/i/show.gif [deleted file]
pix/i/tick_amber_big.gif [deleted file]
pix/i/tick_amber_big.png [deleted file]
pix/i/tick_amber_big.svg [deleted file]
pix/i/tick_amber_small.gif [deleted file]
pix/i/tick_amber_small.png [deleted file]
pix/i/tick_amber_small.svg [deleted file]
pix/i/tick_green_big.gif [deleted file]
pix/i/tick_green_big.png [deleted file]
pix/i/tick_green_big.svg [deleted file]
pix/i/tick_green_small.gif [deleted file]
pix/i/tick_green_small.png [deleted file]
pix/i/tick_green_small.svg [deleted file]
pix/i/user.gif [deleted file]
pix/i/users.gif [deleted file]
pix/t/add.gif [deleted file]
pix/t/addgreen.gif [deleted file]
pix/t/addgreen.png [deleted file]
pix/t/addgreen.svg [deleted file]
pix/t/backup.gif [deleted file]
pix/t/block.gif [deleted file]
pix/t/calc.gif [deleted file]
pix/t/calc_off.gif [deleted file]
pix/t/clear.gif [deleted file]
pix/t/clear.png [deleted file]
pix/t/clear.svg [deleted file]
pix/t/copy.gif [deleted file]
pix/t/delete.gif [deleted file]
pix/t/down.gif [deleted file]
pix/t/edit.gif [deleted file]
pix/t/email.gif [deleted file]
pix/t/emailno.gif [deleted file]
pix/t/go.gif [deleted file]
pix/t/grades.gif [deleted file]
pix/t/groupn.gif [deleted file]
pix/t/groups.gif [deleted file]
pix/t/groupv.gif [deleted file]
pix/t/hide.gif [deleted file]
pix/t/left.gif [deleted file]
pix/t/lock.gif [deleted file]
pix/t/locktime.gif [deleted file]
pix/t/manual_item.gif [deleted file]
pix/t/manual_item.png [deleted file]
pix/t/manual_item.svg [deleted file]
pix/t/message.gif [deleted file]
pix/t/move.gif [deleted file]
pix/t/portfolioadd.gif [deleted file]
pix/t/preview.gif [deleted file]
pix/t/restore.gif [deleted file]
pix/t/right.gif [deleted file]
pix/t/show.gif [deleted file]
pix/t/stop.gif [deleted file]
pix/t/switch_minus.gif [deleted file]
pix/t/switch_plus.gif [deleted file]
pix/t/switch_whole.gif [deleted file]
pix/t/unlock.gif [deleted file]
pix/t/unlock_gray.gif [deleted file]
pix/t/unlock_gray.png [deleted file]
pix/t/unlock_gray.svg [deleted file]
pix/t/up.gif [deleted file]
pix/t/user.gif [deleted file]
pix/t/userblue.gif [deleted file]
pix/t/userblue.png [deleted file]
pix/t/userblue.svg [deleted file]
question/engine/tests/helpers.php
question/type/calculatedsimple/tests/helper.php
question/type/calculatedsimple/tests/questiontype_test.php [new file with mode: 0644]
question/type/description/tests/helper.php
question/type/description/tests/questiontype_test.php
question/type/match/tests/helper.php [new file with mode: 0644]
question/type/match/tests/questiontype_test.php
question/type/multianswer/tests/helper.php
question/type/multianswer/tests/questiontype_test.php
question/type/multichoice/tests/helper.php [new file with mode: 0644]
question/type/multichoice/tests/questiontype_test.php
question/type/numerical/tests/helper.php
question/type/numerical/tests/questiontype_test.php
question/type/questionbase.php
question/type/shortanswer/tests/helper.php
question/type/shortanswer/tests/questiontype_test.php
question/type/truefalse/tests/helper.php
question/type/truefalse/tests/questiontype_test.php
theme/afterburner/pix_core/i/courseevent.png [moved from theme/afterburner/pix_core/c/course.png with 100% similarity]
theme/afterburner/pix_core/i/siteevent.png [moved from theme/afterburner/pix_core/c/site.png with 100% similarity]
theme/afterburner/pix_core/i/userevent.png [moved from theme/afterburner/pix_core/c/user.png with 100% similarity]
theme/afterburner/pix_core/t/add.png [moved from theme/afterburner/pix_core/t/addgreen.png with 100% similarity]
theme/afterburner/pix_core/t/check.png [moved from theme/afterburner/pix_core/t/clear.png with 100% similarity]
theme/afterburner/pix_core/t/userblue.png [deleted file]
theme/formfactor/config.php
theme/mymobile/pix_core/i/courseevent.png [moved from theme/mymobile/pix_core/c/course.png with 100% similarity]
theme/mymobile/pix_core/i/cross_red_big.png [deleted file]
theme/mymobile/pix_core/i/cross_red_small.png [deleted file]
theme/mymobile/pix_core/i/groupevent.png [moved from theme/mymobile/pix_core/c/group.png with 100% similarity]
theme/mymobile/pix_core/i/siteevent.png [moved from theme/mymobile/pix_core/c/site.png with 100% similarity]
theme/mymobile/pix_core/i/userevent.png [moved from theme/mymobile/pix_core/c/user.png with 100% similarity]
theme/mymobile/pix_core/t/approve.png [moved from theme/mymobile/pix_core/i/approve.png with 100% similarity]
theme/mymobile/pix_core/t/check.png [moved from theme/mymobile/pix_core/t/clear.png with 100% similarity]

index ad0e4bd..97578b8 100644 (file)
@@ -48,13 +48,13 @@ YUI.add('moodle-tool_installaddon-permcheck', function(Y) {
                         var resultline = Y.one('#tool_installaddon_installfromzip_permcheck');
                         if (resultline) {
                             if (status === 'success') {
-                                resultline.setContent('<span class="success"><img src="' + M.util.image_url('i/tick_green_big') + '" /> ' +
+                                resultline.setContent('<span class="success"><img src="' + M.util.image_url('i/valid') + '" /> ' +
                                     msg + '</span>');
                             } else if (status === 'progress') {
                                 resultline.setContent('<span class="progress"><img src="' + M.cfg.loadingicon + '" /> ' +
                                     msg + '</span>');
                             } else {
-                                resultline.setContent('<span class="error"><img src="' + M.util.image_url('i/cross_red_big') + '" /> ' +
+                                resultline.setContent('<span class="error"><img src="' + M.util.image_url('i/invalid') + '" /> ' +
                                     msg + '</span>');
                             }
                         }
index 171bdb3..e6e9d2d 100644 (file)
@@ -527,7 +527,7 @@ class core_badges_renderer extends plugin_renderer_base {
             $description = $badge->description;
             $criteria = self::print_badge_criteria($badge);
             if ($badge->dateissued) {
-                $icon = new pix_icon('i/tick_green_big',
+                $icon = new pix_icon('i/valid',
                             get_string('dateearned', 'badges',
                                 userdate($badge->dateissued, get_string('strftimedatefullshort', 'core_langconfig'))));
                 $badgeurl = new moodle_url('/badges/badge.php', array('hash' => $badge->uniquehash));
similarity index 98%
rename from calendar/tests/externallib_tests.php
rename to calendar/tests/externallib_test.php
index 866b268..e38538e 100644 (file)
@@ -113,13 +113,16 @@ class core_calendar_external_testcase extends externallib_advanced_testcase {
 
         // Create a few events and do asserts.
         $this->create_calendar_event('test', $USER->id);
-        $count = count($DB->get_records("event", array('name' => 'test')));
+        $where = $DB->sql_compare_text('name') ." = ?";
+        $count = count($DB->get_records_select("event", $where, array('test')));
         $this->assertEquals(1, $count);
         $aftercount = count($DB->get_records("event"));
         $this->assertEquals($prevcount + 1, $aftercount);
 
         $this->create_calendar_event('user', $USER->id, 'user', 3);
-        $count = count($DB->get_records("event", array('name' => 'user')));
+        $where = $DB->sql_compare_text('name') ." = ?";
+        $count = count($DB->get_records_select("event", $where, array('user')));
+
         $this->assertEquals(3, $count);
         $aftercount = count($DB->get_records("event"));
         $this->assertEquals($prevcount + 4, $aftercount);
index 075ca27..8de5bca 100644 (file)
@@ -223,7 +223,7 @@ foreach ($rs as $template) {
     $actions = array();
     if ($controller->is_shared_template()) {
         $actions[] = $output->pick_action_icon(new moodle_url($PAGE->url, array('pick' => $template->id)),
-            get_string('templatepick', 'core_grading'), 'i/tick_green_big', 'pick template');
+            get_string('templatepick', 'core_grading'), 'i/valid', 'pick template');
         if ($canmanage or ($canshare and ($template->usercreated == $USER->id))) {
             //$actions[] = $output->pick_action_icon(new moodle_url($PAGE->url, array('edit' => $template->id)),
             //    get_string('templateedit', 'core_grading'), 'i/edit', 'edit');
@@ -232,7 +232,7 @@ foreach ($rs as $template) {
         }
     } else if ($controller->is_own_form()) {
         $actions[] = $output->pick_action_icon(new moodle_url($PAGE->url, array('pick' => $template->id)),
-            get_string('templatepickownform', 'core_grading'), 'i/tick_green_big', 'pick ownform');
+            get_string('templatepickownform', 'core_grading'), 'i/valid', 'pick ownform');
     }
     $out .= $output->box(join(' ', $actions), 'template-actions');
     $out .= $output->box($controller->get_formatted_description(), 'template-description');
index c99f672..3c21585 100644 (file)
@@ -532,93 +532,17 @@ class grade_report_grader extends grade_report {
     }
 
     /**
-     * Builds and returns a div with on/off toggles.
-     * @return string HTML code
-     * @deprecated since 2.4 as it appears not to be used any more.
+     * @deprecated since Moodle 2.4 as it appears not to be used any more.
      */
     public function get_toggles_html() {
-        global $CFG, $USER, $COURSE, $OUTPUT;
-        debugging('Call to deprecated function grade_report_grader::get_toggles_html().', DEBUG_DEVELOPER);
-        $html = '';
-        if ($USER->gradeediting[$this->courseid]) {
-            if (has_capability('moodle/grade:manage', $this->context) or has_capability('moodle/grade:hide', $this->context)) {
-                $html .= $this->print_toggle('eyecons');
-            }
-            if (has_capability('moodle/grade:manage', $this->context)
-             or has_capability('moodle/grade:lock', $this->context)
-             or has_capability('moodle/grade:unlock', $this->context)) {
-                $html .= $this->print_toggle('locks');
-            }
-            if (has_capability('moodle/grade:manage', $this->context)) {
-                $html .= $this->print_toggle('quickfeedback');
-            }
-
-            if (has_capability('moodle/grade:manage', $this->context)) {
-                $html .= $this->print_toggle('calculations');
-            }
-        }
-
-        if ($this->canviewhidden) {
-            $html .= $this->print_toggle('averages');
-        }
-
-        $html .= $this->print_toggle('ranges');
-        if (!empty($CFG->enableoutcomes)) {
-            $html .= $this->print_toggle('nooutcomes');
-        }
-
-        return $OUTPUT->container($html, 'grade-report-toggles');
+        throw new coding_exception('get_toggles_html() can not be used any more');
     }
 
     /**
-    * Shortcut function for printing the grader report toggles.
-    * @param string $type The type of toggle
-    * @param bool $return Whether to return the HTML string rather than printing it
-    * @return void
-    * @deprecated since 2.4 as it appears not to be used any more.
-    */
+     * @deprecated since 2.4 as it appears not to be used any more.
+     */
     public function print_toggle($type) {
-        global $CFG, $OUTPUT;
-        debugging('Call to deprecated function grade_report_grader::print_toggle().', DEBUG_DEVELOPER);
-        $icons = array('eyecons' => 't/hide',
-                       'calculations' => 't/calc',
-                       'locks' => 't/lock',
-                       'averages' => 't/mean',
-                       'quickfeedback' => 't/feedback',
-                       'nooutcomes' => 't/outcomes');
-
-        $prefname = 'grade_report_show' . $type;
-
-        if (array_key_exists($prefname, $CFG)) {
-            $showpref = get_user_preferences($prefname, $CFG->$prefname);
-        } else {
-            $showpref = get_user_preferences($prefname);
-        }
-
-        $strshow = $this->get_lang_string('show' . $type, 'grades');
-        $strhide = $this->get_lang_string('hide' . $type, 'grades');
-
-        $showhide = 'show';
-        $toggleaction = 1;
-
-        if ($showpref) {
-            $showhide = 'hide';
-            $toggleaction = 0;
-        }
-
-        if (array_key_exists($type, $icons)) {
-            $imagename = $icons[$type];
-        } else {
-            $imagename = "t/$type";
-        }
-
-        $string = ${'str' . $showhide};
-
-        $url = new moodle_url($this->baseurl, array('toggle' => $toggleaction, 'toggle_type' => $type));
-
-        $retval = $OUTPUT->container($OUTPUT->action_icon($url, new pix_icon($imagename, $string))); // TODO: this container looks wrong here
-
-        return $retval;
+        throw new coding_exception('print_toggle() can not be used any more');
     }
 
     /**
index 4a8d086..9ff8f36 100644 (file)
@@ -1,6 +1,9 @@
 This files describes API changes in /grade/report/*,
 information provided here is intended especially for developers.
 
+=== 2.6 ===
+* grade_report_grader::get_toggles_html() and grade_report_grader::print_toggle()
+  can not be used any more
 
 === 2.3.5, 2.4.2 ===
 * class_grade_report::showtotalsifcontainhidden has been switched from a single integer value to an array.
index c0bc249..4a91911 100644 (file)
@@ -1307,6 +1307,37 @@ abstract class moodleform {
             }
         }
     }
+
+    /**
+     * Used by tests to simulate submitted form data submission from the user.
+     *
+     * For form fields where no data is submitted the default for that field as set by set_data or setDefault will be passed to
+     * get_data.
+     *
+     * This method sets $_POST or $_GET and $_FILES with the data supplied. Our unit test code empties all these
+     * global arrays after each test.
+     *
+     * @param array  $simulatedsubmitteddata       An associative array of form values (same format as $_POST).
+     * @param array  $simulatedsubmittedfiles      An associative array of files uploaded (same format as $_FILES). Can be omitted.
+     * @param string $method                       'post' or 'get', defaults to 'post'.
+     * @param null   $formidentifier               the default is to use the class name for this class but you may need to provide
+     *                                              a different value here for some forms that are used more than once on the
+     *                                              same page.
+     */
+    public static function mock_submit($simulatedsubmitteddata, $simulatedsubmittedfiles = array(), $method = 'post',
+                                       $formidentifier = null) {
+        $_FILES = $simulatedsubmittedfiles;
+        if ($formidentifier === null) {
+            $formidentifier = get_called_class();
+        }
+        $simulatedsubmitteddata['_qf__'.$formidentifier] = 1;
+        $simulatedsubmitteddata['sesskey'] = sesskey();
+        if (strtolower($method) === 'get') {
+            $_GET = $simulatedsubmitteddata;
+        } else {
+            $_POST = $simulatedsubmitteddata;
+        }
+    }
 }
 
 /**
index cc820a7..ebc204d 100644 (file)
@@ -5,6 +5,7 @@ information provided here is intended especially for developers.
 
 * Use new core_component::* plugin listing and component normalisation methods.
 * Use core_text::* instead of textlib:: and also core_collator::* instead of collatorlib::*.
+* Use new function moodleform::mock_submit() to simulate form submission in unit tests (backported).
 * get_context_instance() is deprecated, please use use context_xxxx::instance().
 * get_context_instance_by_id() is deprecated, please use context::instance_by_id($id).
 * load_temp_role() and remove_temp_roles() can not be used any more.
index 70c2287..6703422 100644 (file)
@@ -260,11 +260,10 @@ class assign_grading_table extends table_sql implements renderable {
         // Submission status.
         if ($assignment->is_any_submission_plugin_enabled()) {
             $columns[] = 'status';
-            $headers[] = get_string('status');
+            $headers[] = get_string('status', 'assign');
         } else if ($this->assignment->get_instance()->markingworkflow) {
             $columns[] = 'workflowstatus';
-            $headers[] = get_string('status');
-
+            $headers[] = get_string('status', 'assign');
         }
 
         // Team submission columns.
index 34c193e..b214864 100644 (file)
@@ -308,6 +308,7 @@ $string['setmarkingworkflowstateforlog'] = 'Set marking workflow state : (id={$a
 $string['setmarkerallocationforlog'] = 'Set marking allocation : (id={$a->id}, fullname={$a->fullname}, marker={$a->marker}). ';
 $string['settings'] = 'Assignment settings';
 $string['showrecentsubmissions'] = 'Show recent submissions';
+$string['status'] = 'Status';
 $string['submissioncopiedtext'] = 'You have made a copy of your previous
 assignment submission for \'{$a->assignment}\'
 
index 428bbbb..e03bab9 100644 (file)
@@ -50,6 +50,7 @@ class quiz_overview_settings_form extends mod_quiz_attempts_report_form {
                     get_string('showdetailedmarks', 'quiz_overview'));
         } else {
             $mform->addElement('hidden', 'slotmarks', 0);
+            $mform->setType('slotmarks', PARAM_INT);
         }
     }
 }
diff --git a/pix/c/course.gif b/pix/c/course.gif
deleted file mode 100644 (file)
index 72761ea..0000000
Binary files a/pix/c/course.gif and /dev/null differ
diff --git a/pix/c/course.png b/pix/c/course.png
deleted file mode 100644 (file)
index 4f86f2c..0000000
Binary files a/pix/c/course.png and /dev/null differ
diff --git a/pix/c/course.svg b/pix/c/course.svg
deleted file mode 100644 (file)
index e60475f..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>\r
-<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In  -->\r
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [\r
-       <!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">\r
-]>\r
-<svg version="1.1"\r
-        xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"\r
-        x="0px" y="0px" width="16px" height="16px" viewBox="-0.2 0 16 16" style="overflow:visible;enable-background:new -0.2 0 16 16;"\r
-        xml:space="preserve" preserveAspectRatio="xMinYMid meet">\r
-<defs>\r
-</defs>\r
-<path style="fill:#999999;" d="M6,0.4c0.4-0.1,0.8-0.1,1.3-0.1c1.5,0,3,0.5,4.2,1.4c-0.6,0.2-1.2,0.5-1.7,1C9.7,2.7,9.6,2.8,9.6,2.8\r
-       C8.9,2.5,8.1,2.2,7.2,2.2c-0.1,0-0.2,0-0.3,0C6.8,1.6,6.5,0.9,6,0.4z M11.7,9.4c-0.2,0.5-0.5,1-1,1.4c-0.3,0.3-0.8,0.6-1.2,0.8\r
-       c0.2,0.7,0.3,1.4,0.1,2.2c0.9-0.3,1.8-0.9,2.5-1.6c0.9-0.9,1.4-1.9,1.8-3C13.2,9.5,12.5,9.5,11.7,9.4z M3,10.1C3,10,3.1,10,3,10.1\r
-       C2.5,9.1,2.2,8,2.3,6.9C1.6,6.8,0.9,6.5,0.4,6C0,8,0.5,10.2,2,11.9C2.2,11.2,2.5,10.6,3,10.1z M10.4,3.4c-1.2,1.2-1.2,3.1,0,4.2\r
-       c1.2,1.2,3.1,1.2,4.2,0s1.2-3.1,0-4.2C13.5,2.2,11.6,2.2,10.4,3.4z M3.7,10.8c-1.2,1.2-1.2,3.1,0,4.2c1.2,1.2,3.1,1.2,4.2,0\r
-       c1.2-1.2,1.2-3.1,0-4.2C6.8,9.6,4.9,9.6,3.7,10.8z M0.9,0.9c-1.2,1.2-1.2,3.1,0,4.2C2,6.3,4,6.3,5.1,5.1c1.2-1.2,1.2-3.1,0-4.2\r
-       C4-0.3,2-0.3,0.9,0.9z"/>\r
-</svg>\r
diff --git a/pix/c/group.gif b/pix/c/group.gif
deleted file mode 100644 (file)
index 327422e..0000000
Binary files a/pix/c/group.gif and /dev/null differ
diff --git a/pix/c/group.png b/pix/c/group.png
deleted file mode 100644 (file)
index 393371b..0000000
Binary files a/pix/c/group.png and /dev/null differ
diff --git a/pix/c/group.svg b/pix/c/group.svg
deleted file mode 100644 (file)
index 7107000..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>\r
-<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In  -->\r
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [\r
-       <!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">\r
-]>\r
-<svg version="1.1"\r
-        xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"\r
-        x="0px" y="0px" width="16px" height="16px" viewBox="0 0 16 16" style="overflow:visible;enable-background:new 0 0 16 16;"\r
-        xml:space="preserve" preserveAspectRatio="xMinYMid meet">\r
-<defs>\r
-</defs>\r
-<path style="fill:#999999;" d="M3,16H0v-4l3.2-1.7C3.6,10,3.8,9.5,3.4,9C3.4,9,2,7.2,2,5.2C2,2.3,3.8,0,6,0c0.4,0,0.7,0.1,1.1,0.2\r
-       c-1.2,1.1-2,3-2,5c0,1.7,0.6,2.7,1,3.5c0.6,0.9,0.1,1-0.3,1.3C5.6,10.1,3,11.4,3,11.4V16z M16,11.9l-3.1-1.6\r
-       C12.4,10,12.3,9.4,12.6,9c0,0,1.4-1.8,1.4-3.8C14,2.3,12.2,0,10,0S6,2.3,6,5.2C6,7.2,7.5,9,7.5,9c0.3,0.4,0.2,1-0.3,1.3L4,12v4h12\r
-       V11.9z"/>\r
-</svg>\r
diff --git a/pix/c/site.gif b/pix/c/site.gif
deleted file mode 100644 (file)
index 2ea062e..0000000
Binary files a/pix/c/site.gif and /dev/null differ
diff --git a/pix/c/site.png b/pix/c/site.png
deleted file mode 100644 (file)
index 02a18b5..0000000
Binary files a/pix/c/site.png and /dev/null differ
diff --git a/pix/c/site.svg b/pix/c/site.svg
deleted file mode 100644 (file)
index 23f6975..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>\r
-<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In  -->\r
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [\r
-       <!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">\r
-]>\r
-<svg version="1.1"\r
-        xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"\r
-        x="0px" y="0px" width="16px" height="16px" viewBox="0 0 16 16" style="overflow:visible;enable-background:new 0 0 16 16;"\r
-        xml:space="preserve" preserveAspectRatio="xMinYMid meet">\r
-<defs>\r
-</defs>\r
-<path style="fill:#999999;" d="M14,1h-2v1.5C12,3.3,11.3,4,10.5,4S9,3.3,9,2.5V1H6v1.5C6,3.3,5.3,4,4.5,4S3,3.3,3,2.5V1H1\r
-       C0.4,1,0,1.4,0,2v13c0,0.6,0.4,1,1,1h13c0.6,0,1-0.4,1-1V2C15,1.4,14.6,1,14,1z M4,14H2v-2h2V14z M4,11H2V9h2V11z M4,8H2V6h2V8z\r
-        M7,14H5v-2h2V14z M7,11H5V9h2V11z M7,8H5V6h2V8z M10,14H8v-2h2V14z M10,11H8V9h2V11z M10,8H8V6h2V8z M13,14h-2v-2h2V14z M13,11h-2\r
-       V9h2V11z M13,8h-2V6h2V8z M5,2.5C5,2.8,4.8,3,4.5,3l0,0C4.2,3,4,2.8,4,2.5v-2C4,0.2,4.2,0,4.5,0l0,0C4.8,0,5,0.2,5,0.5V2.5z M11,2.5\r
-       C11,2.8,10.8,3,10.5,3l0,0C10.2,3,10,2.8,10,2.5v-2C10,0.2,10.2,0,10.5,0l0,0C10.8,0,11,0.2,11,0.5V2.5z"/>\r
-</svg>\r
diff --git a/pix/c/user.gif b/pix/c/user.gif
deleted file mode 100644 (file)
index ff6579f..0000000
Binary files a/pix/c/user.gif and /dev/null differ
diff --git a/pix/c/user.png b/pix/c/user.png
deleted file mode 100644 (file)
index f803c86..0000000
Binary files a/pix/c/user.png and /dev/null differ
diff --git a/pix/c/user.svg b/pix/c/user.svg
deleted file mode 100644 (file)
index 9fc0081..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>\r
-<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In  -->\r
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [\r
-       <!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">\r
-]>\r
-<svg version="1.1"\r
-        xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"\r
-        x="0px" y="0px" width="16px" height="16px" viewBox="0 0 16 16" style="overflow:visible;enable-background:new 0 0 16 16;"\r
-        xml:space="preserve" preserveAspectRatio="xMinYMid meet">\r
-<defs>\r
-</defs>\r
-<path style="fill:#999999;" d="M5.2,10.3L0,13.1V16h16v-3l-5.2-2.7C10.3,10,10.2,9.4,10.6,9c0,0,1.4-1.8,1.4-3.8C12,2.3,10.2,0,8,0\r
-       S4,2.3,4,5.2C4,7.2,5.4,9,5.4,9C5.8,9.5,5.7,10,5.2,10.3z"/>\r
-</svg>\r
diff --git a/pix/i/agg_mean.gif b/pix/i/agg_mean.gif
deleted file mode 100644 (file)
index 8a3031a..0000000
Binary files a/pix/i/agg_mean.gif and /dev/null differ
diff --git a/pix/i/agg_sum.gif b/pix/i/agg_sum.gif
deleted file mode 100644 (file)
index 49b5bf0..0000000
Binary files a/pix/i/agg_sum.gif and /dev/null differ
diff --git a/pix/i/approve.gif b/pix/i/approve.gif
deleted file mode 100644 (file)
index 289190c..0000000
Binary files a/pix/i/approve.gif and /dev/null differ
diff --git a/pix/i/approve.png b/pix/i/approve.png
deleted file mode 100644 (file)
index 43540a5..0000000
Binary files a/pix/i/approve.png and /dev/null differ
diff --git a/pix/i/approve.svg b/pix/i/approve.svg
deleted file mode 100644 (file)
index 5c768d1..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>\r
-<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In  -->\r
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [\r
-       <!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">\r
-]>\r
-<svg version="1.1"\r
-        xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"\r
-        x="0px" y="0px" width="12px" height="12px" viewBox="0 0 12 12" style="overflow:visible;enable-background:new 0 0 12 12;"\r
-        xml:space="preserve" preserveAspectRatio="xMinYMid meet">\r
-<defs>\r
-</defs>\r
-<path style="fill:#999999;" d="M11.4,0.6l-0.9-0.5C10.1-0.1,9.5,0,9.2,0.5L4.7,8.2L2,6.6C1.5,6.3,0.9,6.5,0.6,7L0.1,7.8\r
-       C-0.1,8.3,0,8.9,0.5,9.2L5,11.8c0.1,0.1,0.3,0.1,0.4,0.1c0.4,0.1,0.8-0.1,1-0.5L11.8,2C12.1,1.5,11.9,0.9,11.4,0.6z"/>\r
-</svg>\r
diff --git a/pix/i/backup.gif b/pix/i/backup.gif
deleted file mode 100644 (file)
index 6772be4..0000000
Binary files a/pix/i/backup.gif and /dev/null differ
diff --git a/pix/i/calc.gif b/pix/i/calc.gif
deleted file mode 100644 (file)
index ec20176..0000000
Binary files a/pix/i/calc.gif and /dev/null differ
diff --git a/pix/i/calendar.gif b/pix/i/calendar.gif
deleted file mode 100644 (file)
index 7cd8f85..0000000
Binary files a/pix/i/calendar.gif and /dev/null differ
diff --git a/pix/i/checkpermissions.gif b/pix/i/checkpermissions.gif
deleted file mode 100644 (file)
index 5dc6242..0000000
Binary files a/pix/i/checkpermissions.gif and /dev/null differ
diff --git a/pix/i/cohort.gif b/pix/i/cohort.gif
deleted file mode 100644 (file)
index 225036a..0000000
Binary files a/pix/i/cohort.gif and /dev/null differ
diff --git a/pix/i/configlock.gif b/pix/i/configlock.gif
deleted file mode 100644 (file)
index 36d1eef..0000000
Binary files a/pix/i/configlock.gif and /dev/null differ
diff --git a/pix/i/course.gif b/pix/i/course.gif
deleted file mode 100644 (file)
index ba0d89c..0000000
Binary files a/pix/i/course.gif and /dev/null differ
diff --git a/pix/i/cross_red_big.gif b/pix/i/cross_red_big.gif
deleted file mode 100644 (file)
index b14b1ae..0000000
Binary files a/pix/i/cross_red_big.gif and /dev/null differ
diff --git a/pix/i/cross_red_big.png b/pix/i/cross_red_big.png
deleted file mode 100644 (file)
index 0f5cfe0..0000000
Binary files a/pix/i/cross_red_big.png and /dev/null differ
diff --git a/pix/i/cross_red_big.svg b/pix/i/cross_red_big.svg
deleted file mode 100644 (file)
index de6808d..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>\r
-<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In  -->\r
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [\r
-       <!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">\r
-]>\r
-<svg version="1.1"\r
-        xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"\r
-        x="0px" y="0px" width="16px" height="16px" viewBox="-1.6 -0.5 16 16"\r
-        style="overflow:visible;enable-background:new -1.6 -0.5 16 16;" xml:space="preserve" preserveAspectRatio="xMinYMid meet">\r
-<defs>\r
-</defs>\r
-<path style="fill:#FF403C;" d="M12.8,2.7L10.1,0c0,0-1.6,1.5-3.7,4C4.3,1.5,2.7,0,2.7,0L0,2.7c0,0,1.9,1.3,4.6,3.7\r
-       C3,8.7,1.3,11.6,0,14.9C2.2,12.2,4.4,9.9,6.4,8c2,1.9,4.2,4.2,6.4,6.9c-1.3-3.3-3-6.2-4.6-8.6C10.9,4,12.8,2.7,12.8,2.7z"/>\r
-</svg>\r
diff --git a/pix/i/cross_red_small.gif b/pix/i/cross_red_small.gif
deleted file mode 100644 (file)
index 32499b4..0000000
Binary files a/pix/i/cross_red_small.gif and /dev/null differ
diff --git a/pix/i/cross_red_small.png b/pix/i/cross_red_small.png
deleted file mode 100644 (file)
index 0f5cfe0..0000000
Binary files a/pix/i/cross_red_small.png and /dev/null differ
diff --git a/pix/i/cross_red_small.svg b/pix/i/cross_red_small.svg
deleted file mode 100644 (file)
index de6808d..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>\r
-<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In  -->\r
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [\r
-       <!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">\r
-]>\r
-<svg version="1.1"\r
-        xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"\r
-        x="0px" y="0px" width="16px" height="16px" viewBox="-1.6 -0.5 16 16"\r
-        style="overflow:visible;enable-background:new -1.6 -0.5 16 16;" xml:space="preserve" preserveAspectRatio="xMinYMid meet">\r
-<defs>\r
-</defs>\r
-<path style="fill:#FF403C;" d="M12.8,2.7L10.1,0c0,0-1.6,1.5-3.7,4C4.3,1.5,2.7,0,2.7,0L0,2.7c0,0,1.9,1.3,4.6,3.7\r
-       C3,8.7,1.3,11.6,0,14.9C2.2,12.2,4.4,9.9,6.4,8c2,1.9,4.2,4.2,6.4,6.9c-1.3-3.3-3-6.2-4.6-8.6C10.9,4,12.8,2.7,12.8,2.7z"/>\r
-</svg>\r
diff --git a/pix/i/db.gif b/pix/i/db.gif
deleted file mode 100644 (file)
index 2aaeeb3..0000000
Binary files a/pix/i/db.gif and /dev/null differ
diff --git a/pix/i/edit.gif b/pix/i/edit.gif
deleted file mode 100644 (file)
index 3a94a4d..0000000
Binary files a/pix/i/edit.gif and /dev/null differ
diff --git a/pix/i/enrolmentsuspended.gif b/pix/i/enrolmentsuspended.gif
deleted file mode 100644 (file)
index 0d0e69d..0000000
Binary files a/pix/i/enrolmentsuspended.gif and /dev/null differ
diff --git a/pix/i/filter.gif b/pix/i/filter.gif
deleted file mode 100644 (file)
index fa266ae..0000000
Binary files a/pix/i/filter.gif and /dev/null differ
diff --git a/pix/i/grades.gif b/pix/i/grades.gif
deleted file mode 100644 (file)
index f090ffd..0000000
Binary files a/pix/i/grades.gif and /dev/null differ
diff --git a/pix/i/group.gif b/pix/i/group.gif
deleted file mode 100644 (file)
index 327422e..0000000
Binary files a/pix/i/group.gif and /dev/null differ
diff --git a/pix/i/hide.gif b/pix/i/hide.gif
deleted file mode 100644 (file)
index 0b9cadb..0000000
Binary files a/pix/i/hide.gif and /dev/null differ
diff --git a/pix/i/hierarchylock.gif b/pix/i/hierarchylock.gif
deleted file mode 100644 (file)
index 84bb424..0000000
Binary files a/pix/i/hierarchylock.gif and /dev/null differ
diff --git a/pix/i/info.gif b/pix/i/info.gif
deleted file mode 100644 (file)
index 4927e1a..0000000
Binary files a/pix/i/info.gif and /dev/null differ
diff --git a/pix/i/item.gif b/pix/i/item.gif
deleted file mode 100644 (file)
index 55f329e..0000000
Binary files a/pix/i/item.gif and /dev/null differ
diff --git a/pix/i/marked.gif b/pix/i/marked.gif
deleted file mode 100644 (file)
index 4836bb0..0000000
Binary files a/pix/i/marked.gif and /dev/null differ
diff --git a/pix/i/marker.gif b/pix/i/marker.gif
deleted file mode 100644 (file)
index afb497e..0000000
Binary files a/pix/i/marker.gif and /dev/null differ
diff --git a/pix/i/mnethost.gif b/pix/i/mnethost.gif
deleted file mode 100644 (file)
index 3c9edaa..0000000
Binary files a/pix/i/mnethost.gif and /dev/null differ
diff --git a/pix/i/move_2d.gif b/pix/i/move_2d.gif
deleted file mode 100644 (file)
index b965205..0000000
Binary files a/pix/i/move_2d.gif and /dev/null differ
diff --git a/pix/i/outcomes.gif b/pix/i/outcomes.gif
deleted file mode 100644 (file)
index 640a236..0000000
Binary files a/pix/i/outcomes.gif and /dev/null differ
diff --git a/pix/i/permissionlock.gif b/pix/i/permissionlock.gif
deleted file mode 100644 (file)
index b10ac74..0000000
Binary files a/pix/i/permissionlock.gif and /dev/null differ
diff --git a/pix/i/permissions.gif b/pix/i/permissions.gif
deleted file mode 100644 (file)
index e8cae89..0000000
Binary files a/pix/i/permissions.gif and /dev/null differ
diff --git a/pix/i/reload.gif b/pix/i/reload.gif
deleted file mode 100644 (file)
index b246607..0000000
Binary files a/pix/i/reload.gif and /dev/null differ
diff --git a/pix/i/report.gif b/pix/i/report.gif
deleted file mode 100644 (file)
index 0457bf4..0000000
Binary files a/pix/i/report.gif and /dev/null differ
diff --git a/pix/i/restore.gif b/pix/i/restore.gif
deleted file mode 100644 (file)
index 0c28dae..0000000
Binary files a/pix/i/restore.gif and /dev/null differ
diff --git a/pix/i/return.gif b/pix/i/return.gif
deleted file mode 100644 (file)
index 48f27ba..0000000
Binary files a/pix/i/return.gif and /dev/null differ
diff --git a/pix/i/risk_config.gif b/pix/i/risk_config.gif
deleted file mode 100644 (file)
index 095c519..0000000
Binary files a/pix/i/risk_config.gif and /dev/null differ
diff --git a/pix/i/risk_dataloss.gif b/pix/i/risk_dataloss.gif
deleted file mode 100644 (file)
index 9e7dd9b..0000000
Binary files a/pix/i/risk_dataloss.gif and /dev/null differ
diff --git a/pix/i/risk_managetrust.gif b/pix/i/risk_managetrust.gif
deleted file mode 100644 (file)
index 885ec21..0000000
Binary files a/pix/i/risk_managetrust.gif and /dev/null differ
diff --git a/pix/i/risk_personal.gif b/pix/i/risk_personal.gif
deleted file mode 100644 (file)
index b03beb8..0000000
Binary files a/pix/i/risk_personal.gif and /dev/null differ
diff --git a/pix/i/risk_spam.gif b/pix/i/risk_spam.gif
deleted file mode 100644 (file)
index 6067083..0000000
Binary files a/pix/i/risk_spam.gif and /dev/null differ
diff --git a/pix/i/risk_xss.gif b/pix/i/risk_xss.gif
deleted file mode 100644 (file)
index 8a298b1..0000000
Binary files a/pix/i/risk_xss.gif and /dev/null differ
diff --git a/pix/i/roles.gif b/pix/i/roles.gif
deleted file mode 100644 (file)
index dfd2c0f..0000000
Binary files a/pix/i/roles.gif and /dev/null differ
diff --git a/pix/i/roles.png b/pix/i/roles.png
deleted file mode 100644 (file)
index f803c86..0000000
Binary files a/pix/i/roles.png and /dev/null differ
diff --git a/pix/i/roles.svg b/pix/i/roles.svg
deleted file mode 100644 (file)
index 9fc0081..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>\r
-<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In  -->\r
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [\r
-       <!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">\r
-]>\r
-<svg version="1.1"\r
-        xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"\r
-        x="0px" y="0px" width="16px" height="16px" viewBox="0 0 16 16" style="overflow:visible;enable-background:new 0 0 16 16;"\r
-        xml:space="preserve" preserveAspectRatio="xMinYMid meet">\r
-<defs>\r
-</defs>\r
-<path style="fill:#999999;" d="M5.2,10.3L0,13.1V16h16v-3l-5.2-2.7C10.3,10,10.2,9.4,10.6,9c0,0,1.4-1.8,1.4-3.8C12,2.3,10.2,0,8,0\r
-       S4,2.3,4,5.2C4,7.2,5.4,9,5.4,9C5.8,9.5,5.7,10,5.2,10.3z"/>\r
-</svg>\r
diff --git a/pix/i/rss.gif b/pix/i/rss.gif
deleted file mode 100644 (file)
index 925c32c..0000000
Binary files a/pix/i/rss.gif and /dev/null differ
diff --git a/pix/i/scales.gif b/pix/i/scales.gif
deleted file mode 100644 (file)
index 4b624a6..0000000
Binary files a/pix/i/scales.gif and /dev/null differ
diff --git a/pix/i/search.gif b/pix/i/search.gif
deleted file mode 100644 (file)
index 0bfd029..0000000
Binary files a/pix/i/search.gif and /dev/null differ
diff --git a/pix/i/settings.gif b/pix/i/settings.gif
deleted file mode 100644 (file)
index 0457bf4..0000000
Binary files a/pix/i/settings.gif and /dev/null differ
diff --git a/pix/i/show.gif b/pix/i/show.gif
deleted file mode 100644 (file)
index f5ffac7..0000000
Binary files a/pix/i/show.gif and /dev/null differ
diff --git a/pix/i/tick_amber_big.gif b/pix/i/tick_amber_big.gif
deleted file mode 100644 (file)
index bf4906f..0000000
Binary files a/pix/i/tick_amber_big.gif and /dev/null differ
diff --git a/pix/i/tick_amber_big.png b/pix/i/tick_amber_big.png
deleted file mode 100644 (file)
index 1733b8a..0000000
Binary files a/pix/i/tick_amber_big.png and /dev/null differ
diff --git a/pix/i/tick_amber_big.svg b/pix/i/tick_amber_big.svg
deleted file mode 100644 (file)
index 4e2bb31..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>\r
-<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In  -->\r
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [\r
-       <!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">\r
-]>\r
-<svg version="1.1"\r
-        xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"\r
-        x="0px" y="0px" width="16px" height="16px" viewBox="-0.1 0 16 16" style="overflow:visible;enable-background:new -0.1 0 16 16;"\r
-        xml:space="preserve" preserveAspectRatio="xMinYMid meet">\r
-<defs>\r
-</defs>\r
-<path style="fill:#FFB844;" d="M6.4,11.1c-2-2.5-3.7-4-3.7-4S0.3,9.5,0,9.8C5,13.1,8.1,16,8.1,16s0.2-0.7,0.6-1.8\r
-       c0.9-2.7,3.2-8.1,7.1-14.2C11.2,3.7,8.1,8.2,6.4,11.1z"/>\r
-</svg>\r
diff --git a/pix/i/tick_amber_small.gif b/pix/i/tick_amber_small.gif
deleted file mode 100644 (file)
index 02fa0b7..0000000
Binary files a/pix/i/tick_amber_small.gif and /dev/null differ
diff --git a/pix/i/tick_amber_small.png b/pix/i/tick_amber_small.png
deleted file mode 100644 (file)
index 1733b8a..0000000
Binary files a/pix/i/tick_amber_small.png and /dev/null differ
diff --git a/pix/i/tick_amber_small.svg b/pix/i/tick_amber_small.svg
deleted file mode 100644 (file)
index 4e2bb31..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>\r
-<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In  -->\r
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [\r
-       <!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">\r
-]>\r
-<svg version="1.1"\r
-        xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"\r
-        x="0px" y="0px" width="16px" height="16px" viewBox="-0.1 0 16 16" style="overflow:visible;enable-background:new -0.1 0 16 16;"\r
-        xml:space="preserve" preserveAspectRatio="xMinYMid meet">\r
-<defs>\r
-</defs>\r
-<path style="fill:#FFB844;" d="M6.4,11.1c-2-2.5-3.7-4-3.7-4S0.3,9.5,0,9.8C5,13.1,8.1,16,8.1,16s0.2-0.7,0.6-1.8\r
-       c0.9-2.7,3.2-8.1,7.1-14.2C11.2,3.7,8.1,8.2,6.4,11.1z"/>\r
-</svg>\r
diff --git a/pix/i/tick_green_big.gif b/pix/i/tick_green_big.gif
deleted file mode 100644 (file)
index 55d336e..0000000
Binary files a/pix/i/tick_green_big.gif and /dev/null differ
diff --git a/pix/i/tick_green_big.png b/pix/i/tick_green_big.png
deleted file mode 100644 (file)
index 11ef29b..0000000
Binary files a/pix/i/tick_green_big.png and /dev/null differ
diff --git a/pix/i/tick_green_big.svg b/pix/i/tick_green_big.svg
deleted file mode 100644 (file)
index c5156f3..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>\r
-<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In  -->\r
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [\r
-       <!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">\r
-]>\r
-<svg version="1.1"\r
-        xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"\r
-        x="0px" y="0px" width="16px" height="16px" viewBox="-0.1 0 16 16" style="overflow:visible;enable-background:new -0.1 0 16 16;"\r
-        xml:space="preserve" preserveAspectRatio="xMinYMid meet">\r
-<defs>\r
-</defs>\r
-<path style="fill:#99CC33;" d="M6.4,11.1c-2-2.5-3.7-4-3.7-4S0.3,9.5,0,9.8C5,13.1,8.1,16,8.1,16s0.2-0.7,0.6-1.8\r
-       c0.9-2.7,3.2-8.1,7.1-14.2C11.2,3.7,8.1,8.2,6.4,11.1z"/>\r
-</svg>\r
diff --git a/pix/i/tick_green_small.gif b/pix/i/tick_green_small.gif
deleted file mode 100644 (file)
index d81ab16..0000000
Binary files a/pix/i/tick_green_small.gif and /dev/null differ
diff --git a/pix/i/tick_green_small.png b/pix/i/tick_green_small.png
deleted file mode 100644 (file)
index 11ef29b..0000000
Binary files a/pix/i/tick_green_small.png and /dev/null differ
diff --git a/pix/i/tick_green_small.svg b/pix/i/tick_green_small.svg
deleted file mode 100644 (file)
index c5156f3..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>\r
-<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In  -->\r
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [\r
-       <!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">\r
-]>\r
-<svg version="1.1"\r
-        xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"\r
-        x="0px" y="0px" width="16px" height="16px" viewBox="-0.1 0 16 16" style="overflow:visible;enable-background:new -0.1 0 16 16;"\r
-        xml:space="preserve" preserveAspectRatio="xMinYMid meet">\r
-<defs>\r
-</defs>\r
-<path style="fill:#99CC33;" d="M6.4,11.1c-2-2.5-3.7-4-3.7-4S0.3,9.5,0,9.8C5,13.1,8.1,16,8.1,16s0.2-0.7,0.6-1.8\r
-       c0.9-2.7,3.2-8.1,7.1-14.2C11.2,3.7,8.1,8.2,6.4,11.1z"/>\r
-</svg>\r
diff --git a/pix/i/user.gif b/pix/i/user.gif
deleted file mode 100644 (file)
index ff6579f..0000000
Binary files a/pix/i/user.gif and /dev/null differ
diff --git a/pix/i/users.gif b/pix/i/users.gif
deleted file mode 100644 (file)
index 72761ea..0000000
Binary files a/pix/i/users.gif and /dev/null differ
diff --git a/pix/t/add.gif b/pix/t/add.gif
deleted file mode 100644 (file)
index 1b5c6a2..0000000
Binary files a/pix/t/add.gif and /dev/null differ
diff --git a/pix/t/addgreen.gif b/pix/t/addgreen.gif
deleted file mode 100644 (file)
index 6b2554c..0000000
Binary files a/pix/t/addgreen.gif and /dev/null differ
diff --git a/pix/t/addgreen.png b/pix/t/addgreen.png
deleted file mode 100644 (file)
index fd8cbbe..0000000
Binary files a/pix/t/addgreen.png and /dev/null differ
diff --git a/pix/t/addgreen.svg b/pix/t/addgreen.svg
deleted file mode 100644 (file)
index 9197663..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>\r
-<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In  -->\r
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [\r
-       <!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">\r
-]>\r
-<svg version="1.1"\r
-        xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"\r
-        x="0px" y="0px" width="12px" height="12px" viewBox="0 0 12 12" style="overflow:visible;enable-background:new 0 0 12 12;"\r
-        xml:space="preserve" preserveAspectRatio="xMinYMid meet">\r
-<defs>\r
-</defs>\r
-<path style="fill:#999999;" d="M11,4.5H7.5V1c0-0.5-0.5-1-1-1h-1c-0.5,0-1,0.5-1,1v3.5L1,4.5c-0.5,0-1,0.5-1,1v1c0,0.5,0.5,1,1,1\r
-       h3.5V11c0,0.5,0.5,1,1,1h1c0.5,0,1-0.5,1-1V7.5H11c0.6,0,1-0.5,1-1l0-1C12,5,11.6,4.5,11,4.5z"/>\r
-</svg>\r
diff --git a/pix/t/backup.gif b/pix/t/backup.gif
deleted file mode 100644 (file)
index 41b962b..0000000
Binary files a/pix/t/backup.gif and /dev/null differ
diff --git a/pix/t/block.gif b/pix/t/block.gif
deleted file mode 100644 (file)
index b82de76..0000000
Binary files a/pix/t/block.gif and /dev/null differ
diff --git a/pix/t/calc.gif b/pix/t/calc.gif
deleted file mode 100644 (file)
index c74ca93..0000000
Binary files a/pix/t/calc.gif and /dev/null differ
diff --git a/pix/t/calc_off.gif b/pix/t/calc_off.gif
deleted file mode 100644 (file)
index 296f9bd..0000000
Binary files a/pix/t/calc_off.gif and /dev/null differ
diff --git a/pix/t/clear.gif b/pix/t/clear.gif
deleted file mode 100644 (file)
index 0a38b0f..0000000
Binary files a/pix/t/clear.gif and /dev/null differ
diff --git a/pix/t/clear.png b/pix/t/clear.png
deleted file mode 100644 (file)
index 43540a5..0000000
Binary files a/pix/t/clear.png and /dev/null differ
diff --git a/pix/t/clear.svg b/pix/t/clear.svg
deleted file mode 100644 (file)
index 5c768d1..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>\r
-<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In  -->\r
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [\r
-       <!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">\r
-]>\r
-<svg version="1.1"\r
-        xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"\r
-        x="0px" y="0px" width="12px" height="12px" viewBox="0 0 12 12" style="overflow:visible;enable-background:new 0 0 12 12;"\r
-        xml:space="preserve" preserveAspectRatio="xMinYMid meet">\r
-<defs>\r
-</defs>\r
-<path style="fill:#999999;" d="M11.4,0.6l-0.9-0.5C10.1-0.1,9.5,0,9.2,0.5L4.7,8.2L2,6.6C1.5,6.3,0.9,6.5,0.6,7L0.1,7.8\r
-       C-0.1,8.3,0,8.9,0.5,9.2L5,11.8c0.1,0.1,0.3,0.1,0.4,0.1c0.4,0.1,0.8-0.1,1-0.5L11.8,2C12.1,1.5,11.9,0.9,11.4,0.6z"/>\r
-</svg>\r
diff --git a/pix/t/copy.gif b/pix/t/copy.gif
deleted file mode 100644 (file)
index 12881b5..0000000
Binary files a/pix/t/copy.gif and /dev/null differ
diff --git a/pix/t/delete.gif b/pix/t/delete.gif
deleted file mode 100644 (file)
index d17f867..0000000
Binary files a/pix/t/delete.gif and /dev/null differ
diff --git a/pix/t/down.gif b/pix/t/down.gif
deleted file mode 100644 (file)
index c46bd04..0000000
Binary files a/pix/t/down.gif and /dev/null differ
diff --git a/pix/t/edit.gif b/pix/t/edit.gif
deleted file mode 100644 (file)
index f32a845..0000000
Binary files a/pix/t/edit.gif and /dev/null differ
diff --git a/pix/t/email.gif b/pix/t/email.gif
deleted file mode 100644 (file)
index 2889f57..0000000
Binary files a/pix/t/email.gif and /dev/null differ
diff --git a/pix/t/emailno.gif b/pix/t/emailno.gif
deleted file mode 100644 (file)
index 0b4af5b..0000000
Binary files a/pix/t/emailno.gif and /dev/null differ
diff --git a/pix/t/go.gif b/pix/t/go.gif
deleted file mode 100644 (file)
index bb49a62..0000000
Binary files a/pix/t/go.gif and /dev/null differ
diff --git a/pix/t/grades.gif b/pix/t/grades.gif
deleted file mode 100644 (file)
index 31a9136..0000000
Binary files a/pix/t/grades.gif and /dev/null differ
diff --git a/pix/t/groupn.gif b/pix/t/groupn.gif
deleted file mode 100644 (file)
index 21ca545..0000000
Binary files a/pix/t/groupn.gif and /dev/null differ
diff --git a/pix/t/groups.gif b/pix/t/groups.gif
deleted file mode 100644 (file)
index 77a6c67..0000000
Binary files a/pix/t/groups.gif and /dev/null differ
diff --git a/pix/t/groupv.gif b/pix/t/groupv.gif
deleted file mode 100644 (file)
index 32edba5..0000000
Binary files a/pix/t/groupv.gif and /dev/null differ
diff --git a/pix/t/hide.gif b/pix/t/hide.gif
deleted file mode 100644 (file)
index e97caa7..0000000
Binary files a/pix/t/hide.gif and /dev/null differ
diff --git a/pix/t/left.gif b/pix/t/left.gif
deleted file mode 100644 (file)
index 8673d37..0000000
Binary files a/pix/t/left.gif and /dev/null differ
diff --git a/pix/t/lock.gif b/pix/t/lock.gif
deleted file mode 100644 (file)
index 35174e5..0000000
Binary files a/pix/t/lock.gif and /dev/null differ
diff --git a/pix/t/locktime.gif b/pix/t/locktime.gif
deleted file mode 100644 (file)
index e365be4..0000000
Binary files a/pix/t/locktime.gif and /dev/null differ
diff --git a/pix/t/manual_item.gif b/pix/t/manual_item.gif
deleted file mode 100644 (file)
index 1119c26..0000000
Binary files a/pix/t/manual_item.gif and /dev/null differ
diff --git a/pix/t/manual_item.png b/pix/t/manual_item.png
deleted file mode 100644 (file)
index 830c426..0000000
Binary files a/pix/t/manual_item.png and /dev/null differ
diff --git a/pix/t/manual_item.svg b/pix/t/manual_item.svg
deleted file mode 100644 (file)
index ecbbb58..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>\r
-<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In  -->\r
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [\r
-       <!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">\r
-]>\r
-<svg version="1.1"\r
-        xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"\r
-        x="0px" y="0px" width="16px" height="16px" viewBox="0 0 16 16" style="overflow:visible;enable-background:new 0 0 16 16;"\r
-        xml:space="preserve" preserveAspectRatio="xMinYMid meet">\r
-<defs>\r
-</defs>\r
-<path style="fill:#999999;" d="M15,5.2V15c0,0.5-0.5,1-1,1H1c-0.5,0-1-0.5-1-1V2c0-0.5,0.5-1,1-1h9.8l-2,2H3C2.5,3,2,3.4,2,4v9\r
-       c0,0.5,0.5,1,1,1h9c0.5,0,1-0.5,1-1V7.2L15,5.2z M15.4,0.6L15.4,0.6c-0.8-0.8-2.1-0.8-2.8,0l-1,1l2.8,2.8l1-1\r
-       C16.2,2.6,16.2,1.4,15.4,0.6z M10.6,2.6L4,9.1V12h2.8c0,0,1.8-1.8,1.8-1.8l4.8-4.8L10.6,2.6z"/>\r
-</svg>\r
diff --git a/pix/t/message.gif b/pix/t/message.gif
deleted file mode 100644 (file)
index 2889f57..0000000
Binary files a/pix/t/message.gif and /dev/null differ
diff --git a/pix/t/move.gif b/pix/t/move.gif
deleted file mode 100644 (file)
index 9e70188..0000000
Binary files a/pix/t/move.gif and /dev/null differ
diff --git a/pix/t/portfolioadd.gif b/pix/t/portfolioadd.gif
deleted file mode 100644 (file)
index 3fdabc3..0000000
Binary files a/pix/t/portfolioadd.gif and /dev/null differ
diff --git a/pix/t/preview.gif b/pix/t/preview.gif
deleted file mode 100644 (file)
index 9af8dd2..0000000
Binary files a/pix/t/preview.gif and /dev/null differ
diff --git a/pix/t/restore.gif b/pix/t/restore.gif
deleted file mode 100644 (file)
index 9bdf346..0000000
Binary files a/pix/t/restore.gif and /dev/null differ
diff --git a/pix/t/right.gif b/pix/t/right.gif
deleted file mode 100644 (file)
index 8b4b78f..0000000
Binary files a/pix/t/right.gif and /dev/null differ
diff --git a/pix/t/show.gif b/pix/t/show.gif
deleted file mode 100644 (file)
index 553ebb4..0000000
Binary files a/pix/t/show.gif and /dev/null differ
diff --git a/pix/t/stop.gif b/pix/t/stop.gif
deleted file mode 100644 (file)
index 6167506..0000000
Binary files a/pix/t/stop.gif and /dev/null differ
diff --git a/pix/t/switch_minus.gif b/pix/t/switch_minus.gif
deleted file mode 100644 (file)
index df24469..0000000
Binary files a/pix/t/switch_minus.gif and /dev/null differ
diff --git a/pix/t/switch_plus.gif b/pix/t/switch_plus.gif
deleted file mode 100644 (file)
index 0be2012..0000000
Binary files a/pix/t/switch_plus.gif and /dev/null differ
diff --git a/pix/t/switch_whole.gif b/pix/t/switch_whole.gif
deleted file mode 100644 (file)
index 76e7ce7..0000000
Binary files a/pix/t/switch_whole.gif and /dev/null differ
diff --git a/pix/t/unlock.gif b/pix/t/unlock.gif
deleted file mode 100644 (file)
index dcf06d6..0000000
Binary files a/pix/t/unlock.gif and /dev/null differ
diff --git a/pix/t/unlock_gray.gif b/pix/t/unlock_gray.gif
deleted file mode 100644 (file)
index 392d354..0000000
Binary files a/pix/t/unlock_gray.gif and /dev/null differ
diff --git a/pix/t/unlock_gray.png b/pix/t/unlock_gray.png
deleted file mode 100644 (file)
index 04b8c5b..0000000
Binary files a/pix/t/unlock_gray.png and /dev/null differ
diff --git a/pix/t/unlock_gray.svg b/pix/t/unlock_gray.svg
deleted file mode 100644 (file)
index 72eb809..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>\r
-<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In  -->\r
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [\r
-       <!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">\r
-]>\r
-<svg version="1.1"\r
-        xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"\r
-        x="0px" y="0px" width="12px" height="12px" viewBox="0 0 12 12" style="overflow:visible;enable-background:new 0 0 12 12;"\r
-        xml:space="preserve" preserveAspectRatio="xMinYMid meet">\r
-<defs>\r
-</defs>\r
-<path style="fill:#999999;" d="M6.5,0l-1,0c-1.7,0-3,1.3-3,3v2H1C0.5,5,0,5.5,0,6l0,5c0,0.6,0.4,1,1,1h10c0.5,0,1-0.5,1-1l0-5\r
-       c0-0.6-0.5-1-1-1H9.5l0-2C9.5,1.3,8.2,0,6.5,0z M7,8c0,0.4-0.2,0.7-0.6,0.9L6.5,9L7,10H6H5l0.5-1l0.1-0.1C5.2,8.7,5,8.4,5,8\r
-       c0-0.5,0.4-1,1-1S7,7.5,7,8z M7.5,3v2l-3,0V3c0-0.6,0.5-1,1-1h1C7.1,2,7.5,2.4,7.5,3z"/>\r
-</svg>\r
diff --git a/pix/t/up.gif b/pix/t/up.gif
deleted file mode 100644 (file)
index bb4a12b..0000000
Binary files a/pix/t/up.gif and /dev/null differ
diff --git a/pix/t/user.gif b/pix/t/user.gif
deleted file mode 100644 (file)
index d0c6d58..0000000
Binary files a/pix/t/user.gif and /dev/null differ
diff --git a/pix/t/userblue.gif b/pix/t/userblue.gif
deleted file mode 100644 (file)
index 75d1778..0000000
Binary files a/pix/t/userblue.gif and /dev/null differ
diff --git a/pix/t/userblue.png b/pix/t/userblue.png
deleted file mode 100644 (file)
index e7ca8cc..0000000
Binary files a/pix/t/userblue.png and /dev/null differ
diff --git a/pix/t/userblue.svg b/pix/t/userblue.svg
deleted file mode 100644 (file)
index a1220af..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>\r
-<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In  -->\r
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [\r
-       <!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">\r
-]>\r
-<svg version="1.1"\r
-        xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"\r
-        x="0px" y="0px" width="12px" height="12px" viewBox="0 0 12 12" style="overflow:visible;enable-background:new 0 0 12 12;"\r
-        xml:space="preserve" preserveAspectRatio="xMinYMid meet">\r
-<defs>\r
-</defs>\r
-<path style="fill:#999999;" d="M3.7,7.6L0.1,9.4c0,0-0.1,0-0.1,0.1V12h12V9.3c0,0-0.1-0.1-0.1-0.1L8.3,7.5C7.8,7.3,7.7,6.7,8,6.3\r
-       c0,0,0.9-1.1,0.9-2.5C8.9,1.7,7.6,0,6,0C4.4,0,3.1,1.7,3.1,3.8C3.1,5.2,4,6.3,4,6.3C4.3,6.7,4.2,7.3,3.7,7.6z"/>\r
-</svg>\r
index ece0ed7..a55c6c8 100644 (file)
@@ -96,6 +96,29 @@ abstract class question_test_helper {
      * this question type.
      */
     abstract public function get_test_questions();
+
+    /**
+     * Set up a form to create a question in $cat. This method also sets cat and contextid on $questiondata object.
+     * @param object $cat the category
+     * @param object $questiondata form initialisation requires question data.
+     * @return moodleform
+     */
+    public static function get_question_editing_form($cat, $questiondata) {
+        $catcontext = context::instance_by_id($cat->contextid, MUST_EXIST);
+        $contexts = new question_edit_contexts($catcontext);
+        $dataforformconstructor = new stdClass();
+        $dataforformconstructor->qtype = $questiondata->qtype;
+        $dataforformconstructor->contextid = $questiondata->contextid = $catcontext->id;
+        $dataforformconstructor->category = $questiondata->category = $cat->id;
+        $dataforformconstructor->formoptions = new stdClass();
+        $dataforformconstructor->formoptions->canmove = true;
+        $dataforformconstructor->formoptions->cansaveasnew = true;
+        $dataforformconstructor->formoptions->movecontext = false;
+        $dataforformconstructor->formoptions->canedit = true;
+        $dataforformconstructor->formoptions->repeatelements = true;
+        $qtype = question_bank::get_qtype($questiondata->qtype);
+        return  $qtype->create_editing_form('question.php', $dataforformconstructor, $cat, $contexts, true);
+    }
 }
 
 
@@ -172,18 +195,6 @@ class test_question_maker {
         $qdata->hints = array();
     }
 
-    public static function initialise_question_form_data($qdata) {
-        $formdata = new stdClass();
-        $formdata->id = 0;
-        $formdata->category = '0,0';
-        $formdata->usecurrentcat = 1;
-        $formdata->categorymoveto = '0,0';
-        $formdata->tags = array();
-        $formdata->penalty = 0.3333333;
-        $formdata->questiontextformat = FORMAT_HTML;
-        $formdata->generalfeedbackformat = FORMAT_HTML;
-    }
-
     /**
      * Get the test helper class for a particular question type.
      * @param $qtype the question type name, e.g. 'multichoice'.
@@ -413,6 +424,19 @@ class test_question_maker {
         $q->incorrectfeedback = self::STANDARD_OVERALL_INCORRECT_FEEDBACK;
         $q->incorrectfeedbackformat = FORMAT_HTML;
     }
+
+    /**
+     * Add some standard overall feedback to a question's form data.
+     */
+    public static function set_standard_combined_feedback_form_data($form) {
+        $form->correctfeedback = array('text' => self::STANDARD_OVERALL_CORRECT_FEEDBACK,
+                                    'format' => FORMAT_HTML);
+        $form->partiallycorrectfeedback = array('text' => self::STANDARD_OVERALL_PARTIALLYCORRECT_FEEDBACK,
+                                             'format' => FORMAT_HTML);
+        $form->shownumcorrect = true;
+        $form->incorrectfeedback = array('text' => self::STANDARD_OVERALL_INCORRECT_FEEDBACK,
+                                    'format' => FORMAT_HTML);
+    }
 }
 
 
index 4cd72a3..53cb8e4 100644 (file)
@@ -38,7 +38,7 @@ require_once($CFG->dirroot . '/question/type/calculated/tests/helper.php');
  */
 class qtype_calculatedsimple_test_helper extends question_test_helper {
     public function get_test_questions() {
-        return array('sum');
+        return array('sum', 'sumwithvariants');
     }
 
     /**
@@ -77,4 +77,184 @@ class qtype_calculatedsimple_test_helper extends question_test_helper {
 
         return $q;
     }
+
+
+    public function get_calculatedsimple_question_form_data_sumwithvariants() {
+        $form = new stdClass();
+
+        $form->name = 'Calculated simple';
+
+        $form->qtype = 'calculatedsimple';
+
+        $form->questiontext = array();
+        $form->questiontext['text'] = '<p>This is a simple sum of two variables.</p>';
+        $form->questiontext['format'] = '1';
+
+        $form->defaultmark = 1;
+        $form->generalfeedback = array();
+        $form->generalfeedback['text'] = '<p>The answer is  {a} + {b}</p>';
+        $form->generalfeedback['format'] = '1';
+
+        $form->synchronize = 0;
+        $form->initialcategory = 1;
+        $form->reload = 1;
+        $form->mform_isexpanded_id_answerhdr = 1;
+        $form->noanswers = 1;
+        $form->answer = array('{a} + {b}');
+
+        $form->fraction = array('1.0');
+
+        $form->tolerance = array(0.01);
+        $form->tolerancetype = array('1');
+
+        $form->correctanswerlength = array('2');
+        $form->correctanswerformat = array('1');
+
+        $form->feedback = array();
+        $form->feedback[0] = array();
+        $form->feedback[0]['text'] = '';
+        $form->feedback[0]['format'] = '1';
+
+        $form->unitrole = '3';
+        $form->unitpenalty = 0.1;
+        $form->unitgradingtypes = '1';
+        $form->unitsleft = '0';
+        $form->nounits = 1;
+        $form->multiplier = array('1.0');
+
+        $form->penalty = '0.3333333';
+        $form->numhints = 2;
+        $form->hint = array();
+        $form->hint[0] = array();
+        $form->hint[0]['text'] = '';
+        $form->hint[0]['format'] = '1';
+
+        $form->hint[1] = array();
+        $form->hint[1]['text'] = '';
+        $form->hint[1]['format'] = '1';
+
+        $form->calcmin = array();
+        $form->calcmin[1] = 1;
+        $form->calcmin[2] = 1;
+
+        $form->calcmax = array();
+        $form->calcmax[1] = 10;
+        $form->calcmax[2] = 10;
+
+        $form->calclength = array();
+        $form->calclength[1] = '1';
+        $form->calclength[2] = '1';
+
+        $form->calcdistribution = array();
+        $form->calcdistribution[1] = 0;
+        $form->calcdistribution[2] = 0;
+
+        $form->datasetdef = array();
+        $form->datasetdef[1] = '1-0-a';
+        $form->datasetdef[2] = '1-0-b';
+
+        $form->defoptions = array();
+        $form->defoptions[1] = '';
+        $form->defoptions[2] = '';
+
+        $form->selectadd = '10';
+        $form->selectshow = '10';
+        $form->number = array();
+        $form->number[1] = '2.3';
+        $form->number[2] = '7.6';
+        $form->number[3] = '2.1';
+        $form->number[4] = '6.4';
+        $form->number[5] = '1.4';
+        $form->number[6] = '1.9';
+        $form->number[7] = '9.9';
+        $form->number[8] = '9.5';
+        $form->number[9] = '9.0';
+        $form->number[10] = '5.2';
+        $form->number[11] = '2.1';
+        $form->number[12] = '7.3';
+        $form->number[13] = '7.9';
+        $form->number[14] = '1.2';
+        $form->number[15] = '2.3';
+        $form->number[16] = '3.4';
+        $form->number[17] = '1.9';
+        $form->number[18] = '5.2';
+        $form->number[19] = '3.4';
+        $form->number[20] = '3.4';
+
+        $form->itemid = array_fill(1, 20, 0);
+
+        $form->definition = array();
+        $form->definition[1] = '1-0-b';
+        $form->definition[2] = '1-0-a';
+        $form->definition[3] = '1-0-b';
+        $form->definition[4] = '1-0-a';
+        $form->definition[5] = '1-0-b';
+        $form->definition[6] = '1-0-a';
+        $form->definition[7] = '1-0-b';
+        $form->definition[8] = '1-0-a';
+        $form->definition[9] = '1-0-b';
+        $form->definition[10] = '1-0-a';
+        $form->definition[11] = '1-0-b';
+        $form->definition[12] = '1-0-a';
+        $form->definition[13] = '1-0-b';
+        $form->definition[14] = '1-0-a';
+        $form->definition[15] = '1-0-b';
+        $form->definition[16] = '1-0-a';
+        $form->definition[17] = '1-0-b';
+        $form->definition[18] = '1-0-a';
+        $form->definition[19] = '1-0-b';
+        $form->definition[20] = '1-0-a';
+
+        return $form;
+    }
+
+    public function get_calculatedsimple_question_data_sumwithvariants() {
+        $q = new stdClass();
+
+        $q->name = 'Calculated simple';
+        $q->questiontext = '<p>This is a simple sum of two variables.</p>';
+        $q->questiontextformat = '1';
+        $q->generalfeedback = '<p>The answer is  {a} + {b}</p>';
+        $q->generalfeedbackformat = '1';
+        $q->defaultmark = 1;
+        $q->penalty = 0.3333333;
+        $q->qtype = 'calculatedsimple';
+        $q->length = '1';
+        $q->hidden = '0';
+        $q->options = new stdClass();
+        $q->options->synchronize = 0;
+        $q->options->single = 0;
+        $q->options->answernumbering = 'abc';
+        $q->options->shuffleanswers = 0;
+        $q->options->correctfeedback = '';
+        $q->options->partiallycorrectfeedback = '';
+        $q->options->incorrectfeedback = '';
+        $q->options->correctfeedbackformat = 0;
+        $q->options->partiallycorrectfeedbackformat = 0;
+        $q->options->incorrectfeedbackformat = 0;
+        $q->options->answers = array();
+        $q->options->answers[0] = new stdClass();
+        $q->options->answers[0]->id = '6977';
+        $q->options->answers[0]->question = '3379';
+        $q->options->answers[0]->answer = '{a} + {b}';
+        $q->options->answers[0]->answerformat = '0';
+        $q->options->answers[0]->fraction = '1.0000000';
+        $q->options->answers[0]->feedback = '';
+        $q->options->answers[0]->feedbackformat = '1';
+        $q->options->answers[0]->tolerance = '0.01';
+        $q->options->answers[0]->tolerancetype = '1';
+        $q->options->answers[0]->correctanswerlength = '2';
+        $q->options->answers[0]->correctanswerformat = '1';
+
+        $q->options->units = array();
+
+        $q->options->unitgradingtype = '0';
+        $q->options->unitpenalty = '0.1000000';
+        $q->options->showunits = '3';
+        $q->options->unitsleft = '0';
+
+        $q->hints = array();
+
+        return $q;
+    }
 }
diff --git a/question/type/calculatedsimple/tests/questiontype_test.php b/question/type/calculatedsimple/tests/questiontype_test.php
new file mode 100644 (file)
index 0000000..1b9771a
--- /dev/null
@@ -0,0 +1,122 @@
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * Unit tests for the calculatedsimple question type class.
+ *
+ * @package    qtype_calculatedsimple
+ * @copyright  2013 The Open University
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+
+defined('MOODLE_INTERNAL') || die();
+
+global $CFG;
+require_once($CFG->dirroot . '/question/type/calculatedsimple/questiontype.php');
+require_once($CFG->dirroot . '/question/engine/tests/helpers.php');
+require_once($CFG->dirroot . '/question/type/edit_question_form.php');
+require_once($CFG->dirroot . '/question/type/calculatedsimple/edit_calculatedsimple_form.php');
+
+
+/**
+ * Unit tests for the calculatedsimple question type class.
+ *
+ * @copyright  2007 The Open University
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+class qtype_calculatedsimple_test extends advanced_testcase {
+    public static $includecoverage = array(
+        'question/type/questiontypebase.php',
+        'question/type/calculatedsimple/questiontype.php',
+        'question/type/edit_question_form.php',
+        'question/type/calculatedsimple/edit_calculatedsimple_form.php'
+    );
+
+    protected $qtype;
+
+    protected function setUp() {
+        $this->qtype = new qtype_calculatedsimple();
+    }
+
+    protected function tearDown() {
+        $this->qtype = null;
+    }
+
+    public function test_name() {
+        $this->assertEquals($this->qtype->name(), 'calculatedsimple');
+    }
+
+    public function test_can_analyse_responses() {
+        $this->assertTrue($this->qtype->can_analyse_responses());
+    }
+
+
+    public function test_question_saving_sumwithvariants() {
+        $this->resetAfterTest(true);
+        $this->setAdminUser();
+
+        $questiondata = test_question_maker::get_question_data('calculatedsimple', 'sumwithvariants');
+        $formdata = test_question_maker::get_question_form_data('calculatedsimple', 'sumwithvariants');
+
+        $generator = $this->getDataGenerator()->get_plugin_generator('core_question');
+        $cat = $generator->create_question_category(array());
+
+        $formdata->category = "{$cat->id},{$cat->contextid}";
+        qtype_calculatedsimple_edit_form::mock_submit((array)$formdata);
+
+        $form = qtype_calculatedsimple_test_helper::get_question_editing_form($cat, $questiondata);
+
+        $this->assertTrue($form->is_validated());
+
+        $fromform = $form->get_data();
+
+        $returnedfromsave = $this->qtype->save_question($questiondata, $fromform);
+        $actualquestionsdata = question_load_questions(array($returnedfromsave->id));
+        $actualquestiondata = end($actualquestionsdata);
+
+        foreach ($questiondata as $property => $value) {
+            if (!in_array($property, array('id', 'version', 'timemodified', 'timecreated', 'options'))) {
+                $this->assertAttributeEquals($value, $property, $actualquestiondata);
+            }
+        }
+
+        foreach ($questiondata->options as $optionname => $value) {
+            if ($optionname != 'answers') {
+                $this->assertAttributeEquals($value, $optionname, $actualquestiondata->options);
+            }
+        }
+
+        foreach ($questiondata->options->answers as $answer) {
+            $actualanswer = array_shift($actualquestiondata->options->answers);
+            foreach ($answer as $ansproperty => $ansvalue) {
+                if (!in_array($ansproperty, array('id', 'question', 'answerformat'))) {
+                    $this->assertAttributeEquals($ansvalue, $ansproperty, $actualanswer);
+                }
+            }
+        }
+
+        $datasetloader = new qtype_calculated_dataset_loader($actualquestiondata->id);
+
+        $this->assertEquals(10, $datasetloader->get_number_of_items());
+
+        for ($itemno = 1; $itemno <= 10; $itemno++) {
+            $item = $datasetloader->get_values($itemno);
+            $this->assertEquals($formdata->number[($itemno -1)*2 + 2], $item['a']);
+            $this->assertEquals($formdata->number[($itemno -1)*2 + 1], $item['b']);
+        }
+    }
+}
index d571b5d..a8c68ff 100644 (file)
@@ -17,9 +17,8 @@
 /**
  * Test helper code for the description question type.
  *
- * @package    qtype
- * @subpackage description
- * @copyright  2010 The Open University
+ * @package    qtype_description
+ * @copyright  2013 The Open University
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
 
@@ -30,7 +29,7 @@ defined('MOODLE_INTERNAL') || die();
 /**
  * Test helper class for the description question type.
  *
- * @copyright  2010 The Open University
+ * @copyright  2013 The Open University
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
 class qtype_description_test_helper extends question_test_helper {
@@ -59,11 +58,10 @@ class qtype_description_test_helper extends question_test_helper {
     }
 
     /**
-     * Get the question data, as it would be loaded by get_question_options, for
-     * the question returned by {@link make_an_oumultiresponse_two_of_four()}.
+     * Get the question data, as it would be loaded by get_question_options.
      * @return object
      */
-    public static function get_question_data() {
+    public static function get_description_question_data_info() {
         global $USER;
 
         $qdata = new stdClass();
@@ -87,7 +85,28 @@ class qtype_description_test_helper extends question_test_helper {
         $qdata->length = 0;
         $qdata->penalty = 0;
         $qdata->hidden = 0;
+        $qdata->hints = array();
+        $qdata->options = new stdClass();
+        $qdata->options->answers = array();
 
         return $qdata;
     }
+
+
+    /**
+     * Get the question form data.
+     * @return object
+     */
+    public static function get_description_question_form_data_info() {
+        $form = new stdClass();
+
+        $form->name = 'Description';
+        $form->questiontext = array('text' => 'Here is some information about the questions you are about to attempt.',
+                                    'format' => FORMAT_HTML);
+        $form->generalfeedback = array('text' => 'And here is some more text shown only on the review page.',
+                                       'format' => FORMAT_HTML);
+
+        return $form;
+    }
+
 }
index ae97ed8..60da13e 100644 (file)
@@ -17,9 +17,8 @@
 /**
  * Unit tests for the description question type class.
  *
- * @package    qtype
- * @subpackage description
- * @copyright  2010 The Open University
+ * @package    qtype_description
+ * @copyright  2013 The Open University
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
 
@@ -28,12 +27,15 @@ defined('MOODLE_INTERNAL') || die();
 
 global $CFG;
 require_once($CFG->dirroot . '/question/type/description/questiontype.php');
+require_once($CFG->dirroot . '/question/engine/tests/helpers.php');
+require_once($CFG->dirroot . '/question/type/edit_question_form.php');
+require_once($CFG->dirroot . '/question/type/description/edit_description_form.php');
 
 
 /**
  * Unit tests for the description question type class.
  *
- * @copyright  2010 The Open University
+ * @copyright  2013 The Open University
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
 class qtype_description_test extends advanced_testcase {
@@ -66,4 +68,35 @@ class qtype_description_test extends advanced_testcase {
     public function test_get_possible_responses() {
         $this->assertEquals(array(), $this->qtype->get_possible_responses(null));
     }
+
+
+    public function test_question_saving() {
+        $this->resetAfterTest(true);
+        $this->setAdminUser();
+
+        $questiondata = test_question_maker::get_question_data('description');
+        $formdata = test_question_maker::get_question_form_data('description');
+
+        $generator = $this->getDataGenerator()->get_plugin_generator('core_question');
+        $cat = $generator->create_question_category(array());
+
+        $formdata->category = "{$cat->id},{$cat->contextid}";
+        qtype_description_edit_form::mock_submit((array)$formdata);
+
+        $form = qtype_description_test_helper::get_question_editing_form($cat, $questiondata);
+
+        $this->assertTrue($form->is_validated());
+
+        $fromform = $form->get_data();
+
+        $returnedfromsave = $this->qtype->save_question($questiondata, $fromform);
+        $actualquestionsdata = question_load_questions(array($returnedfromsave->id));
+        $actualquestiondata = end($actualquestionsdata);
+
+        foreach ($questiondata as $property => $value) {
+            if (!in_array($property, array('id', 'version', 'timemodified', 'timecreated'))) {
+                $this->assertAttributeEquals($value, $property, $actualquestiondata);
+            }
+        }
+    }
 }
diff --git a/question/type/match/tests/helper.php b/question/type/match/tests/helper.php
new file mode 100644 (file)
index 0000000..d69b9ee
--- /dev/null
@@ -0,0 +1,131 @@
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * Test helpers for the match question type.
+ *
+ * @package    qtype_match
+ * @copyright  2013 The Open University
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+
+defined('MOODLE_INTERNAL') || die();
+
+global $CFG;
+require_once($CFG->dirroot . '/question/type/match/question.php');
+
+
+/**
+ * Test helper class for the match question type.
+ *
+ * @copyright  2013 The Open University
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+class qtype_match_test_helper extends question_test_helper {
+    public function get_test_questions() {
+        return array('foursubq');
+    }
+
+
+    /**
+     * Makes a match question about completing two blanks in some text.
+     * @return object the question definition data, as it might be returned from
+     * get_question_options.
+     */
+    public function get_match_question_data_foursubq() {
+        global $USER;
+        $q = new stdClass();
+        test_question_maker::initialise_question_data($q);
+        $q->name = 'Matching question';
+        $q->qtype = 'match';
+        $q->parent = 0;
+        $q->questiontext = 'Classify the animals.';
+        $q->questiontextformat = FORMAT_HTML;
+        $q->generalfeedback = 'General feedback.';
+        $q->generalfeedbackformat = FORMAT_HTML;
+        $q->defaultmark = 1;
+        $q->penalty = 0.3333333;
+        $q->length = 1;
+        $q->hidden = 0;
+        $q->createdby = $USER->id;
+        $q->modifiedby = $USER->id;
+
+        $q->options = new stdClass();
+        $q->options->shuffleanswers = 0;
+        test_question_maker::set_standard_combined_feedback_fields($q->options);
+
+        $q->options->subquestions = array(
+            14 => (object) array(
+                'id' => 14,
+                'questiontext' => 'frog',
+                'questiontextformat' => FORMAT_HTML,
+                'answertext' => 'amphibian'),
+            15 => (object) array(
+                'id' => 15,
+                'questiontext' => 'cat',
+                'questiontextformat' => FORMAT_HTML,
+                'answertext' => 'mammal'),
+            16 => (object) array(
+                'id' => 16,
+                'questiontext' => 'newt',
+                'questiontextformat' => FORMAT_HTML,
+                'answertext' => 'amphibian'),
+            17 => (object) array(
+                'id' => 17,
+                'questiontext' => '',
+                'questiontextformat' => FORMAT_HTML,
+                'answertext' => 'insect'),
+        );
+
+        return $q;
+    }
+
+    /**
+     * Makes a match question about completing two blanks in some text.
+     * @return object the question definition data, as it might be returned from
+     *      the question editing form.
+     */
+    public function get_match_question_form_data_foursubq() {
+        $q = new stdClass();
+        $q->name = 'Matching question';
+        $q->questiontext = array('text' => 'Classify the animals.', 'format' => FORMAT_HTML);
+        $q->generalfeedback = array('text' => 'General feedback.', 'format' => FORMAT_HTML);
+        $q->defaultmark = 1;
+        $q->penalty = 0.3333333;
+
+        $q->shuffleanswers = 0;
+        test_question_maker::set_standard_combined_feedback_form_data($q);
+
+        $q->subquestions = array(
+            0 => array('text' => 'frog', 'format' => FORMAT_HTML),
+            1 => array('text' => 'cat', 'format' => FORMAT_HTML),
+            2 => array('text' => 'newt', 'format' => FORMAT_HTML),
+            3 => array('text' => '', 'format' => FORMAT_HTML));
+
+        $q->subanswers = array(
+            0 => 'amphibian',
+            1 => 'mammal',
+            2 => 'amphibian',
+            3 => 'insect'
+        );
+
+        $q->noanswers = 4;
+
+        return $q;
+    }
+
+}
index 4ec6f4e..2a8af38 100644 (file)
@@ -28,6 +28,8 @@ defined('MOODLE_INTERNAL') || die();
 global $CFG;
 require_once($CFG->dirroot . '/question/engine/tests/helpers.php');
 require_once($CFG->dirroot . '/question/type/match/questiontype.php');
+require_once($CFG->dirroot . '/question/type/edit_question_form.php');
+require_once($CFG->dirroot . '/question/type/match/edit_match_form.php');
 
 
 /**
@@ -135,4 +137,53 @@ class qtype_match_test extends advanced_testcase {
                 null => question_possible_response::no_response()),
         ), $this->qtype->get_possible_responses($q));
     }
+
+
+    public function test_question_saving_foursubq() {
+        $this->resetAfterTest(true);
+        $this->setAdminUser();
+
+        $questiondata = test_question_maker::get_question_data('match');
+        $formdata = test_question_maker::get_question_form_data('match');
+
+        $generator = $this->getDataGenerator()->get_plugin_generator('core_question');
+        $cat = $generator->create_question_category(array());
+
+        $formdata->category = "{$cat->id},{$cat->contextid}";
+
+        qtype_match_edit_form::mock_submit((array)$formdata);
+
+        $form = qtype_match_test_helper::get_question_editing_form($cat, $questiondata);
+        $this->assertTrue($form->is_validated());
+
+        $fromform = $form->get_data();
+
+        $returnedfromsave = $this->qtype->save_question($questiondata, $fromform);
+        $actualquestionsdata = question_load_questions(array($returnedfromsave->id));
+        $actualquestiondata = end($actualquestionsdata);
+
+        foreach ($questiondata as $property => $value) {
+            if (!in_array($property, array('id', 'version', 'timemodified', 'timecreated', 'options', 'stamp'))) {
+                $this->assertAttributeEquals($value, $property, $actualquestiondata);
+            }
+        }
+
+        foreach ($questiondata->options as $optionname => $value) {
+            if ($optionname != 'subquestions') {
+                $this->assertAttributeEquals($value, $optionname, $actualquestiondata->options);
+            }
+        }
+
+        $this->assertObjectHasAttribute('subquestions', $actualquestiondata->options);
+
+        $subqpropstoignore = array('id');
+        foreach ($questiondata->options->subquestions as $subq) {
+            $actualsubq = array_shift($actualquestiondata->options->subquestions);
+            foreach ($subq as $subqproperty => $subqvalue) {
+                if (!in_array($subqproperty, $subqpropstoignore)) {
+                    $this->assertAttributeEquals($subqvalue, $subqproperty, $actualsubq);
+                }
+            }
+        }
+    }
 }
index 743058e..92a51e4 100644 (file)
@@ -17,9 +17,8 @@
 /**
  * Test helpers for the multianswer question type.
  *
- * @package    qtype
- * @subpackage multianswer
- * @copyright  2011 The Open University
+ * @package    qtype_multianswer
+ * @copyright  2013 The Open University
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
 
@@ -33,7 +32,7 @@ require_once($CFG->dirroot . '/question/type/multianswer/question.php');
 /**
  * Test helper class for the multianswer question type.
  *
- * @copyright  2011 The Open University
+ * @copyright  2013 The Open University
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
 class qtype_multianswer_test_helper extends question_test_helper {
@@ -171,7 +170,7 @@ class qtype_multianswer_test_helper extends question_test_helper {
         $mc->options->partiallycorrectfeedbackformat = 1;
         $mc->options->incorrectfeedback = '';
         $mc->options->incorrectfeedbackformat = 1;
-        $mc->options->answernumbering = '';
+        $mc->options->answernumbering = 0;
         $mc->options->shownumcorrect = 0;
 
         $mc->options->answers = array(
@@ -190,8 +189,8 @@ class qtype_multianswer_test_helper extends question_test_helper {
         );
 
         $qdata->hints = array(
-            new question_hint(0, 'Hint 1', FORMAT_HTML),
-            new question_hint(0, 'Hint 2', FORMAT_HTML),
+            new question_hint_with_parts(0, 'Hint 1', FORMAT_HTML, 0, 0),
+            new question_hint_with_parts(0, 'Hint 2', FORMAT_HTML, 0, 0),
         );
 
         return $qdata;
@@ -204,16 +203,14 @@ class qtype_multianswer_test_helper extends question_test_helper {
      */
     public function get_multianswer_question_form_data_twosubq() {
         $formdata = new stdClass();
-        test_question_maker::initialise_question_form_data($formdata);
-
         $formdata->name = 'Simple multianswer';
-        $formdata->questiontext = 'Complete this opening line of verse: "The ' .
+        $formdata->questiontext = array('text' => 'Complete this opening line of verse: "The ' .
                 '{1:SHORTANSWER:Dog#Wrong, silly!~=Owl#Well done!~*#Wrong answer} ' .
                 'and the {1:MULTICHOICE:Bow-wow#You seem to have a dog obsessions!' .
                 '~Wiggly worm#Now you are just being ridiculous!~=Pussy-cat#Well done!}' .
-                ' went to sea".';
-        $formdata->generalfeedback = 'General feedback: It\'s from "The Owl and the Pussy-cat" ' .
-                'by Lear: "The owl and the pussycat went to sea';
+                ' went to sea".', 'format' => FORMAT_HTML);
+        $formdata->generalfeedback = array('text' => 'General feedback: It\'s from "The Owl and the Pussy-cat" ' .
+                'by Lear: "The owl and the pussycat went to sea', 'format' => FORMAT_HTML);
 
         $formdata->hint = array(
             0 => array('text' => 'Hint 1', 'format' => FORMAT_HTML, 'itemid' => 0),
index 9caffbf..241742d 100644 (file)
@@ -29,6 +29,8 @@ defined('MOODLE_INTERNAL') || die();
 global $CFG;
 require_once($CFG->dirroot . '/question/engine/tests/helpers.php');
 require_once($CFG->dirroot . '/question/type/multianswer/questiontype.php');
+require_once($CFG->dirroot . '/question/type/edit_question_form.php');
+require_once($CFG->dirroot . '/question/type/multianswer/edit_multianswer_form.php');
 
 
 /**
@@ -112,4 +114,77 @@ class qtype_multianswer_test extends advanced_testcase {
         $q = test_question_maker::get_question_data('multianswer', 'twosubq');
         $this->assertEquals(0.1666667, $this->qtype->get_random_guess_score($q), '', 0.0000001);
     }
+
+    public function test_question_saving_twosubq() {
+        $this->resetAfterTest(true);
+        $this->setAdminUser();
+
+        $questiondata = test_question_maker::get_question_data('multianswer');
+        $formdata = test_question_maker::get_question_form_data('multianswer');
+
+        $generator = $this->getDataGenerator()->get_plugin_generator('core_question');
+        $cat = $generator->create_question_category(array());
+
+        $formdata->category = "{$cat->id},{$cat->contextid}";
+        qtype_multianswer_edit_form::mock_submit((array)$formdata);
+
+        $form = qtype_multianswer_test_helper::get_question_editing_form($cat, $questiondata);
+
+        $this->assertTrue($form->is_validated());
+
+        $fromform = $form->get_data();
+
+        $returnedfromsave = $this->qtype->save_question($questiondata, $fromform);
+        $actualquestionsdata = question_load_questions(array($returnedfromsave->id));
+        $actualquestiondata = end($actualquestionsdata);
+
+        foreach ($questiondata as $property => $value) {
+            if (!in_array($property, array('id', 'version', 'timemodified', 'timecreated', 'options', 'hints', 'stamp'))) {
+                $this->assertAttributeEquals($value, $property, $actualquestiondata);
+            }
+        }
+
+        foreach ($questiondata->options as $optionname => $value) {
+            if ($optionname != 'questions') {
+                $this->assertAttributeEquals($value, $optionname, $actualquestiondata->options);
+            }
+        }
+
+        foreach ($questiondata->hints as $hint) {
+            $actualhint = array_shift($actualquestiondata->hints);
+            foreach ($hint as $property => $value) {
+                if (!in_array($property, array('id', 'questionid', 'options'))) {
+                    $this->assertAttributeEquals($value, $property, $actualhint);
+                }
+            }
+        }
+
+        $this->assertObjectHasAttribute('questions', $actualquestiondata->options);
+
+        $subqpropstoignore =
+            array('id', 'category', 'parent', 'contextid', 'question', 'options', 'stamp', 'version', 'timemodified',
+                'timecreated');
+        foreach ($questiondata->options->questions as $subqno => $subq) {
+            $actualsubq = $actualquestiondata->options->questions[$subqno];
+            foreach ($subq as $subqproperty => $subqvalue) {
+                if (!in_array($subqproperty, $subqpropstoignore)) {
+                    $this->assertAttributeEquals($subqvalue, $subqproperty, $actualsubq);
+                }
+            }
+            foreach ($subq->options as $optionname => $value) {
+                if (!in_array($optionname, array('answers'))) {
+                    $this->assertAttributeEquals($value, $optionname, $actualsubq->options);
+                }
+            }
+            foreach ($subq->options->answers as $answer) {
+                $actualanswer = array_shift($actualsubq->options->answers);
+                foreach ($answer as $ansproperty => $ansvalue) {
+                    // These questions do not use 'answerformat', will ignore it.
+                    if (!in_array($ansproperty, array('id', 'question', 'answerformat'))) {
+                        $this->assertAttributeEquals($ansvalue, $ansproperty, $actualanswer);
+                    }
+                }
+            }
+        }
+    }
 }
diff --git a/question/type/multichoice/tests/helper.php b/question/type/multichoice/tests/helper.php
new file mode 100644 (file)
index 0000000..0746b51
--- /dev/null
@@ -0,0 +1,219 @@
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * Test helper code for the multiple choice question type.
+ *
+ * @package    qtype_multichoice
+ * @copyright  2013 The Open University
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+
+defined('MOODLE_INTERNAL') || die();
+
+
+/**
+ * Test helper class for the multiple choice question type.
+ *
+ * @copyright  2013 The Open University
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+class qtype_multichoice_test_helper extends question_test_helper {
+    public function get_test_questions() {
+        return array('two_of_four');
+    }
+
+    /**
+     * Get the question data, as it would be loaded by get_question_options.
+     * @return object
+     */
+    public static function get_multichoice_question_data_two_of_four() {
+        global $USER;
+
+        $qdata = new stdClass();
+
+        $qdata->createdby = $USER->id;
+        $qdata->modifiedby = $USER->id;
+        $qdata->qtype = 'multichoice';
+        $qdata->name = 'Multiple choice question';
+        $qdata->questiontext = 'Which are the odd numbers?';
+        $qdata->questiontextformat = FORMAT_HTML;
+        $qdata->generalfeedback = 'The odd numbers are One and Three.';
+        $qdata->generalfeedbackformat = FORMAT_HTML;
+        $qdata->defaultmark = 1;
+        $qdata->length = 1;
+        $qdata->penalty = 0.3333333;
+        $qdata->hidden = 0;
+
+        $qdata->options = new stdClass();
+        $qdata->options->shuffleanswers = 1;
+        $qdata->options->answernumbering = '123';
+        $qdata->options->layout = 0;
+        $qdata->options->single = 0;
+        $qdata->options->correctfeedback =
+                test_question_maker::STANDARD_OVERALL_CORRECT_FEEDBACK;
+        $qdata->options->correctfeedbackformat = FORMAT_HTML;
+        $qdata->options->partiallycorrectfeedback =
+                test_question_maker::STANDARD_OVERALL_PARTIALLYCORRECT_FEEDBACK;
+        $qdata->options->partiallycorrectfeedbackformat = FORMAT_HTML;
+        $qdata->options->shownumcorrect = 1;
+        $qdata->options->incorrectfeedback =
+                test_question_maker::STANDARD_OVERALL_INCORRECT_FEEDBACK;
+        $qdata->options->incorrectfeedbackformat = FORMAT_HTML;
+
+        $qdata->options->answers = array(
+            13 => (object) array(
+                'id' => 13,
+                'answer' => 'One',
+                'answerformat' => FORMAT_PLAIN,
+                'fraction' => '0.5',
+                'feedback' => 'One is odd.',
+                'feedbackformat' => FORMAT_HTML,
+            ),
+            14 => (object) array(
+                'id' => 14,
+                'answer' => 'Two',
+                'answerformat' => FORMAT_PLAIN,
+                'fraction' => '0.0',
+                'feedback' => 'Two is even.',
+                'feedbackformat' => FORMAT_HTML,
+            ),
+            15 => (object) array(
+                'id' => 15,
+                'answer' => 'Three',
+                'answerformat' => FORMAT_PLAIN,
+                'fraction' => '0.5',
+                'feedback' => 'Three is odd.',
+                'feedbackformat' => FORMAT_HTML,
+            ),
+            16 => (object) array(
+                'id' => 16,
+                'answer' => 'Four',
+                'answerformat' => FORMAT_PLAIN,
+                'fraction' => '0.0',
+                'feedback' => 'Four is even.',
+                'feedbackformat' => FORMAT_HTML,
+            ),
+        );
+
+        $qdata->hints = array(
+            1 => (object) array(
+                'hint' => 'Hint 1.',
+                'hintformat' => FORMAT_HTML,
+                'shownumcorrect' => 1,
+                'clearwrong' => 0,
+                'options' => 0,
+            ),
+            2 => (object) array(
+                'hint' => 'Hint 2.',
+                'hintformat' => FORMAT_HTML,
+                'shownumcorrect' => 1,
+                'clearwrong' => 1,
+                'options' => 1,
+            ),
+        );
+
+        return $qdata;
+    }
+    /**
+     * Get the question data, as it would be loaded by get_question_options.
+     * @return object
+     */
+    public static function get_multichoice_question_form_data_two_of_four() {
+        $qdata = new stdClass();
+
+        $qdata->name = 'multiple choice question';
+        $qdata->questiontext = array('text' => 'Which are the odd numbers?', 'format' => FORMAT_HTML);
+        $qdata->generalfeedback = array('text' => 'The odd numbers are One and Three.', 'format' => FORMAT_HTML);
+        $qdata->defaultmark = 1;
+        $qdata->noanswers = 5;
+        $qdata->numhints = 2;
+        $qdata->penalty = 0.3333333;
+
+        $qdata->shuffleanswers = 1;
+        $qdata->answernumbering = '123';
+        $qdata->single = '0';
+        $qdata->correctfeedback = array('text' => test_question_maker::STANDARD_OVERALL_CORRECT_FEEDBACK,
+                                                 'format' => FORMAT_HTML);
+        $qdata->partiallycorrectfeedback = array('text' => test_question_maker::STANDARD_OVERALL_PARTIALLYCORRECT_FEEDBACK,
+                                                          'format' => FORMAT_HTML);
+        $qdata->shownumcorrect = 1;
+        $qdata->incorrectfeedback = array('text' => test_question_maker::STANDARD_OVERALL_INCORRECT_FEEDBACK,
+                                                   'format' => FORMAT_HTML);
+        $qdata->fraction = array('0.5', '0.0', '0.5', '0.0', '0.0');
+        $qdata->answer = array(
+            0 => array(
+                'text' => 'One',
+                'format' => FORMAT_PLAIN
+            ),
+            1 => array(
+                'text' => 'Two',
+                'format' => FORMAT_PLAIN
+            ),
+            2 => array(
+                'text' => 'Three',
+                'format' => FORMAT_PLAIN
+            ),
+            3 => array(
+                'text' => 'Four',
+                'format' => FORMAT_PLAIN
+            ),
+            4 => array(
+                'text' => '',
+                'format' => FORMAT_PLAIN
+            )
+        );
+
+        $qdata->feedback = array(
+            0 => array(
+                'text' => 'One is odd.',
+                'format' => FORMAT_HTML
+            ),
+            1 => array(
+                'text' => 'Two is even.',
+                'format' => FORMAT_HTML
+            ),
+            2 => array(
+                'text' => 'Three is odd.',
+                'format' => FORMAT_HTML
+            ),
+            3 => array(
+                'text' => 'Four is even.',
+                'format' => FORMAT_HTML
+            ),
+            4 => array(
+                'text' => '',
+                'format' => FORMAT_HTML
+            )
+        );
+
+        $qdata->hint = array(
+            0 => array(
+                'text' => 'Hint 1.',
+                'format' => FORMAT_HTML
+            ),
+            1 => array(
+                'text' => 'Hint 2.',
+                'format' => FORMAT_HTML
+            )
+        );
+        $qdata->hintclearwrong = array(0, 1);
+        $qdata->hintshownumcorrect = array(1, 1);
+
+        return $qdata;
+    }
+}
index 17e50db..1f1f100 100644 (file)
@@ -17,9 +17,8 @@
 /**
  * Unit tests for the mulitple choice question definition class.
  *
- * @package    qtype
- * @subpackage multichoice
- * @copyright  2009 The Open University
+ * @package    qtype_multichoice
+ * @copyright  2013 The Open University
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
 
 defined('MOODLE_INTERNAL') || die();
 
 global $CFG;
+require_once($CFG->dirroot . '/question/engine/tests/helpers.php');
 require_once($CFG->dirroot . '/question/type/multichoice/questiontype.php');
-
+require_once($CFG->dirroot . '/question/type/edit_question_form.php');
+require_once($CFG->dirroot . '/question/type/multichoice/edit_multichoice_form.php');
 
 /**
  * Unit tests for the multiple choice question definition class.
@@ -100,4 +101,59 @@ class qtype_multichoice_test extends advanced_testcase {
             2 => array(2 => new question_possible_response('toad', 0)),
         ), $this->qtype->get_possible_responses($q));
     }
+
+    public function test_question_saving_two_of_four() {
+        $this->resetAfterTest(true);
+        $this->setAdminUser();
+
+        $questiondata = test_question_maker::get_question_data('multichoice');
+        $formdata = test_question_maker::get_question_form_data('multichoice');
+
+        $generator = $this->getDataGenerator()->get_plugin_generator('core_question');
+        $cat = $generator->create_question_category(array());
+
+        $formdata->category = "{$cat->id},{$cat->contextid}";
+        qtype_multichoice_edit_form::mock_submit((array)$formdata);
+
+        $form = qtype_multichoice_test_helper::get_question_editing_form($cat, $questiondata);
+
+        $this->assertTrue($form->is_validated());
+
+        $fromform = $form->get_data();
+
+        $returnedfromsave = $this->qtype->save_question($questiondata, $fromform);
+        $actualquestionsdata = question_load_questions(array($returnedfromsave->id));
+        $actualquestiondata = end($actualquestionsdata);
+
+        foreach ($questiondata as $property => $value) {
+            if (!in_array($property, array('id', 'version', 'timemodified', 'timecreated', 'options', 'hints', 'stamp'))) {
+                $this->assertAttributeEquals($value, $property, $actualquestiondata);
+            }
+        }
+
+        foreach ($questiondata->options as $optionname => $value) {
+            if (!in_array($optionname, array('answers'))) {
+                $this->assertAttributeEquals($value, $optionname, $actualquestiondata->options);
+            }
+        }
+
+        foreach ($questiondata->hints as $hint) {
+            $actualhint = array_shift($actualquestiondata->hints);
+            foreach ($hint as $property => $value) {
+                if (!in_array($property, array('id', 'questionid', 'options'))) {
+                    $this->assertAttributeEquals($value, $property, $actualhint);
+                }
+            }
+        }
+
+        foreach ($questiondata->options->answers as $answer) {
+            $actualanswer = array_shift($actualquestiondata->options->answers);
+            foreach ($answer as $ansproperty => $ansvalue) {
+                // This question does not use 'answerformat', will ignore it.
+                if (!in_array($ansproperty, array('id', 'question', 'answerformat'))) {
+                    $this->assertAttributeEquals($ansvalue, $ansproperty, $actualanswer);
+                }
+            }
+        }
+    }
 }
index ffd15bb..7157dfb 100644 (file)
@@ -71,7 +71,155 @@ class qtype_numerical_test_helper extends question_test_helper {
         return $num;
     }
 
-    /**
+    public function get_numerical_question_form_data_pi() {
+        $form = new stdClass();
+        $form->name = 'Pi to two d.p.';
+        $form->questiontext = array();
+        $form->questiontext['format'] = '1';
+        $form->questiontext['text'] = 'What is pi to two d.p.?';
+
+        $form->defaultmark = 1;
+        $form->generalfeedback = array();
+        $form->generalfeedback['format'] = '1';
+        $form->generalfeedback['text'] = 'Generalfeedback: 3.14 is the right answer.';
+
+        $form->noanswers = 6;
+        $form->answer = array();
+        $form->answer[0] = '3.14';
+        $form->answer[1] = '3.142';
+        $form->answer[2] = '3.1';
+        $form->answer[3] = '3';
+        $form->answer[4] = '*';
+        $form->answer[5] = '';
+
+        $form->tolerance = array();
+        $form->tolerance[0] = 0;
+        $form->tolerance[1] = 0;
+        $form->tolerance[2] = 0;
+        $form->tolerance[3] = 0;
+        $form->tolerance[4] = 0;
+        $form->tolerance[5] = 0;
+
+        $form->fraction = array();
+        $form->fraction[0] = '1.0';
+        $form->fraction[1] = '0.0';
+        $form->fraction[2] = '0.0';
+        $form->fraction[3] = '0.0';
+        $form->fraction[4] = '0.0';
+        $form->fraction[5] = '0.0';
+
+        $form->feedback = array();
+        $form->feedback[0] = array();
+        $form->feedback[0]['format'] = '1';
+        $form->feedback[0]['text'] = 'Very good.';
+
+        $form->feedback[1] = array();
+        $form->feedback[1]['format'] = '1';
+        $form->feedback[1]['text'] = 'Too accurate.';
+
+        $form->feedback[2] = array();
+        $form->feedback[2]['format'] = '1';
+        $form->feedback[2]['text'] = 'Not accurate enough.';
+
+        $form->feedback[3] = array();
+        $form->feedback[3]['format'] = '1';
+        $form->feedback[3]['text'] = 'Not accurate enough.';
+
+        $form->feedback[4] = array();
+        $form->feedback[4]['format'] = '1';
+        $form->feedback[4]['text'] = 'Completely wrong.';
+
+        $form->feedback[5] = array();
+        $form->feedback[5]['format'] = '1';
+        $form->feedback[5]['text'] = '';
+
+        $form->unitrole = '3';
+        $form->unitpenalty = 0.1;
+        $form->unitgradingtypes = '1';
+        $form->unitsleft = '0';
+        $form->nounits = 1;
+        $form->multiplier = array();
+        $form->multiplier[0] = '1.0';
+
+        $form->penalty = '0.3333333';
+        $form->numhints = 2;
+        $form->hint = array();
+        $form->hint[0] = array();
+        $form->hint[0]['format'] = '1';
+        $form->hint[0]['text'] = '';
+
+        $form->hint[1] = array();
+        $form->hint[1]['format'] = '1';
+        $form->hint[1]['text'] = '';
+
+        $form->qtype = 'numerical';
+        return $form;
+    }
+
+    public function get_numerical_question_data_pi() {
+        $q = new stdClass();
+        $q->name = 'Pi to two d.p.';
+        $q->questiontext = 'What is pi to two d.p.?';
+        $q->questiontextformat = FORMAT_HTML;
+        $q->generalfeedback = 'Generalfeedback: 3.14 is the right answer.';
+        $q->generalfeedbackformat = FORMAT_HTML;
+        $q->defaultmark = 1;
+        $q->penalty = 0.3333333;
+        $q->qtype = 'numerical';
+        $q->length = '1';
+        $q->hidden = '0';
+        $q->createdby = '2';
+        $q->modifiedby = '2';
+        $q->options = new stdClass();
+        $q->options->answers = array();
+        $q->options->answers[0] = new stdClass();
+        $q->options->answers[0]->answer = '3.14';
+        $q->options->answers[0]->fraction = '1.0000000';
+        $q->options->answers[0]->feedback = 'Very good.';
+        $q->options->answers[0]->feedbackformat = FORMAT_HTML;
+        $q->options->answers[0]->tolerance = '0';
+
+        $q->options->answers[1] = new stdClass();
+        $q->options->answers[1]->answer = '3.142';
+        $q->options->answers[1]->fraction = '0.0000000';
+        $q->options->answers[1]->feedback = 'Too accurate.';
+        $q->options->answers[1]->feedbackformat = FORMAT_HTML;
+        $q->options->answers[1]->tolerance = '0';
+
+        $q->options->answers[2] = new stdClass();
+        $q->options->answers[2]->answer = '3.1';
+        $q->options->answers[2]->fraction = '0.0000000';
+        $q->options->answers[2]->feedback = 'Not accurate enough.';
+        $q->options->answers[2]->feedbackformat = FORMAT_HTML;
+        $q->options->answers[2]->tolerance = '0';
+
+        $q->options->answers[3] = new stdClass();
+        $q->options->answers[3]->answer = '3';
+        $q->options->answers[3]->answerformat = '0';
+        $q->options->answers[3]->fraction = '0.0000000';
+        $q->options->answers[3]->feedback = 'Not accurate enough.';
+        $q->options->answers[3]->feedbackformat = FORMAT_HTML;
+        $q->options->answers[3]->tolerance = '0';
+
+        $q->options->answers[4] = new stdClass();
+        $q->options->answers[4]->answer = '*';
+        $q->options->answers[4]->answerformat = '0';
+        $q->options->answers[4]->fraction = '0.0000000';
+        $q->options->answers[4]->feedback = 'Completely wrong.';
+        $q->options->answers[4]->feedbackformat = FORMAT_HTML;
+        $q->options->answers[4]->tolerance = '0';
+
+        $q->options->units = array();
+
+        $q->options->unitgradingtype = '0';
+        $q->options->unitpenalty = '0.1000000';
+        $q->options->showunits = '3';
+        $q->options->unitsleft = '0';
+
+        return $q;
+    }
+
+        /**
      * Makes a numerical question with a choice (select menu) of units.
      * @return qtype_numerical_question
      */
index d54408a..1d19a2f 100644 (file)
@@ -28,7 +28,9 @@ defined('MOODLE_INTERNAL') || die();
 
 global $CFG;
 require_once($CFG->dirroot . '/question/type/numerical/questiontype.php');
-
+require_once($CFG->dirroot . '/question/engine/tests/helpers.php');
+require_once($CFG->dirroot . '/question/type/edit_question_form.php');
+require_once($CFG->dirroot . '/question/type/numerical/edit_numerical_form.php');
 
 /**
  * Unit tests for question/type/numerical/questiontype.php.
@@ -121,4 +123,50 @@ class qtype_numerical_test extends advanced_testcase {
             ),
         ), $this->qtype->get_possible_responses($q));
     }
+
+    public function test_question_saving_pi() {
+        $this->resetAfterTest(true);
+        $this->setAdminUser();
+
+        $questiondata = test_question_maker::get_question_data('numerical');
+        $formdata = test_question_maker::get_question_form_data('numerical');
+
+        $generator = $this->getDataGenerator()->get_plugin_generator('core_question');
+        $cat = $generator->create_question_category(array());
+
+        $formdata->category = "{$cat->id},{$cat->contextid}";
+        qtype_numerical_edit_form::mock_submit((array)$formdata);
+
+        $form = qtype_numerical_test_helper::get_question_editing_form($cat, $questiondata);
+
+        $this->assertTrue($form->is_validated());
+
+        $fromform = $form->get_data();
+
+        $returnedfromsave = $this->qtype->save_question($questiondata, $fromform);
+        $actualquestionsdata = question_load_questions(array($returnedfromsave->id));
+        $actualquestiondata = end($actualquestionsdata);
+
+        foreach ($questiondata as $property => $value) {
+            if (!in_array($property, array('options'))) {
+                $this->assertAttributeEquals($value, $property, $actualquestiondata);
+            }
+        }
+
+        foreach ($questiondata->options as $optionname => $value) {
+            if (!in_array($optionname, array('answers'))) {
+                $this->assertAttributeEquals($value, $optionname, $actualquestiondata->options);
+            }
+        }
+
+        foreach ($questiondata->options->answers as $ansindex => $answer) {
+            $actualanswer = array_shift($actualquestiondata->options->answers);
+            foreach ($answer as $ansproperty => $ansvalue) {
+                // This question does not use 'answerformat', will ignore it.
+                if (!in_array($ansproperty, array('id', 'question', 'answerformat'))) {
+                    $this->assertAttributeEquals($ansvalue, $ansproperty, $actualanswer);
+                }
+            }
+        }
+    }
 }
index 452b1a4..5b9c748 100644 (file)
@@ -768,7 +768,6 @@ class question_answer {
      * Constructor.
      * @param int $id the answer.
      * @param string $answer the answer.
-     * @param int $answerformat the format of the answer.
      * @param number $fraction the fraction this answer is worth.
      * @param string $feedback the feedback for this answer.
      * @param int $feedbackformat the format of the feedback.
@@ -966,4 +965,4 @@ class question_first_matching_answer_grading_strategy implements question_gradin
         }
         return null;
     }
-}
\ No newline at end of file
+}
index 40180a7..0889919 100644 (file)
@@ -77,7 +77,7 @@ class qtype_shortanswer_test_helper extends question_test_helper {
         $qdata->generalfeedback = 'Generalfeedback: frog or toad would have been OK.';
 
         $qdata->options = new stdClass();
-        $qdata->options->usecase = false;
+        $qdata->options->usecase = 0;
         $qdata->options->answers = array(
             13 => new question_answer(13, 'frog', 1.0, 'Frog is a very good answer.', FORMAT_HTML),
             14 => new question_answer(14, 'toad', 0.8, 'Toad is an OK good answer.', FORMAT_HTML),
@@ -88,29 +88,28 @@ class qtype_shortanswer_test_helper extends question_test_helper {
     }
 
     /**
-     * Gets the question data for a shortanswer question with with correct
-     * ansewer 'frog', partially correct answer 'toad' and defaultmark 1.
+     * Gets the question form data for a shortanswer question with with correct
+     * answer 'frog', partially correct answer 'toad' and defaultmark 1.
      * This question also has a '*' match anything answer.
      * @return stdClass
      */
     public function get_shortanswer_question_form_data_frogtoad() {
-        $fromform = new stdClass();
-        test_question_maker::initialise_question_form_data($fromform);
-
-        $fromform->qtype = 'shortanswer';
-        $fromform->name = 'Short answer question';
-        $fromform->questiontext = array('text' => 'Name an amphibian: __________', 'format' => FORMAT_HTML);
-        $fromform->generalfeedback = array('text' => 'Generalfeedback: frog or toad would have been OK.', 'format' => FORMAT_HTML);
-        $fromform->usecase = false;
-        $fromform->answer = array('frog', 'toad', '*');
-        $fromform->fraction = array(1.0, 0.8, 0.0);
-        $fromform->feedback = array(
+        $form = new stdClass();
+
+        $form->name = 'Short answer question';
+        $form->questiontext = array('text' => 'Name an amphibian: __________', 'format' => FORMAT_HTML);
+        $form->defaultmark = 1.0;
+        $form->generalfeedback = array('text' => 'Generalfeedback: frog or toad would have been OK.', 'format' => FORMAT_HTML);
+        $form->usecase = false;
+        $form->answer = array('frog', 'toad', '*');
+        $form->fraction = array('1.0', '0.8', '0.0');
+        $form->feedback = array(
             array('text' => 'Frog is a very good answer.', 'format' => FORMAT_HTML),
             array('text' => 'Toad is an OK good answer.', 'format' => FORMAT_HTML),
             array('text' => 'That is a bad answer.', 'format' => FORMAT_HTML),
         );
 
-        return $fromform;
+        return $form;
     }
 
     /**
index 512b635..91d2bcd 100644 (file)
@@ -17,9 +17,8 @@
 /**
  * Unit tests for the shortanswer question type class.
  *
- * @package    qtype
- * @subpackage shortanswer
- * @copyright  2007 The Open University
+ * @package    qtype_shortanswer
+ * @copyright  2013 The Open University
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
 
@@ -29,7 +28,8 @@ defined('MOODLE_INTERNAL') || die();
 global $CFG;
 require_once($CFG->dirroot . '/question/type/shortanswer/questiontype.php');
 require_once($CFG->dirroot . '/question/engine/tests/helpers.php');
-
+require_once($CFG->dirroot . '/question/type/edit_question_form.php');
+require_once($CFG->dirroot . '/question/type/shortanswer/edit_shortanswer_form.php');
 
 /**
  * Unit tests for the shortanswer question type class.
@@ -95,4 +95,50 @@ class qtype_shortanswer_test extends advanced_testcase {
             ),
         ), $this->qtype->get_possible_responses($q));
     }
+
+    public function test_question_saving_frogtoad() {
+        $this->resetAfterTest(true);
+        $this->setAdminUser();
+
+        $questiondata = test_question_maker::get_question_data('shortanswer');
+        $formdata = test_question_maker::get_question_form_data('shortanswer');
+
+        $generator = $this->getDataGenerator()->get_plugin_generator('core_question');
+        $cat = $generator->create_question_category(array());
+
+        $formdata->category = "{$cat->id},{$cat->contextid}";
+        qtype_shortanswer_edit_form::mock_submit((array)$formdata);
+
+        $form = qtype_shortanswer_test_helper::get_question_editing_form($cat, $questiondata);
+
+        $this->assertTrue($form->is_validated());
+
+        $fromform = $form->get_data();
+
+        $returnedfromsave = $this->qtype->save_question($questiondata, $fromform);
+        $actualquestionsdata = question_load_questions(array($returnedfromsave->id));
+        $actualquestiondata = end($actualquestionsdata);
+
+        foreach ($questiondata as $property => $value) {
+            if (!in_array($property, array('id', 'version', 'timemodified', 'timecreated', 'options'))) {
+                $this->assertAttributeEquals($value, $property, $actualquestiondata);
+            }
+        }
+
+        foreach ($questiondata->options as $optionname => $value) {
+            if ($optionname != 'answers') {
+                $this->assertAttributeEquals($value, $optionname, $actualquestiondata->options);
+            }
+        }
+
+        foreach ($questiondata->options->answers as $answer) {
+            $actualanswer = array_shift($actualquestiondata->options->answers);
+            foreach ($answer as $ansproperty => $ansvalue) {
+                // This question does not use 'answerformat', will ignore it.
+                if (!in_array($ansproperty, array('id', 'question', 'answerformat'))) {
+                    $this->assertAttributeEquals($ansvalue, $ansproperty, $actualanswer);
+                }
+            }
+        }
+    }
 }
index 1ee7e8e..359ade0 100644 (file)
@@ -63,6 +63,67 @@ class qtype_truefalse_test_helper extends question_test_helper {
         return $tf;
     }
 
+    public function get_truefalse_question_form_data_true() {
+
+        $form = new stdClass();
+        $form->name = 'True/false question';
+        $form->questiontext = array();
+        $form->questiontext['format'] = '1';
+        $form->questiontext['text'] = 'The answer is true.';
+
+        $form->defaultmark = 1;
+        $form->generalfeedback = array();
+        $form->generalfeedback['format'] = '1';
+        $form->generalfeedback['text'] = 'You should have selected true.';
+
+        $form->correctanswer = '1';
+        $form->feedbacktrue = array();
+        $form->feedbacktrue['format'] = '1';
+        $form->feedbacktrue['text'] = 'This is the right answer.';
+
+        $form->feedbackfalse = array();
+        $form->feedbackfalse['format'] = '1';
+        $form->feedbackfalse['text'] = 'This is the wrong answer.';
+
+        $form->penalty = 1;
+
+        return $form;
+    }
+
+    function get_truefalse_question_data_true() {
+
+        $q = new stdClass();
+        $q->name = 'True/false question';
+        $q->questiontext = 'The answer is true.';
+        $q->questiontextformat = FORMAT_HTML;
+        $q->generalfeedback = 'You should have selected true.';
+        $q->generalfeedbackformat = FORMAT_HTML;
+        $q->defaultmark = 1;
+        $q->penalty = 1;
+        $q->qtype = 'truefalse';
+        $q->length = '1';
+        $q->hidden = '0';
+        $q->createdby = '2';
+        $q->modifiedby = '2';
+        $q->options = new stdClass();
+        $q->options->trueanswer = '0';
+        $q->options->falseanswer = '1';
+        $q->options->answers = array();
+        $q->options->answers[0] = new stdClass();
+        $q->options->answers[0]->answer = 'True';
+        $q->options->answers[0]->fraction = '1.0000000';
+        $q->options->answers[0]->feedback = 'This is the right answer.';
+        $q->options->answers[0]->feedbackformat = FORMAT_HTML;
+
+        $q->options->answers[1] = new stdClass();
+        $q->options->answers[1]->answer = 'False';
+        $q->options->answers[1]->fraction = '0.0000000';
+        $q->options->answers[1]->feedback = 'This is the wrong answer.';
+        $q->options->answers[1]->feedbackformat = FORMAT_HTML;
+
+        return $q;
+    }
+
     /**
      * Makes a truefalse question with correct answer false.
      * @return qtype_truefalse_question
index 57f6999..824f256 100644 (file)
@@ -28,7 +28,9 @@ defined('MOODLE_INTERNAL') || die();
 
 global $CFG;
 require_once($CFG->dirroot . '/question/type/truefalse/questiontype.php');
-
+require_once($CFG->dirroot . '/question/engine/tests/helpers.php');
+require_once($CFG->dirroot . '/question/type/edit_question_form.php');
+require_once($CFG->dirroot . '/question/type/truefalse/edit_truefalse_form.php');
 
 /**
  * Unit tests for the true-false question definition class.
@@ -75,4 +77,55 @@ class qtype_truefalse_test extends advanced_testcase {
                 null => question_possible_response::no_response()),
         ), $this->qtype->get_possible_responses($q));
     }
+
+    public function test_question_saving_true() {
+        $this->resetAfterTest(true);
+        $this->setAdminUser();
+
+        $questiondata = test_question_maker::get_question_data('truefalse');
+        $formdata = test_question_maker::get_question_form_data('truefalse');
+
+        $generator = $this->getDataGenerator()->get_plugin_generator('core_question');
+        $cat = $generator->create_question_category(array());
+
+        $formdata->category = "{$cat->id},{$cat->contextid}";
+        qtype_truefalse_edit_form::mock_submit((array)$formdata);
+
+        $form = qtype_truefalse_test_helper::get_question_editing_form($cat, $questiondata);
+
+        $this->assertTrue($form->is_validated());
+
+        $fromform = $form->get_data();
+
+        $returnedfromsave = $this->qtype->save_question($questiondata, $fromform);
+        $actualquestionsdata = question_load_questions(array($returnedfromsave->id));
+        $actualquestiondata = end($actualquestionsdata);
+
+        foreach ($questiondata as $property => $value) {
+            if (!in_array($property, array('options'))) {
+                $this->assertAttributeEquals($value, $property, $actualquestiondata);
+            }
+        }
+
+        foreach ($questiondata->options as $optionname => $value) {
+            if (!in_array($optionname, array('trueanswer', 'falseanswer', 'answers'))) {
+                $this->assertAttributeEquals($value, $optionname, $actualquestiondata->options);
+            }
+        }
+
+        $answerindexes = array();
+        foreach ($questiondata->options->answers as $ansindex => $answer) {
+            $actualanswer = array_shift($actualquestiondata->options->answers);
+            foreach ($answer as $ansproperty => $ansvalue) {
+                // This question does not use 'answerformat', will ignore it.
+                if (!in_array($ansproperty, array('id', 'question', 'answerformat'))) {
+                    $this->assertAttributeEquals($ansvalue, $ansproperty, $actualanswer);
+                }
+            }
+            $answerindexes[$answer->answer] = $ansindex;
+        }
+
+        $this->assertEquals($questiondata->options->trueanswer, $answerindexes['True']);
+        $this->assertEquals($questiondata->options->falseanswer, $answerindexes['False']);
+    }
 }
diff --git a/theme/afterburner/pix_core/t/userblue.png b/theme/afterburner/pix_core/t/userblue.png
deleted file mode 100644 (file)
index e7cfd7d..0000000
Binary files a/theme/afterburner/pix_core/t/userblue.png and /dev/null differ
index 2d4066d..2292481 100644 (file)
  * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
 
-$THEME->name = 'formfactor';
-
-////////////////////////////////////////////////////
-// Name of the theme. Most likely the name of
-// the directory in which this file resides.
-////////////////////////////////////////////////////
-
+// Name of the theme, and most likely the name
+// of the directory in which this file resides.
 
-$THEME->parents = array('canvas','base');
+$THEME->name = 'formfactor';
 
-/////////////////////////////////////////////////////
 // Which existing theme(s) in the /theme/ directory
-// do you want this theme to extend. A theme can
-// extend any number of themes. Rather than
-// creating an entirely new theme and copying all
+// do you want this theme to extend?
+// A theme can extend any number of themes. So rather
+// than creating an entirely new theme and copying all
 // of the CSS, you can simply create a new theme,
-// extend the theme you like and just add the
+// by extending the theme you like and just add the
 // changes you want to your theme.
-////////////////////////////////////////////////////
 
+$THEME->parents = array('canvas','base');
+
+// Name of the stylesheet(s) you've including in
+// this theme's /styles/ directory.
 
 $THEME->sheets = array(
     'selected',
@@ -57,66 +54,72 @@ $THEME->sheets = array(
     'blocks'
 );
 
-////////////////////////////////////////////////////
-// Name of the stylesheet(s) you've including in
-// this theme's /styles/ directory.
-////////////////////////////////////////////////////
+// Do you want to use the new navigation dock?
 
 $THEME->enable_dock = false;
 
-////////////////////////////////////////////////////
-// Do you want to use the new navigation dock?
-////////////////////////////////////////////////////
+// An array of stylesheets to include within the
+// body of the editor.
 
 $THEME->editor_sheets = array('editor');
 
-////////////////////////////////////////////////////
-// An array of stylesheets to include within the
-// body of the editor.
-////////////////////////////////////////////////////
+// These are all of the possible layouts in Moodle. The
+// simplest way to do this is to keep the theme and file
+// variables the same for every layout. Including them
+// all in this way allows some flexibility down the road
+// if you want to add a different layout template to a
+// specific page.
 
 $THEME->layouts = array(
+    // Most backwards compatible layout without the blocks - this is the layout used by default
     'base' => array(
         'file' => 'general.php',
-        'regions' => array('side-pre', 'side-post'),
-        'defaultregion' => 'side-pre',
+        'regions' => array(),
     ),
+    // Standard layout with blocks, this is recommended for most pages with general information
     'standard' => array(
         'file' => 'general.php',
         'regions' => array('side-pre', 'side-post'),
         'defaultregion' => 'side-pre',
     ),
+    // Main course page
     'course' => array(
         'file' => 'general.php',
         'regions' => array('side-pre', 'side-post'),
-        'defaultregion' => 'side-pre'
+        'defaultregion' => 'side-pre',
+        'options' => array('langmenu'=>true),
     ),
     'coursecategory' => array(
         'file' => 'general.php',
         'regions' => array('side-pre', 'side-post'),
         'defaultregion' => 'side-pre',
     ),
+    // part of course, typical for modules - default page layout if $cm specified in require_login()
     'incourse' => array(
         'file' => 'general.php',
         'regions' => array('side-pre', 'side-post'),
         'defaultregion' => 'side-pre',
     ),
+    // The site home page.
     'frontpage' => array(
         'file' => 'frontpage.php',
         'regions' => array('side-pre', 'side-post'),
         'defaultregion' => 'side-pre',
     ),
+    // Server administration scripts.
     'admin' => array(
         'file' => 'general.php',
         'regions' => array('side-pre'),
         'defaultregion' => 'side-pre',
     ),
+    // My dashboard page
     'mydashboard' => array(
         'file' => 'general.php',
         'regions' => array('side-pre', 'side-post'),
         'defaultregion' => 'side-pre',
         'options' => array('langmenu'=>true),
     ),
+    // My public page
     'mypublic' => array(
         'file' => 'general.php',
         'regions' => array('side-pre', 'side-post'),
@@ -127,31 +130,56 @@ $THEME->layouts = array(
         'regions' => array(),
         'options' => array('langmenu'=>true),
     ),
+
+    // Pages that appear in pop-up windows - no navigation, no blocks, no header.
     'popup' => array(
         'file' => 'general.php',
         'regions' => array(),
-        'options' => array('nofooter'=>true, 'noblocks'=>true, 'nonavbar'=>true, 'nocourseheaderfooter'=>true),
+        'options' => array('nofooter'=>true, 'nonavbar'=>true, 'nocustommenu'=>true, 'nologininfo'=>true, 'nocourseheaderfooter'=>true),
     ),
+    // No blocks and minimal footer - used for legacy frame layouts only!
     'frametop' => array(
         'file' => 'general.php',
         'regions' => array(),
         'options' => array('nofooter'=>true, 'nocoursefooter'=>true),
     ),
-    'maintenance' => array(
-        'file' => 'general.php',
-        'regions' => array(),
-        'options' => array('nofooter'=>true, 'nonavbar'=>true, 'nocourseheaderfooter'=>true),
-    ),
+    // Embeded pages, like iframe/object embeded in moodleform - it needs as much space as possible
     'embedded' => array(
         'file' => 'embedded.php',
         'regions' => array(),
-        'options' => array('nofooter'=>true, 'nonavbar'=>true, 'nocourseheaderfooter'=>true),
+        'options' => array('nofooter'=>true, 'nonavbar'=>true, 'nocustommenu'=>true, 'nocourseheaderfooter'=>true),
+    ),
+    // Used during upgrade and install, and for the 'This site is undergoing maintenance' message.
+    // This must not have any blocks, and it is good idea if it does not have links to
+    // other places - for example there should not be a home link in the footer...
+    'maintenance' => array(
+        'file' => 'general.php',
+        'regions' => array(),
+        'options' => array('noblocks'=>true, 'nofooter'=>true, 'nonavbar'=>true, 'nocustommenu'=>true, 'nocourseheaderfooter'=>true),
     ),
     // Should display the content and basic headers only.
     'print' => array(
         'file' => 'general.php',
         'regions' => array(),
-        'options' => array('nofooter'=>true, 'nonavbar'=>false, 'noblocks'=>true, 'nocourseheaderfooter'=>true),
+        'options' => array('noblocks'=>true, 'nofooter'=>true, 'nonavbar'=>false, 'nocustommenu'=>true, 'nocourseheaderfooter'=>true),
     ),
-
-);
+    // The pagelayout used when a redirection is occuring.
+    'redirect' => array(
+        'file' => 'embedded.php',
+        'regions' => array(),
+        'options' => array('nofooter'=>true, 'nonavbar'=>true, 'nocustommenu'=>true, 'nocourseheaderfooter'=>true),
+    ),
+    // The pagelayout used for reports.
+    'report' => array(
+        'file' => 'report.php',
+        'regions' => array('side-pre'),
+        'defaultregion' => 'side-pre',
+    ),
+    // The pagelayout used for safebrowser and securewindow.
+    'secure' => array(
+        'file' => 'general.php',
+        'regions' => array('side-pre', 'side-post'),
+        'defaultregion' => 'side-pre',
+        'options' => array('nofooter'=>true, 'nonavbar'=>true, 'nocustommenu'=>true, 'nologinlinks'=>true, 'nocourseheaderfooter'=>true),
+    ),
+);
\ No newline at end of file
diff --git a/theme/mymobile/pix_core/i/cross_red_big.png b/theme/mymobile/pix_core/i/cross_red_big.png
deleted file mode 100644 (file)
index 4f50e31..0000000
Binary files a/theme/mymobile/pix_core/i/cross_red_big.png and /dev/null differ
diff --git a/theme/mymobile/pix_core/i/cross_red_small.png b/theme/mymobile/pix_core/i/cross_red_small.png
deleted file mode 100644 (file)
index f55e3cf..0000000
Binary files a/theme/mymobile/pix_core/i/cross_red_small.png and /dev/null differ