diff --git a/cis/testtool/frage.php b/cis/testtool/frage.php index 12d9d8d26..69dc9496c 100644 --- a/cis/testtool/frage.php +++ b/cis/testtool/frage.php @@ -37,6 +37,7 @@ require_once('../../include/gebiet.class.php'); require_once('../../include/sprache.class.php'); require_once '../../include/phrasen.class.php'; require_once '../../include/reihungstest.class.php'; +require_once '../../include/pruefling.class.php'; if (!$db = new basis_db()) die('Fehler beim Oeffnen der Datenbankverbindung'); @@ -157,6 +158,12 @@ echo ' if(!isset($_SESSION['pruefling_id'])) die($p->t('testtool/bitteZuerstAnmelden')); +$pruefling = new pruefling(); +$pruefling->load($_SESSION['pruefling_id']); + +if ($pruefling->gesperrt === 't') + die(""); + $gebiet = new gebiet($gebiet_id); if($gebiet->level_start!='') diff --git a/cis/testtool/prueflinggesperrt.php b/cis/testtool/prueflinggesperrt.php new file mode 100644 index 000000000..f0ab2b1ad --- /dev/null +++ b/cis/testtool/prueflinggesperrt.php @@ -0,0 +1,39 @@ + + + + + + + + + + +




+

t('testtool/prueflingGesperrt');?>

+
+ + diff --git a/include/pruefling.class.php b/include/pruefling.class.php index 17fe48789..fc64d90c4 100644 --- a/include/pruefling.class.php +++ b/include/pruefling.class.php @@ -31,6 +31,7 @@ class pruefling extends basis_db public $registriert; public $prestudent_id; public $semester; + public $gesperrt; // ErgebnisArray public $result=array(); @@ -67,6 +68,7 @@ class pruefling extends basis_db $this->registriert = $row->registriert; $this->prestudent_id = $row->prestudent_id; $this->semester = $row->semester; + $this->gesperrt = $row->gesperrt; return true; } else @@ -184,6 +186,7 @@ class pruefling extends basis_db $this->registriert = $row->registriert; $this->prestudent_id = $row->prestudent_id; $this->semester = $row->semester; + $this->gesperrt = $row->gesperrt; return true; } else @@ -221,6 +224,7 @@ class pruefling extends basis_db $obj->registriert = $row->registriert; $obj->prestudent_id = $row->prestudent_id; $obj->semester = $row->semester; + $obj->gesperrt = $row->gesperrt; $this->result[] = $obj; } diff --git a/locale/de-AT/testtool.php b/locale/de-AT/testtool.php index a4d9e33fd..8e330dafe 100644 --- a/locale/de-AT/testtool.php +++ b/locale/de-AT/testtool.php @@ -78,4 +78,6 @@ $this->phrasen['testtool/einfuehrungsText']=' Display testpage '; +$this->phrasen['testtool/prueflingGesperrt']='Bitte kontaktieren Sie die Reihungstestaufsicht!'; + ?> diff --git a/locale/en-US/testtool.php b/locale/en-US/testtool.php index 1630c9251..473ac1e0d 100644 --- a/locale/en-US/testtool.php +++ b/locale/en-US/testtool.php @@ -50,4 +50,5 @@ $this->phrasen['testtool/startDrueckenUmZuBeginnen']='To start this section, ple $this->phrasen['testtool/keinPrueflingseintragVorhanden']='No candidate entry available.'; $this->phrasen['testtool/fuerFolgendeStgAngemeldet']='You have applied for the following degree programs:'; $this->phrasen['testtool/invalideGebiete']='One or more question areas incorrect!
Please inform an assisting person.'; +$this->phrasen['testtool/prueflingGesperrt']='Please contact the placement test supervisor!'; ?> \ No newline at end of file diff --git a/system/dbupdate_3.3.php b/system/dbupdate_3.3.php index fa073bcba..d9098795f 100644 --- a/system/dbupdate_3.3.php +++ b/system/dbupdate_3.3.php @@ -2990,6 +2990,19 @@ if($result = @$db->db_query("SELECT * FROM information_schema.role_table_grants } } + +// Spalte gesperrt in testtool.tbl_pruefling +if(!$result = @$db->db_query("SELECT gesperrt FROM testtool.tbl_pruefling LIMIT 1;")) +{ + $qry = "ALTER TABLE testtool.tbl_pruefling ADD COLUMN gesperrt boolean NOT NULL DEFAULT false;"; + + if(!$db->db_query($qry)) + echo 'testtool.tbl_pruefling: '.$db->db_last_error().'
'; + else + echo '
testtool.tbl_pruefling: Spalte gesperrt hinzugefuegt!
'; +} + + // Kategorisierung von Services if(!$result = @$db->db_query("SELECT * FROM public.tbl_servicekategorie LIMIT 1")) { @@ -6233,7 +6246,7 @@ $tabellen=array( "testtool.tbl_gebiet" => array("gebiet_id","kurzbz","bezeichnung","beschreibung","zeit","multipleresponse","kategorien","maxfragen","zufallfrage","zufallvorschlag","levelgleichverteilung","maxpunkte","insertamum", "insertvon", "updateamum", "updatevon", "level_start","level_sprung_auf","level_sprung_ab","antwortenprozeile","bezeichnung_mehrsprachig", "offsetpunkte"), "testtool.tbl_kategorie" => array("kategorie_kurzbz","gebiet_id"), "testtool.tbl_kriterien" => array("gebiet_id","kategorie_kurzbz","punkte","typ"), - "testtool.tbl_pruefling" => array("pruefling_id","prestudent_id","studiengang_kz","idnachweis","registriert","semester"), + "testtool.tbl_pruefling" => array("pruefling_id","prestudent_id","studiengang_kz","idnachweis","registriert","semester", "gesperrt"), "testtool.tbl_vorschlag" => array("vorschlag_id","frage_id","nummer","punkte","insertamum","insertvon","updateamum","updatevon","aktiv"), "testtool.tbl_pruefling_frage" => array("prueflingfrage_id","pruefling_id","frage_id","nummer","begintime","endtime"), "testtool.tbl_frage_sprache" => array("frage_id","sprache","text","bild","audio","insertamum","insertvon","updateamum","updatevon"), diff --git a/vilesci/stammdaten/auswertung_fhtw.php b/vilesci/stammdaten/auswertung_fhtw.php index 1acfe1a55..8c3e17d61 100644 --- a/vilesci/stammdaten/auswertung_fhtw.php +++ b/vilesci/stammdaten/auswertung_fhtw.php @@ -440,6 +440,43 @@ if ($deleteAllResults) } } +$rtprueflingEntSperren = filter_input(INPUT_POST, 'rtprueflingEntSperren', FILTER_VALIDATE_BOOLEAN); +if ($rtprueflingEntSperren) +{ + if (!$rechte->isBerechtigt('lehre/reihungstestAufsicht', null, 'su')) + { + echo json_encode(array( + 'status' => 'fehler', + 'msg' => $rechte->errormsg + )); + exit(); + } + + if (isset($_POST['prestudent_id']) && is_numeric($_POST['prestudent_id']) + && isset($_POST['art'])) + { + $qry = "UPDATE testtool.tbl_pruefling SET gesperrt =" . $db->db_add_param($_POST['art'], 'BOOLEAN') . " + WHERE prestudent_id = " . $db->db_add_param($_POST['prestudent_id']) . ";"; + + if ($result = $db->db_query($qry)) + { + $msg = $_POST['art'] === 'false' ? 'Pruefling wurde gesperrt' : 'Pruefling wurde freigeschaltet'; + echo json_encode(array( + 'status' => 'ok', + 'msg' => $msg)); + exit(); + } + else + { + echo json_encode(array( + 'status' => 'fehler', + 'msg' => 'Fehler beim speichern der Daten' + )); + exit(); + } + } +} + // Ajax-Request um einen Reihungstest freizuschalten $rtFreischalten = filter_input(INPUT_POST, 'rtFreischalten', FILTER_VALIDATE_BOOLEAN); if ($rtFreischalten) @@ -1408,6 +1445,7 @@ if (isset($_REQUEST['reihungstest']) || isset($_POST['rtauswsubmit'])) tbl_gebiet.bezeichnung AS gebiet, tbl_pruefling.idnachweis, tbl_pruefling.registriert, + tbl_pruefling.gesperrt, get_rolle_prestudent(prestudent_id, rt.studiensemester_kurzbz) AS letzter_status FROM PUBLIC.tbl_rt_person JOIN PUBLIC.tbl_person ON (tbl_rt_person.person_id = tbl_person.person_id) @@ -1530,6 +1568,7 @@ if (isset($_REQUEST['reihungstest']) || isset($_POST['rtauswsubmit'])) $ergebnis[$row->prestudent_id]->geschlecht = $row->geschlecht; $ergebnis[$row->prestudent_id]->idnachweis = $row->idnachweis; $ergebnis[$row->prestudent_id]->registriert = $row->registriert; + $ergebnis[$row->prestudent_id]->gesperrt = $row->gesperrt; $ergebnis[$row->prestudent_id]->stg_kurzbz = $row->stg_kurzbz; $ergebnis[$row->prestudent_id]->stg_bez = $row->stg_bez; $ergebnis[$row->prestudent_id]->ausbildungssemester = $row->ausbildungssemester; @@ -2291,7 +2330,57 @@ else }); } } - + function prueflingEntSperren(prestudent_id, name, art) + { + if (art === true) + var text = "sperren"; + else if (art === false) + var text = "entsperren"; + + if (confirm("Wollen Sie den Studenten "+ name + " wirklich " + text + "?")) + { + data = { + prestudent_id: prestudent_id, + art: art, + rtprueflingEntSperren: true + }; + + $.ajax({ + url: "auswertung_fhtw.php", + data: data, + type: "POST", + dataType: "json", + success: function(data) + { + if(data.status !== "ok") + { + $("#msgbox").attr("class","alert alert-danger"); + $("#msgbox").show(); + $("#msgbox").html(data["msg"]); + } + else + { + if (art === true) + { + $("#prueflingentsperren_" + prestudent_id).removeClass("hidden"); + $("#prueflingsperren_" + prestudent_id).addClass("hidden"); + } + else if (art === false) + { + $("#prueflingsperren_" + prestudent_id).removeClass("hidden"); + $("#prueflingentsperren_" + prestudent_id).addClass("hidden"); + } + } + }, + error: function(data) + { + $("#msgbox").attr("class","alert alert-danger"); + $("#msgbox").show(); + $("#msgbox").html(data["msg"]); + } + }); + } + } function deleteAllResults(prestudent_id, name) { if (confirm("Wollen Sie ALLE Ergebnisse der Person "+name+" wirklich löschen")) @@ -2955,6 +3044,7 @@ else PreId + Ent-/Sperren Nachname Vornamen GebDatum @@ -3011,6 +3101,18 @@ else $erg->prestudent_id + "; + + + echo " + + + + + + + "; + echo " ".$erg->nachname." ".($erg->qualifikationskurs == true ? "(Q)" : "")." $erg->vorname " . $datum_obj->formatDatum($erg->gebdatum, 'd.m.Y') . "