Notenübernahme aus Moodle optimiert

This commit is contained in:
Andreas Österreicher
2014-03-07 08:03:01 +00:00
parent befc4b7074
commit 8358b7b78e
3 changed files with 21 additions and 16 deletions
@@ -93,8 +93,7 @@ $datum_obj = new datum();
$uebung_id = (isset($_GET['uebung_id'])?$_GET['uebung_id']:'');
$uid = (isset($_GET['uid'])?$_GET['uid']:'');
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
?><!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
@@ -783,7 +782,7 @@ echo '<table>';
<tr>
<td class='td_datum'>".$p->t('global/datum')."</td>
<td class='td_note'>".$p->t('benotungstool/note')."</td>
</td></td>
<td></td>
</tr>
</table>
</td>
@@ -792,7 +791,7 @@ echo '<table>';
<tr>
<td class='td_datum'>".$p->t('global/datum')."</td>
<td class='td_note'>".$p->t('benotungstool/note')."</td>
</td></td>
<td></td>
</tr>
</table>
</td>
@@ -804,22 +803,25 @@ echo '<table>';
if($grade_from_moodle)
{
flush();
ob_flush();
$moodle24 = new moodle24_course();
$moodle24->loadNoten($lvid, $stsem);
$moodle24_course_bezeichung=array();
$moodle24_course_bezeichnung=array();
if(count($moodle24->result)>0)
{
// Bezeichnungen der Moodlekurse laden
foreach($moodle24->result as $obj)
{
if(!isset($moodle24_course_bezeichnung))
if(!isset($moodle24_course_bezeichnung[$obj->mdl_course_id]))
{
$moodle24course = new moodle24_course();
$moodle24course->load($obj->mdl_course_id);
$moodle24_course_bezeichung[$obj->mdl_course_id]=$moodle24course->mdl_shortname;
$moodle24_course_bezeichnung[$obj->mdl_course_id]=$moodle24course->mdl_shortname;
}
}
}
@@ -960,10 +962,10 @@ echo '<table>';
else
$leneg = ' style="font-weight: bold;"';
$title="Moodle 2.4 KursID: ".$moodle24_noten->mdl_course_id.
"\nKursbezeichnung: ".$moodle24_course_bezeichung[$moodle24_noten->mdl_course_id].
"\nKursbezeichnung: ".$moodle24_course_bezeichnung[$moodle24_noten->mdl_course_id].
"\nUser: ".$moodle24_noten->uid.
"\nNote: $moodle24_noten->note";
$note_les_str .= "<br><span".$leneg.">".$moodle24_noten->note."</span><span title='".$title."' style='font-size:10px'> (".$moodle24_course_bezeichung[$moodle24_noten->mdl_course_id].")</span> ";
$note_les_str .= "<br><span".$leneg.">".$moodle24_noten->note."</span><span title='".$title."' style='font-size:10px'> (".$moodle24_course_bezeichnung[$moodle24_noten->mdl_course_id].")</span> ";
}
}
@@ -1067,7 +1069,7 @@ echo '<table>';
echo "<tr><td class='td_datum'>";
echo $pr_datum."</td><td class='td_note'>".$pr_note."</td><td>";
echo "<input type='button' name='anlegen' value='".$p->t('global/aendern')."' onclick='pruefungAnlegen(\"".$row_stud->uid."\",\"".$pr_datum."\",\"".$pr_note."\",\"".$pr_le_id."\")'>";
echo "</td></tr>";
echo "<td></tr>";
}
echo "</table>";
echo "</span>";
@@ -88,6 +88,7 @@ class local_fhcompletews_external extends external_api
if($grade_item->itemtype=='course')
{
$final_id=$key;
$finalitem = $grade_item;
break;
}
}
@@ -100,7 +101,7 @@ class local_fhcompletews_external extends external_api
// Liste mit allen Studierenden des Kurses durchlaufen
$geub = new grade_export_update_buffer();
$gui = new graded_users_iterator($export->course, $export->columns, $export->groupid);
$gui = new graded_users_iterator($export->course, array($final_id=>$finalitem), $export->groupid); //$export->columns
$gui->init();
$kursgrad =array();
@@ -119,9 +120,11 @@ class local_fhcompletews_external extends external_api
{
$gradestr = $export->format_grade($userdata->grades[$final_id]);
$user_item['note']=$gradestr;
// nur zurueckliefern wenn eine Note gefunden wurde und diese nicht '-' ist
if($user_item['note']!='-')
$data[]=$user_item;
}
$data[]=$user_item;
}
$gui->close();
+2 -2
View File
@@ -12,7 +12,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
$plugin->version = 2013031302; // The (date) version of this module + 2 extra digital for daily versions
$plugin->version = 2014030605; // The (date) version of this module + 2 extra digital for daily versions
// This version number is displayed into /admin/forms.php
// TODO: if ever this plugin get branched, the old branch number
// will not be updated to the current date but just incremented. We will
@@ -20,5 +20,5 @@ $plugin->version = 2013031302; // The (date) version of this module + 2 extra
// display this version number with userdate (dev friendly)
$plugin->requires = 2010112400; // Requires this Moodle version - at least 2.0
$plugin->cron = 0;
$plugin->release = '1.0 (Build: 2013031302)';
$plugin->release = '1.0 (Build: 2014030605)';
$plugin->maturity = MATURITY_STABLE;