|
@@ -451,13 +451,33 @@ class iassign {
|
|
|
|
|
|
//2021 $diretorio = $CFG->dataroot . DIRECTORY_SEPARATOR . 'temp' . DIRECTORY_SEPARATOR . 'files' . DIRECTORY_SEPARATOR;
|
|
//2021 $diretorio = $CFG->dataroot . DIRECTORY_SEPARATOR . 'temp' . DIRECTORY_SEPARATOR . 'files' . DIRECTORY_SEPARATOR;
|
|
//TODO: tem que criar moodledata/temp/iassign_files
|
|
//TODO: tem que criar moodledata/temp/iassign_files
|
|
|
|
+ // Create $CFG->dataroot/temp/iassign_files
|
|
|
|
+
|
|
|
|
+ $tempfilespath = $CFG->dataroot . DIRECTORY_SEPARATOR . 'temp';
|
|
|
|
+ if (!file_exists($tempfilespath)) {
|
|
|
|
+ mkdir($tempfilespath, 0777, true);
|
|
|
|
+ }
|
|
|
|
+ $iassignfilespath = $tempfilespath . DIRECTORY_SEPARATOR . 'iassign_files';
|
|
|
|
+ if (!file_exists($iassignfilespath)) {
|
|
|
|
+ mkdir($iassignfilespath, 0777, true);
|
|
|
|
+ }
|
|
|
|
+
|
|
$diretorio = $CFG->dataroot . DIRECTORY_SEPARATOR . 'temp'
|
|
$diretorio = $CFG->dataroot . DIRECTORY_SEPARATOR . 'temp'
|
|
. DIRECTORY_SEPARATOR . 'iassign_files' . DIRECTORY_SEPARATOR;
|
|
. DIRECTORY_SEPARATOR . 'iassign_files' . DIRECTORY_SEPARATOR;
|
|
|
|
+
|
|
|
|
+ if (!file_exists($diretorio)) {
|
|
|
|
+ echo 'Não foi possível criar o diretório para preparar o arquivo com as submissões. Possivelmente o caminho está bloqueado para escrita.';
|
|
|
|
+ exit;
|
|
|
|
+ }
|
|
|
|
|
|
$zip_filename = $diretorio . 'package_iassign_'.time().'.zip';
|
|
$zip_filename = $diretorio . 'package_iassign_'.time().'.zip';
|
|
|
|
|
|
$zip = new zip_archive(); // create ZIP
|
|
$zip = new zip_archive(); // create ZIP
|
|
- $zip->open($zip_filename);
|
|
|
|
|
|
+ if (!$zip->open($zip_filename)) {
|
|
|
|
+ echo 'Não foi possível criar o arquivo zip com as submissões dos alunos, pois o diretório no servidor está bloqueado para escrita: ' . $diretorio;
|
|
|
|
+ exit;
|
|
|
|
+ }
|
|
|
|
+ ;
|
|
|
|
|
|
foreach ($exercises_list as $exercise) {
|
|
foreach ($exercises_list as $exercise) {
|
|
$dir_ex = iassign_utils::format_filename($exercise->name);
|
|
$dir_ex = iassign_utils::format_filename($exercise->name);
|
|
@@ -2491,7 +2511,7 @@ $param->special_param1 = 0; // 'special_param1 == 1' => script of iGeom
|
|
$this->activity->view_dates();
|
|
$this->activity->view_dates();
|
|
$USER->iassignEdit = $this->bottonPost;
|
|
$USER->iassignEdit = $this->bottonPost;
|
|
$this->activity->show_info_iassign();
|
|
$this->activity->show_info_iassign();
|
|
-
|
|
|
|
|
|
+
|
|
if ($iassign_submission) {
|
|
if ($iassign_submission) {
|
|
//xxx $param_aux = "action=get_answer&iassign_submission_current=" . $iassign_submission->id . "&id=" . $id . "&iassign_current=" . $this->activity->get_activity()->id . "&write_solution=" . $this->write_solution . "&userid_iassign=" . $USER->id;
|
|
//xxx $param_aux = "action=get_answer&iassign_submission_current=" . $iassign_submission->id . "&id=" . $id . "&iassign_current=" . $this->activity->get_activity()->id . "&write_solution=" . $this->write_solution . "&userid_iassign=" . $USER->id;
|
|
$param_aux = "action=get_answer&iassign_submission_current=" . $iassign_submission->id . "&id=" . $id . "&iassign_current=" . $this->activity->get_activity()->id . "&userid_iassign=" . $USER->id;
|
|
$param_aux = "action=get_answer&iassign_submission_current=" . $iassign_submission->id . "&id=" . $id . "&iassign_current=" . $this->activity->get_activity()->id . "&userid_iassign=" . $USER->id;
|
|
@@ -2945,6 +2965,7 @@ $param->special_param1 = 0; // 'special_param1 == 1' => script of iGeom
|
|
print '</tr></table>' . "\n";
|
|
print '</tr></table>' . "\n";
|
|
|
|
|
|
// Presents the iLM
|
|
// Presents the iLM
|
|
|
|
+
|
|
print '<table width=100% border=0 valign="top">' . "\n";
|
|
print '<table width=100% border=0 valign="top">' . "\n";
|
|
print '<td width=80% align="left">';
|
|
print '<td width=80% align="left">';
|
|
print '<strong>' . $last_iassign . ' ' . get_string('repeat_msg', 'iassign') . '</strong></td>' . "\n"; // If you want to do this activity from the beginning again, use the \"Redo button\".
|
|
print '<strong>' . $last_iassign . ' ' . get_string('repeat_msg', 'iassign') . '</strong></td>' . "\n"; // If you want to do this activity from the beginning again, use the \"Redo button\".
|
|
@@ -5082,14 +5103,14 @@ class activity {
|
|
/// Show information of activity
|
|
/// Show information of activity
|
|
function show_info_iassign () {
|
|
function show_info_iassign () {
|
|
global $DB, $OUTPUT;
|
|
global $DB, $OUTPUT;
|
|
|
|
+ $output = '';
|
|
|
|
|
|
- $output = '<p><strong>' . get_string('proposition', 'iassign') . ':</strong> ' . $this->activity->proposition . '</p>' . "\n";
|
|
|
|
if ($this->activity->type_iassign == 3) {
|
|
if ($this->activity->type_iassign == 3) {
|
|
if ($this->activity->dependency == 0) {
|
|
if ($this->activity->dependency == 0) {
|
|
- $output .= '<p><strong>' . get_string('independent_activity', 'iassign') . '</strong></p>' . "\n";
|
|
|
|
|
|
+ $output .= '<p style="margin-top: -1rem;"><strong>' . get_string('independent_activity', 'iassign') . '</strong>' . "\n";
|
|
} else {
|
|
} else {
|
|
$dependencys = explode(';', $this->activity->dependency);
|
|
$dependencys = explode(';', $this->activity->dependency);
|
|
- $output .= '<p><strong>' . get_string('dependency', 'iassign') . '</strong></p>';
|
|
|
|
|
|
+ $output .= '<p style="margin-top: -1rem;"><strong>' . get_string('dependency', 'iassign') . '</strong>';
|
|
foreach ($dependencys as $dependency) {
|
|
foreach ($dependencys as $dependency) {
|
|
$dependencyiassign = $DB->get_record("iassign_statement", array("id" => $dependency));
|
|
$dependencyiassign = $DB->get_record("iassign_statement", array("id" => $dependency));
|
|
if ($dependencyiassign)
|
|
if ($dependencyiassign)
|
|
@@ -5097,12 +5118,44 @@ class activity {
|
|
} // foreach ($dependencys as $dependency)
|
|
} // foreach ($dependencys as $dependency)
|
|
} // if ($iassign_statement_activity_item->dependency == 0)
|
|
} // if ($iassign_statement_activity_item->dependency == 0)
|
|
if ($this->activity->max_experiment == 0)
|
|
if ($this->activity->max_experiment == 0)
|
|
- $output .= '<p><strong>' . get_string('experiment', 'iassign') . '</strong> ' . get_string('ilimit', 'iassign');
|
|
|
|
|
|
+ $output .= '<strong style="margin-left: 3rem;">' . get_string('experiment', 'iassign') . '</strong> ' . get_string('ilimit', 'iassign');
|
|
else
|
|
else
|
|
- $output .= '<p><strong>' . get_string('experiment_iassign', 'iassign') . '</strong> ' . $this->activity->max_experiment . "\n";
|
|
|
|
- $output .= ' <strong>' . get_string('grade_iassign', 'iassign') . '</strong> ' . $this->activity->grade . '</p>' . "\n";
|
|
|
|
|
|
+ $output .= '<strong style="margin-left: 3rem;">' . get_string('experiment_iassign', 'iassign') . '</strong> ' . $this->activity->max_experiment . "\n";
|
|
|
|
+ $output .= '<strong style="margin-left: 3rem;">' . get_string('grade_iassign', 'iassign') . ':</strong> ' . $this->activity->grade . '</p>' . "\n";
|
|
} // if ($iassign_statement_activity_item->type_iassign == 3)
|
|
} // if ($iassign_statement_activity_item->type_iassign == 3)
|
|
|
|
|
|
|
|
+ $output .= '<script>
|
|
|
|
+ function toLeft () {
|
|
|
|
+
|
|
|
|
+ document.getElementsByClassName("proposition")[0].style.cssFloat = "left";
|
|
|
|
+ document.getElementsByClassName("proposition")[0].style.width = "40%";
|
|
|
|
+ document.getElementById("fullscreen").style.marginTop = "-3rem";
|
|
|
|
+ document.getElementById("columnsbutton").style.color = "#1da075";
|
|
|
|
+ }
|
|
|
|
+ function toDefault () {
|
|
|
|
+
|
|
|
|
+ document.getElementsByClassName("proposition")[0].style.cssFloat = "none";
|
|
|
|
+ document.getElementsByClassName("proposition")[0].style.width = "100%";
|
|
|
|
+ document.getElementById("fullscreen").style.marginTop = "0";
|
|
|
|
+ document.getElementById("columnsbutton").style.color = "#343a40";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ var activate = false;
|
|
|
|
+ function toggleColumns () {
|
|
|
|
+ if (activate) {
|
|
|
|
+ activate = false;
|
|
|
|
+ toDefault();
|
|
|
|
+ } else {
|
|
|
|
+ activate = true;
|
|
|
|
+ toLeft();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ </script>';
|
|
|
|
+
|
|
|
|
+ $output .= '<span style="float: right"> <i id="columnsbutton" onclick="toggleColumns()" class="fa fa-columns" style="font-size: 1.5rem;" aria-hidden="true" role="button"></i></span>';
|
|
|
|
+
|
|
|
|
+ $output .= '<p><strong>' . get_string('proposition', 'iassign') . ':</p> <div class="proposition">' . $this->activity->proposition . '</div>' . "\n";
|
|
|
|
+
|
|
print $OUTPUT->box($output);
|
|
print $OUTPUT->box($output);
|
|
} // function show_info_iassign()
|
|
} // function show_info_iassign()
|
|
|
|
|