Adding copy_exercise function see BT#752 + cleaning some code, changing license text

skala
Julio Montoya 16 years ago
parent 590e50f11f
commit c124dc1456
  1. 20
      main/exercice/addlimits.php
  2. 94
      main/exercice/exercice.php
  3. 4
      main/exercice/exercise_admin.php
  4. 4
      main/exercice/exercise_show.php
  5. 22
      main/exercice/matching.class.php
  6. 26
      main/exercice/multiple_answer.class.php
  7. 23
      main/exercice/multiple_answer_combination.class.php
  8. 69
      main/exercice/question.class.php
  9. 26
      main/exercice/question_admin.inc.php
  10. 3
      main/exercice/question_create.php
  11. 36
      main/exercice/question_list_admin.inc.php
  12. 29
      main/exercice/question_pool.php
  13. 23
      main/exercice/unique_answer.class.php

@ -1,26 +1,10 @@
<?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
*/
/* For licensing terms, see /license.txt */
/**
* Adding limits
* @package dokeos.exercise
* @package chamilo.exercise
* @author
* @version $Id: admin.php 10680 2007-01-11 21:26:23Z pcool $
*/

@ -1,10 +1,10 @@
<?php
// $Id: exercice.php 22201 2009-07-17 19:57:03Z cfasanando $
/* For licensing terms, see /dokeos_license.txt */
/* For licensing terms, see /license.txt */
/**
* Exercise list: This script shows the list of exercises for administrators and students.
* @package dokeos.exercise
* @package chamilo.exercise
* @author Olivier Brouckaert, original author
* @author Denes Nagy, HotPotatoes integration
* @author Wolfgang Schneider, code/html cleanup
@ -41,24 +41,24 @@ require_once api_get_path(LIBRARY_PATH) . 'usermanager.lib.php';
Constants and variables
-----------------------------------------------------------
*/
$is_allowedToEdit = api_is_allowed_to_edit(null,true);
$is_tutor = api_is_allowed_to_edit(true);
$is_tutor_course = api_is_course_tutor();
$tbl_course_rel_user = Database :: get_main_table(TABLE_MAIN_COURSE_USER);
$TBL_USER = Database :: get_main_table(TABLE_MAIN_USER);
$TBL_DOCUMENT = Database :: get_course_table(TABLE_DOCUMENT);
$TBL_ITEM_PROPERTY = Database :: get_course_table(TABLE_ITEM_PROPERTY);
$TBL_EXERCICE_ANSWER = Database :: get_course_table(TABLE_QUIZ_ANSWER);
$TBL_EXERCICE_QUESTION = Database :: get_course_table(TABLE_QUIZ_TEST_QUESTION);
$TBL_EXERCICES = Database :: get_course_table(TABLE_QUIZ_TEST);
$TBL_QUESTIONS = Database :: get_course_table(TABLE_QUIZ_QUESTION);
$TBL_TRACK_EXERCICES = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCICES);
$TBL_TRACK_HOTPOTATOES = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_HOTPOTATOES);
$TBL_TRACK_ATTEMPT = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_ATTEMPT);
$TBL_TRACK_ATTEMPT_RECORDING = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_ATTEMPT_RECORDING);
$TBL_LP_ITEM_VIEW = Database :: get_course_table(TABLE_LP_ITEM_VIEW);
$TBL_LP_ITEM = Database :: get_course_table(TABLE_LP_ITEM);
$TBL_LP_VIEW = Database :: get_course_table(TABLE_LP_VIEW);
$is_allowedToEdit = api_is_allowed_to_edit(null,true);
$is_tutor = api_is_allowed_to_edit(true);
$is_tutor_course = api_is_course_tutor();
$tbl_course_rel_user = Database :: get_main_table(TABLE_MAIN_COURSE_USER);
$TBL_USER = Database :: get_main_table(TABLE_MAIN_USER);
$TBL_DOCUMENT = Database :: get_course_table(TABLE_DOCUMENT);
$TBL_ITEM_PROPERTY = Database :: get_course_table(TABLE_ITEM_PROPERTY);
$TBL_EXERCICE_ANSWER = Database :: get_course_table(TABLE_QUIZ_ANSWER);
$TBL_EXERCICE_QUESTION = Database :: get_course_table(TABLE_QUIZ_TEST_QUESTION);
$TBL_EXERCICES = Database :: get_course_table(TABLE_QUIZ_TEST);
$TBL_QUESTIONS = Database :: get_course_table(TABLE_QUIZ_QUESTION);
$TBL_TRACK_EXERCICES = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCICES);
$TBL_TRACK_HOTPOTATOES = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_HOTPOTATOES);
$TBL_TRACK_ATTEMPT = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_ATTEMPT);
$TBL_TRACK_ATTEMPT_RECORDING= Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_ATTEMPT_RECORDING);
$TBL_LP_ITEM_VIEW = Database :: get_course_table(TABLE_LP_ITEM_VIEW);
$TBL_LP_ITEM = Database :: get_course_table(TABLE_LP_ITEM);
$TBL_LP_VIEW = Database :: get_course_table(TABLE_LP_VIEW);
// document path
$documentPath = api_get_path(SYS_COURSE_PATH) . $_course['path'] . "/document";
@ -95,6 +95,7 @@ if (isset ($_SESSION['exerciseResult'])) {
api_session_unregister('exerciseResult');
}
//general POST/GET/SESSION/COOKIES parameters recovery
if (empty ($origin)) {
$origin = Security::remove_XSS($_REQUEST['origin']);
@ -563,6 +564,15 @@ if ($is_allowedToEdit) {
$objExerciseTmp->save();
Display :: display_confirmation_message(get_lang('ResultsEnabled'));
break;
case 'clean_results' : //clean student results
$quantity_results_deleted= $objExerciseTmp->clean_results();
Display :: display_confirmation_message(sprintf(get_lang('XResultsCleaned'),$quantity_results_deleted));
break;
case 'copy_exercise' : //copy an exercise
$objExerciseTmp->copy_exercise();
Display :: display_confirmation_message(get_lang('ExerciseCopied'));
break;
}
}
@ -872,7 +882,9 @@ if ($show == 'test') {
<td width="30" align="left"><?php Display::display_icon('quiz.gif', get_lang('Exercice'))?></td>
<td width="15" valign="left"><?php echo ($i+($page*$limitExPage)).'.'; ?></td>
<?php $row['title']=api_parse_tex($row['title']); ?>
<td><a href="exercice_submit.php?<?php echo api_get_cidreq().$myorigin.$mylpid.$mylpitemid; ?>&amp;exerciseId=<?php echo $row['id']; ?>" <?php if(!$row['active']) echo 'class="invisible"'; ?>><?php echo $row['title']; ?></a><?php echo $session_img; ?></td>
<td>
<a href="exercice_submit.php?<?php echo api_get_cidreq().$myorigin.$mylpid.$mylpitemid; ?>&amp;exerciseId=<?php echo $row['id']; ?>" <?php if(!$row['active']) echo 'class="invisible"'; ?>><?php echo $row['title']; ?></a><?php echo $session_img; ?>
</td>
<td align="center"> <?php
$exid = $row['id'];
@ -895,6 +907,10 @@ if ($show == 'test') {
?>
<td>
<a href="admin.php?<?php echo api_get_cidreq()?>&amp;exerciseId=<?php echo $row['id']; ?>"><img src="../img/wizard_small.gif" border="0" title="<?php echo api_htmlentities(get_lang('Edit'),ENT_QUOTES,$charset); ?>" alt="<?php echo api_htmlentities(get_lang('Edit'),ENT_QUOTES,$charset); ?>" /></a>
<a href="exercice.php?<?php echo api_get_cidreq()?>&amp;choice=copy_exercise&amp;exerciseId=<?php echo $row['id']; ?>"><img width="16" src="../img/cd.gif" border="0" title="<?php echo api_htmlentities(get_lang('CopyExercise'),ENT_QUOTES,$charset); ?>" alt="<?php echo api_htmlentities(get_lang('CopyExercise'),ENT_QUOTES,$charset); ?>" /></a>
<a href="exercice.php?<?php echo api_get_cidreq()?>&amp;choice=clean_results&amp;exerciseId=<?php echo $row['id']; ?>"><img width="16" src="../img/clean_group.gif" border="0" title="<?php echo api_htmlentities(get_lang('CleanStudentResults'),ENT_QUOTES,$charset); ?>" alt="<?php echo api_htmlentities(get_lang('CleanStudentResults'),ENT_QUOTES,$charset); ?>" /></a>
<?php
if ($row['results_disabled']) {
@ -1342,28 +1358,24 @@ if ($_configuration['tracking_enabled'] && ($show == 'result')) {
}
}
////////////////////////////////////////////////////////////////////////////////
//Code added by Isaac flores
$parameters=array('cidReq'=>Security::remove_XSS($_GET['cidReq']),'show'=>Security::remove_XSS($_GET['show']),'filter' => Security::remove_XSS($_GET['filter']),'gradebook' =>Security::remove_XSS($_GET['gradebook']));
$parameters=array('cidReq'=>Security::remove_XSS($_GET['cidReq']),'show'=>Security::remove_XSS($_GET['show']),'filter' => Security::remove_XSS($_GET['filter']),'gradebook' =>Security::remove_XSS($_GET['gradebook']));
$table = new SortableTableFromArrayConfig($list_info, 1,20,'quiz_table');
$table->set_additional_parameters($parameters);
if ($is_allowedToEdit || $is_tutor) {
$table->set_header(0, get_lang('User'));
$secuence = 0;
} else {
$secuence = 1;
}
$table->set_header(-$secuence + 1, get_lang('Exercice'));
$table->set_header(-$secuence + 2, get_lang('Duration'),false);
$table->set_header(-$secuence + 3, get_lang('Date'));
$table->set_header(-$secuence + 4, get_lang('Result'),false);
$table->set_header(-$secuence + 5, (($is_allowedToEdit||$is_tutor) ? get_lang("CorrectTest") : get_lang("ViewTest")), false);
$table->display();
$table = new SortableTableFromArrayConfig($list_info, 1,20,'quiz_table');
$table->set_additional_parameters($parameters);
if ($is_allowedToEdit || $is_tutor) {
$table->set_header(0, get_lang('User'));
$secuence = 0;
} else {
$secuence = 1;
}
$table->set_header(-$secuence + 1, get_lang('Exercice'));
$table->set_header(-$secuence + 2, get_lang('Duration'),false);
$table->set_header(-$secuence + 3, get_lang('Date'));
$table->set_header(-$secuence + 4, get_lang('Result'),false);
$table->set_header(-$secuence + 5, (($is_allowedToEdit||$is_tutor) ? get_lang("CorrectTest") : get_lang("ViewTest")), false);
$table->display();
//////////////////////////////////////////////////////////////////////////////////
} else {
$NoTestRes = 1;
}

@ -1,10 +1,10 @@
<?php
/* For licensing terms, see /dokeos_license.txt */
/* For licensing terms, see /license.txt */
/**
* Exercise administration
* This script allows to manage an exercise. It is included from the script admin.php
* @package dokeos.exercise
* @package chamilo.exercise
* @author Olivier Brouckaert
* @version $Id$
*/

@ -1,8 +1,8 @@
<?php //$id: $
/* For licensing terms, see /chamilo_license.txt */
/* For licensing terms, see /license.txt */
/**
*
* @package dokeos.exercise
* @package chamilo.exercise
* @author Julio Montoya Armas Added switchable fill in blank option added
* @version $Id: exercise_show.php 22256 2009-07-20 17:40:20Z ivantcholakov $
*

@ -1,26 +1,10 @@
<?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
*/
/* For licensing terms, see /license.txt */
/**
* File containing the Matching class.
* @package dokeos.exercise
* @package chamilo.exercise
* @author Eric Marguin
* @version $Id: admin.php 10680 2007-01-11 21:26:23Z pcool $
*/
@ -162,7 +146,7 @@ class Matching extends Question {
$form -> addElement ('html', '</table></div></div>');
$group = array();
if ($navigator_info['name']=='Internet Explorer' && $navigator_info['version']=='6') {
$group[] = FormValidator :: createElement ('submit', 'lessMatches', get_lang('DelElem'),'class="minus"');
$group[] = FormValidator :: createElement ('submit', 'moreMatches', get_lang('AddElem'),'class="plus"');

@ -137,19 +137,21 @@ class MultipleAnswer extends Question {
$navigator_info = api_get_navigator();
global $text, $class;
//ie6 fix
if ($navigator_info['name']=='Internet Explorer' && $navigator_info['version']=='6') {
$form->addElement('submit', 'lessAnswers', get_lang('LessAnswer'),'class="minus"');
$form->addElement('submit', 'moreAnswers', get_lang('PlusAnswer'),'class="plus"');
$form->addElement('submit','submitQuestion',$text, 'class="'.$class.'"');
} else {
$form->addElement('style_submit_button', 'lessAnswers', get_lang('LessAnswer'),'class="minus"');
$form->addElement('style_submit_button', 'moreAnswers', get_lang('PlusAnswer'),'class="plus"');
// setting the save button here and not in the question class.php
$form->addElement('style_submit_button','submitQuestion',$text, 'class="'.$class.'"');
global $text, $class, $show_quiz_edition;
if ($show_quiz_edition) {
//ie6 fix
if ($navigator_info['name']=='Internet Explorer' && $navigator_info['version']=='6') {
$form->addElement('submit', 'lessAnswers', get_lang('LessAnswer'),'class="minus"');
$form->addElement('submit', 'moreAnswers', get_lang('PlusAnswer'),'class="plus"');
$form->addElement('submit','submitQuestion',$text, 'class="'.$class.'"');
} else {
$form->addElement('style_submit_button', 'lessAnswers', get_lang('LessAnswer'),'class="minus"');
$form->addElement('style_submit_button', 'moreAnswers', get_lang('PlusAnswer'),'class="plus"');
// setting the save button here and not in the question class.php
$form->addElement('style_submit_button','submitQuestion',$text, 'class="'.$class.'"');
}
}
$renderer->setElementTemplate('{element}&nbsp;','lessAnswers');
$renderer->setElementTemplate('{element}&nbsp;','submitQuestion');
$renderer->setElementTemplate('{element}','moreAnswers');

@ -144,19 +144,20 @@ class MultipleAnswerCombination extends Question {
$form -> addElement ('html', '<br /><br />');
$navigator_info = api_get_navigator();
global $text, $class;
global $text, $class, $show_quiz_edition;
//ie6 fix
if ($navigator_info['name']=='Internet Explorer' && $navigator_info['version']=='6') {
$form->addElement('submit', 'lessAnswers', get_lang('LessAnswer'),'class="minus"');
$form->addElement('submit', 'moreAnswers', get_lang('PlusAnswer'),'class="plus"');
$form->addElement('submit','submitQuestion',$text, 'class="'.$class.'"');
} else {
$form->addElement('style_submit_button', 'lessAnswers', get_lang('LessAnswer'),'class="minus"');
$form->addElement('style_submit_button', 'moreAnswers', get_lang('PlusAnswer'),'class="plus"');
// setting the save button here and not in the question class.php
$form->addElement('style_submit_button','submitQuestion',$text, 'class="'.$class.'"');
if ($show_quiz_edition) {
if ($navigator_info['name']=='Internet Explorer' && $navigator_info['version']=='6') {
$form->addElement('submit', 'lessAnswers', get_lang('LessAnswer'),'class="minus"');
$form->addElement('submit', 'moreAnswers', get_lang('PlusAnswer'),'class="plus"');
$form->addElement('submit','submitQuestion',$text, 'class="'.$class.'"');
} else {
$form->addElement('style_submit_button', 'lessAnswers', get_lang('LessAnswer'),'class="minus"');
$form->addElement('style_submit_button', 'moreAnswers', get_lang('PlusAnswer'),'class="plus"');
// setting the save button here and not in the question class.php
$form->addElement('style_submit_button','submitQuestion',$text, 'class="'.$class.'"');
}
}
$renderer->setElementTemplate('{element}&nbsp;','lessAnswers');
$renderer->setElementTemplate('{element}&nbsp;','submitQuestion');
$renderer->setElementTemplate('{element}','moreAnswers');

@ -47,13 +47,13 @@ abstract class Question
static $typePicture = 'new_question.png';
static $explanationLangVar = '';
static $questionTypes = array(
UNIQUE_ANSWER => array('unique_answer.class.php' , 'UniqueAnswer'),
MULTIPLE_ANSWER => array('multiple_answer.class.php' , 'MultipleAnswer'),
FILL_IN_BLANKS => array('fill_blanks.class.php' , 'FillBlanks'),
MATCHING => array('matching.class.php' , 'Matching'),
FREE_ANSWER => array('freeanswer.class.php' , 'FreeAnswer'),
HOT_SPOT => array('hotspot.class.php' , 'HotSpot'),
MULTIPLE_ANSWER_COMBINATION => array('multiple_answer_combination.class.php' , 'MultipleAnswerCombination'),
UNIQUE_ANSWER => array('unique_answer.class.php' , 'UniqueAnswer'),
MULTIPLE_ANSWER => array('multiple_answer.class.php' , 'MultipleAnswer'),
FILL_IN_BLANKS => array('fill_blanks.class.php' , 'FillBlanks'),
MATCHING => array('matching.class.php' , 'Matching'),
FREE_ANSWER => array('freeanswer.class.php' , 'FreeAnswer'),
HOT_SPOT => array('hotspot.class.php' , 'HotSpot'),
MULTIPLE_ANSWER_COMBINATION => array('multiple_answer_combination.class.php' , 'MultipleAnswerCombination'),
);
/**
@ -61,8 +61,7 @@ abstract class Question
*
* @author - Olivier Brouckaert
*/
function Question()
{
function Question() {
$this->id=0;
$this->question='';
$this->description='';
@ -1083,29 +1082,57 @@ abstract class Question
//2. but if it is a feedback DIRECT we only show the UNIQUE_ANSWER type that is currently available
$question_type_custom_list = array ( UNIQUE_ANSWER => self::$questionTypes[UNIQUE_ANSWER]);
}
//blocking edition
$show_quiz_edition = true;
if (isset($exerciseId) && !empty($exerciseId)) {
$TBL_LP_ITEM = Database::get_course_table(TABLE_LP_ITEM);
$sql="SELECT max_score FROM $TBL_LP_ITEM
WHERE item_type = '".TOOL_QUIZ."' AND path ='".Database::escape_string($exerciseId)."'";
$result = Database::query($sql);
if (Database::num_rows($result) > 0) {
$show_quiz_edition = false;
}
}
echo '<ul class="question_menu">';
foreach ($question_type_custom_list as $i=>$a_type) {
// include the class of the type
include_once($a_type[0]);
// get the picture of the type and the langvar which describes it
require_once($a_type[0]);
// get the picture of the type and the langvar which describes it
eval('$img = '.$a_type[1].'::$typePicture;');
eval('$explanation = get_lang('.$a_type[1].'::$explanationLangVar);');
echo '<li>';
echo '<div class="icon_image_content">';
echo '<a href="admin.php?'.api_get_cidreq().'&newQuestion=yes&answerType='.$i.'">'.Display::return_icon($img, $explanation).'</a>';
echo '<br>';
echo '<a href="admin.php?'.api_get_cidreq().'&newQuestion=yes&answerType='.$i.'">'.$explanation.'</a>';
if ($show_quiz_edition) {
echo '<a href="admin.php?'.api_get_cidreq().'&newQuestion=yes&answerType='.$i.'">'.Display::return_icon($img, $explanation).'</a>';
echo '<br>';
echo '<a href="admin.php?'.api_get_cidreq().'&newQuestion=yes&answerType='.$i.'">'.$explanation.'</a>';
} else {
$img = pathinfo($img);
$img = $img['filename'];
echo ''.Display::return_icon($img.'_na.gif',$explanation).'';
echo '<br>';
echo ''.$explanation.'';
}
echo '</div>';
echo '</li>';
}
echo '<li>';
echo '<div class="icon_image_content">';
if ($feedbacktype==1) {
echo $url = '<a href="question_pool.php?'.api_get_cidreq().'&type=1&fromExercise='.$exerciseId.'">';
if ($show_quiz_edition) {
if ($feedbacktype==1) {
echo $url = '<a href="question_pool.php?'.api_get_cidreq().'&type=1&fromExercise='.$exerciseId.'">';
} else {
echo $url = '<a href="question_pool.php?'.api_get_cidreq().'&fromExercise='.$exerciseId.'">';
}
echo Display::return_icon('database.png', get_lang('GetExistingQuestion'), '');
} else {
echo $url = '<a href="question_pool.php?'.api_get_cidreq().'&fromExercise='.$exerciseId.'">';
echo Display::return_icon('database_na.png', get_lang('GetExistingQuestion'), '');
}
echo Display::return_icon('database.png', get_lang('GetExistingQuestion'), '');
echo '<br>';
echo $url;
echo get_lang('GetExistingQuestion');
@ -1118,6 +1145,12 @@ abstract class Question
{
return self::$questionTypes;
}
static function updateId()
{
return self::$questionTypes;
}
}
endif;
?>

@ -1,5 +1,5 @@
<?php
/* For licensing terms, see /chamilo_license.txt */
/* For licensing terms, see /license.txt */
/**
* Statement (?) administration
@ -16,8 +16,8 @@
==============================================================================
*/
include_once(api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php');
include_once(api_get_path(LIBRARY_PATH).'image.lib.php');
require_once api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php';
require_once api_get_path(LIBRARY_PATH).'image.lib.php';
// ALLOWED_TO_INCLUDE is defined in admin.php
if(!defined('ALLOWED_TO_INCLUDE')) {
@ -28,18 +28,18 @@ if(!defined('ALLOWED_TO_INCLUDE')) {
/*********************
* INIT QUESTION
*********************/
if(isset($_GET['editQuestion'])) {
$objQuestion = Question::read ($_GET['editQuestion']);
$action = api_get_self()."?".api_get_cidreq()."&modifyQuestion=".$modifyQuestion."&editQuestion=".$objQuestion->id;
if (isset($exerciseId) && !empty($exerciseId)) {
$TBL_LP_ITEM = Database::get_course_table(TABLE_LP_ITEM);
$sql="SELECT max_score FROM $TBL_LP_ITEM
WHERE item_type = '".TOOL_QUIZ."' AND path ='".Database::escape_string($exerciseId)."'";
$result = Database::query($sql);
if (Database::num_rows($result) > 0) {
Display::display_warning_message(get_lang('EditingScoreCauseProblemsToExercisesInLP'));
//Display::display_warning_message(get_lang('EditingScoreCauseProblemsToExercisesInLP'));
}
}
@ -94,10 +94,15 @@ if(is_object($objQuestion)) {
// question form elements
$objQuestion -> createForm ($form,array('Height'=>150));
// answer form elements
$objQuestion -> createAnswersForm ($form);
// this variable $show_quiz_edition comes from admin.php blocks the exercise/quiz modifications
if ($show_quiz_edition == false) {
$form->freeze();
}
// submit button is implemented in every question type
//$form->addElement('style_submit_button','submitQuestion',$text, 'class="'.$class.'"');
@ -108,8 +113,7 @@ if(is_object($objQuestion)) {
/**********************
* FORM VALIDATION
**********************/
if(isset($_POST['submitQuestion']) && $form->validate())
{
if(isset($_POST['submitQuestion']) && $form->validate()) {
// question
$objQuestion -> processCreation($form,$objExercise);
@ -123,9 +127,7 @@ if(is_object($objQuestion)) {
echo '<script type="text/javascript">window.location.href="admin.php"</script>';
else
echo '<script type="text/javascript">window.location.href="admin.php?hotspotadmin='.$objQuestion->id.'"</script>';
}
else
{
} else {
/******************
* FORM DISPLAY

@ -145,8 +145,7 @@ $pictures_question_types[5] = 'open_answer.gif';
$pictures_question_types[6] = 'hotspot.gif';
$pictures_question_types[9] = 'mcmac.gif';
foreach (Question::$questionTypes as $key=>$value)
{
foreach (Question::$questionTypes as $key=>$value) {
?>
ddlObj1.addItem('<table width="100%"><tr><td style="width: 37px;" valign="top"><?php Display::display_icon($pictures_question_types[$key],addslashes(get_lang($value[1])),array('height'=>'40px;', 'style' => 'vertical-align:top; cursor:hand;')); ?></td><td><span class="thistext" style="cursor:hand"><?php echo addslashes(get_lang($value[1])); ?></span><br/><sub><?php /*echo addslashes(get_lang($value[1].'Comment'));*/ ?></sub></td></tr></table>','');
<?php

@ -1,28 +1,5 @@
<?php // $Id: question_list_admin.inc.php 20810 2009-05-18 21:16:22Z cfasanando $
/*
==============================================================================
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
==============================================================================
*/
/* For licensing terms, see /license.txt */
/**
* Code library for HotPotatoes integration.
@ -114,9 +91,16 @@ if($nbrQuestions) {
<td><?php eval('echo get_lang('.get_class($objQuestionTmp).'::$explanationLangVar);'); ?></td>
<td align="center"><?php echo $objQuestionTmp->selectLevel(); ?></td>
<td>
<a href="<?php echo api_get_self(); ?>?<?php echo api_get_cidreq() ?>&myid=1&editQuestion=<?php echo $id; ?>"><img src="../img/edit.gif" border="0" alt="<?php echo get_lang('Modify'); ?>" /></a>
<a href="<?php echo api_get_self(); ?>?<?php echo api_get_cidreq() ?>&myid=1&editQuestion=<?php echo $id; ?>"><img src="../img/edit.gif" border="0" alt="<?php echo get_lang('Modify'); ?>" /></a>
<?php
// this variable $show_quiz_edition comes from admin.php blocks the exercise/quiz modifications
if ($show_quiz_edition) { ?>
<a href="<?php echo api_get_self(); ?>?<?php echo api_get_cidreq() ?>&amp;deleteQuestion=<?php echo $id; ?>" onclick="javascript:if(!confirm('<?php echo addslashes(api_htmlentities(get_lang('ConfirmYourChoice'))); ?>')) return false;"><img src="../img/delete.gif" border="0" alt="<?php echo get_lang('Delete'); ?>" /></a>
<?php if($i != 1) { ?>
<?php
}
if($i != 1) { ?>
<a href="<?php echo api_get_self(); ?>?<?php echo api_get_cidreq() ?>&moveUp=<?php echo $id; ?>"><img src="../img/up.gif" border="0" alt="<?php echo get_lang('MoveUp'); ?>"></a>
<?php if($i == $nbrQuestions) {
echo '<img src="../img/down_na.gif">';

@ -1,34 +1,11 @@
<?php // $Id: question_pool.php 20451 2009-05-10 12:02:22Z ivantcholakov $
/*
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2004-2009 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
==============================================================================
*/
<?php
/* For licensing terms, see /license.txt */
/**
* Question Pool
* This script allows administrators to manage questions and add them into their exercises.
* One question can be in several exercises
* @package dokeos.exercise
* @package chamilo.exercise
* @author Olivier Brouckaert
* @version $Id: question_pool.php 20451 2009-05-10 12:02:22Z ivantcholakov $
*/

@ -258,19 +258,20 @@ class UniqueAnswer extends Question {
$form -> addElement ('html', '<br />');
$navigator_info = api_get_navigator();
global $text, $class;
global $text, $class, $show_quiz_edition;
//ie6 fix
if ($navigator_info['name']=='Internet Explorer' && $navigator_info['version']=='6') {
$form->addElement('submit', 'lessAnswers', get_lang('LessAnswer'),'class="minus"');
$form->addElement('submit', 'moreAnswers', get_lang('PlusAnswer'),'class="plus"');
$form->addElement('submit','submitQuestion',$text, 'class="'.$class.'"');
} else {
$form->addElement('style_submit_button', 'lessAnswers', get_lang('LessAnswer'),'class="minus"');
$form->addElement('style_submit_button', 'moreAnswers', get_lang('PlusAnswer'),'class="plus"');
// setting the save button here and not in the question class.php
$form->addElement('style_submit_button','submitQuestion',$text, 'class="'.$class.'"');
if ($show_quiz_edition) {
if ($navigator_info['name']=='Internet Explorer' && $navigator_info['version']=='6') {
$form->addElement('submit', 'lessAnswers', get_lang('LessAnswer'),'class="minus"');
$form->addElement('submit', 'moreAnswers', get_lang('PlusAnswer'),'class="plus"');
$form->addElement('submit','submitQuestion',$text, 'class="'.$class.'"');
} else {
$form->addElement('style_submit_button', 'lessAnswers', get_lang('LessAnswer'),'class="minus"');
$form->addElement('style_submit_button', 'moreAnswers', get_lang('PlusAnswer'),'class="plus"');
// setting the save button here and not in the question class.php
$form->addElement('style_submit_button','submitQuestion',$text, 'class="'.$class.'"');
}
}
$renderer->setElementTemplate('{element}','submitQuestion');
$renderer->setElementTemplate('{element}&nbsp;','lessAnswers');
$renderer->setElementTemplate('{element}','moreAnswers');

Loading…
Cancel
Save