Changing names of classes to be used by Phing - BT#821

skala
Guillaume Viguier 15 years ago
parent 7c7524f043
commit d98243c5a7
  1. 3
      main/survey/fillsurvey.php
  2. 5
      main/survey/preview.php
  3. 5
      main/survey/question.php
  4. 23
      main/survey/survey.lib.php

@ -1205,7 +1205,8 @@ if(isset($questions) && is_array($questions))
{ {
foreach ($questions as $key=>$question) foreach ($questions as $key=>$question)
{ {
$display = new $question['type']; $ch_type = 'ch_'.$question['type'];
$display = new $ch_type;
$display->render_question($question); $display->render_question($question);
} }
} }

@ -186,7 +186,8 @@ if (api_is_course_admin() || (api_is_course_admin() && $_GET['isStudentView']=='
{ {
foreach ($questions as $key=>$question) foreach ($questions as $key=>$question)
{ {
$display = new $question['type']; $ch_type = 'ch_'.$question['type'];
$display = new $ch_type;
$display->render_question($question); $display->render_question($question);
} }
} }
@ -208,4 +209,4 @@ if (api_is_course_admin() || (api_is_course_admin() && $_GET['isStudentView']=='
} }
// Footer // Footer
Display :: display_footer(); Display :: display_footer();

@ -140,7 +140,8 @@ if (empty($_POST['save_question']) && in_array($_GET['type'],$possible_types)) {
} }
} }
} }
$form = new $_GET['type']; $ch_type = 'ch_'.$_GET['type'];
$form = new $ch_type;
// The defaults values for the form // The defaults values for the form
$form_content['answers'] = array('', ''); $form_content['answers'] = array('', '');
@ -192,7 +193,7 @@ if (empty($_POST['save_question']) && in_array($_GET['type'],$possible_types)) {
$form->render_form(); $form->render_form();
} else { } else {
$form_content = $_POST; $form_content = $_POST;
$form = new question(); $form = new survey_question();
$form->handle_action($form_content); $form->handle_action($form_content);
} }

@ -1327,7 +1327,7 @@ class survey_manager
} }
class question class survey_question
{ {
// the html code of the form // the html code of the form
public $html; public $html;
@ -1617,7 +1617,7 @@ class question
} }
} }
class yesno extends question class ch_yesno extends survey_question
{ {
/** /**
* This function creates the form elements for the yesno questions * This function creates the form elements for the yesno questions
@ -1718,7 +1718,7 @@ class yesno extends question
} }
class multiplechoice extends question class ch_multiplechoice extends survey_question
{ {
/** /**
* This function creates the form elements for the multiple choice questions * This function creates the form elements for the multiple choice questions
@ -1807,7 +1807,7 @@ class multiplechoice extends question
} }
class personality extends question class ch_personality extends survey_question
{ {
/** /**
* This function creates the form elements for the multiple response questions * This function creates the form elements for the multiple response questions
@ -1911,7 +1911,7 @@ class personality extends question
class multipleresponse extends question class ch_multipleresponse extends survey_question
{ {
/** /**
* This function creates the form elements for the multiple response questions * This function creates the form elements for the multiple response questions
@ -2020,7 +2020,7 @@ class multipleresponse extends question
} }
} }
class dropdown extends question class ch_dropdown extends survey_question
{ {
/** /**
* This function creates the form elements for the dropdown questions * This function creates the form elements for the dropdown questions
@ -2108,7 +2108,7 @@ class dropdown extends question
} }
class open extends question class ch_open extends survey_question
{ {
/** /**
* This function creates the form elements for the open questions * This function creates the form elements for the open questions
@ -2151,7 +2151,8 @@ class open extends question
} }
} }
class comment extends question
class ch_comment extends survey_question
{ {
/** /**
* This function creates the form elements for a comment. * This function creates the form elements for a comment.
@ -2185,7 +2186,7 @@ class comment extends question
} }
} }
class pagebreak extends question class ch_pagebreak extends survey_question
{ {
/** /**
* This function creates the form elements for a comment. * This function creates the form elements for a comment.
@ -2202,7 +2203,7 @@ class pagebreak extends question
} }
} }
class percentage extends question class ch_percentage extends survey_question
{ {
function create_form($form_content) function create_form($form_content)
{ {
@ -2236,7 +2237,7 @@ class percentage extends question
} }
class score extends question class ch_score extends survey_question
{ {
function create_form($form_content) function create_form($form_content)
{ {

Loading…
Cancel
Save