Some fixes in the exercise tool due #4400

skala
Julio Montoya 13 years ago
parent 465cc3062f
commit 0b519c7c4e
  1. 4
      main/css/base.css
  2. 6
      main/css/base_chamilo.css
  3. 2
      main/exercice/freeanswer.class.php
  4. 7
      main/exercice/hotspot.class.php
  5. 10
      main/exercice/hotspot_admin.inc.php
  6. 37
      main/exercice/matching.class.php
  7. 19
      main/exercice/multiple_answer.class.php
  8. 14
      main/exercice/multiple_answer_combination.class.php
  9. 2
      main/exercice/oral_expression.class.php
  10. 9
      main/exercice/question.class.php
  11. 13
      main/exercice/unique_answer.class.php
  12. 14
      main/exercice/unique_answer_no_option.class.php
  13. 2
      main/template/default/layout/hot_courses.tpl
  14. 1
      main/template/default/layout/main_header.tpl

@ -159,7 +159,9 @@ footer {
}
.actions a img {
padding-right:0px;
padding:0px;
margin:0px;
float:left;
}
.muted {

@ -1706,10 +1706,6 @@ Document title
padding:2px;
vertical-align:middle;
}
.actions a img {
padding-right:0px;
}
.actions a {
display:inline-block;
@ -2296,7 +2292,7 @@ span.form_required {
#header3 {
font-size: 11px;
font-weight: bold;
margin:0px;
margin:4px 0px 0px 0px;
}
/* Scroll effect */

@ -35,7 +35,7 @@ class FreeAnswer extends Question {
*/
function createAnswersForm ($form)
{
$form -> addElement('text','weighting',get_lang('Weighting'),'size="5"');
$form -> addElement('text','weighting',get_lang('Weighting'), array('class' => 'span1'));
global $text, $class;
// setting the save button here and not in the question class.php
$form->addElement('style_submit_button','submitQuestion',$text, 'class="'.$class.'"');

@ -40,15 +40,12 @@ class HotSpot extends Question {
parent::createForm ($form);
global $text, $class;
if(!isset($_GET['editQuestion'])) {
$renderer = $form->defaultRenderer();
//$form->addElement('html', '<div class="row"><div class="label"></div><div class="formw">'.get_lang('UploadJpgPicture').'</div></div>');
$form->addElement('file','imageUpload',array('<span class="form_required">*</span><img src="../img/hotspots.png" />', get_lang('UploadJpgPicture')) );
$renderer = $form->defaultRenderer();
$form->addElement('file','imageUpload',array('<img src="../img/hotspots.png" />', get_lang('UploadJpgPicture')) );
// setting the save button here and not in the question class.php
// Saving a question
$form->addElement('style_submit_button','submitQuestion',get_lang('GoToQuestion'), 'class="'.$class.'"');
$renderer->setElementTemplate('<div class="row"><div class="label" style="margin-top:-30px;">{label}</div><div class="formw" >{element}<span class="help-block">{label_2}</div></div>','imageUpload');
$form->addRule('imageUpload', get_lang('OnlyImagesAllowed'), 'filetype', array ('jpg', 'jpeg', 'png', 'gif'));
$form->addRule('imageUpload', get_lang('NoImage'), 'uploadedfile');
} else {

@ -647,7 +647,9 @@ $hotspot_admin_url = api_get_path(WEB_CODE_PATH) . 'exercice/admin.php?' . api_g
<td align="left">
<br />
<textarea wrap="virtual" rows="3" cols="25" name="comment[<?php echo $i; ?>]" style="width: 100%"><?php echo stripslashes(htmlentities($comment[$i])); ?></textarea>
<textarea wrap="virtual" rows="3" cols="25" name="comment[<?php echo $i; ?>]" style="width: 100%">
<?php echo stripslashes(htmlentities($comment[$i])); ?>
</textarea>
<input type="hidden" name="hotspot_type[<?php echo $i; ?>]" value="delineation" />
<input type="hidden" name="hotspot_coordinates[<?php echo $i; ?>]" value="<?php echo (empty($hotspot_coordinates[$i]) ? '0;0|0|0' : $hotspot_coordinates[$i]); ?>" />
<br/>
@ -843,14 +845,14 @@ $hotspot_admin_url = api_get_path(WEB_CODE_PATH) . 'exercice/admin.php?' . api_g
//if ($answerType==HOT_SPOT_DELINEATION && $i!=2)
if ($answerType==HOT_SPOT_DELINEATION) {
if ($_SESSION['tmp_answers']['hotspot_type'][$i]=='oar') { ?>
<input type="hidden" name="weighting[<?php echo $i; ?>]" size="3" value="0" />
<input type="hidden" name="weighting[<?php echo $i; ?>]" class="span3" value="0" />
<?php } else { ?>
<input type="text" name="weighting[<?php echo $i; ?>]" size="3" value="<?php echo (isset($weighting[$i]) ? $weighting[$i] : 10); ?>" />
<input type="text" name="weighting[<?php echo $i; ?>]" class="span3" value="<?php echo (isset($weighting[$i]) ? $weighting[$i] : 10); ?>" />
<?php }
}
if ($answerType==HOT_SPOT) {
?>
<input type="text" name="weighting[<?php echo $i; ?>]" size="3" value="<?php echo (isset($weighting[$i]) ? $weighting[$i] : 10); ?>" />
<input type="text" name="weighting[<?php echo $i; ?>]" class="span3" value="<?php echo (isset($weighting[$i]) ? $weighting[$i] : 10); ?>" />
<input type="hidden" name="hotspot_coordinates[<?php echo $i; ?>]" value="<?php echo (empty($hotspot_coordinates[$i]) ? '0;0|0|0' : $hotspot_coordinates[$i]); ?>" />
<input type="hidden" name="hotspot_type[<?php echo $i; ?>]" value="<?php echo (empty($hotspot_type[$i]) ? 'square' : $hotspot_type[$i]); ?>" />
<?php

@ -18,8 +18,6 @@ if(!class_exists('Matching')):
* @package chamilo.exercise
*/
class Matching extends Question {
static $typePicture = 'matching.gif';
static $explanationLangVar = 'Matching';
@ -99,17 +97,17 @@ class Matching extends Question {
<div class="formw">
'.get_lang('MakeCorrespond').'
<table class="data_table">
<tr style="text-align: center">
<th width="40px">
<tr>
<th width="10px">
'.get_lang('Number').'
</th>
<th>
<th width="40%">
'.get_lang('Answer').'
</th>
<th>
<th width="40%">
'.get_lang('MatchesTo').'
</th>
<th>
<th width="50px">
'.get_lang('Weighting').'
</th>
@ -130,22 +128,20 @@ class Matching extends Question {
$group[] = FormValidator :: createElement ('text', 'answer['.$i.']',null, 'size="60" style="margin-left: 0em;"');
$group[] = FormValidator :: createElement ('select', 'matches['.$i.']',null,$a_matches);
$group[] = FormValidator :: createElement ('text', 'weighting['.$i.']',null, 'style="vertical-align:middle;margin-left: 0em;" size="5" value="10"');
$form -> addGroup($group, null, null, '</td><td width="0">');
$group[] = FormValidator :: createElement ('text', 'weighting['.$i.']',null, array('class' => 'span9', 'value' => 10));
$form -> addGroup($group, null, null, '</td><td>');
$form -> addElement ('html', '</td></tr>');
}
$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"');
} else {
$group[] = FormValidator :: createElement ('style_submit_button', 'moreMatches', get_lang('AddElem'),'class="plus"');
$group[] = FormValidator :: createElement ('style_submit_button', 'lessMatches', get_lang('DelElem'),'class="minus"');
$group[] = FormValidator :: createElement ('style_submit_button', 'lessMatches', get_lang('DelElem'),'class="minus"');
}
$form -> addGroup($group);
@ -158,10 +154,10 @@ class Matching extends Question {
<div class="formw"><br /><br />
<table class="data_table">
<tr style="text-align: center;">
<th width="40px">
<th width="10px">
'.get_lang('Number').'
</th>
<th>
<th width="90%"
'.get_lang('Answer').'
</th>
@ -175,13 +171,12 @@ class Matching extends Question {
for($i = 1 ; $i <= $nb_options ; ++$i) {
$form -> addElement ('html', '<tr><td>');
$group = array();
$puce = FormValidator :: createElement ('text', null,null,'value="'.chr(64+$i).'"');
$puce->freeze();
$group[] = $puce;
$group[] = FormValidator :: createElement ('text', 'option['.$i.']',null, 'size="60" style="margin-left: 0em;"');
$form -> addGroup($group, null, null, '</td><td width="0">');
$group[] = FormValidator :: createElement ('text', 'option['.$i.']',null, array('class' =>'span6'));
$form -> addGroup($group, null, null, '</td><td>');
$form -> addElement ('html', '</td></tr>');
}
@ -191,13 +186,9 @@ class Matching extends Question {
if ($navigator_info['name']=='Internet Explorer' && $navigator_info['version']=='6') {
// setting the save button here and not in the question class.php
$group[] = FormValidator :: createElement('submit','submitQuestion',$text, 'class="'.$class.'"');
$group[] = FormValidator :: createElement('submit','submitQuestion',$text, 'class="'.$class.'"');
$group[] = FormValidator :: createElement ('submit', 'lessOptions', get_lang('DelElem'),'class="minus"');
$group[] = FormValidator :: createElement ('submit', 'moreOptions',get_lang('AddElem'),'class="plus"');
$group[] = FormValidator :: createElement ('submit', 'moreOptions',get_lang('AddElem'),'class="plus"');
} else {
// setting the save button here and not in the question class.php
$group[] = FormValidator :: createElement ('style_submit_button', 'lessOptions', get_lang('DelElem'),'class="minus"');

@ -53,24 +53,23 @@ class MultipleAnswer extends Question {
</div>
<div class="formw">
<table class="data_table">
<tr style="text-align: center;">
<th>
<tr>
<th width="10px">
'.get_lang('Number').'
</th>
<th>
<th width="10px">
'.get_lang('True').'
</th>
<th>
<th width="50%">
'.get_lang('Answer').'
</th>';
// show column comment when feedback is enable
if ($obj_ex->selectFeedbackType() != EXERCISE_FEEDBACK_TYPE_EXAM ) {
$html .='<th>
'.get_lang('Comment').'
</th>';
$html .='<th>
'.get_lang('Comment').'
</th>';
}
$html .= '<th>
$html .= '<th width="50px">
'.get_lang('Weighting').'
</th>
</tr>';
@ -128,7 +127,7 @@ class MultipleAnswer extends Question {
$form->addElement('html_editor', 'comment['.$i.']',null, 'style="vertical-align:middle"', array('ToolbarSet' => 'TestProposedAnswer', 'Width' => '100%', 'Height' => '100'));
}
$form->addElement('text', 'weighting['.$i.']',null, 'style="vertical-align:middle;margin-left: 0em;" size="5" value="0"');
$form->addElement('text', 'weighting['.$i.']',null, array('class' => "span9", 'value' => '0'));
$form -> addElement ('html', '</tr>');
}
$form -> addElement ('html', '</table>');

@ -44,12 +44,6 @@ class MultipleAnswerCombination extends Question {
$nb_answers = isset($_POST['nb_answers']) ? $_POST['nb_answers'] : 2;
$nb_answers += (isset($_POST['lessAnswers']) ? -1 : (isset($_POST['moreAnswers']) ? 1 : 0));
$obj_ex = $_SESSION['objExercise'];
/*
*
* <th>
'.get_lang('Weighting').'
</th>
*/
$html='
<div class="row">
<div class="label">
@ -58,13 +52,13 @@ class MultipleAnswerCombination extends Question {
<div class="formw">
<table class="data_table">
<tr style="text-align: center;">
<th>
<th width="10px">
'.get_lang('Number').'
</th>
<th>
<th width="10px">
'.get_lang('True').'
</th>
<th>
<th width="50%">
'.get_lang('Answer').'
</th>';
// show column comment when feedback is enable
@ -141,7 +135,7 @@ class MultipleAnswerCombination extends Question {
$form -> addElement ('html', $html_total_score);
//only 1 answer the all deal ...
$form->addElement('text', 'weighting[1]',null, 'style="vertical-align:middle;margin-left: 0em;" size="5" value="10"');
$form->addElement('text', 'weighting[1]',null, array('class' => "span1", 'value' => '10'));
$form -> addElement ('html', '<br /><br />');
$navigator_info = api_get_navigator();

@ -34,7 +34,7 @@ class OralExpression extends Question {
* @param the formvalidator instance
*/
function createAnswersForm ($form) {
$form -> addElement('text','weighting',get_lang('Weighting'),'size="5"');
$form -> addElement('text','weighting',get_lang('Weighting'), array('class' => 'span1'));
global $text, $class;
// setting the save button here and not in the question class.php
$form->addElement('style_submit_button','submitQuestion',$text, 'class="'.$class.'"');

@ -1137,14 +1137,7 @@ abstract class Question
$renderer = $form->defaultRenderer();
$form->addElement('html','<div class="form">');
// question name
$form->addElement('text','questionName','<span class="form_required">*</span> '.get_lang('Question'),'size="80"');
//$form->applyFilter('questionName','html_filter');
//$radios_results_enabled[] = $form->createElement('static', null, null, null);
//$test=FormValidator :: createElement ('text', 'questionName');
//$radios_results_enabled[]=$test;
$form->addElement('text','questionName','<span class="form_required">*</span> '.get_lang('Question'), array('class' => 'span6'));
$renderer->setElementTemplate('<div class="row"><div class="label">{label}</div><div class="formw" >{element}</div></div>','questionName');
$renderer->setElementTemplate('<div class="row"><div class="label">{label}</div><div class="formw">{element}</div></div>','questionLevel');
//

@ -68,7 +68,7 @@ class UniqueAnswer extends Question {
} elseif ($obj_ex->selectFeedbackType()==1) {
$editor_config['Width'] = '250';
$editor_config['Height'] = '110';
$comment_title = '<th width="500" >'.get_lang('Comment').'</th>';
$comment_title = '<th width="500px" >'.get_lang('Comment').'</th>';
$feedback_title = '<th width="350px" >'.get_lang('Scenario').'</th>';
}
@ -86,12 +86,12 @@ class UniqueAnswer extends Question {
<th width="10px" >
'.get_lang('True').'
</th>
<th width="38%">
<th width="50%">
'.get_lang('Answer').'
</th>
'.$comment_title.'
'.$feedback_title.'
<th width="20px">
<th width="50px">
'.get_lang('Weighting').'
</th>
</tr>';
@ -228,11 +228,8 @@ class UniqueAnswer extends Question {
//$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('text', 'weighting['.$i.']', null, array('class' => "span9", 'value' => '0'));
$form->addElement ('html', '</tr>');
}
$form -> addElement ('html', '</table>');

@ -87,12 +87,12 @@ class UniqueAnswerNoOption extends Question {
<th width="10px" >
'.get_lang('True').'
</th>
<th width="38%">
<th width="50%">
'.get_lang('Answer').'
</th>
'.$comment_title.'
'.$feedback_title.'
<th width="20px">
<th width="60px">
'.get_lang('Weighting').'
</th>
</tr>';
@ -259,12 +259,10 @@ class UniqueAnswerNoOption extends Question {
//$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('text', 'weighting['.$i.']', null, array('class' => "span9", 'value' => '0'));
$form->addElement('html', '</tr>');
$i++;
}
}
if (empty($this -> id)) {
$form->addElement('hidden', 'new_question', 1);
@ -311,7 +309,7 @@ class UniqueAnswerNoOption extends Question {
//$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" readonly="readonly" ');
$form->addElement('text', 'weighting['.$i.']', null, array('class' => "span9", 'value' => '0', 'readonly' =>'readonly'));
$form->addElement ('html', '</tr>');
//}

@ -21,7 +21,7 @@ $(document).ready( function() {
</script>
{if !(empty($hot_courses)) }
<div class="span8">
<div class="span12">
<h3>{"HottestCourses"|get_lang}</h3>
{foreach $hot_courses as $hot_course}
<div class="categories-block-course">

@ -4,6 +4,7 @@
<!--[if IE 8]> <html lang="{$document_language}" class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html lang="{$document_language}" class="no-js"> <!--<![endif]-->
<head>
{* <script type="text/javascript" src="http://fbug.googlecode.com/svn/lite/branches/firebug1.4/content/firebug-lite-dev.js"></script> *}
{include file="default/layout/head.tpl"}
</head>
<body dir="{$text_direction}" class="{$section_name}">

Loading…
Cancel
Save