From 9b0f6ae71d83b953b3cae64e7fedce08002ba2b2 Mon Sep 17 00:00:00 2001 From: pichetp Date: Tue, 12 Jun 2007 03:16:40 +0000 Subject: [PATCH] giving to questiondatasets.html all the features of datasetdefinitions_form.php of HTML QuickForm --- .../type/datasetdependent/abstractqtype.php | 14 ++-- .../datasetdependent/datasetdefinitions.php | 6 +- .../datasetdependent/questiondatasets.html | 64 +++++++++++++++---- 3 files changed, 63 insertions(+), 21 deletions(-) diff --git a/question/type/datasetdependent/abstractqtype.php b/question/type/datasetdependent/abstractqtype.php index 6a4880e8de2..1354275a78e 100644 --- a/question/type/datasetdependent/abstractqtype.php +++ b/question/type/datasetdependent/abstractqtype.php @@ -630,10 +630,10 @@ class question_dataset_dependent_questiontype extends default_questiontype { return $datasetdefs; } - function dataset_options($form, $name) { + function dataset_options($form, $name,$prefix='',$langfile='quiz') { // First options - it is not a dataset... - $options['0'] = get_string('nodataset', 'quiz'); + $options['0'] = get_string($prefix.'nodataset', $langfile); // Construct question local options global $CFG; @@ -649,9 +649,9 @@ class question_dataset_dependent_questiontype extends default_questiontype { $key = "$type-0-$name"; if ($currentdatasetdef->type == $type and $currentdatasetdef->category == 0) { - $options[$key] = get_string("keptlocal$type", 'quiz'); + $options[$key] = get_string($prefix."keptlocal$type", $langfile); } else { - $options[$key] = get_string("newlocal$type", 'quiz'); + $options[$key] = get_string($prefix."newlocal$type", $langfile); } } @@ -669,12 +669,12 @@ class question_dataset_dependent_questiontype extends default_questiontype { and $categorydef = $categorydatasetdefs[$type]) { if ($currentdatasetdef->type == $type and $currentdatasetdef->id == $categorydef->id) { - $options[$key] = get_string("keptcategory$type", 'quiz'); + $options[$key] = get_string($prefix."keptcategory$type", $langfile); } else { - $options[$key] = get_string("existingcategory$type", 'quiz'); + $options[$key] = get_string($prefix."existingcategory$type", $langfile); } } else { - $options[$key] = get_string("newcategory$type", 'quiz'); + $options[$key] = get_string($prefix."newcategory$type", $langfile); } } diff --git a/question/type/datasetdependent/datasetdefinitions.php b/question/type/datasetdependent/datasetdefinitions.php index cdb5814c47d..30e7c857bd6 100644 --- a/question/type/datasetdependent/datasetdefinitions.php +++ b/question/type/datasetdependent/datasetdefinitions.php @@ -9,8 +9,12 @@ foreach ($form->answers as $answer) { $mandatorydatasets += $this ->find_dataset_names($answer); } -$datasets = $this->construct_dataset_menus( +$datasetmenus = $this->construct_dataset_menus( $form, $mandatorydatasets, $possibledatasets); +// prepare shared wild card display + $labelsharedwildcard = get_string("sharedwildcard", "qtype_datasetdependent"); + $datadefscat= array(); + $datadefscat = $this->get_dataset_definitions_category($form); // Print the page print_heading_with_help(get_string("choosedatasetproperties", "quiz"), "questiondatasets", "quiz"); diff --git a/question/type/datasetdependent/questiondatasets.html b/question/type/datasetdependent/questiondatasets.html index 37343f4c75f..d881bcb713d 100644 --- a/question/type/datasetdependent/questiondatasets.html +++ b/question/type/datasetdependent/questiondatasets.html @@ -1,35 +1,73 @@
+
+

+
+ + - + - - - - + + + + - $menu) { ?> + - - + + + + + + + +
{ $tmp){break;} p($name) ?>} -
- {} +
+
+

+ +
+ + + + $menu) { ?> + + + - + + + + + + + + +
+
+ + -
+ + -" /> +