Browse Source

[svn r18476] configure test buttons bar

Juan Carlos Raña 16 years ago
parent
commit
7fa94503e9

+ 4 - 4
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 18422 2009-02-10 20:54:53Z juliomontoya $
+* 	@version $Id: exercise.class.php 18476 2009-02-12 20:44:00Z herodoto $
 */
 
 
@@ -817,10 +817,10 @@ class Exercise
 		$form -> addElement('text', 'exerciseTitle', get_lang('ExerciseName'),'class="input_titles"');
 		// fck editor
 		global $fck_attribute;
-		$fck_attribute = array();
+		$fck_attribute = array();		
+		$fck_attribute['Width'] 	= '100%'; 
 		$fck_attribute['Height'] 	= '200px';
-		$fck_attribute['Width'] 	= '50%'; 
-		$fck_attribute['ToolbarSet'] = 'NewTest';		  
+		$fck_attribute['ToolbarSet'] = 'TestDescription';		  
 		
 		$fck_attribute['Config']['InDocument'] = false;		
 		$fck_attribute['Config']['CreateDocumentDir'] = '../../courses/'.api_get_course_path().'/document/';		

+ 217 - 217
main/exercice/multiple_answer.class.php

@@ -1,217 +1,217 @@
-<?php // $Id: document.php 16494 2008-10-10 22:07:36Z yannoo $
- 
-/*
-==============================================================================
-	Dokeos - elearning and course management software
-
-	Copyright (c) 2004-2008 Dokeos SPRL
-	Copyright (c) 2003 Ghent University (UGent)
-	Copyright (c) 2001 Universite catholique de Louvain (UCL)
-	Copyright (c) various contributors
-
-	For a full list of contributors, see "credits.txt".
-	The full license can be read in "license.txt".
-
-	This program 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 2
-	of the License, or (at your option) any later version.
-
-	See the GNU General Public License for more details.
-
-	Contact address: Dokeos, rue du Corbeau, 108, B-1030 Brussels, Belgium
-	Mail: info@dokeos.com
-==============================================================================
-*/
-
-/**
-*	File containing the MultipleAnswer class.
-*	@package dokeos.exercise
-* 	@author Eric Marguin
-* 	@version $Id: admin.php 10680 2007-01-11 21:26:23Z pcool $
-*/
-
-if(!class_exists('MultipleAnswer')):
-
-/**
-	CLASS MultipleAnswer
- *
- *	This class allows to instantiate an object of type MULTIPLE_ANSWER (MULTIPLE CHOICE, MULTIPLE ANSWER),
- *	extending the class question
- *
- *	@author Eric Marguin
- *	@package dokeos.exercise
- **/
-
-class MultipleAnswer extends Question {
-
-	static $typePicture = 'mcma.gif';
-	static $explanationLangVar = 'MultipleSelect';
-
-	/**
-	 * Constructor
-	 */
-	function MultipleAnswer(){
-		parent::question();
-		$this -> type = MULTIPLE_ANSWER;
-	}
-
-	/**
-	 * function which redifines Question::createAnswersForm
-	 * @param the formvalidator instance
-	 * @param the answers number to display
-	 */
-	function createAnswersForm ($form) {
-
-		global $fck_attribute;
-
-		$fck_attribute = array();
-		//$fck_attribute['Width'] = '348px';
-		$fck_attribute['Width'] = '100%';
-		$fck_attribute['Height'] = '100px';
-		$fck_attribute['ToolbarSet'] = 'Test';
-		$fck_attribute['Config']['IMUploadPath'] = 'upload/test/';
-		$fck_attribute['Config']['FlashUploadPath'] = 'upload/test/';
-		
-		$fck_attribute['Config']['InDocument'] = false;		
-		$fck_attribute['Config']['CreateDocumentDir'] = '../../courses/'.api_get_course_path().'/document/';
-		$fck_attribute['Config']['ToolbarStartExpanded']='false';
-			
-
-		$nb_answers = isset($_POST['nb_answers']) ? $_POST['nb_answers'] : 2;
-		$nb_answers += (isset($_POST['lessAnswers']) ? -1 : (isset($_POST['moreAnswers']) ? 1 : 0));
-
-		$html='
-		<div class="row">
-			<div class="label">
-			'.get_lang('Answers').'
-			</div>
-			<div class="formw">
-				<table class="data_table">
-					<tr style="text-align: center;">
-						<th>
-							'.get_lang('Number').'
-						</th>
-						<th>
-							'.get_lang('True').'
-						</th>
-						<th>
-							'.get_lang('Answer').'
-						</th>
-						<th>
-							'.get_lang('Comment').'
-						</th>
-						<th>
-							'.get_lang('Weighting').'
-						</th>
-						
-					</tr>';
-		$form -> addElement ('html', $html);
-
-		$defaults = array();
-		$correct = 0;
-		if(!empty($this -> id))
-		{
-			$answer = new Answer($this -> id);
-			$answer -> read();
-			if(count($answer->nbrAnswers)>0 && !$form->isSubmitted())
-			{
-				$nb_answers = $answer->nbrAnswers;
-			}
-		}
-
-		$form -> addElement('hidden', 'nb_answers');		
-		$boxes_names = array();
-
-		for($i = 1 ; $i <= $nb_answers ; ++$i)
-		{			
-			if(is_object($answer))
-			{
-				$defaults['answer['.$i.']'] = $answer -> answer[$i];
-				$defaults['comment['.$i.']'] = $answer -> comment[$i];
-				$defaults['weighting['.$i.']'] = $answer -> weighting[$i];
-				$defaults['correct['.$i.']'] = $answer -> correct[$i];
-			}
-			
-			$renderer = & $form->defaultRenderer();
-			$renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>');
-			
-			$answer_number=$form->addElement('text', null,null,'value="'.$i.'"');
-			$answer_number->freeze(); 
-			
-			$form->addElement('checkbox', 'correct['.$i.']', null, null, 'class="checkbox" style="margin-left: 0em;"');
-			$boxes_names[] = 'correct['.$i.']';
-			
-			$form->addElement('html_editor', 'answer['.$i.']',null, 'style="vertical-align:middle"');
-			$form->addRule('answer['.$i.']', get_lang('ThisFieldIsRequired'), 'required');
-			$form->addElement('html_editor', 'comment['.$i.']',null, 'style="vertical-align:middle"');
-			$form->addElement('text', 'weighting['.$i.']',null, 'style="vertical-align:middle;margin-left: 0em;" size="5" value="0"');
-			$form -> addElement ('html', '</tr>');
-		}
-		$form -> addElement ('html', '</table>');
-		
-		$form -> add_multiple_required_rule ($boxes_names , get_lang('ChooseAtLeastOneCheckbox') , 'multiple_required');
-
-		$form->addElement('style_submit_button', 'lessAnswers', get_lang('LessAnswer'));
-		$form->addElement('style_submit_button', 'moreAnswers', get_lang('PlusAnswer'));
-		$renderer->setElementTemplate('{element}&nbsp;','lessAnswers');
-		$renderer->setElementTemplate('{element}','moreAnswers');
-		$form -> addElement ('html', '</div></div>');
-
-		$defaults['correct'] = $correct;
-		$form -> setDefaults($defaults);
-
-		$form->setConstants(array('nb_answers' => $nb_answers));
-
-	}
-
-
-	/**
-	 * abstract function which creates the form to create / edit the answers of the question
-	 * @param the formvalidator instance
-	 * @param the answers number to display
-	 */
-	function processAnswersCreation($form) {
-
-		$questionWeighting = $nbrGoodAnswers = 0;
-
-		$objAnswer = new Answer($this->id);
-
-		$nb_answers = $form -> getSubmitValue('nb_answers');
-
-		for($i=1 ; $i <= $nb_answers ; $i++)
-        {
-        	$answer = trim($form -> getSubmitValue('answer['.$i.']'));
-            $comment = trim($form -> getSubmitValue('comment['.$i.']'));
-            $weighting = trim($form -> getSubmitValue('weighting['.$i.']'));
-            $goodAnswer = trim($form -> getSubmitValue('correct['.$i.']'));
-
-			if($goodAnswer){
-    			$weighting = abs($weighting);
-			}
-			else{
-				$weighting = abs($weighting);
-				$weighting = -$weighting;
-			}
-    		if($weighting > 0)
-            {
-                $questionWeighting += $weighting;
-            }
-
-        	$objAnswer -> createAnswer($answer,$goodAnswer,$comment,$weighting,$i);
-
-        }
-
-    	// saves the answers into the data base
-        $objAnswer -> save();
-
-        // sets the total weighting of the question
-        $this -> updateWeighting($questionWeighting);
-        $this -> save();
-
-	}
-
-}
-
-endif;
-?>
+<?php // $Id: document.php 16494 2008-10-10 22:07:36Z yannoo $
+ 
+/*
+==============================================================================
+	Dokeos - elearning and course management software
+
+	Copyright (c) 2004-2008 Dokeos SPRL
+	Copyright (c) 2003 Ghent University (UGent)
+	Copyright (c) 2001 Universite catholique de Louvain (UCL)
+	Copyright (c) various contributors
+
+	For a full list of contributors, see "credits.txt".
+	The full license can be read in "license.txt".
+
+	This program 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 2
+	of the License, or (at your option) any later version.
+
+	See the GNU General Public License for more details.
+
+	Contact address: Dokeos, rue du Corbeau, 108, B-1030 Brussels, Belgium
+	Mail: info@dokeos.com
+==============================================================================
+*/
+
+/**
+*	File containing the MultipleAnswer class.
+*	@package dokeos.exercise
+* 	@author Eric Marguin
+* 	@version $Id: admin.php 10680 2007-01-11 21:26:23Z pcool $
+*/
+
+if(!class_exists('MultipleAnswer')):
+
+/**
+	CLASS MultipleAnswer
+ *
+ *	This class allows to instantiate an object of type MULTIPLE_ANSWER (MULTIPLE CHOICE, MULTIPLE ANSWER),
+ *	extending the class question
+ *
+ *	@author Eric Marguin
+ *	@package dokeos.exercise
+ **/
+
+class MultipleAnswer extends Question {
+
+	static $typePicture = 'mcma.gif';
+	static $explanationLangVar = 'MultipleSelect';
+
+	/**
+	 * Constructor
+	 */
+	function MultipleAnswer(){
+		parent::question();
+		$this -> type = MULTIPLE_ANSWER;
+	}
+
+	/**
+	 * function which redifines Question::createAnswersForm
+	 * @param the formvalidator instance
+	 * @param the answers number to display
+	 */
+	function createAnswersForm ($form) {
+
+		global $fck_attribute;
+
+		$fck_attribute = array();
+		//$fck_attribute['Width'] = '348px';
+		$fck_attribute['Width'] = '100%';
+		$fck_attribute['Height'] = '100px';
+		$fck_attribute['ToolbarSet'] = 'Answer';
+		$fck_attribute['Config']['IMUploadPath'] = 'upload/test/';
+		$fck_attribute['Config']['FlashUploadPath'] = 'upload/test/';
+		
+		$fck_attribute['Config']['InDocument'] = false;		
+		$fck_attribute['Config']['CreateDocumentDir'] = '../../courses/'.api_get_course_path().'/document/';
+		$fck_attribute['Config']['ToolbarStartExpanded']='false';
+			
+
+		$nb_answers = isset($_POST['nb_answers']) ? $_POST['nb_answers'] : 2;
+		$nb_answers += (isset($_POST['lessAnswers']) ? -1 : (isset($_POST['moreAnswers']) ? 1 : 0));
+
+		$html='
+		<div class="row">
+			<div class="label">
+			'.get_lang('Answers').'
+			</div>
+			<div class="formw">
+				<table class="data_table">
+					<tr style="text-align: center;">
+						<th>
+							'.get_lang('Number').'
+						</th>
+						<th>
+							'.get_lang('True').'
+						</th>
+						<th>
+							'.get_lang('Answer').'
+						</th>
+						<th>
+							'.get_lang('Comment').'
+						</th>
+						<th>
+							'.get_lang('Weighting').'
+						</th>
+						
+					</tr>';
+		$form -> addElement ('html', $html);
+
+		$defaults = array();
+		$correct = 0;
+		if(!empty($this -> id))
+		{
+			$answer = new Answer($this -> id);
+			$answer -> read();
+			if(count($answer->nbrAnswers)>0 && !$form->isSubmitted())
+			{
+				$nb_answers = $answer->nbrAnswers;
+			}
+		}
+
+		$form -> addElement('hidden', 'nb_answers');		
+		$boxes_names = array();
+
+		for($i = 1 ; $i <= $nb_answers ; ++$i)
+		{			
+			if(is_object($answer))
+			{
+				$defaults['answer['.$i.']'] = $answer -> answer[$i];
+				$defaults['comment['.$i.']'] = $answer -> comment[$i];
+				$defaults['weighting['.$i.']'] = $answer -> weighting[$i];
+				$defaults['correct['.$i.']'] = $answer -> correct[$i];
+			}
+			
+			$renderer = & $form->defaultRenderer();
+			$renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>');
+			
+			$answer_number=$form->addElement('text', null,null,'value="'.$i.'"');
+			$answer_number->freeze(); 
+			
+			$form->addElement('checkbox', 'correct['.$i.']', null, null, 'class="checkbox" style="margin-left: 0em;"');
+			$boxes_names[] = 'correct['.$i.']';
+			
+			$form->addElement('html_editor', 'answer['.$i.']',null, 'style="vertical-align:middle"');
+			$form->addRule('answer['.$i.']', get_lang('ThisFieldIsRequired'), 'required');
+			$form->addElement('html_editor', 'comment['.$i.']',null, 'style="vertical-align:middle"');
+			$form->addElement('text', 'weighting['.$i.']',null, 'style="vertical-align:middle;margin-left: 0em;" size="5" value="0"');
+			$form -> addElement ('html', '</tr>');
+		}
+		$form -> addElement ('html', '</table>');
+		
+		$form -> add_multiple_required_rule ($boxes_names , get_lang('ChooseAtLeastOneCheckbox') , 'multiple_required');
+
+		$form->addElement('style_submit_button', 'lessAnswers', get_lang('LessAnswer'));
+		$form->addElement('style_submit_button', 'moreAnswers', get_lang('PlusAnswer'));
+		$renderer->setElementTemplate('{element}&nbsp;','lessAnswers');
+		$renderer->setElementTemplate('{element}','moreAnswers');
+		$form -> addElement ('html', '</div></div>');
+
+		$defaults['correct'] = $correct;
+		$form -> setDefaults($defaults);
+
+		$form->setConstants(array('nb_answers' => $nb_answers));
+
+	}
+
+
+	/**
+	 * abstract function which creates the form to create / edit the answers of the question
+	 * @param the formvalidator instance
+	 * @param the answers number to display
+	 */
+	function processAnswersCreation($form) {
+
+		$questionWeighting = $nbrGoodAnswers = 0;
+
+		$objAnswer = new Answer($this->id);
+
+		$nb_answers = $form -> getSubmitValue('nb_answers');
+
+		for($i=1 ; $i <= $nb_answers ; $i++)
+        {
+        	$answer = trim($form -> getSubmitValue('answer['.$i.']'));
+            $comment = trim($form -> getSubmitValue('comment['.$i.']'));
+            $weighting = trim($form -> getSubmitValue('weighting['.$i.']'));
+            $goodAnswer = trim($form -> getSubmitValue('correct['.$i.']'));
+
+			if($goodAnswer){
+    			$weighting = abs($weighting);
+			}
+			else{
+				$weighting = abs($weighting);
+				$weighting = -$weighting;
+			}
+    		if($weighting > 0)
+            {
+                $questionWeighting += $weighting;
+            }
+
+        	$objAnswer -> createAnswer($answer,$goodAnswer,$comment,$weighting,$i);
+
+        }
+
+    	// saves the answers into the data base
+        $objAnswer -> save();
+
+        // sets the total weighting of the question
+        $this -> updateWeighting($questionWeighting);
+        $this -> save();
+
+	}
+
+}
+
+endif;
+?>

+ 3 - 3
main/exercice/question.class.php

@@ -1,4 +1,4 @@
-<?php // $Id: question.class.php 18411 2009-02-10 17:59:08Z juliomontoya $
+<?php // $Id: question.class.php 18476 2009-02-12 20:44:00Z herodoto $
  
 /*
 ==============================================================================
@@ -28,7 +28,7 @@
 *	File containing the Question class.
 *	@package dokeos.exercise
 * 	@author Olivier Brouckaert
-* 	@version $Id: question.class.php 18411 2009-02-10 17:59:08Z juliomontoya $
+* 	@version $Id: question.class.php 18476 2009-02-12 20:44:00Z herodoto $
 */
 
 
@@ -996,7 +996,7 @@ abstract class Question
 		$fck_attribute = array();
 		$fck_attribute['Width'] = '100%';
 		$fck_attribute['Height'] = '300';
-		$fck_attribute['ToolbarSet'] = 'TestComment';
+		$fck_attribute['ToolbarSet'] = 'QuestionDescription';
 		$fck_attribute['Config']['IMUploadPath'] = 'upload/test/';
 		$fck_attribute['Config']['FlashUploadPath'] = 'upload/test/';
 		

+ 377 - 377
main/exercice/unique_answer.class.php

@@ -1,377 +1,377 @@
-<?php
-/*
-    DOKEOS - elearning and course management software
-
-    For a full list of contributors, see documentation/credits.html
-
-    This program 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 2
-    of the License, or (at your option) any later version.
-    See "documentation/licence.html" more details.
-
-    Contact:
-		Dokeos
-		Rue des Palais 44 Paleizenstraat
-		B-1030 Brussels - Belgium
-		Tel. +32 (2) 211 34 56
-*/
-
-
-/**
-*	File containing the UNIQUE_ANSWER class.
-*	@package dokeos.exercise
-* 	@author Eric Marguin
-* 	@version $Id: admin.php 10680 2007-01-11 21:26:23Z pcool $
-*/
-
-
-if(!class_exists('UniqueAnswer')):
-
-/**
-	CLASS UNIQUE_ANSWER
- *
- *	This class allows to instantiate an object of type UNIQUE_ANSWER (MULTIPLE CHOICE, UNIQUE ANSWER),
- *	extending the class question
- *
- *	@author Eric Marguin
- *  @author Julio Montoya 
- *	@package dokeos.exercise
- **/
-
-class UniqueAnswer extends Question {
-
-	static $typePicture = 'mcua.gif';
-	static $explanationLangVar = 'UniqueSelect';
-
-	/**
-	 * Constructor
-	 */
-	function UniqueAnswer(){
-		//this is highly important
-		parent::question();
-		$this -> type = UNIQUE_ANSWER;
-	}
-
-	/**
-	 * function which redifines Question::createAnswersForm
-	 * @param the formvalidator instance
-	 * @param the answers number to display
-	 */
-	function createAnswersForm ($form) {
-		// getting the exercise list	
-		$obj_ex =$_SESSION['objExercise'];
-		// multiple 
-		global $fck_attribute;
-
-		$fck_attribute = array();
-		$fck_attribute['Width'] = '50%';
-		$fck_attribute['Height'] = '125px';
-		
-		$fck_attribute['ToolbarSet'] = 'Test';
-		$fck_attribute['Config']['IMUploadPath'] = 'upload/test/';
-		$fck_attribute['Config']['FlashUploadPath'] = 'upload/test/';
-		$fck_attribute['Config']['InDocument'] = false;		
-		$fck_attribute['Config']['CreateDocumentDir'] = '../../courses/'.api_get_course_path().'/document/';
-		// we collapse the fckeditor toolbar
-		$fck_attribute['Config']['ToolbarStartExpanded']='false';		
-		
-		//this line define how many question by default appear when creating a choice question
-		$nb_answers = isset($_POST['nb_answers']) ? (int) $_POST['nb_answers'] : 4;
-		$nb_answers += (isset($_POST['lessAnswers']) ? -1 : (isset($_POST['moreAnswers']) ? 1 : 0));
-		
-		/*
-	 		Types of Feedback
-	 		$feedback_option[0]=get_lang('Feedback');
-			$feedback_option[1]=get_lang('DirectFeedback');
-			$feedback_option[2]=get_lang('NoFeedback');
-	 	*/
-	 
-		$feedback_title='';
-		$comment_title='';
-		
-		if ($obj_ex->selectFeedbackType()==0) {
-			$comment_title = '<th>'.get_lang('Comment').'</th>';			
-		} elseif ($obj_ex->selectFeedbackType()==1) {						
-			$fck_attribute['Width'] = '250px';
-			$fck_attribute['Height'] = '110px';			
-			$comment_title = '<th width="'.$fck_attribute['Width'].'" >'.get_lang('Comment').'</th>';
-			$feedback_title = '<th width="300px" >'.get_lang('Scenario').'</th>';			
-		} 
-		
-		$html='
-		<div class="row">
-			<div class="label">
-			'.get_lang('Answers').'
-			</div>
-			<div class="formw">
-				<table class="data_table">
-					<tr style="text-align: center;">
-						<th width="14px">
-							'.get_lang('Number').'
-						</th>
-						<th width="10px" >
-							'.get_lang('True').'
-						</th>
-						<th width="'.$fck_attribute['Width'].' ">
-							'.get_lang('Answer').'
-						</th>
-							'.$comment_title.'	
-							'.$feedback_title.'							
-						<th width="20px">
-							'.get_lang('Weighting').'
-						</th>						
-					</tr>';
-					
-		$form -> addElement ('html', $html);
-
-		$defaults = array();
-		$correct = 0;
-		if(!empty($this -> id)) {
-			$answer = new Answer($this -> id);
-			$answer -> read();
-			if(count($answer->nbrAnswers)>0 && !$form->isSubmitted())
-			{
-				$nb_answers = $answer->nbrAnswers;
-			}
-		}
-		$form -> addElement('hidden', 'nb_answers');
-		
-		//Feedback SELECT
-		$question_list=$obj_ex->selectQuestionList();
-		$select_question=array();
-		$select_question[0]=get_lang('SelectTargetQuestion');
-		require_once('../newscorm/learnpathList.class.php');		
-		require_once(api_get_path(LIBRARY_PATH).'text.lib.php');
-		
-		
-		foreach ($question_list as $key=>$questionid) {				
-			$question = Question::read($questionid);			
-			$select_question[$questionid]='Q'.$key.' :'.cut($question->selectTitle(),20);						
-		}		
-		$select_question[-1]=get_lang('ExitTest');		
-			
-		//LP SELECT
-		require_once('../newscorm/learnpathList.class.php');
-		//require_once('../newscorm/learnpath.class.php');
-		//require_once('../newscorm/learnpathItem.class.php');
-
-		$list = new LearnpathList(api_get_user_id());
-		$flat_list = $list->get_flat_list();
-		$select_lp_id=array();		
-		$select_lp_id[0]=get_lang('SelectTargetLP');
-		
-		foreach ($flat_list as $id => $details)
-		{
-			$select_lp_id[$id] = cut($details['lp_name'],20);
-		}	
-			
-		$temp_scenario=array();		
-		for($i = 1 ; $i <= $nb_answers ; ++$i)
-		{
-			$form -> addElement ('html', '<tr>');
-			if(is_object($answer))
-			{
-				if($answer -> correct[$i])
-				{
-					$correct = $i;
-				}
-				
-				$defaults['answer['.$i.']'] = $answer -> answer[$i];
-				$defaults['comment['.$i.']'] = $answer -> comment[$i];
-				$defaults['weighting['.$i.']'] = $answer -> weighting[$i];
-				
-				$item_list=explode('@@',$answer -> destination[$i]);
-				//echo '<pre>';	print_r($item_list);
-				
-				$try = $item_list[0];
-				$lp = $item_list[1];
-				$list_dest= $item_list[2];
-				$url=$item_list[3];
-				
-				if ($try==0)
-					$try_result=0;
-				else
-					$try_result=1;
-					
-				if ($url==0)					
-					$url_result='';
-				else
-					$url_result=$url;
-				
-				$temp_scenario['url'.$i]=$url_result;
-				$temp_scenario['try'.$i]=$try_result;			
-				$temp_scenario['lp'.$i]=$lp;
-				$temp_scenario['destination'.$i]=$list_dest;							
-								
-				
-				/*$pre_list_destination=explode(';',$list_dest);
-				$list_destination=array();						
-				foreach($pre_list_destination as $value)
-				{
-					$list_destination[]=$value;		
-				}
-				$defaults['destination'.$i]=$list_destination;
-				*/
-				//$defaults['destination'.$i] = $list_destination;		
-			}
-			else
-			{
-				$temp_scenario['destination'.$i] = array('0');
-				$temp_scenario['lp'.$i] = array('0');
-				//$defaults['scenario']
-			}			
-			$defaults['scenario']=$temp_scenario;	
-				
-			$renderer = & $form->defaultRenderer();			
-			$renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>');						
-			$answer_number=$form->addElement('text', null,null,'value="'.$i.'"');
-			$answer_number->freeze();
-			
-			$form->addElement('radio', 'correct', null, null, $i, 'class="checkbox" style="margin-left: 0em;"');
-			$form->addElement('html_editor', 'answer['.$i.']',null, 'style="vertical-align:middle"');
-			$form->addRule('answer['.$i.']', get_lang('ThisFieldIsRequired'), 'required');
-			
-			if ($obj_ex->selectFeedbackType()==0) // feedback
-				$form->addElement('html_editor', 'comment['.$i.']',null, 'style="vertical-align:middle"');
-			elseif ($obj_ex->selectFeedbackType()==1) // direct feedback
-			{								
-				$form->addElement('html_editor', 'comment['.$i.']',null, 'style="vertical-align:middle"');
-				//Adding extra feedback fields  
-				$group = array(); 				
-				$group['try'.$i] =&$form->createElement('checkbox', 'try'.$i,get_lang('TryAgain').': ' );								
-				$group['lp'.$i] =&$form->createElement('select', 'lp'.$i,get_lang('SeeTheory').': ',$select_lp_id);				
-				$group['destination'.$i]=&$form->createElement('select', 'destination'.$i, get_lang('GoToQuestion').': ' ,$select_question);								
-				$group['url'.$i] =&$form->createElement('text', 'url'.$i,get_lang('Other').': ',array('size'=>'25px'));
-															
-				$form -> addGroup($group, 'scenario', 'scenario');							
-				$renderer->setGroupElementTemplate('<div class="exercise_scenario_label">{label}</div><div class="exercise_scenario_element">{element}</div>','scenario');								
-			}
-			
-			//$form->addElement('select', 'destination'.$i, get_lang('SelectQuestion').' : ',$select_question,'multiple');
-						
-			$form->addElement('text', 'weighting['.$i.']',null, 'style="vertical-align:middle;margin-left: 0em;" size="5" value="0"');
-			$form -> addElement ('html', '</tr>');
-		}
-		
-		$form -> addElement ('html', '</table>');
-
-		$form->addElement('style_submit_button', 'lessAnswers', get_lang('LessAnswer'));
-		$form->addElement('style_submit_button', 'moreAnswers', get_lang('PlusAnswer'));
-		
-		$renderer->setElementTemplate('{element}&nbsp;','lessAnswers');
-		$renderer->setElementTemplate('{element}','moreAnswers');
-		
-		$form -> addElement ('html', '</div></div>');
-		
-		//We check the first radio button to be sure a radio button will be check 
-		if($correct==0){
-			$correct=1;
-		}
-		$defaults['correct'] = $correct;
-		$form -> setDefaults($defaults);
-
-		$form->setConstants(array('nb_answers' => $nb_answers));
-
-	}
-
-
-	/**
-	 * abstract function which creates the form to create / edit the answers of the question
-	 * @param the formvalidator instance
-	 * @param the answers number to display
-	 */
-	function processAnswersCreation($form) {
-
-		$questionWeighting = $nbrGoodAnswers = 0;		 
-		$correct = $form -> getSubmitValue('correct');
-		$objAnswer = new Answer($this->id);
-		$nb_answers = $form -> getSubmitValue('nb_answers');
-
-		for($i=1 ; $i <= $nb_answers ; $i++)
-        {
-        	$answer = trim($form -> getSubmitValue('answer['.$i.']'));
-            $comment = trim($form -> getSubmitValue('comment['.$i.']'));
-            $weighting = trim($form -> getSubmitValue('weighting['.$i.']'));
-            
-            $scenario= $form -> getSubmitValue('scenario');
-                    
-            echo '<pre>';
-           	//$list_destination = $form -> getSubmitValue('destination'.$i);
-           	//$destination_str = $form -> getSubmitValue('destination'.$i);
-           	 
- 		    $try = $scenario['try'.$i];
-            $lp= $scenario['lp'.$i];       
- 			$destination = $scenario['destination'.$i]; 		
- 			$url = trim($scenario['url'.$i]); 			
- 			 			
- 			/*
- 			How we are going to parse the destination value
- 			
-			here we parse the destination value which is a string 
-		 	1@@3@@2;4;4;@@http://www.dokeos.com
-		 	
-		 	where: try_again@@lp_id@@selected_questions@@url	
-		 		
-			try_again = is 1 || 0
-			lp_id = id of a learning path (0 if dont select)
-			selected_questions= ids of questions 
-			url= an url			
-			*/
-			/*	
- 			$destination_str='';
- 			foreach ($list_destination as $destination_id)
- 			{
- 				$destination_str.=$destination_id.';';
- 			}*/
- 		 	 
-        	$goodAnswer= ($correct == $i) ? true : false;
-
-        	if($goodAnswer)
-        	{
-        		$nbrGoodAnswers++;
-        		$weighting = abs($weighting); 
-        		if($weighting > 0)
-                {
-                    $questionWeighting += $weighting;
-                }
-        	}
-        	
- 			if (empty($try))
- 				$try=0;
- 				
- 			if (empty($lp))
- 			{
- 				$lp=0;
- 			}
- 			
- 			if (empty($destination))
- 			{
- 				$destination=0;
- 			}
- 			
- 			
- 			
- 			if ($url=='')
- 			{
- 				$url=0;
- 			}
- 			
- 			//1@@1;2;@@2;4;4;@@http://www.dokeos.com
-			$dest= $try.'@@'.$lp.'@@'.$destination.'@@'.$url;
-        	$objAnswer -> createAnswer($answer,$goodAnswer,$comment,$weighting,$i,NULL,NULL,$dest);
-        	
-        }
-        
-	
-    	// saves the answers into the data base
-        $objAnswer -> save();
-
-        // sets the total weighting of the question
-        $this -> updateWeighting($questionWeighting);
-        $this -> save();
- 
-	}
-}
-endif;
-?>
+<?php
+/*
+    DOKEOS - elearning and course management software
+
+    For a full list of contributors, see documentation/credits.html
+
+    This program 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 2
+    of the License, or (at your option) any later version.
+    See "documentation/licence.html" more details.
+
+    Contact:
+		Dokeos
+		Rue des Palais 44 Paleizenstraat
+		B-1030 Brussels - Belgium
+		Tel. +32 (2) 211 34 56
+*/
+
+
+/**
+*	File containing the UNIQUE_ANSWER class.
+*	@package dokeos.exercise
+* 	@author Eric Marguin
+* 	@version $Id: admin.php 10680 2007-01-11 21:26:23Z pcool $
+*/
+
+
+if(!class_exists('UniqueAnswer')):
+
+/**
+	CLASS UNIQUE_ANSWER
+ *
+ *	This class allows to instantiate an object of type UNIQUE_ANSWER (MULTIPLE CHOICE, UNIQUE ANSWER),
+ *	extending the class question
+ *
+ *	@author Eric Marguin
+ *  @author Julio Montoya 
+ *	@package dokeos.exercise
+ **/
+
+class UniqueAnswer extends Question {
+
+	static $typePicture = 'mcua.gif';
+	static $explanationLangVar = 'UniqueSelect';
+
+	/**
+	 * Constructor
+	 */
+	function UniqueAnswer(){
+		//this is highly important
+		parent::question();
+		$this -> type = UNIQUE_ANSWER;
+	}
+
+	/**
+	 * function which redifines Question::createAnswersForm
+	 * @param the formvalidator instance
+	 * @param the answers number to display
+	 */
+	function createAnswersForm ($form) {
+		// getting the exercise list	
+		$obj_ex =$_SESSION['objExercise'];
+		// multiple 
+		global $fck_attribute;
+
+		$fck_attribute = array();
+		$fck_attribute['Width'] = '50%';
+		$fck_attribute['Height'] = '125px';
+		
+		$fck_attribute['ToolbarSet'] = 'Answer';
+		$fck_attribute['Config']['IMUploadPath'] = 'upload/test/';
+		$fck_attribute['Config']['FlashUploadPath'] = 'upload/test/';
+		$fck_attribute['Config']['InDocument'] = false;		
+		$fck_attribute['Config']['CreateDocumentDir'] = '../../courses/'.api_get_course_path().'/document/';
+		// we collapse the fckeditor toolbar
+		$fck_attribute['Config']['ToolbarStartExpanded']='false';		
+		
+		//this line define how many question by default appear when creating a choice question
+		$nb_answers = isset($_POST['nb_answers']) ? (int) $_POST['nb_answers'] : 4;
+		$nb_answers += (isset($_POST['lessAnswers']) ? -1 : (isset($_POST['moreAnswers']) ? 1 : 0));
+		
+		/*
+	 		Types of Feedback
+	 		$feedback_option[0]=get_lang('Feedback');
+			$feedback_option[1]=get_lang('DirectFeedback');
+			$feedback_option[2]=get_lang('NoFeedback');
+	 	*/
+	 
+		$feedback_title='';
+		$comment_title='';
+		
+		if ($obj_ex->selectFeedbackType()==0) {
+			$comment_title = '<th>'.get_lang('Comment').'</th>';			
+		} elseif ($obj_ex->selectFeedbackType()==1) {						
+			$fck_attribute['Width'] = '250px';
+			$fck_attribute['Height'] = '110px';			
+			$comment_title = '<th width="'.$fck_attribute['Width'].'" >'.get_lang('Comment').'</th>';
+			$feedback_title = '<th width="300px" >'.get_lang('Scenario').'</th>';			
+		} 
+		
+		$html='
+		<div class="row">
+			<div class="label">
+			'.get_lang('Answers').'
+			</div>
+			<div class="formw">
+				<table class="data_table">
+					<tr style="text-align: center;">
+						<th width="14px">
+							'.get_lang('Number').'
+						</th>
+						<th width="10px" >
+							'.get_lang('True').'
+						</th>
+						<th width="'.$fck_attribute['Width'].' ">
+							'.get_lang('Answer').'
+						</th>
+							'.$comment_title.'	
+							'.$feedback_title.'							
+						<th width="20px">
+							'.get_lang('Weighting').'
+						</th>						
+					</tr>';
+					
+		$form -> addElement ('html', $html);
+
+		$defaults = array();
+		$correct = 0;
+		if(!empty($this -> id)) {
+			$answer = new Answer($this -> id);
+			$answer -> read();
+			if(count($answer->nbrAnswers)>0 && !$form->isSubmitted())
+			{
+				$nb_answers = $answer->nbrAnswers;
+			}
+		}
+		$form -> addElement('hidden', 'nb_answers');
+		
+		//Feedback SELECT
+		$question_list=$obj_ex->selectQuestionList();
+		$select_question=array();
+		$select_question[0]=get_lang('SelectTargetQuestion');
+		require_once('../newscorm/learnpathList.class.php');		
+		require_once(api_get_path(LIBRARY_PATH).'text.lib.php');
+		
+		
+		foreach ($question_list as $key=>$questionid) {				
+			$question = Question::read($questionid);			
+			$select_question[$questionid]='Q'.$key.' :'.cut($question->selectTitle(),20);						
+		}		
+		$select_question[-1]=get_lang('ExitTest');		
+			
+		//LP SELECT
+		require_once('../newscorm/learnpathList.class.php');
+		//require_once('../newscorm/learnpath.class.php');
+		//require_once('../newscorm/learnpathItem.class.php');
+
+		$list = new LearnpathList(api_get_user_id());
+		$flat_list = $list->get_flat_list();
+		$select_lp_id=array();		
+		$select_lp_id[0]=get_lang('SelectTargetLP');
+		
+		foreach ($flat_list as $id => $details)
+		{
+			$select_lp_id[$id] = cut($details['lp_name'],20);
+		}	
+			
+		$temp_scenario=array();		
+		for($i = 1 ; $i <= $nb_answers ; ++$i)
+		{
+			$form -> addElement ('html', '<tr>');
+			if(is_object($answer))
+			{
+				if($answer -> correct[$i])
+				{
+					$correct = $i;
+				}
+				
+				$defaults['answer['.$i.']'] = $answer -> answer[$i];
+				$defaults['comment['.$i.']'] = $answer -> comment[$i];
+				$defaults['weighting['.$i.']'] = $answer -> weighting[$i];
+				
+				$item_list=explode('@@',$answer -> destination[$i]);
+				//echo '<pre>';	print_r($item_list);
+				
+				$try = $item_list[0];
+				$lp = $item_list[1];
+				$list_dest= $item_list[2];
+				$url=$item_list[3];
+				
+				if ($try==0)
+					$try_result=0;
+				else
+					$try_result=1;
+					
+				if ($url==0)					
+					$url_result='';
+				else
+					$url_result=$url;
+				
+				$temp_scenario['url'.$i]=$url_result;
+				$temp_scenario['try'.$i]=$try_result;			
+				$temp_scenario['lp'.$i]=$lp;
+				$temp_scenario['destination'.$i]=$list_dest;							
+								
+				
+				/*$pre_list_destination=explode(';',$list_dest);
+				$list_destination=array();						
+				foreach($pre_list_destination as $value)
+				{
+					$list_destination[]=$value;		
+				}
+				$defaults['destination'.$i]=$list_destination;
+				*/
+				//$defaults['destination'.$i] = $list_destination;		
+			}
+			else
+			{
+				$temp_scenario['destination'.$i] = array('0');
+				$temp_scenario['lp'.$i] = array('0');
+				//$defaults['scenario']
+			}			
+			$defaults['scenario']=$temp_scenario;	
+				
+			$renderer = & $form->defaultRenderer();			
+			$renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>');						
+			$answer_number=$form->addElement('text', null,null,'value="'.$i.'"');
+			$answer_number->freeze();
+			
+			$form->addElement('radio', 'correct', null, null, $i, 'class="checkbox" style="margin-left: 0em;"');
+			$form->addElement('html_editor', 'answer['.$i.']',null, 'style="vertical-align:middle"');
+			$form->addRule('answer['.$i.']', get_lang('ThisFieldIsRequired'), 'required');
+			
+			if ($obj_ex->selectFeedbackType()==0) // feedback
+				$form->addElement('html_editor', 'comment['.$i.']',null, 'style="vertical-align:middle"');
+			elseif ($obj_ex->selectFeedbackType()==1) // direct feedback
+			{								
+				$form->addElement('html_editor', 'comment['.$i.']',null, 'style="vertical-align:middle"');
+				//Adding extra feedback fields  
+				$group = array(); 				
+				$group['try'.$i] =&$form->createElement('checkbox', 'try'.$i,get_lang('TryAgain').': ' );								
+				$group['lp'.$i] =&$form->createElement('select', 'lp'.$i,get_lang('SeeTheory').': ',$select_lp_id);				
+				$group['destination'.$i]=&$form->createElement('select', 'destination'.$i, get_lang('GoToQuestion').': ' ,$select_question);								
+				$group['url'.$i] =&$form->createElement('text', 'url'.$i,get_lang('Other').': ',array('size'=>'25px'));
+															
+				$form -> addGroup($group, 'scenario', 'scenario');							
+				$renderer->setGroupElementTemplate('<div class="exercise_scenario_label">{label}</div><div class="exercise_scenario_element">{element}</div>','scenario');								
+			}
+			
+			//$form->addElement('select', 'destination'.$i, get_lang('SelectQuestion').' : ',$select_question,'multiple');
+						
+			$form->addElement('text', 'weighting['.$i.']',null, 'style="vertical-align:middle;margin-left: 0em;" size="5" value="0"');
+			$form -> addElement ('html', '</tr>');
+		}
+		
+		$form -> addElement ('html', '</table>');
+
+		$form->addElement('style_submit_button', 'lessAnswers', get_lang('LessAnswer'));
+		$form->addElement('style_submit_button', 'moreAnswers', get_lang('PlusAnswer'));
+		
+		$renderer->setElementTemplate('{element}&nbsp;','lessAnswers');
+		$renderer->setElementTemplate('{element}','moreAnswers');
+		
+		$form -> addElement ('html', '</div></div>');
+		
+		//We check the first radio button to be sure a radio button will be check 
+		if($correct==0){
+			$correct=1;
+		}
+		$defaults['correct'] = $correct;
+		$form -> setDefaults($defaults);
+
+		$form->setConstants(array('nb_answers' => $nb_answers));
+
+	}
+
+
+	/**
+	 * abstract function which creates the form to create / edit the answers of the question
+	 * @param the formvalidator instance
+	 * @param the answers number to display
+	 */
+	function processAnswersCreation($form) {
+
+		$questionWeighting = $nbrGoodAnswers = 0;		 
+		$correct = $form -> getSubmitValue('correct');
+		$objAnswer = new Answer($this->id);
+		$nb_answers = $form -> getSubmitValue('nb_answers');
+
+		for($i=1 ; $i <= $nb_answers ; $i++)
+        {
+        	$answer = trim($form -> getSubmitValue('answer['.$i.']'));
+            $comment = trim($form -> getSubmitValue('comment['.$i.']'));
+            $weighting = trim($form -> getSubmitValue('weighting['.$i.']'));
+            
+            $scenario= $form -> getSubmitValue('scenario');
+                    
+            echo '<pre>';
+           	//$list_destination = $form -> getSubmitValue('destination'.$i);
+           	//$destination_str = $form -> getSubmitValue('destination'.$i);
+           	 
+ 		    $try = $scenario['try'.$i];
+            $lp= $scenario['lp'.$i];       
+ 			$destination = $scenario['destination'.$i]; 		
+ 			$url = trim($scenario['url'.$i]); 			
+ 			 			
+ 			/*
+ 			How we are going to parse the destination value
+ 			
+			here we parse the destination value which is a string 
+		 	1@@3@@2;4;4;@@http://www.dokeos.com
+		 	
+		 	where: try_again@@lp_id@@selected_questions@@url	
+		 		
+			try_again = is 1 || 0
+			lp_id = id of a learning path (0 if dont select)
+			selected_questions= ids of questions 
+			url= an url			
+			*/
+			/*	
+ 			$destination_str='';
+ 			foreach ($list_destination as $destination_id)
+ 			{
+ 				$destination_str.=$destination_id.';';
+ 			}*/
+ 		 	 
+        	$goodAnswer= ($correct == $i) ? true : false;
+
+        	if($goodAnswer)
+        	{
+        		$nbrGoodAnswers++;
+        		$weighting = abs($weighting); 
+        		if($weighting > 0)
+                {
+                    $questionWeighting += $weighting;
+                }
+        	}
+        	
+ 			if (empty($try))
+ 				$try=0;
+ 				
+ 			if (empty($lp))
+ 			{
+ 				$lp=0;
+ 			}
+ 			
+ 			if (empty($destination))
+ 			{
+ 				$destination=0;
+ 			}
+ 			
+ 			
+ 			
+ 			if ($url=='')
+ 			{
+ 				$url=0;
+ 			}
+ 			
+ 			//1@@1;2;@@2;4;4;@@http://www.dokeos.com
+			$dest= $try.'@@'.$lp.'@@'.$destination.'@@'.$url;
+        	$objAnswer -> createAnswer($answer,$goodAnswer,$comment,$weighting,$i,NULL,NULL,$dest);
+        	
+        }
+        
+	
+    	// saves the answers into the data base
+        $objAnswer -> save();
+
+        // sets the total weighting of the question
+        $this -> updateWeighting($questionWeighting);
+        $this -> save();
+ 
+	}
+}
+endif;
+?>

+ 41 - 27
main/inc/lib/fckeditor/myconfig.js

@@ -25,17 +25,8 @@
  * Editor's toolbar definitions.
  */
 
-FCKConfig.ToolbarSets["Question"] = [
-	['Source','DocProps','-','NewPage','Preview','-'],
-	['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
-	['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'],
-	['OrderedList','UnorderedList','-','Outdent','Indent'],
-	['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
-	['Link','Unlink','Anchor'],
-	['Image','Flash','MP3','Table','Rule','Smiley','SpecialChar','UniversalKey'],
-	['Form','Checkbox','Radio','TextField','Textarea','Select','Button','ImageButton','HiddenField'],
-	'/',
-	['Style','FontFormat','FontName','FontSize'],['Attachment']
+FCKConfig.ToolbarSets["Full"] = [
+	['FitWindow','PasteWord','Link','Unlink','Anchor','-','Image','flvPlayer','Flash','EmbedMovies','MP3','YouTube','Table','Rule','-','Subscript', 'Superscript','-','OrderedList','UnorderedList','Outdent','Indent','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],'/',['FontFormat','Style','FontName','FontSize','Bold','Italic','Underline','StrikeThrough','TextColor', 'BGColor','-','Source']
 ] ;
 
 FCKConfig.ToolbarSets["Middle"] = [
@@ -46,26 +37,10 @@ FCKConfig.ToolbarSets["Small"] = [
 	['Bold','Italic','Underline','StrikeThrough','Link','Unlink','Image','Flash','OrderedList','UnorderedList','Table']
 ] ;
 
-FCKConfig.ToolbarSets["Full"] = [
-	['FitWindow','PasteWord','Link','Unlink','Anchor','-','Image','flvPlayer','Flash','EmbedMovies','MP3','YouTube','Table','Rule','-','Subscript', 'Superscript','-','OrderedList','UnorderedList','Outdent','Indent','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],'/',['FontFormat','Style','FontName','FontSize','Bold','Italic','Underline','StrikeThrough','TextColor', 'BGColor','-','Source']
-] ;
-
 FCKConfig.ToolbarSets["Comment"] = [
 	['Bold','Italic','Underline','StrikeThrough']
 ] ;
 
-FCKConfig.ToolbarSets["NewTest"] = [
-	['Bold','Italic','Underline','StrikeThrough','Link','Unlink','Image','Flash','MP3','OrderedList','UnorderedList','Table','Source']
-] ;
-
-FCKConfig.ToolbarSets["TestComment"] = [
-	['FontName','FontSize','TextColor','BGColor'],['Bold','Italic','Underline','StrikeThrough','Subscript', 'Superscript','Link','Unlink','Image','Flash','MP3','OrderedList','UnorderedList','Table','Source']
-] ;
-
-FCKConfig.ToolbarSets["Test"] = [
-	['Bold','Italic','Underline','StrikeThrough','Subscript','Superscript','Link','Unlink','Image','MP3','OrderedList','UnorderedList','Table']
-] ;
-
 FCKConfig.ToolbarSets["Profil"] = [
 	['FitWindow','PasteWord','Undo','Redo'],
 	['Link','Image','imgmapPopup','flvPlayer','Flash','EmbedMovies','YouTube','Table','googlemaps'],
@@ -78,6 +53,7 @@ FCKConfig.ToolbarSets["Messages"] = [
 	['Bold','Italic','Underline','OrderedList','UnorderedList','TextColor','-','Source']
 ] ;
 
+//Course introduction
 FCKConfig.ToolbarSets["Introduction"] = [
 	['NewPage','Templates','Preview','FitWindow','-','PasteText','PasteWord','-','Undo','Redo','-','SelectAll','RemoveFormat','-','Find'],
 	['Link','Unlink','Anchor'],
@@ -89,6 +65,7 @@ FCKConfig.ToolbarSets["Introduction"] = [
 	['Source']
 ] ;
 
+//Agenda
 FCKConfig.ToolbarSets["Agenda"] = [
 	['FitWindow','-','PasteWord','-','Undo','Redo','RemoveFormat'],
 	['Link','Unlink'],
@@ -111,6 +88,7 @@ FCKConfig.ToolbarSets["Agenda_Student"] = [
 	['ShowBlocks']
 ] ;
 
+//Announcements
 FCKConfig.ToolbarSets["Announcements"] = [
 	['NewPage','Preview','FitWindow','-','PasteText','-','Undo','Redo','-','SelectAll','RemoveFormat'],
 	['Link','Unlink','Anchor'],
@@ -133,6 +111,7 @@ FCKConfig.ToolbarSets["Announcements_Student"] = [
 	['ShowBlocks']
 ] ;
 
+//Blog
 FCKConfig.ToolbarSets["Blog"] = [
 	['FitWindow','-','PasteWord','-','Undo','Redo','-','RemoveFormat'],
 	['Link','Unlink','Anchor'],
@@ -175,6 +154,7 @@ FCKConfig.ToolbarSets["BlogComment_Student"] = [
 	['ShowBlocks']
 ] ;
 
+//Course Description
 FCKConfig.ToolbarSets["CourseDescription"] = [
 	['NewPage','Templates','Save','PageBreak','Preview','FitWindow','-','PasteText','PasteWord','-','Undo','Redo','-','SelectAll','RemoveFormat','-','Find'],
 	['Link','Unlink','Anchor'],
@@ -186,6 +166,7 @@ FCKConfig.ToolbarSets["CourseDescription"] = [
 	['Source']
 ] ;
 
+//Documents
 FCKConfig.ToolbarSets["Documents"] = [
 	['NewPage','Templates','Save','PageBreak','Preview','FitWindow','-','PasteText','PasteWord','-','Undo','Redo','-','SelectAll','RemoveFormat','-','Find'],
 	['Link','Unlink','Anchor'],
@@ -208,6 +189,7 @@ FCKConfig.ToolbarSets["Documents_Student"] = [
 	['ShowBlocks']
 ] ;
 
+//Forum
 FCKConfig.ToolbarSets["ForumLight"] = [
 	['Bold','Italic','Underline','StrikeThrough']
 ] ;
@@ -234,6 +216,7 @@ FCKConfig.ToolbarSets["Forum_Student"] = [
 	['ShowBlocks']
 ] ;
 
+//Glossary
 FCKConfig.ToolbarSets["Glossary"] = [
 	['NewPage','Save','FitWindow','-','PasteText','PasteWord','-','Undo','Redo','-','SelectAll','RemoveFormat','-','Find'],
 	['Link','Unlink','Anchor'],
@@ -245,6 +228,7 @@ FCKConfig.ToolbarSets["Glossary"] = [
 	['Source']
 ] ;
 
+//Learning Path
 FCKConfig.ToolbarSets["LearnPath"] = [
 	['NewPage','Templates','PageBreak','Preview','-','PasteText','PasteWord','-','Undo','Redo','-','SelectAll','RemoveFormat','-','Find'],
 	['Link','Unlink','Anchor'],
@@ -256,6 +240,7 @@ FCKConfig.ToolbarSets["LearnPath"] = [
 	['Source']
 ] ;//save, FitWindow don't run well here
 
+//Notebook
 FCKConfig.ToolbarSets["Notebook"] = [
 	['NewPage','Save','FitWindow','-','PasteText','PasteWord','-','Undo','Redo','-','SelectAll','RemoveFormat','-','Find'],
 	['Link','Unlink','Anchor'],
@@ -278,6 +263,7 @@ FCKConfig.ToolbarSets["Notebook_Student"] = [
 	['ShowBlocks']
 ] ;
 
+//Survey
 FCKConfig.ToolbarSets["Survey"] = [
 	['FitWindow'],
 	['Link','Unlink'],
@@ -289,6 +275,34 @@ FCKConfig.ToolbarSets["Survey"] = [
 	['Source']
 ] ;
 
+//Test
+FCKConfig.ToolbarSets["TestDescription"] = [
+	['NewPage','Preview','FitWindow','-','PasteText','PasteWord','-','Undo','Redo','-','SelectAll','RemoveFormat'],
+	['Link','Unlink'],
+	['Image','imgmapPopup','flvPlayer','Flash','EmbedMovies','YouTube','MP3'],
+	['Table','Rule','Smiley','SpecialChar','googlemaps'],
+	['FontName','FontSize'],
+	['Bold','Italic','Underline'],
+	['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull','-','OrderedList','UnorderedList','-','Outdent','Indent','-','TextColor','BGColor'],
+	['Source']
+] ;
+
+FCKConfig.ToolbarSets["QuestionDescription"] = [
+	['NewPage','Preview','FitWindow','-','PasteText','PasteWord','-','Undo','Redo','-','SelectAll','RemoveFormat'],
+	['Link','Unlink'],
+	['Image','imgmapPopup','flvPlayer','Flash','EmbedMovies','YouTube','MP3'],
+	['Table','Rule','Smiley','SpecialChar','googlemaps'],
+	['FontName','FontSize'],
+	['Bold','Italic','Underline'],
+	['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull','-','OrderedList','UnorderedList','-','Outdent','Indent','-','TextColor','BGColor'],
+	['Source']
+] ;
+
+FCKConfig.ToolbarSets["Answer"] = [
+	['FitWindow','Link','Unlink','Image','flvPlayer','Table','Bold','Italic','TextColor','Source']
+] ;
+
+//Wiki
 FCKConfig.ToolbarSets["Wiki"] = [
 	['NewPage','Templates','Save','PageBreak','Preview','FitWindow','-','PasteText','PasteWord','-','Undo','Redo','-','SelectAll','RemoveFormat','-','Find'],
 	['Wikilink','Link','Unlink','Anchor'],