skala
Julio Montoya 14 years ago
commit 5a0da5d32f
  1. 8
      main/exercice/exercise.class.php
  2. 14
      main/exercice/exercise_admin.php
  3. 23
      main/metadata/md_funcs.php

@ -871,8 +871,8 @@ class Exercise {
if($type=='full') { if($type=='full') {
// feedback type // feedback type
$radios_feedback = array(); $radios_feedback = array();
$radios_feedback[] = FormValidator :: createElement ('radio', 'exerciseFeedbackType', null, get_lang('ExerciseAtTheEndOfTheTest'),'0'); $radios_feedback[] = FormValidator :: createElement ('radio', 'exerciseFeedbackType', null, get_lang('ExerciseAtTheEndOfTheTest'),'0',array('id' =>'exerciseType_1','onclick' => 'check_feedback()'));
$radios_feedback[] = FormValidator :: createElement ('radio', 'exerciseFeedbackType', null, get_lang('NoFeedback'),'2'); $radios_feedback[] = FormValidator :: createElement ('radio', 'exerciseFeedbackType', null, get_lang('NoFeedback'),'2',array('id' =>'exerciseType_2'));
$form -> addGroup($radios_feedback, null, get_lang('FeedbackType')); $form -> addGroup($radios_feedback, null, get_lang('FeedbackType'));
$feedback_option[0]=get_lang('ExerciseAtTheEndOfTheTest'); $feedback_option[0]=get_lang('ExerciseAtTheEndOfTheTest');
@ -906,8 +906,8 @@ class Exercise {
} }
$radios_results_disabled = array(); $radios_results_disabled = array();
$radios_results_disabled[] = FormValidator :: createElement ('radio', 'results_disabled', null, get_lang('Yes'),'0'); $radios_results_disabled[] = FormValidator :: createElement ('radio', 'results_disabled', null, get_lang('Yes'), '0', array('id'=>'result_disabled_0'));
$radios_results_disabled[] = FormValidator :: createElement ('radio', 'results_disabled', null, get_lang('No'),'1'); $radios_results_disabled[] = FormValidator :: createElement ('radio', 'results_disabled', null, get_lang('No'), '1',array('id'=>'result_disabled_1','onclick' => 'check_results_disabled()'));
$form -> addGroup($radios_results_disabled, null, get_lang('ShowResultsToStudents')); $form -> addGroup($radios_results_disabled, null, get_lang('ShowResultsToStudents'));
$random = array(); $random = array();

@ -112,14 +112,24 @@ $htmlHeadXtra[] = '<script>
} }
} }
function check_per_page_all() function check_per_page_all() {
{
if (document.getElementById(\'divtimecontrol\').style.display==\'block\') if (document.getElementById(\'divtimecontrol\').style.display==\'block\')
{ {
document.getElementById(\'divtimecontrol\').style.display=\'none\'; document.getElementById(\'divtimecontrol\').style.display=\'none\';
document.getElementById(\'enabletimercontroltotalminutes\').value=\'\'; document.getElementById(\'enabletimercontroltotalminutes\').value=\'\';
} }
} }
function check_feedback() {
document.getElementById(\'result_disabled_0\').checked = true;
}
function check_results_disabled() {
document.getElementById(\'exerciseType_2\').checked = true;
}
</script>'; </script>';

@ -415,20 +415,16 @@ function mds_update_xml_and_mdt($mdo, &$xmlDoc, $mda, $eid, &$traceinfo,
function mdstore($allow_create) function mdstore($allow_create)
{ {
global $_course; if (!isset($_course)) return; global $_course; if (!isset($_course)) return;
define('MDS_TABLE', Database::get_course_table(TABLE_METADATA)); define('MDS_TABLE', Database::get_course_table(TABLE_METADATA));
$this->_query("CREATE TABLE IF NOT EXISTS " . MDS_TABLE . " ( " .
if (!Database::query("SELECT eid FROM " . MDS_TABLE)) "eid varchar(250) NOT NULL," . // entry-id, e.g. doc.1
if ($allow_create) "mdxmltext text default ''," . // MD-text, XML-formatted
$this->_query("CREATE TABLE " . MDS_TABLE . " ( " . "md5 char(32) default ''," . // hash-validator
"eid varchar(250) NOT NULL," . // entry-id, e.g. doc.1 "htmlcache1 text default ''," . // cached HTML, part 1
"mdxmltext text default ''," . // MD-text, XML-formatted "htmlcache2 text default ''," . // cached HTML, part 2
"md5 char(32) default ''," . // hash-validator "indexabletext text default ''," . // indexable for search
"htmlcache1 text default ''," . // cached HTML, part 1 "PRIMARY KEY (eid) )");
"htmlcache2 text default ''," . // cached HTML, part 2
"indexabletext text default ''," . // indexable for search
"PRIMARY KEY (eid) )");
else give_up('No metadata store is available for this course.');
} }
function _coldatstart($column, $data) function _coldatstart($column, $data)
@ -445,7 +441,6 @@ function _query($sql, $eid = '', $sep = '')
{ {
if ($eid) $sql .= $sep ? $this->_coldatstart('eid', $eid . $sep) : if ($eid) $sql .= $sep ? $this->_coldatstart('eid', $eid . $sep) :
$this->_coldat('eid', $eid); $this->_coldat('eid', $eid);
return Database::query($sql); return Database::query($sql);
} }

Loading…
Cancel
Save