HGustavs / LenaSYS

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

Reaserch why generic_dugga_file_recieve.js is broken #12159

Open b20hanwa opened 2 years ago

b20hanwa commented 2 years ago

This issue is split from issue #11934

Issue #11934

The image shows error messages on the file. Might have to do with a problem with the upload functionality.

a20behta commented 2 years ago

current progress: The html file [[generic_dugga_file_receive.html]] is built the same way all other duggor are. nothing special about it.

[[generic_dugga_file_receive.js]] uses 3 function calls before breaking.

will continue to see where/how duggaParam["submisson"] can be defined.

a20behta commented 2 years ago

spent last two days looking for datatype and what is expected from dataParam["submissions"] however nothing clear. contains dataParam["submissions"].type and dataParam["submissions"].filename

no clear info on what datatype or what generally is supposed to be there. comments/documentation is not helpfull in the slightest

a20behta commented 2 years ago

[submissions] is never defined and thereby cannot use that info to find, will look at createFileUploadArea(fileUploadfiled) to find more info on intended use of variable

a20behta commented 2 years ago

image is the main problem area. it is the first time dataparam["submissions"] is used for a loop however not the last.

when defined. the popups appear however cannot find where the info should be recieved from, ajaxService does not call on it.

duggaParam["submissions"] is an array where each index contains 2 variables.

*duggaParam["submissions"][index].filename is a string

seems like showdugga.php cannot find setup() even if it is defined. since undefined/null is continously used it breaks the dugga. issue can affect other parts of the system

HGustavs commented 2 years ago

Could it be that it crashes if we have not had any data in the configuration for that test.

e.g. that we have not specified that we want to receive a pdf file for example or a pdf and a zip file.

HGustavs commented 2 years ago

If submissions is not an array we should not iterate, typeof duggaParam['submissions'] should be an array.