Fixing blocking of exercise if is attached to an LP

skala
Julio Montoya 15 years ago
parent 5d11e0eb60
commit a56b154350
  1. 15
      main/exercice/exercise_admin.php

@ -196,21 +196,16 @@ if ($form -> validate()) {
// to hide the exercise description
echo '<style> .media { display:none;}</style>';
$show_quiz_edition = true;
if (isset($exerciseId) && !empty($exerciseId)) {
if (isset($objExercise) && !empty($objExercise->id)) {
$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)."'";
WHERE item_type = '".TOOL_QUIZ."' AND path ='".Database::escape_string($objExercise->id)."'";
$result = Database::query($sql);
if (Database::num_rows($result) > 0) {
$show_quiz_edition = false;
}
$form->freeze();
}
}
if ($show_quiz_edition) {
$form->freeze();
}
$form -> display ();
}
Display::display_footer();
Loading…
Cancel
Save