diff --git a/main/exercice/admin.php b/main/exercice/admin.php index 420afc165e..c90bae8245 100644 --- a/main/exercice/admin.php +++ b/main/exercice/admin.php @@ -1,4 +1,4 @@ -'; echo Display::return_icon('preview.gif', get_lang('Preview')).''.get_lang('Preview').''; +echo Display::return_icon('lp_quiz.png', get_lang('ModifyExercise')).''.get_lang('ModifyExercise').''; + echo ''; if(isset($_GET['message'])) @@ -488,7 +490,7 @@ if(!$newQuestion && !$modifyQuestion && !$editQuestion && !isset($_GET['hotspota include_once(api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php'); $form = new FormValidator('exercise_admin', 'post', api_get_self().'?exerciseId='.$_GET['exerciseId']); $form -> addElement ('hidden','edit','true'); - $objExercise -> createForm ($form,'simple'); + //$objExercise -> createForm ($form,'simple'); if($form -> validate()) { $objExercise -> processCreation($form,'simple'); diff --git a/main/exercice/exercice.php b/main/exercice/exercice.php index 43cc4b7d18..6326e3631c 100644 --- a/main/exercice/exercice.php +++ b/main/exercice/exercice.php @@ -1,4 +1,4 @@ -'; echo ''; } - if (($is_allowedToEdit) and ($origin != 'learnpath')) - { - echo ''.Display::return_icon('new_test.gif',get_lang('NewEx')).get_lang('NewEx').''; - echo ''.Display::return_icon('jqz.gif',get_lang('ImportHotPotatoesQuiz')).get_lang('ImportHotPotatoesQuiz').''; - echo ''.Display::return_icon('show_test_results.gif',get_lang('Results')).get_lang('Results').''; - // the actions for the statistics - if($show == 'result') { - // the form - if(api_is_platform_admin() || api_is_course_admin() || api_is_course_tutor() || api_is_course_coach()) { - if($_SESSION['export_user_fields']==false) { - $alt = get_lang('ExportWithUserFields'); - $extra_user_fields = ''; - } else { - $alt = get_lang('ExportWithoutUserFields'); - $extra_user_fields = ''; - } - echo ''.Display::return_icon('excel.gif',get_lang('ExportAsCSV')).get_lang('ExportAsCSV').''; - echo ''.Display::return_icon('excel.gif',get_lang('ExportAsXLS')).get_lang('ExportAsXLS').''; - echo ''.Display::return_icon('synthese_view.gif',$alt).$alt.''; - echo ''.Display::return_icon('quiz.gif',get_lang('BackToExercisesList')).get_lang('BackToExercisesList').''; - echo '
'; - echo ''; - echo ''; - } - } - } else { - //the student view - echo ''.Display::return_icon('show_test_results.gif',get_lang('Results')).get_lang('Results').''; - if($show == 'result') { - echo ''.Display::return_icon('quiz.gif',get_lang('BackToExercisesList')).get_lang('BackToExercisesList').''; - } - } - - if ($_configuration['tracking_enabled']) - { - if ($show == 'result') - { - if (!function_exists('make_select')) +if ($_configuration['tracking_enabled']) { + if ($show == 'result') { + /*if (!function_exists('make_select')) { function make_select($name,$values,$checked='') { $output .= ''; return $output; } - } + }*/ - if (!function_exists('make_select_users')) + /*if (!function_exists('make_select_users')) { function make_select_users($name,$values,$checked='') { @@ -656,20 +613,16 @@ echo '

+
';
+ //echo '
';
} else {
- echo '
';
+ //echo '
';
}
?>
-
+
')) return false;">
>
-
+
')) return false;">
selectType() == HOT_SPOT)
+ {
+ $number_of_hotspot_questions++;
+ }
+
+ break;
+ }
}
else
{
@@ -919,18 +928,9 @@ else
{
$number_of_hotspot_questions++;
}
- break;
- }
- }
- else
- {
- if ($objQuestionTmp->selectType() == HOT_SPOT)
- {
- $number_of_hotspot_questions++;
}
}
}
-
if($number_of_hotspot_questions > 0)
{
$onsubmit = "onsubmit=\"return validateFlashVar('".$number_of_hotspot_questions."', '".get_lang('HotspotValidateError1')."', '".get_lang('HotspotValidateError2')."');\"";
diff --git a/main/exercice/exercise.class.php b/main/exercice/exercise.class.php
index 70c71e4146..5ca780c754 100644
--- a/main/exercice/exercise.class.php
+++ b/main/exercice/exercise.class.php
@@ -25,7 +25,7 @@
* Exercise class: This class allows to instantiate an object of type Exercise
* @package dokeos.exercise
* @author Olivier Brouckaert
-* @version $Id: exercise.class.php 19314 2009-03-25 17:25:18Z cvargas1 $
+* @version $Id: exercise.class.php 19404 2009-03-28 01:24:38Z cvargas1 $
*/
@@ -45,8 +45,8 @@ class Exercise
var $feedbacktype;
var $end_time;
var $start_time;
-
var $questionList; // array with the list of this exercise's questions
+ var $results_disabled;
/**
* constructor of the class
@@ -66,6 +66,7 @@ class Exercise
$this->timeLimit = 0;
$this->end_time = '0000-00-00 00:00:00';
$this->start_time = '0000-00-00 00:00:00';
+ $this->results_disabled =1;
}
/**
@@ -222,6 +223,17 @@ class Exercise
return $this->type;
}
+ /**
+ * tells if questions are selected randomly, and if so returns the draws
+ *
+ * @author - Carlos Vargas
+ * @return - integer - results disabled exercise
+ */
+ function selectResultsDisabled()
+ {
+ return $this->results_disabled;
+ }
+
/**
* tells if questions are selected randomly, and if so returns the draws
*
@@ -480,6 +492,15 @@ class Exercise
{
$this->results_disabled = false;
}
+ function updateResultsDisabled($results_disabled)
+ {
+ if ($results_disabled==1){
+ $this->results_disabled = true;
+ } else {
+ $this->results_disabled = false;
+ }
+ }
+
/**
* updates the exercise in the data base
@@ -836,19 +857,24 @@ class Exercise
$form -> addElement ('html_editor', 'exerciseDescription', get_lang('ExerciseDescription'));
if($type=='full') {
- // feedback type
+ // feedback type
+ $radios_feedback = array();
+ $radios_feedback[] = FormValidator :: createElement ('radio', 'exerciseFeedbackType', null, get_lang('Feedback'),'0');
+ $radios_feedback[] = FormValidator :: createElement ('radio', 'exerciseFeedbackType', null, get_lang('NoFeedback'),'2');
+ $form -> addGroup($radios_feedback, null, get_lang('Evaluation'));
+
$feedback_option[0]=get_lang('Feedback');
$feedback_option[1]=get_lang('DirectFeedback');
$feedback_option[2]=get_lang('NoFeedback');
//Can't modify a DirectFeedback question
if ($this->selectFeedbackType() != 1 ) {
- $form -> addElement('select', 'exerciseFeedbackType',get_lang('FeedbackType'),$feedback_option,'onchange="javascript:feedbackselection()"');
+ // $form -> addElement('select', 'exerciseFeedbackType',get_lang('FeedbackType'),$feedback_option,'onchange="javascript:feedbackselection()"');
// test type
$radios = array();
$radios[] = FormValidator :: createElement ('radio', 'exerciseType', null, get_lang('SimpleExercise'),'1');
$radios[] = FormValidator :: createElement ('radio', 'exerciseType', null, get_lang('SequentialExercise'),'2');
- $form -> addGroup($radios, null, get_lang('ExerciseType'), '