HGustavs / LenaSYS

Code Viewer and Course Organization System used in some courses at University of Skövde
57 stars 31 forks source link

Filter output for deleteListentries test in sectionedservice_Test.php #14715

Closed a22iliru closed 6 months ago

a22iliru commented 7 months ago
make sure a correct expected output and filters are used
currently this does not pass the assert test
Be aware that some tests needs a fresh database to pass

File: sectionedservice_Test.php

a22marca commented 7 months ago

I've been trying to manually get a response from the inspect-tool in the browser, but this functionality doesn't seem to work properly. I'm assuming this functionality should be executed when trying to remove a listed entry in a course. When trying to delete a course no requests are sent. We should resolve this issue before creating a test for it.

a22albjo commented 7 months ago

I went to coursed.php pressed test-course and the trashbin on a listentrie, opened the networktab in inspector and waited 60 sec and got this respons, the response seems fine and can be used as expected output. {"entries":[{"entryname":"JavaScript-Code:","lid":1,"pos":1,"kind":1,"moment":null,"link":"1","handindeadline":null,"visible":1,"highscoremode":0,"gradesys":null,"code_id":null,"deadline":"2015-01-30 15:30:00","relativedeadline":null,"qrelease":"2015-01-01 00:00:00","comments":null,"qstart":null,"grptype":null,"tabs":null,"feedbackenabled":0,"feedbackquestion":null,"ts":"2024-04-24 14:14:57"},{"entryname":"JS-TEST template 2","lid":4001,"pos":1,"kind":2,"moment":null,"link":"7001","handindeadline":null,"visible":1,"highscoremode":0,"gradesys":null,"code_id":null,"deadline":null,"relativedeadline":null,"qrelease":null,"comments":null,"qstart":null,"grptype":null,"tabs":null,"feedbackenabled":0,"feedbackquestion":null,"ts":"2024-04-24 14:14:57"},{"entryname":"JS-TEST template 3","lid":4002,"pos":1,"kind":2,"moment":null,"link":"7002","handindeadline":null,"visible":1,"highscoremode":0,"gradesys":null,"code_id":null,"deadline":null,"relativedeadline":null,"qrelease":null,"comments":null,"qstart":null,"grptype":null,"tabs":null,"feedbackenabled":0,"feedbackquestion":null,"ts":"2024-04-24 14:14:57"},{"entryname":"JS-TEST template 4","lid":4003,"pos":1,"kind":2,"moment":null,"link":"7003","handindeadline":null,"visible":1,"highscoremode":0,"gradesys":null,"code_id":null,"deadline":null,"relativedeadline":null,"qrelease":null,"comments":null,"qstart":null,"grptype":null,"tabs":null,"feedbackenabled":0,"feedbackquestion":null,"ts":"2024-04-24 14:14:57"},{"entryname":"JS-TEST template 5","lid":4004,"pos":1,"kind":2,"moment":null,"link":"7004","handindeadline":null,"visible":1,"highscoremode":0,"gradesys":null,"code_id":null,"deadline":null,"relativedeadline":null,"qrelease":null,"comments":null,"qstart":null,"grptype":null,"tabs":null,"feedbackenabled":0,"feedbackquestion":null,"ts":"2024-04-24 14:14:57"},{"entryname":"JS-TEST template 6","lid":4005,"pos":1,"kind":2,"moment":null,"link":"7005","handindeadline":null,"visible":1,"highscoremode":0,"gradesys":null,"code_id":null,"deadline":null,"relativedeadline":null,"qrelease":null,"comments":null,"qstart":null,"grptype":null,"tabs":null,"feedbackenabled":0,"feedbackquestion":null,"ts":"2024-04-24 14:14:57"},{"entryname":"JS-TEST template 7","lid":4006,"pos":1,"kind":2,"moment":null,"link":"7006","handindeadline":null,"visible":1,"highscoremode":0,"gradesys":null,"code_id":null,"deadline":null,"relativedeadline":null,"qrelease":null,"comments":null,"qstart":null,"grptype":null,"tabs":null,"feedbackenabled":0,"feedbackquestion":null,"ts":"2024-04-24 14:14:57"},{"entryname":"JS-TEST template 8","lid":4007,"pos":1,"kind":2,"moment":null,"link":"7007","handindeadline":null,"visible":1,"highscoremode":0,"gradesys":null,"code_id":null,"deadline":null,"relativedeadline":null,"qrelease":null,"comments":null,"qstart":null,"grptype":null,"tabs":null,"feedbackenabled":0,"feedbackquestion":null,"ts":"2024-04-24 14:14:57"},{"entryname":"JS-TEST template 9","lid":4008,"pos":1,"kind":2,"moment":null,"link":"7008","handindeadline":null,"visible":1,"highscoremode":0,"gradesys":null,"code_id":null,"deadline":null,"relativedeadline":null,"qrelease":null,"comments":null,"qstart":null,"grptype":null,"tabs":null,"feedbackenabled":0,"feedbackquestion":null,"ts":"2024-04-24 14:14:57"},{"entryname":"JS-TEST template 10","lid":4009,"pos":1,"kind":2,"moment":null,"link":"7009","handindeadline":null,"visible":1,"highscoremode":0,"gradesys":null,"code_id":null,"deadline":null,"relativedeadline":null,"qrelease":null,"comments":null,"qstart":null,"grptype":null,"tabs":null,"feedbackenabled":0,"feedbackquestion":null,"ts":"2024-04-24 14:14:57"},{"entryname":"HTML-Code:","lid":2,"pos":2,"kind":1,"moment":null,"link":"1","handindeadline":null,"visible":1,"highscoremode":0,"gradesys":null,"code_id":null,"deadline":"2015-01-30 15:30:00","relativedeadline":null,"qrelease":"2015-01-01 00:00:00","comments":null,"qstart":null,"grptype":null,"tabs":null,"feedbackenabled":0,"feedbackquestion":null,"ts":"2024-04-24 14:14:57"},{"entryname":"Html-test template 1","lid":5000,"pos":2,"kind":2,"moment":null,"link":"6000","handindeadline":null,"visible":1,"highscoremode":0,"gradesys":null,"code_id":null,"deadline":null,"relativedeadline":null,"qrelease":null,"comments":null,"qstart":null,"grptype":null,"tabs":null,"feedbackenabled":0,"feedbackquestion":null,"ts":"2024-04-24 14:14:57"},{"entryname":"Html-test template 2","lid":5001,"pos":2,"kind":2,"moment":null,"link":"6001","handindeadline":null,"visible":1,"highscoremode":0,"gradesys":null,"code_id":null,"deadline":null,"relativedeadline":null,"qrelease":null,"comments":null,"qstart":null,"grptype":null,"tabs":null,"feedbackenabled":0,"feedbackquestion":null,"ts":"2024-04-24 14:14:57"},{"entryname":"Html-test template 3","lid":5002,"pos":2,"kind":2,"moment":null,"link":"6002","handindeadline":null,"visible":1,"highscoremode":0,"gradesys":null,"code_id":null,"deadline":null,"relativedeadline":null,"qrelease":null,"comments":null,"qstart":null,"grptype":null,"tabs":null,"feedbackenabled":0,"feedbackquestion":null,"ts":"2024-04-24 14:14:57"},{"entryname":"Html-test template 4","lid":5003,"pos":2,"kind":2,"moment":null,"link":"6003","handindeadline":null,"visible":1,"highscoremode":0,"gradesys":null,"code_id":null,"deadline":null,"relativedeadline":null,"qrelease":null,"comments":null,"qstart":null,"grptype":null,"tabs":null,"feedbackenabled":0,"feedbackquestion":null,"ts":"2024-04-24 14:14:57"},{"entryname":"Html-test template 5","lid":5004,"pos":2,"kind":2,"moment":null,"link":"6004","handindeadline":null,"visible":1,"highscoremode":0,"gradesys":null,"code_id":null,"deadline":null,"relativedeadline":null,"qrelease":null,"comments":null,"qstart":null,"grptype":null,"tabs":null,"feedbackenabled":0,"feedbackquestion":null,"ts":"2024-04-24 14:14:57"},{"entryname":"Html-test template 6","lid":5005,"pos":2,"kind":2,"moment":null,"link":"6005","handindeadline":null,"visible":1,"highscoremode":0,"gradesys":null,"code_id":null,"deadline":null,"relativedeadline":null,"qrelease":null,"comments":null,"qstart":null,"grptype":null,"tabs":null,"feedbackenabled":0,"feedbackquestion":null,"ts":"2024-04-24 14:14:57"},{"entryname":"Html-test template 7","lid":5006,"pos":2,"kind":2,"moment":null,"link":"6006","handindeadline":null,"visible":1,"highscoremode":0,"gradesys":null,"code_id":null,"deadline":null,"relativedeadline":null,"qrelease":null,"comments":null,"qstart":null,"grptype":null,"tabs":null,"feedbackenabled":0,"feedbackquestion":null,"ts":"2024-04-24 14:14:57"},{"entryname":"Html-test template 8","lid":5007,"pos":2,"kind":2,"moment":null,"link":"6007","handindeadline":null,"visible":1,"highscoremode":0,"gradesys":null,"code_id":null,"deadline":null,"relativedeadline":null,"qrelease":null,"comments":null,"qstart":null,"grptype":null,"tabs":null,"feedbackenabled":0,"feedbackquestion":null,"ts":"2024-04-24 14:14:57"},{"entryname":"Html-test template 9","lid":5008,"pos":2,"kind":2,"moment":null,"link":"6008","handindeadline":null,"visible":1,"highscoremode":0,"gradesys":null,"code_id":null,"deadline":null,"relativedeadline":null,"qrelease":null,"comments":null,"qstart":null,"grptype":null,"tabs":null,"feedbackenabled":0,"feedbackquestion":null,"ts":"2024-04-24 14:14:57"},{"entryname":"Html-test template 10","lid":5009,"pos":2,"kind":2,"moment":null,"link":"6009","handindeadline":null,"visible":1,"highscoremode":0,"gradesys":null,"code_id":null,"deadline":null,"relativedeadline":null,"qrelease":null,"comments":null,"qstart":null,"grptype":null,"tabs":null,"feedbackenabled":0,"feedbackquestion":null,"ts":"2024-04-24 14:14:57"},{"entryname":"SQL-CODE:","lid":4,"pos":3,"kind":1,"moment":null,"link":"1","handindeadline":null,"visible":1,"highscoremode":0,"gradesys":null,"code_id":null,"deadline":"2015-01-30 15:30:00","relativedeadline":null,"qrelease":"2015-01-01 00:00:00","comments":null,"qstart":null,"grptype":null,"tabs":null,"feedbackenabled":0,"feedbackquestion":null,"ts":"2024-04-24 14:14:57"},{"entryname":"SQL-TEST template 1","lid":3110,"pos":3,"kind":2,"moment":null,"link":"8000","handindeadline":null,"visible":1,"highscoremode":0,"gradesys":null,"code_id":null,"deadline":null,"relativedeadline":null,"qrelease":null,"comments":null,"qstart":null,"grptype":null,"tabs":null,"feedbackenabled":0,"feedbackquestion":null,"ts":"2024-04-24 14:14:57"},{"entryname":"SQL-TEST template 2","lid":3111,"pos":3,"kind":2,"moment":null,"link":"8001","handindeadline":null,"visible":1,"highscoremode":0,"gradesys":null,"code_id":null,"deadline":null,"relativedeadline":null,"qrelease":null,"comments":null,"qstart":null,"grptype":null,"tabs":null,"feedbackenabled":0,"feedbackquestion":null,"ts":"2024-04-24 14:14:57"},{"entryname":"SQL-TEST template 3","lid":3112,"pos":3,"kind":2,"moment":null,"link":"8002","handindeadline":null,"visible":1,"highscoremode":0,"gradesys":null,"code_id":null,"deadline":null,"relativedeadline":null,"qrelease":null,"comments":null,"qstart":null,"grptype":null,"tabs":null,"feedbackenabled":0,"feedbackquestion":null,"ts":"2024-04-24 14:14:57"},{"entryname":"SQL-TEST template 4","lid":3113,"pos":3,"kind":2,"moment":null,"link":"8003","handindeadline":null,"visible":1,"highscoremode":0,"gradesys":null,"code_id":null,"deadline":null,"relativedeadline":null,"qrelease":null,"comments":null,"qstart":null,"grptype":null,"tabs":null,"feedbackenabled":0,"feedbackquestion":null,"ts":"2024-04-24 14:14:57"},{"entryname":"SQL-TEST template 5","lid":3114,"pos":3,"kind":2,"moment":null,"link":"8004","handindeadline":null,"visible":1,"highscoremode":0,"gradesys":null,"code_id":null,"deadline":null,"relativedeadline":null,"qrelease":null,"comments":null,"qstart":null,"grptype":null,"tabs":null,"feedbackenabled":0,"feedbackquestion":null,"ts":"2024-04-24 14:14:57"},{"entryname":"SQL-TEST template 6","lid":3115,"pos":3,"kind":2,"moment":null,"link":"8005","handindeadline":null,"visible":1,"highscoremode":0,"gradesys":null,"code_id":null,"deadline":null,"relativedeadline":null,"qrelease":null,"comments":null,"qstart":null,"grptype":null,"tabs":null,"feedbackenabled":0,"feedbackquestion":null,"ts":"2024-04-24 14:14:57"},{"entryname":"SQL-TEST template 7","lid":3116,"pos":3,"kind":2,"moment":null,"link":"8006","handindeadline":null,"visible":1,"highscoremode":0,"gradesys":null,"code_id":null,"deadline":null,"relativedeadline":null,"qrelease":null,"comments":null,"qstart":null,"grptype":null,"tabs":null,"feedbackenabled":0,"feedbackquestion":null,"ts":"2024-04-24 14:14:57"},{"entryname":"SQL-TEST template 8","lid":3117,"pos":3,"kind":2,"moment":null,"link":"8007","handindeadline":null,"visible":1,"highscoremode":0,"gradesys":null,"code_id":null,"deadline":null,"relativedeadline":null,"qrelease":null,"comments":null,"qstart":null,"grptype":null,"tabs":null,"feedbackenabled":0,"feedbackquestion":null,"ts":"2024-04-24 14:14:57"},{"entryname":"SQL-TEST template 9","lid":3118,"pos":3,"kind":2,"moment":null,"link":"8008","handindeadline":null,"visible":1,"highscoremode":0,"gradesys":null,"code_id":null,"deadline":null,"relativedeadline":null,"qrelease":null,"comments":null,"qstart":null,"grptype":null,"tabs":null,"feedbackenabled":0,"feedbackquestion":null,"ts":"2024-04-24 14:14:57"},{"entryname":"SQL-TEST template 10","lid":3119,"pos":3,"kind":2,"moment":null,"link":"8009","handindeadline":null,"visible":1,"highscoremode":0,"gradesys":null,"code_id":null,"deadline":null,"relativedeadline":null,"qrelease":null,"comments":null,"qstart":null,"grptype":null,"tabs":null,"feedbackenabled":0,"feedbackquestion":null,"ts":"2024-04-24 14:14:57"},{"entryname":"PHP-CODE:","lid":5,"pos":4,"kind":1,"moment":null,"link":"1","handindeadline":null,"visible":1,"highscoremode":0,"gradesys":null,"code_id":null,"deadline":"2015-01-30 15:30:00","relativedeadline":null,"qrelease":"2015-01-01 00:00:00","comments":null,"qstart":null,"grptype":null,"tabs":null,"feedbackenabled":0,"feedbackquestion":null,"ts":"2024-04-24 14:14:57"},{"entryname":"PHP-TEST template 1","lid":2110,"pos":4,"kind":2,"moment":null,"link":"9000","handindeadline":null,"visible":1,"highscoremode":0,"gradesys":null,"code_id":null,"deadline":null,"relativedeadline":null,"qrelease":null,"comments":null,"qstart":null,"grptype":null,"tabs":null,"feedbackenabled":0,"feedbackquestion":null,"ts":"2024-04-24 14:14:57"},{"entryname":"PHP-TEST template 2","lid":2111,"pos":4,"kind":2,"moment":null,"link":"9001","handindeadline":null,"visible":1,"highscoremode":0,"gradesys":null,"code_id":null,"deadline":null,"relativedeadline":null,"qrelease":null,"comments":null,"qstart":null,"grptype":null,"tabs":null,"feedbackenabled":0,"feedbackquestion":null,"ts":"2024-04-24 14:14:57"},{"entryname":"PHP-TEST template 3","lid":2112,"pos":4,"kind":2,"moment":null,"link":"9002","handindeadline":null,"visible":1,"highscoremode":0,"gradesys":null,"code_id":null,"deadline":null,"relativedeadline":null,"qrelease":null,"comments":null,"qstart":null,"grptype":null,"tabs":null,"feedbackenabled":0,"feedbackquestion":null,"ts":"2024-04-24 14:14:57"},{"entryname":"PHP-TEST template 4","lid":2113,"pos":4,"kind":2,"moment":null,"link":"9003","handindeadline":null,"visible":1,"highscoremode":0,"gradesys":null,"code_id":null,"deadline":null,"relativedeadline":null,"qrelease":null,"comments":null,"qstart":null,"grptype":null,"tabs":null,"feedbackenabled":0,"feedbackquestion":null,"ts":"2024-04-24 14:14:57"},{"entryname":"PHP-TEST template 5","lid":2114,"pos":4,"kind":2,"moment":null,"link":"9004","handindeadline":null,"visible":1,"highscoremode":0,"gradesys":null,"code_id":null,"deadline":null,"relativedeadline":null,"qrelease":null,"comments":null,"qstart":null,"grptype":null,"tabs":null,"feedbackenabled":0,"feedbackquestion":null,"ts":"2024-04-24 14:14:57"},{"entryname":"PHP-TEST template 6","lid":2115,"pos":4,"kind":2,"moment":null,"link":"9005","handindeadline":null,"visible":1,"highscoremode":0,"gradesys":null,"code_id":null,"deadline":null,"relativedeadline":null,"qrelease":null,"comments":null,"qstart":null,"grptype":null,"tabs":null,"feedbackenabled":0,"feedbackquestion":null,"ts":"2024-04-24 14:14:57"},{"entryname":"PHP-TEST template 7","lid":2116,"pos":4,"kind":2,"moment":null,"link":"9006","handindeadline":null,"visible":1,"highscoremode":0,"gradesys":null,"code_id":null,"deadline":null,"relativedeadline":null,"qrelease":null,"comments":null,"qstart":null,"grptype":null,"tabs":null,"feedbackenabled":0,"feedbackquestion":null,"ts":"2024-04-24 14:14:57"},{"entryname":"PHP-TEST template 8","lid":2117,"pos":4,"kind":2,"moment":null,"link":"9007","handindeadline":null,"visible":1,"highscoremode":0,"gradesys":null,"code_id":null,"deadline":null,"relativedeadline":null,"qrelease":null,"comments":null,"qstart":null,"grptype":null,"tabs":null,"feedbackenabled":0,"feedbackquestion":null,"ts":"2024-04-24 14:14:57"},{"entryname":"PHP-TEST template 9","lid":2118,"pos":4,"kind":2,"moment":null,"link":"9008","handindeadline":null,"visible":1,"highscoremode":0,"gradesys":null,"code_id":null,"deadline":null,"relativedeadline":null,"qrelease":null,"comments":null,"qstart":null,"grptype":null,"tabs":null,"feedbackenabled":0,"feedbackquestion":null,"ts":"2024-04-24 14:14:57"},{"entryname":"PHP-TEST template 10","lid":2119,"pos":4,"kind":2,"moment":null,"link":"9009","handindeadline":null,"visible":1,"highscoremode":0,"gradesys":null,"code_id":null,"deadline":null,"relativedeadline":null,"qrelease":null,"comments":null,"qstart":null,"grptype":null,"tabs":null,"feedbackenabled":0,"feedbackquestion":null,"ts":"2024-04-24 14:14:57"},{"entryname":"Other:","lid":6,"pos":5,"kind":1,"moment":null,"link":"1","handindeadline":null,"visible":1,"highscoremode":0,"gradesys":null,"code_id":null,"deadline":"2015-01-30 15:30:00","relativedeadline":null,"qrelease":"2015-01-01 00:00:00","comments":null,"qstart":null,"grptype":null,"tabs":null,"feedbackenabled":0,"feedbackquestion":null,"ts":"2024-04-24 14:14:57"}],"debug":"NONE!","writeaccess":true,"studentteacher":false,"readaccess":true,"coursename":"Testing-Course","coursevers":"1337","coursecode":"G1337","courseid":"1885","links":[{"fileid":-1,"filename":"---===######===---"},{"fileid":45,"filename":"diagram.json"},{"fileid":47,"filename":"helloWorld.html"},{"fileid":4,"filename":"HTML_Ex1.txt"},{"fileid":6,"filename":"HTML_Ex2.txt"},{"fileid":8,"filename":"HTML_Ex3.txt"},{"fileid":10,"filename":"HTML_Ex4.txt"},{"fileid":12,"filename":"HTML_Ex5.txt"},{"fileid":14,"filename":"HTML_Ex6.txt"},{"fileid":16,"filename":"HTML_Ex7.txt"},{"fileid":20,"filename":"HTML_Ex8.txt"},{"fileid":55,"filename":"HTML-TEST1.html"},{"fileid":56,"filename":"HTML-TEST2.html"},{"fileid":57,"filename":"HTML-TEST3.html"},{"fileid":58,"filename":"HTML-TEST4.html"},{"fileid":23,"filename":"JavaScript_Ex1.txt"},{"fileid":26,"filename":"JavaScript_Ex2.txt"},{"fileid":29,"filename":"JavaScript_Ex3.txt"},{"fileid":61,"filename":"JS-TEST1.js"},{"fileid":62,"filename":"JS-TEST2.js"},{"fileid":50,"filename":"mdTest.md"},{"fileid":31,"filename":"PHP_Ex1.txt"},{"fileid":33,"filename":"PHP_Ex2.txt"},{"fileid":35,"filename":"PHP_Ex3.txt"},{"fileid":63,"filename":"PHP-TEST1.php"},{"fileid":38,"filename":"Shader_Ex1.txt"},{"fileid":41,"filename":"Shader_Ex2.txt"},{"fileid":59,"filename":"SQL-TEST1.sql"},{"fileid":60,"filename":"SQL-TEST2.sql"}],"duggor":[],"results":[],"versions":[{"cid":1,"coursecode":"DV12G","vers":"45656","versname":"HT15","coursename":"Webbprogrammering","coursenamealt":"UNK","startdate":"2014-12-29 00:00:00","enddate":"2015-03-08 00:00:00","motd":"Webbprogrammering - HT15"},{"cid":1,"coursecode":"DV12G","vers":"45657","versname":"HT16","coursename":"Webbprogrammering","coursenamealt":"UNK","startdate":"2015-12-29 00:00:00","enddate":"2016-03-08 00:00:00","motd":"Webbprogrammering - HT16"},{"cid":2,"coursecode":"IT118G","vers":"97731","versname":"HT14","coursename":"Webbutveckling - datorgrafik","coursenamealt":"UNK","startdate":"2014-12-29 00:00:00","enddate":"2015-03-08 00:00:00","motd":"Webbutveckling - datorgrafik - HT14"},{"cid":2,"coursecode":"IT118G","vers":"97732","versname":"HT15","coursename":"Webbutveckling - datorgrafik","coursenamealt":"UNK","startdate":"2014-12-29 00:00:00","enddate":"2015-03-08 00:00:00","motd":"Webbutveckling - datorgrafik - HT15"},{"cid":3,"coursecode":"IT500G","vers":"1337","versname":"HT15","coursename":"Datorns grunder","coursenamealt":"UNK","startdate":"2014-12-29 00:00:00","enddate":"2015-03-08 00:00:00","motd":"Datorns grunder - HT15"},{"cid":4,"coursecode":"IT301G","vers":"1338","versname":"HT15","coursename":"Software Engineering","coursenamealt":"UNK","startdate":"2014-12-29 00:00:00","enddate":"2015-03-08 00:00:00","motd":"Software Engineering - HT15"},{"cid":305,"coursecode":"IT308G","vers":"12305","versname":"HT15","coursename":"Objektorienterad programmering","coursenamealt":"UNK","startdate":null,"enddate":null,"motd":null},{"cid":307,"coursecode":"IT115G","vers":"12307","versname":"HT15","coursename":"Datorns grunder","coursenamealt":"UNK","startdate":null,"enddate":null,"motd":null},{"cid":308,"coursecode":"MA161G","vers":"12308","versname":"HT15","coursename":"Diskret matematik","coursenamealt":"UNK","startdate":null,"enddate":null,"motd":null},{"cid":309,"coursecode":"DA322G","vers":"12309","versname":"HT15","coursename":"Operativsystem","coursenamealt":"UNK","startdate":null,"enddate":null,"motd":null},{"cid":312,"coursecode":"IT326G","vers":"12312","versname":"HT15","coursename":"Distribuerade system","coursenamealt":"UNK","startdate":null,"enddate":null,"motd":null},{"cid":319,"coursecode":"DV736A","vers":"12319","versname":"HT15","coursename":"Examensarbete i datavetenskap","coursenamealt":"UNK","startdate":null,"enddate":null,"motd":null},{"cid":324,"coursecode":"IT108G","vers":"12324","versname":"HT15","coursename":"Webbutveckling - webbplatsdesign","coursenamealt":"UNK","startdate":null,"enddate":null,"motd":null},{"cid":1885,"coursecode":"G1337","vers":"1337","versname":"","coursename":"Testing-Course","coursenamealt":"Course for testing codeviewer","startdate":"2020-05-01 00:00:00","enddate":"2020-06-30 00:00:00","motd":"Code examples shows both templateid and boxid!"},{"cid":1894,"coursecode":"G420","vers":"52432","versname":"ST20","coursename":"Demo-Course","coursenamealt":"Chaos Theory - Conspiracy 64k Demo","startdate":"2020-05-01 00:00:00","enddate":"2020-06-30 00:00:00","motd":"Demo Course 2020 - All current duggas"}],"codeexamples":[{"exampleid":"-1","cid":"","examplename":"","sectionname":"New Example","runlink":"","cversion":""},{"exampleid":6000,"cid":1885,"examplename":"HTML-TEST1.html","sectionname":"html","runlink":"HTML-TEST1.html","cversion":1337},{"exampleid":6001,"cid":1885,"examplename":"HTML-TEST1.html","sectionname":"html","runlink":"HTML-TEST1.html","cversion":1337},{"exampleid":6002,"cid":1885,"examplename":"HTML-TEST1.html","sectionname":"html","runlink":"HTML-TEST1.html","cversion":1337},{"exampleid":6003,"cid":1885,"examplename":"HTML-TEST1.html","sectionname":"html","runlink":"HTML-TEST1.html","cversion":1337},{"exampleid":6004,"cid":1885,"examplename":"HTML-TEST1.html","sectionname":"html","runlink":"HTML-TEST1.html","cversion":1337},{"exampleid":6005,"cid":1885,"examplename":"HTML-TEST1.html","sectionname":"html","runlink":"HTML-TEST1.html","cversion":1337},{"exampleid":6006,"cid":1885,"examplename":"HTML-TEST1.html","sectionname":"html","runlink":"HTML-TEST1.html","cversion":1337},{"exampleid":6007,"cid":1885,"examplename":"HTML-TEST1.html","sectionname":"html","runlink":"HTML-TEST1.html","cversion":1337},{"exampleid":6008,"cid":1885,"examplename":"HTML-TEST1.html","sectionname":"html","runlink":"HTML-TEST1.html","cversion":1337},{"exampleid":6009,"cid":1885,"examplename":"HTML-TEST1.html","sectionname":"html","runlink":"HTML-TEST1.html","cversion":1337},{"exampleid":7000,"cid":1885,"examplename":"JS-TEST1.js","sectionname":"js","runlink":"JS-TEST1.js","cversion":1337},{"exampleid":7001,"cid":1885,"examplename":"JS-TEST1.js","sectionname":"js","runlink":"JS-TEST1.js","cversion":1337},{"exampleid":7002,"cid":1885,"examplename":"JS-TEST1.js","sectionname":"js","runlink":"JS-TEST1.js","cversion":1337},{"exampleid":7003,"cid":1885,"examplename":"JS-TEST1.js","sectionname":"js","runlink":"JS-TEST1.js","cversion":1337},{"exampleid":7004,"cid":1885,"examplename":"JS-TEST1.js","sectionname":"js","runlink":"JS-TEST1.js","cversion":1337},{"exampleid":7005,"cid":1885,"examplename":"JS-TEST1.js","sectionname":"js","runlink":"JS-TEST1.js","cversion":1337},{"exampleid":7006,"cid":1885,"examplename":"JS-TEST1.js","sectionname":"js","runlink":"JS-TEST1.js","cversion":1337},{"exampleid":7007,"cid":1885,"examplename":"JS-TEST1.js","sectionname":"js","runlink":"JS-TEST1.js","cversion":1337},{"exampleid":7008,"cid":1885,"examplename":"JS-TEST1.js","sectionname":"js","runlink":"JS-TEST1.js","cversion":1337},{"exampleid":7009,"cid":1885,"examplename":"JS-TEST1.js","sectionname":"js","runlink":"JS-TEST1.js","cversion":1337},{"exampleid":9000,"cid":1885,"examplename":"PHP-TEST1.PHP","sectionname":"PHP","runlink":"PHP-TEST1.PHP","cversion":1337},{"exampleid":9001,"cid":1885,"examplename":"PHP-TEST1.PHP","sectionname":"PHP","runlink":"PHP-TEST1.PHP","cversion":1337},{"exampleid":9002,"cid":1885,"examplename":"PHP-TEST1.PHP","sectionname":"PHP","runlink":"PHP-TEST1.PHP","cversion":1337},{"exampleid":9003,"cid":1885,"examplename":"PHP-TEST1.PHP","sectionname":"PHP","runlink":"PHP-TEST1.PHP","cversion":1337},{"exampleid":9004,"cid":1885,"examplename":"PHP-TEST1.PHP","sectionname":"PHP","runlink":"PHP-TEST1.PHP","cversion":1337},{"exampleid":9005,"cid":1885,"examplename":"PHP-TEST1.PHP","sectionname":"PHP","runlink":"PHP-TEST1.PHP","cversion":1337},{"exampleid":9006,"cid":1885,"examplename":"PHP-TEST1.PHP","sectionname":"PHP","runlink":"PHP-TEST1.PHP","cversion":1337},{"exampleid":9007,"cid":1885,"examplename":"PHP-TEST1.PHP","sectionname":"PHP","runlink":"PHP-TEST1.PHP","cversion":1337},{"exampleid":9008,"cid":1885,"examplename":"PHP-TEST1.PHP","sectionname":"PHP","runlink":"PHP-TEST1.PHP","cversion":1337},{"exampleid":9009,"cid":1885,"examplename":"PHP-TEST1.PHP","sectionname":"PHP","runlink":"PHP-TEST1.PHP","cversion":1337},{"exampleid":8000,"cid":1885,"examplename":"SQL-TEST1.SQL","sectionname":"SQL","runlink":"SQL-TEST1.SQL","cversion":1337},{"exampleid":8001,"cid":1885,"examplename":"SQL-TEST1.SQL","sectionname":"SQL","runlink":"SQL-TEST1.SQL","cversion":1337},{"exampleid":8002,"cid":1885,"examplename":"SQL-TEST1.SQL","sectionname":"SQL","runlink":"SQL-TEST1.SQL","cversion":1337},{"exampleid":8003,"cid":1885,"examplename":"SQL-TEST1.SQL","sectionname":"SQL","runlink":"SQL-TEST1.SQL","cversion":1337},{"exampleid":8004,"cid":1885,"examplename":"SQL-TEST1.SQL","sectionname":"SQL","runlink":"SQL-TEST1.SQL","cversion":1337},{"exampleid":8005,"cid":1885,"examplename":"SQL-TEST1.SQL","sectionname":"SQL","runlink":"SQL-TEST1.SQL","cversion":1337},{"exampleid":8006,"cid":1885,"examplename":"SQL-TEST1.SQL","sectionname":"SQL","runlink":"SQL-TEST1.SQL","cversion":1337},{"exampleid":8007,"cid":1885,"examplename":"SQL-TEST1.SQL","sectionname":"SQL","runlink":"SQL-TEST1.SQL","cversion":1337},{"exampleid":8008,"cid":1885,"examplename":"SQL-TEST1.SQL","sectionname":"SQL","runlink":"SQL-TEST1.SQL","cversion":1337},{"exampleid":8009,"cid":1885,"examplename":"SQL-TEST1.SQL","sectionname":"SQL","runlink":"SQL-TEST1.SQL","cversion":1337}],"unmarked":0,"startdate":"2020-05-01 00:00:00","enddate":"2020-06-30 00:00:00","groups":{"No":["1","2","3","4","5","6","7","8"],"Le":["A","B","C","D","E","F","G","H"],"Vi":["I","II","III","IV","V","VI","VII","VIII"]},"grpmembershp":"UNK","grplst":[],"userfeedback":[],"feedbackquestion":"UNK","avgfeedbackscore":0}

a22albjo commented 7 months ago

I will recreate the test in the app and harvest the output to use as expected.

a22albjo commented 7 months ago

When doing the test i don't get a full response, i only get the courses, i suspect that something is missing in the tests request.

a22albjo commented 7 months ago

Got the right ouutput when adding the course to the data send

a22albjo commented 7 months ago

Filtered the output, i think that the relevant parts are the listentries and the course, listentries to make sure that the relevant entry is deleted and course to make sure that the right course is selected and to make the output more clear.

a22albjo commented 7 months ago

UserAnswer ger ett problem med en foreign key.

Fatal error: Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (albin.useranswer, CONSTRAINT useranswer_ibfk_4 FOREIGN KEY (variant) REFERENCES variant (vid)) in /Applications/XAMPP/xamppfiles/htdocs/LenaSYS/Shared/test.php:87 Stack trace: #0 /Applications/XAMPP/xamppfiles/htdocs/LenaSYS/Shared/test.php(87): PDOStatement->execute() #1 /Applications/XAMPP/xamppfiles/htdocs/LenaSYS/Shared/test.php(129): doDBQuery(Object(PDOStatement), Array, Array, 'query-before-te...') #2 /Applications/XAMPP/xamppfiles/htdocs/LenaSYS/DuggaSys/tests/sectionedservice_Test.php(643): testHandler(Array, true) #3 {main} thrown in /Applications/XAMPP/xamppfiles/htdocs/LenaSYS/Shared/test.php on line 87

a22albjo commented 6 months ago

i found this code in showDuggaService, i think it can be used and modifyed

'query-before-test-1' => "INSERT INTO course(cid, creator) VALUES (9999, 1);",
        'query-before-test-2' => "INSERT INTO listentries(cid, entryname, link, kind, pos, creator, visible, vers, gradesystem, highscoremode, feedbackenabled, feedbackquestion) VALUES (9999, 'Inserttobedeleted', 'UNK', 4, 12, 2, 1, 1337, 1, 1, 0, 'UNK');",
        'query-before-test-3' => "INSERT INTO quiz(cid) VALUES (9999);",
        'query-before-test-4' => "SELECT MAX(id) AS did FROM quiz",
        'query-before-test-5' => "SELECT MAX(lid) AS moment FROM listentries",
        'variables-query-before-test-6' => "did, moment",
        'query-before-test-6' => "INSERT INTO userAnswer (cid, quiz, variant, moment, useranswer, submitted, marked, vers, score, hash, password) VALUES(9999, ?, 3, ?, 'an answer', '2024-04-15 14:00:00', '2024-04-15 14:30:00', 1337, '0', 'ghj1ghj2', 'asddasdd');",
        'query-after-test-1' => "DELETE FROM userAnswer ORDER BY aid DESC LIMIT 1;",
        'query-after-test-2' => "DELETE FROM listentries WHERE cid = 9999;",
        'query-after-test-3' => "DELETE FROM course WHERE cid = 9999;",
        'query-after-test-4' => "DELETE FROM quiz WHERE cid = 9999;",
a22albjo commented 6 months ago

having an issue with test.php Warning: Undefined array key "moment" in /Applications/XAMPP/xamppfiles/htdocs/LenaSYS/Shared/test.php on line 82

Fatal error: Uncaught PDOException: SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens in /Applications/XAMPP/xamppfiles/htdocs/LenaSYS/Shared/test.php:87 Stack trace: #0 /Applications/XAMPP/xamppfiles/htdocs/LenaSYS/Shared/test.php(87): PDOStatement->execute() #1 /Applications/XAMPP/xamppfiles/htdocs/LenaSYS/Shared/test.php(129): doDBQuery(Object(PDOStatement), Array, Array, 'query-before-te...') #2 /Applications/XAMPP/xamppfiles/htdocs/LenaSYS/DuggaSys/tests/sectionedservice_Test.php(647): testHandler(Array, true) #3 {main} thrown in /Applications/XAMPP/xamppfiles/htdocs/LenaSYS/Shared/test.php on line 87

a22albjo commented 6 months ago

im getting output, however the output seem to be to short at the moment, the entries is not included: Test 3 (assertEqual): failed value expected: {"entries":[{"entryname":"PHP examples","lid":1001,"pos":0,"visible":1},{"entryname":"PHP Example 1","lid":1002,"pos":1,"visible":1},{"entryname":"PHP Example 2","lid":1003,"pos":2,"visible":1},{"entryname":"PHP Example 3","lid":1004,"pos":3,"visible":1},{"entryname":"Javascript examples","lid":1005,"pos":4,"visible":1},{"entryname":"JavaScript Example 1","lid":1006,"pos":5,"visible":1},{"entryname":"JavaScript Example 2","lid":1007,"pos":6,"visible":1},{"entryname":"JavaScript Example 3","lid":1008,"pos":7,"visible":1},{"entryname":"HTML5 examples","lid":1009,"pos":8,"visible":1},{"entryname":"HTML5 Example 1","lid":1010,"pos":9,"visible":1},{"entryname":"HTML5 Example 2","lid":1011,"pos":10,"visible":1},{"entryname":"HTML5 Example 3","lid":1012,"pos":11,"visible":1},{"entryname":"HTML5 Example 4","lid":1013,"pos":12,"visible":1},{"entryname":"HTML5 Example 5","lid":1014,"pos":13,"visible":1},{"entryname":"HTML5 Example 6","lid":1015,"pos":14,"visible":1},{"entryname":"HTML5 Example 7","lid":1016,"pos":15,"visible":1},{"entryname":"HTML5 Example 8","lid":1017,"pos":16,"visible":1},{"entryname":"Shader examples","lid":1018,"pos":17,"visible":1},{"entryname":"Shaderprogrammering","lid":1019,"pos":18,"visible":1},{"entryname":"Shaderprogrammering","lid":1020,"pos":19,"visible":1}],"debug":"NONE!","writeaccess":true,"studentteacher":false,"coursename":"Webbprogrammering","courseid":"1"} value output: {"debug":"NONE!","writeaccess":false,"studentteacher":false,"coursename":null,"courseid":"9999"}

a22albjo commented 6 months ago

This has been reviewed and turned back to me 3 times, now all change requests has been addessed.