Commit aeaf3a5b authored by Thomas Fradet's avatar Thomas Fradet
Browse files

bugs divers

parent c9080116
......@@ -286,6 +286,34 @@ NaN dans le tableau d'achèvement quand pas d'activité dans la section (divisio
Le nombre d'activité est vérifié pour afficher 0 s'il n'y a pas d'activité.
[x] Solved.
### Paramétrage d'une section (date, modalité, etc.)
#### 15
Notice: Trying to get property 'date_rendu' of non-object in /Applications/MAMP/htdocs/moodle37/course/format/iena/view/view_param_section.php on line 85
Et autres erreur du même genre.
Raison : pas d'enregistrement existant pour cette section, donc le formulaire est rempli sur la base d'un objet qui n'existe pas (===false).
Des conditions sont ajoutées pour tester la présence de paramètres existants et agit en conséquence pour préremplir ou non le formulaire.
Suppression de la partie inutilisée du formulaire qui était utilisée pour cacher la section avant une certaine date.
[x] Solved.
#### 16
Erreurs lors du post du formulaire d'enregistrement des paramètres d'une section.
## Améliorations
### Suivi des étudiants
......
......@@ -82,14 +82,20 @@
$mform->setDefault('summary', array('text' => $description));
$mform->addElement('date_time_selector', 'date_iena', 'Date');
if ($dataSection == false) {
$dateUp = date_create();
} else {
$dateUp = date_create($dataSection->date_rendu);
}
$mform->setDefault('date_iena', $dateUp->getTimestamp());
$mform->addElement('checkbox', 'date_render', get_string('form_not_defined', 'format_iena'));
if (!$dataSection->date_rendu) {
$mform->setDefault('date_render', '1');
if ($dataSection == false) {
$mform->setDefault('date_render', true);
} else {
$mform->setDefault('date_render', false);
}
//Adding elements to the form not included in moodle
// <script src=\"".$CFG->wwwroot."/course/format/iena/js/param_section.js\"></script>
......@@ -114,7 +120,9 @@
<div class=\"radio\">
<label for=\"radios-0\">
<input type=\"radio\" name=\"presence\" id=\"presence-0\" value=\"1\" ";
if ($dataSection->presence == 1) $content .= "checked=\"checked\"";
if ($dataSection != false && $dataSection->presence == 1) {
$content .= "checked=\"checked\"";
}
$content .= ">
" . get_string('in_presence', 'format_iena') . "
</label>
......@@ -122,7 +130,9 @@
<div class=\"radio\">
<label for=\"radios-1\">
<input type=\"radio\" name=\"presence\" id=\"presence-1\" value=\"2\" ";
if ($dataSection->presence == 2) $content .= "checked=\"checked\"";
if ($dataSection != false && $dataSection->presence == 2) {
$content .= "checked=\"checked\"";
}
$content .= ">
" . get_string('not_presence', 'format_iena') . "
</label>
......@@ -130,7 +140,9 @@
<div class=\"radio\">
<label for=\"radios-1\">
<input type=\"radio\" name=\"presence\" id=\"presence-2\" value=\"0\" ";
if (!$dataSection->presence) $content .= "checked=\"checked\"";
if ($dataSection == false) {
$content .= "checked=\"checked\"";
}
$content .= ">
" . get_string('form_not_defined', 'format_iena') . "
</label>
......@@ -149,23 +161,23 @@
<div class=\"checkbox\">
<label for=\"day_before\">
<input type=\"checkbox\" name=\"day_before\" id=\"day_before\" value=\"1\" ";
if ($dataSection->day_before == 1) $content .= "checked=\"checked\"";
if ($dataSection != false && $dataSection->day_before == 1) $content .= "checked=\"checked\"";
$content .= ">" . get_string('days_before', 'format_iena') . " :
<select class=\"form-control\" style=\"width: 55px; display: inline;\" id=\"nb_days_before\" name =\"nb_days_before\">
<option ";
if ($dataSection->nb_days_before == 1) $content .= "selected=\"selected\"";
if ( ($dataSection != false && $dataSection->nb_days_before == 1) || $dataSection == false ) $content .= "selected=\"selected\"";
$content .= " >1</option>
<option ";
if ($dataSection->nb_days_before == 2) $content .= "selected=\"selected\"";
if ($dataSection != false && $dataSection->nb_days_before == 2) $content .= "selected=\"selected\"";
$content .= " >2</option>
<option ";
if ($dataSection->nb_days_before == 3) $content .= "selected=\"selected\"";
if ($dataSection != false && $dataSection->nb_days_before == 3) $content .= "selected=\"selected\"";
$content .= " >3</option>
<option ";
if ($dataSection->nb_days_before == 4) $content .= "selected=\"selected\"";
if ($dataSection != false && $dataSection->nb_days_before == 4) $content .= "selected=\"selected\"";
$content .= " >4</option>
<option ";
if ($dataSection->nb_days_before == 5) $content .= "selected=\"selected\"";
if ($dataSection != false && $dataSection->nb_days_before == 5) $content .= "selected=\"selected\"";
$content .= " >5</option>
</select> " . get_string('nb_days_before', 'format_iena') . "
</label>
......@@ -173,30 +185,30 @@
<div class=\"checkbox\">
<label for=\"day_same\">
<input type=\"checkbox\" name=\"day_same\" id=\"day_same\" value=\"1\" ";
if ($dataSection->day_same == 1) $content .= "checked=\"checked\"";
if ($dataSection != false && $dataSection->day_same == 1) $content .= "checked=\"checked\"";
$content .= ">" . get_string('days_same', 'format_iena') . "
</label>
</div>
<div class=\"checkbox\">
<label for=\"checkboxes-2\">
<input type=\"checkbox\" name=\"day_after\" id=\"day_after\" value=\"1\" ";
if ($dataSection->day_after == 1) $content .= "checked=\"checked\"";
if ($dataSection != false && $dataSection->day_after == 1) $content .= "checked=\"checked\"";
$content .= ">" . get_string('days_after', 'format_iena') . " :
<select class=\"form-control\" style=\"width: 55px; display: inline;\" id=\"nb_days_after\" name =\"nb_days_after\">
<option ";
if ($dataSection->nb_days_after == 1) $content .= "selected=\"selected\"";
if ( ($dataSection != false && $dataSection->nb_days_after == 1) || $dataSection == false ) $content .= "selected=\"selected\"";
$content .= " >1</option>
<option ";
if ($dataSection->nb_days_after == 2) $content .= "selected=\"selected\"";
if ($dataSection != false && $dataSection->nb_days_after == 2) $content .= "selected=\"selected\"";
$content .= " >2</option>
<option ";
if ($dataSection->nb_days_after == 3) $content .= "selected=\"selected\"";
if ($dataSection != false && $dataSection->nb_days_after == 3) $content .= "selected=\"selected\"";
$content .= " >3</option>
<option ";
if ($dataSection->nb_days_after == 4) $content .= "selected=\"selected\"";
if ($dataSection != false && $dataSection->nb_days_after == 4) $content .= "selected=\"selected\"";
$content .= " >4</option>
<option ";
if ($dataSection->nb_days_after == 5) $content .= "selected=\"selected\"";
if ($dataSection != false && $dataSection->nb_days_after == 5) $content .= "selected=\"selected\"";
$content .= " >5</option>
</select> " . get_string('nb_days_after', 'format_iena') . "
</label>
......@@ -205,42 +217,6 @@
</div>
</div>
<!-- Multiple Radios -->
<div class=\"row\" style=\"display: none;\">
<div class=\"form-group\">
<div class=\"col-md-3\">
<label class=\" control-label\" for=\"radios\">" . get_string('hide_section', 'format_iena') . "</label>
<p style=\"font-size: 12px;\">" . get_string('hide_section_summary', 'format_iena') . "</p>
</div>
<div class=\"col-md-4\">
<div class=\"radio\">
<label for=\"radios-0\">
<input type=\"radio\" name=\"hide\" id=\"hide-0\" value=\"1\" ";
if ($dataSection->hide == 1 || !$dataSection->hide) $content .= "checked=\"checked\"";
$content .= ">
" . get_string('hide_option_1', 'format_iena') . "
</label>
</div>
<div class=\"radio\">
<label for=\"radios-1\">
<input type=\"radio\" name=\"hide\" id=\"hide-1\" value=\"2\" ";
if ($dataSection->hide == 2) $content .= "checked=\"checked\"";
$content .= ">
" . get_string('hide_option_2', 'format_iena') . "
</label>
</div>
<div class=\"radio\">
<label for=\"radios-2\">
<input type=\"radio\" name=\"hide\" id=\"hide-2\" value=\"3\" ";
if ($dataSection->hide == 3) $content .= "checked=\"checked\"";
$content .= ">
" . get_string('hide_option_3', 'format_iena') . "
</label>
</div>
</div>
</div>
</div>
";
$link_annuler = $CFG->wwwroot . "/course/view.php?id=" . $courseID;
$content .= '<div class="">
......@@ -260,7 +236,7 @@
$('.fdescription').hide();
});
</script>
";
";
return $content;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment