diff --git a/question/type/datasetdependent/categorydatasetdefinitions.php b/question/type/datasetdependent/categorydatasetdefinitions.php deleted file mode 100644 index 8c719ed1461..00000000000 --- a/question/type/datasetdependent/categorydatasetdefinitions.php +++ /dev/null @@ -1,105 +0,0 @@ -course)) { - error("This category doesn't belong to a valid course!"); - } - - require_login($course->id, false); - - if (!isteacheredit($course->id)) { - error("Only the teacher can import quiz questions!"); - } - - $DATASET_TYPES = array('1' => get_string('literal', 'quiz'), - '2' => get_string('file', 'quiz'), - '3' => get_string('link', 'quiz')); - - $streditingquiz = get_string("editingquiz", "quiz"); - $strdefinedataset = get_string("datasetdefinitions", "quiz", $category->name); - $strquestions = get_string("questions", "quiz"); - - print_header_simple("$strdefinedataset", "$strdefinedataset", - "$streditingquiz -> $strdefinedataset"); - - if ($form = data_submitted()) { /// Filename - - $definition->category = $category->id; - foreach ($form->name as $key => $name) { - $definition->name = $name; - $definition->id = $form->id[$key]; - $definition->type = $form->type[$key]; - - if ($definition->id) { - if (!update_record('question_dataset_definitions', $definition)) { - notify("Could not update dataset item definition"); - } - - } else if ($definition->name) { - if (!insert_record('question_dataset_definitions', $definition)) { - notify("Could not insert dataset item defintion"); - } - - } else { - // No action - } - } - if ($form->question) { - redirect("../../question.php?id=$question"); - } else { - redirect("../../edit.php"); - } - } - - /// Print form - - print_heading_with_help($strdefinedataset, "datasets", "quiz"); - - print_simple_box_start("center"); - echo "
"; - echo "id\" />"; - if ($question) { - echo ""; - } - - echo ""; - - $definitions = get_records('question_dataset_definitions', - 'category', - $category->id); - for ($idef = 1, $total = max(5, count($definitions)) ; $idef <= $total ; ++$idef) { - if ($definitions) { - $definition = array_shift($definitions); - } else { - $definition = NULL; - } - - echo "\n"; - } - - echo ""; - echo "
"; - print_string("itemdefinition", "quiz"); - echo ":"; - echo "name\" />"; - echo "id\" />"; - echo " "; - choose_from_menu($DATASET_TYPES, 'type[]', $definition->type, ''); - echo "
"; - echo "
"; - print_simple_box_end(); - - print_footer($course); -?>