Forums | Mahara Community

Support /
SmartEvidence error when uploading new matrix


Gordon McLeod's profile picture
Posts: 197

18 February 2017, 5:06

Hello,

I'm working through building a new framework using an existing one as a template. It all seems straightforward, but although I was able to upload the original version to the site and display it, when I try to do the same with my edited version I get the error

"There was an error with submitting this form. Please check the marked fields and try again."

It's not obvious what marked fields I should be looking for, but presumably the file isn't a matrix file as lower down the screen the following is displayed in red

"This is not a valid .matrix file: Unable to parse the JSON content."

I've been through the code and can't see anything that looks wrong (all brackets and syntax accounted for) when comparing with sample matrix files I downloaded from Catalyst and loaded to Mahara. I edited using Notepad++ and saved as *.* all files with the name bvms_ilo_framework_v1.matrix

Any suggestions on what's going wrong would be welcome.

Thanks, Gordon.

Robert Lyon's profile picture
Posts: 756

20 February 2017, 14:16

Hi Gordon,

The error you got relates to the json_decode() of the matrix data.

So first thing I would check is to make sure the matrix data is valid json.

To do this there are a bunch of online json validators, eg http://jsonlint.com/, that can check if the json is valid and show you where possible errors may be.

It is easy to make mistakes with quotes, commas etc when working with such a large file.

If it is valid json can you upload it to your Content -> Files section in mahara.org and I'll take a look at it to see what might be going wrong

Cheers

Robert

Gordon McLeod's profile picture
Posts: 197

21 February 2017, 0:49

Hi Robert,

Thanks for the link to the json verifier. It identified that there was an error on a specific line, which gave me more to work with. I think the problem was that the json view plugin for notepad++ was inserting tabs between new lines and list items, and adding extra spaces (or removing them completely). When I stripped out the extra spaces the error skipped to further down the page, and when I edited that line it jumped again. I also ran the verifier over a couple of other matrix files I'd downloaded for comparison, and one was fine but another found a problem between two almost identical lines. I tried deleting sections of the line to narrow down what was causing the error as it had multiple list items (but other lists were ok), and it looks like it was an extra space near the end of the line. The last one I had to fix to get my file verified was an error on my final closing square bracket - the syntax looks exactly like ones that have passed validation, but I eventually figured out the trailing comma needed to be removed.

I now have a verified file that succesfully uploads, but have a bit more tweaking to do as subheadings aren't being displayed (3 of my categories only have a single item, but the fourth category has multiple elements, only the headline one being displayed).

I think an easy to use GUI to generate the code is going to be an absolute necessity if SmartEvidence is going to get the uptake that it deserves - it's a fabulous functionality, but creating your own bespoke frameworks just seems very pernickety.

Cheers, Gordon.

Robert Lyon's profile picture
Posts: 756

21 February 2017, 7:14

Hi Gordon,

Good to hear you were able to sort out your problems with the matrix file.

Yes, eventually, having an admin interface to add/edit matrix information would be the best solution.

I too would like to see added into Mahara to make the Smart evidence system work better.

This feature just needs some time/budget allocated :)

Cheers

Robert

 

Patric Lougheed's profile picture
Posts: 97

21 February 2017, 8:15

I agree with Gordon and would love to see a GUI for SmartEvidence creation.

I thought I would investigate open source online JSON editors and found that I can edit a framework in this one:

http://mb21.github.io/JSONedit/

Using the nace_usa.matrix and the ala_info_lit.matrix I was able to load them and edit them. Still have to test if creating one from scratch would generate valid JSON to be able to upload into Mahara though.

Kristina Hoeppner's profile picture
Posts: 4729

28 February 2017, 11:34

Hello Patric,

Yes, an editor would be nice. We were also thinking of making one available via mahara.org as a stand-alone editor as that might be easier to develop if we don't have to take Pieforms etc. into consideration. We could then also see how people can share the frameworks easily with the community so we end up with a library of useful frameworks rather than just me uploading the ones we created. ;-)

At the moment, I usually also take one of the existing framework files and adapt it for a new one that I have to set up, adn then run it through the JSON validator https://jsonformatter.curiousconcept.com/

If you want to share a framework file with others, please send it to me and I can include it with the others.

Cheers

Kristina

 

6 results