[svn r18002] Adding some UI improvements - see FS#3515

skala
Julio Montoya 17 years ago
parent 2b64e71d77
commit 99d8694744
  1. 2
      main/css/academica/default.css
  2. 2
      main/css/baby_orange/default.css
  3. 2
      main/css/corporate/default.css
  4. 2
      main/css/cosmic_campus/default.css
  5. 2
      main/css/dokeos_classic/default.css
  6. 2
      main/css/dokeos_classic_2D/default.css
  7. 2
      main/css/medical/default.css
  8. 2
      main/css/public_admin/default.css
  9. 2
      main/css/silver_line/default.css
  10. 2
      main/css/sober_brown/default.css
  11. 17
      main/exercice/exercice_submit.php
  12. 61
      main/exercice/exercise.class.php
  13. 75
      main/exercice/exercise.lib.php
  14. 90
      main/exercice/exercise_admin.php
  15. 8
      main/exercice/question.class.php
  16. 29
      main/exercice/question_admin.inc.php
  17. 6
      main/exercice/question_list_admin.inc.php
  18. 8
      main/exercice/question_pool.php

@ -1455,7 +1455,7 @@ span.radio {
float: left;
}
#question_title{
display:none;
}
#exercise_close_link{
background: url(images/close.gif) no-repeat;

@ -1456,7 +1456,7 @@ span.radio {
float: left;
}
#question_title{
display:none;
}
#exercise_close_link{
background: url(images/close.gif) no-repeat;

@ -1463,7 +1463,7 @@ span.radio {
float: left;
}
#question_title{
display:none;
}
#exercise_close_link{
background: url(images/close.gif) no-repeat;

@ -1489,7 +1489,7 @@ span.radio {
float: left;
}
#question_title{
display:none;
}
#exercise_close_link{
background: url(images/close.gif) no-repeat;

@ -1982,7 +1982,7 @@ span.radio {
float: left;
}
#question_title{
display:none;
}
#exercise_close_link{
background: url(images/close.gif) no-repeat;

@ -2567,7 +2567,7 @@ span.radio {
float: left;
}
#question_title{
display:none;
}
#exercise_close_link{
background: url(images/close.gif) no-repeat;

@ -1966,7 +1966,7 @@ span.radio {
float: left;
}
#question_title{
display:none;
}
#exercise_close_link{
background: url(images/close.gif) no-repeat;

@ -2000,7 +2000,7 @@ span.radio {
float: left;
}
#question_title{
display:none;
}
#exercise_close_link{
background: url(images/close.gif) no-repeat;

@ -2069,7 +2069,7 @@ span.radio {
float: left;
}
#question_title{
display:none;
}
#exercise_close_link{
background: url(images/close.gif) no-repeat;

@ -2034,7 +2034,7 @@ span.radio {
float: left;
}
#question_title{
display:none;
}
#exercise_close_link{
background: url(images/close.gif) no-repeat;

@ -1,4 +1,4 @@
<?php // $Id: exercice_submit.php 17972 2009-01-23 20:11:22Z juliomontoya $
<?php // $Id: exercice_submit.php 18002 2009-01-26 16:33:20Z juliomontoya $
/*
==============================================================================
@ -42,7 +42,7 @@
* @package dokeos.exercise
* @author Olivier Brouckaert
* @author Julio Montoya multiple fill in blank option added
* @version $Id: exercice_submit.php 17972 2009-01-23 20:11:22Z juliomontoya $
* @version $Id: exercice_submit.php 18002 2009-01-26 16:33:20Z juliomontoya $
*/
@ -1286,17 +1286,8 @@ else
".get_lang('Question')." ";
*/
$s="<div id=\"question_title\" class=\"sectiontitle\">
".get_lang('Question').' ';
$s.=$i;
if($exerciseType == 2)
$s.=' / '.$nbrQuestions;
echo $s;
echo ': ';
// shows the question and its answers
showQuestion($questionId, false, $origin);
showQuestion($questionId, false, $origin,$i,$nbrQuestions);
// for sequential exercises
if($exerciseType == 2) {
// quits the loop
@ -1307,7 +1298,7 @@ else
echo "
<!-- <input type='submit' name='buttonCancel' value=".get_lang('Cancel')." />
&nbsp;&nbsp; //-->";
&nbsp;&nbsp; //--><br />";
$submit_btn="<input type='submit' name='submit' value='";
// $submit_btn.=get_lang('ValidateAnswer');
if ($objExercise->selectFeedbackType()==1 && $_SESSION['objExercise']->selectType()==2) {

@ -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 17944 2009-01-22 20:41:25Z juliomontoya $
* @version $Id: exercise.class.php 18002 2009-01-26 16:33:20Z juliomontoya $
*/
@ -807,30 +807,35 @@ class Exercise
* @param FormValidator $form the formvalidator instance (by reference)
*/
function createForm ($form)
{
{
// title
$form -> addElement('text', 'exerciseTitle', get_lang('ExerciseName').' : ','class="input_titles"');
$form -> addElement('text', 'exerciseTitle', get_lang('ExerciseName'),'class="input_titles"');
// fck editor
global $fck_attribute;
$fck_attribute = array();
$fck_attribute['Height'] = '250px';
$fck_attribute['Width'] = '50%';
$fck_attribute['ToolbarSet'] = 'NewTest';
$fck_attribute['Height'] = '200px';
$fck_attribute['Width'] = '50%';
$fck_attribute['ToolbarSet'] = 'NewTest';
$fck_attribute['Config']['InDocument'] = false;
$fck_attribute['Config']['CreateDocumentDir'] = '../../courses/'.api_get_course_path().'/document/';
//$fck_attribute['Config']['CreateDocumentWebDir'] = api_get_path('WEB_COURSE_PATH').$_course['path'].'/document/';
$form -> addElement ('html_editor', 'exerciseDescription', get_lang('ExerciseDescription').' : ');
// type
$form -> addElement ('html_editor', 'exerciseDescription', get_lang('ExerciseDescription'));
// feedback type
$feedback_option[0]=get_lang('Feedback');
$feedback_option[1]=get_lang('DirectFeedback');
$feedback_option[2]=get_lang('NoFeedback');
$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').' : ', '<br />');
$form -> addGroup($radios, null, get_lang('ExerciseType'), '<br />');
$form -> addElement('html','<div class="row">
<div class="label">&nbsp;</div>
<div class="formw">
@ -847,24 +852,17 @@ class Exercise
$option = range(0,$max);
$option[0]=get_lang('DoNotRandomize');
$random[] = FormValidator :: createElement ('select', 'randomQuestions',null,$option);
$random[] = FormValidator :: createElement ('static', 'help','help','<span style="font-style: italic;">'.get_lang('RandomQuestionsHelp').'</span>');
$random[] = FormValidator :: createElement ('select', 'randomQuestions',null,$option);
//$random[] = FormValidator :: createElement ('text', 'randomQuestions', null,null,'0');
$form -> addGroup($random,null,get_lang('RandomQuestions').' : ','<br />');
$feedback_option[0]=get_lang('Feedback');
$feedback_option[1]=get_lang('DirectFeedback');
$feedback_option[2]=get_lang('NoFeedback');
$form -> addElement('select', 'exerciseFeedbackType',get_lang('FeedbackType').' : ',$feedback_option);
$form -> addGroup($random,null,get_lang('RandomQuestions'),'<br />');
$attempt_option=range(0,10);
$attempt_option[0]=get_lang('Infinite');
$form -> addElement('select', 'exerciseAttempts',get_lang('ExerciseAttempts').' : ',$attempt_option);
$form -> addElement('select', 'exerciseAttempts',get_lang('ExerciseAttempts'),$attempt_option);
$form -> addElement('checkbox', 'enabletimelimit',null ,get_lang('EnableTimeLimits'));
//$form -> addElement('date', 'start_time', get_lang('ExeStartTime'), array('language'=>'es','format' => 'dMYHi'));
@ -879,8 +877,7 @@ class Exercise
$defaults = array();
if (api_get_setting('search_enabled') === 'true')
{
if (api_get_setting('search_enabled') === 'true') {
require_once(api_get_path(LIBRARY_PATH) . 'specific_fields_manager.lib.php');
$form -> addElement ('checkbox', 'index_document','', get_lang('SearchFeatureDoIndexDocument'));
@ -903,9 +900,7 @@ class Exercise
$defaults[$specific_field['code']] = implode(', ', $arr_str_values);
}
}
$form -> addElement ('html','</div>');
}
// submit
@ -920,14 +915,10 @@ class Exercise
// defaults
if($this -> id > 0)
{
if ($this -> random > $this->selectNbrQuestions())
{
if($this -> id > 0) {
if ($this -> random > $this->selectNbrQuestions()) {
$defaults['randomQuestions'] = $this->selectNbrQuestions();
}
else
{
} else {
$defaults['randomQuestions'] = $this -> random;
}

@ -1,4 +1,4 @@
<?php // $Id: exercise.lib.php 17944 2009-01-22 20:41:25Z juliomontoya $
<?php // $Id: exercise.lib.php 18002 2009-01-26 16:33:20Z juliomontoya $
/*
==============================================================================
@ -29,12 +29,18 @@
* shows a question and its answers
* @package dokeos.exercise
* @author Olivier Brouckaert <oli.brouckaert@skynet.be>
* @version $Id: exercise.lib.php 17944 2009-01-22 20:41:25Z juliomontoya $
* @version $Id: exercise.lib.php 18002 2009-01-26 16:33:20Z juliomontoya $
*/
/**
* @param int question id
* @param boolean only answers
* @param boolean origin i.e = learnpath
* @param int current item from the list of questions
* @param int number of total questions
* */
require("../inc/lib/fckeditor/fckeditor.php") ;
function showQuestion($questionId, $onlyAnswers=false, $origin=false)
function showQuestion($questionId, $onlyAnswers=false, $origin=false,$current_item, $total_item)
{
echo '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.js" type="text/javascript"></script>';
echo '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.corners.min.js" type="text/javascript"></script>';
@ -48,17 +54,26 @@ function showQuestion($questionId, $onlyAnswers=false, $origin=false)
$answerType=$objQuestionTmp->selectType();
$pictureName=$objQuestionTmp->selectPicture();
if ($answerType != HOT_SPOT) // Question is not of type hotspot
{
if(!$onlyAnswers)
{
if(!$onlyAnswers) {
$questionName=$objQuestionTmp->selectTitle();
$questionDescription=$objQuestionTmp->selectDescription();
$questionName=api_parse_tex($questionName);
$s.=$questionName.'</div>';
$s="<div id=\"question_title\" class=\"sectiontitle\">
".get_lang('Question').' ';
$s.=$current_item;
if($answerType == 2)
$s.=' / '.$total_item;
echo $s;
echo ': ';
$s =$questionName.'</div>';
$s.="<table class='exercise_questions'>
<tr>
<td valign='top' colspan='2'>
@ -185,24 +200,19 @@ function showQuestion($questionId, $onlyAnswers=false, $origin=false)
// fill in blanks
elseif($answerType == FILL_IN_BLANKS)
{
$s.="<tr><td colspan='2'>$answer</td></tr>";
$s.="<tr><td colspan='2'>$answer</td></tr>";
}
// free answer
// matching
else
{
if(!$answerCorrect)
{
else {
if(!$answerCorrect) {
// options (A, B, C, ...) that will be put into the list-box
$Select[$answerId]['Lettre']=$cpt1++;
// answers that will be shown at the right side
$answer = api_parse_tex($answer);
$Select[$answerId]['Reponse']=$answer;
}
else
{
} else {
$s.="
<tr>
<td colspan='2'>
@ -214,17 +224,16 @@ function showQuestion($questionId, $onlyAnswers=false, $origin=false)
<option value='0'>--</option>";
// fills the list-box
foreach($Select as $key=>$val)
{
foreach($Select as $key=>$val) {
$s.="<option value='".$key."'>".$val['Lettre']."</option>";
} // end foreach()
$s.="</select>&nbsp;&nbsp;</td>
<td width='40%' valign='top'>";
if(isset($Select[$cpt2])) $s.='<b>'.$Select[$cpt2]['Lettre'].'.</b> '.$Select[$cpt2]['Reponse'];
else $s.='&nbsp;';
if(isset($Select[$cpt2]))
$s.='<b>'.$Select[$cpt2]['Lettre'].'.</b> '.$Select[$cpt2]['Reponse'];
else
$s.='&nbsp;';
$s.="
</td>
</tr>
@ -238,10 +247,7 @@ function showQuestion($questionId, $onlyAnswers=false, $origin=false)
if($answerId == $nbrAnswers)
{
// if it remains answers to shown at the right side
while(isset($Select[$cpt2]))
{
while(isset($Select[$cpt2])) {
$s.="<tr>
<td colspan='2'>
<table border='0' cellpadding='0' cellspacing='0' width='100%'>
@ -297,7 +303,18 @@ function showQuestion($questionId, $onlyAnswers=false, $origin=false)
if(!$onlyAnswers)
{
$s=$questionName.'</div>';
$s="<div id=\"question_title\" class=\"sectiontitle\">
".get_lang('Question').' ';
$s.=$current_item;
if($answerType == 2)
$s.=' / '.$total_item;
echo $s;
echo ': ';
$s =$questionName.'</div>';
$s.="<table class='exercise_questions'>
<tr>
<td valign='top' colspan='2'>

@ -1,22 +1,24 @@
<?php
/*
DOKEOS - elearning and course management software
==============================================================================
Dokeos - elearning and course management software
For a full list of contributors, see documentation/credits.html
Copyright (c) 2004-2009 Dokeos SPRL
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.
For a full list of contributors, see "credits.txt".
The full license can be read in "license.txt".
Contact:
Dokeos
Rue des Palais 44 Paleizenstraat
B-1030 Brussels - Belgium
Tel. +32 (2) 211 34 56
*/
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
==============================================================================
*/
/**
* Exercise administration
@ -30,32 +32,42 @@
// name of the language file that needs to be included
$language_file='exercice';
include('exercise.class.php');
include('question.class.php');
include('answer.class.php');
include('../inc/global.inc.php');
include('exercise.lib.php');
$this_section=SECTION_COURSES;
if(!api_is_allowed_to_edit())
{
if(!api_is_allowed_to_edit()) {
api_not_allowed(true);
}
$htmlHeadXtra[] = '<script>
function advanced_parameters() {
if(document.getElementById(\'options\').style.display == \'none\') {
document.getElementById(\'options\').style.display = \'block\';
document.getElementById(\'img_plus_and_minus\').innerHTML=\'&nbsp;<img src="../img/nolines_minus.gif" alt="" />&nbsp;'.get_lang('AdvancedParameters').'\';
} else {
function advanced_parameters() {
if(document.getElementById(\'options\').style.display == \'none\') {
document.getElementById(\'options\').style.display = \'block\';
document.getElementById(\'img_plus_and_minus\').innerHTML=\'&nbsp;<img src="../img/nolines_minus.gif" alt="" />&nbsp;'.get_lang('AdvancedParameters').'\';
} else {
document.getElementById(\'options\').style.display = \'none\';
document.getElementById(\'img_plus_and_minus\').innerHTML=\'&nbsp;<img src="../img/nolines_plus.gif" alt="" />&nbsp;'.get_lang('AdvancedParameters').'\';
}
}
}
}
function feedbackselection()
{
var index = document.exercise_admin.exerciseFeedbackType.selectedIndex;
if (index == \'1\') {
document.exercise_admin.exerciseType[1].checked=true;
document.exercise_admin.exerciseType[0].disabled=true;
} else {
document.exercise_admin.exerciseType[0].disabled=false;
}
}
</script>';
/*********************
@ -69,13 +81,11 @@ $objExercise = new Exercise();
/*********************
* INIT FORM
*********************/
if(isset($_GET['exerciseId']))
{
if(isset($_GET['exerciseId'])) {
$form = new FormValidator('exercise_admin', 'post', api_get_self().'?exerciseId='.$_GET['exerciseId']);
$objExercise -> read (intval($_GET['exerciseId']));
$form -> addElement ('hidden','edit','true');
}else
{
} else {
$form = new FormValidator('exercise_admin');
$form -> addElement ('hidden','edit','false');
}
@ -85,30 +95,20 @@ $objExercise -> createForm ($form);
/*********************
* VALIDATE FORM
*********************/
if($form -> validate())
{
if($form -> validate()) {
$objExercise -> processCreation($form);
if($form -> getSubmitValue('edit') == 'true')
{
if($form -> getSubmitValue('edit') == 'true') {
header('Location:exercice.php?message=ExerciseEdited');
}
else
{
} else {
header('Location:admin.php?message=ExerciseStored&exerciseId='.$objExercise->id);
}
}
else
{
} else {
/*********************
* DISPLAY FORM
*********************/
$nameTools=get_lang('ExerciseManagement');
$interbreadcrumb[] = array ("url"=>"exercice.php", "name"=> get_lang('Exercices'));
Display::display_header($nameTools,"Exercise");
$form -> display ();
}
Display::display_footer();
Display::display_footer();

@ -1,4 +1,4 @@
<?php // $Id: question.class.php 17972 2009-01-23 20:11:22Z juliomontoya $
<?php // $Id: question.class.php 18002 2009-01-26 16:33:20Z juliomontoya $
/*
==============================================================================
@ -28,7 +28,7 @@
* File containing the Question class.
* @package dokeos.exercise
* @author Olivier Brouckaert
* @version $Id: question.class.php 17972 2009-01-23 20:11:22Z juliomontoya $
* @version $Id: question.class.php 18002 2009-01-26 16:33:20Z juliomontoya $
*/
@ -993,8 +993,8 @@ abstract class Question
$form->addElement('hidden','answerType',$_REQUEST['answerType']);
// question level
$select_level = array (0,1,2,3,4,5,6);
$form->addElement('select','questionLevel',get_lang('Level'),$select_level);
$select_level = array (0,1,2,3,4,5);
$form->addElement('select','questionLevel',get_lang('Difficulty'),$select_level);
$renderer->setElementTemplate('<div class="row"><div class="label">{label}</div><div class="formw">{element}</div></div>','questionLevel');
// html editor

@ -1,20 +1,23 @@
<?php
/*
DOKEOS - elearning and course management software
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2004-2009 Dokeos SPRL
For a full list of contributors, see "credits.txt".
The full license can be read in "license.txt".
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.
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.
See the GNU General Public License for more details.
Contact:
Dokeos
Rue des Palais 44 Paleizenstraat
B-1030 Brussels - Belgium
Tel. +32 (2) 211 34 56
Contact address: Dokeos, rue du Corbeau, 108, B-1030 Brussels, Belgium
Mail: info@dokeos.com
==============================================================================
*/
@ -24,7 +27,7 @@
* It is included from the script admin.php
* @package dokeos.exercise
* @author Olivier Brouckaert
* @version $Id: question_admin.inc.php 17609 2009-01-09 00:28:59Z marvil07 $
* @version $Id: question_admin.inc.php 18002 2009-01-26 16:33:20Z juliomontoya $
*/
/*

@ -1,4 +1,4 @@
<?php // $Id: question_list_admin.inc.php 17972 2009-01-23 20:11:22Z juliomontoya $
<?php // $Id: question_list_admin.inc.php 18002 2009-01-26 16:33:20Z juliomontoya $
/*
==============================================================================
@ -28,7 +28,7 @@
* Code library for HotPotatoes integration.
* @package dokeos.exercise
* @author
* @version $Id: question_list_admin.inc.php 17972 2009-01-23 20:11:22Z juliomontoya $
* @version $Id: question_list_admin.inc.php 18002 2009-01-26 16:33:20Z juliomontoya $
*/
@ -94,7 +94,7 @@ echo '</div></div>';
<tr class="row_odd">
<th><?php echo get_lang('Question'); ?></th>
<th><?php echo get_lang('Type');?></th>
<th><?php echo get_lang('Level'); ?></th>
<th><?php echo get_lang('Difficulty'); ?></th>
<th><?php echo get_lang('Export'); ?></th>
<th><?php echo get_lang('Modify'); ?></th>
</tr>

@ -1,4 +1,4 @@
<?php // $Id: question_pool.php 17948 2009-01-22 21:39:22Z juliomontoya $
<?php // $Id: question_pool.php 18002 2009-01-26 16:33:20Z juliomontoya $
/*
==============================================================================
@ -30,7 +30,7 @@
* One question can be in several exercises
* @package dokeos.exercise
* @author Olivier Brouckaert
* @version $Id: question_pool.php 17948 2009-01-22 21:39:22Z juliomontoya $
* @version $Id: question_pool.php 18002 2009-01-26 16:33:20Z juliomontoya $
*/
// name of the language file that needs to be included
@ -162,8 +162,6 @@ if($is_allowedToEdit)
<form method="get" action="<?php echo api_get_self(); ?>" style="display:inline;">
<input type="hidden" name="fromExercise" value="<?php echo $fromExercise; ?>">
<?php echo get_lang('Filter'); ?> :
<select name="exerciseId">
<option value="0">-- <?php echo get_lang('AllExercises'); ?> --</option>
@ -183,7 +181,7 @@ if($is_allowedToEdit)
?>
</select>
<?php echo get_lang('Level'); ?> : <select name="exerciseLevel">
<?php echo get_lang('Difficulty'); ?> : <select name="exerciseLevel">
<option value="-1">-- <?php echo get_lang('AllExercises'); ?> --</option>
<?php
$sqlMaxLevel = "SELECT MAX(level) FROM $TBL_QUESTIONS";

Loading…
Cancel
Save