Question Authors' Forum

Changed the prototype octave_function and want to reinstall original version

Changed the prototype octave_function and want to reinstall original version

by Yusri Yusup -
Number of replies: 7

Hi, I hope somebody would be able to assist me with the above problem. 

I have accidentally changed the prototype "octave_function" question type and now when I choose that type it says that it cannot retrieve it. Is there a way I can restore the original version?


error

In reply to Yusri Yusup

Re: Changed the prototype octave_function and want to reinstall original version

by Richard Lobb -

All system prototypes are in the file builtin_PROTOTYPES.xml on github. So you can generally get things back to the original status by deleting all the existing built-in prototypes and importing that file. Or, more safely, by editing the file to remove all but the one you want, and then importing that.

However, I attach the octave_function prototype for even more safety in this case. Just delete the existing prototype and import this file.

Before doing that, though, make sure you haven't somehow managed to create a duplicate - you get the same error message if you missing a prototype and if you have multiple copies of it.

In reply to Richard Lobb

Re: Changed the prototype octave_function and want to reinstall original version

by Yusri Yusup -

Thanks for the response! However, where can I find the prototypes? It is not in my list of questions. 

In reply to Yusri Yusup

Re: Changed the prototype octave_function and want to reinstall original version

by Richard Lobb -

I assumed you were a system administrator since you said "I have accidentally changed the prototype "octave_function" question type". Only sysamins are able to change the prototypes. They're all in the System > CR_PROTOTYPES category.

If you're not able to see those, but are getting that error (failure to load prototype) then I'm a bit puzzled. If you had managed to create a new prototype for octave_function you'd get that error. Could you have done that, perhaps?

Failing that, I'll need a bit more info. Such as:

  • If you start to create a new CodeRunner question, what is the list of (CodeRunner) question types?
  • Do other question types work OK on your server?
  • Do any other octave_function questions work, or are they all broken?
  • Have you done anything "interesting" to your server lately :)
In reply to Richard Lobb

Re: Changed the prototype octave_function and want to reinstall original version

by Yusri Yusup -

Yes, I am not the admin just the user. When I said I changed the prototype I meant I played with the settings to customize the question type, so maybe I have created another prototype with the same name as octave_function.

  1. It starts with undefined as can be seen in the picture below. 
  2. Other question-types work. 
  3. All of the octave_function type questions are not working now. 
  4. Not that I know of ;)

list of question types

In reply to Yusri Yusup

Re: Changed the prototype octave_function and want to reinstall original version

by Richard Lobb -

OK, it does look like you have two or more prototypes for octave_function. I'm curious to know how that came about. New question types are defined by clicking the customise checkbox and then, in Advanced customisation, setting up a user-defined prototype. But I try to avoid accidental creation of duplicate prototypes during question editing -- you should get an error message like this when you try saving:

Duplicate prototype error message

[As a side note, older versions of CodeRunner - several years ago - didn't have this check. Do you know what version of CodeRunner you're running?]

So there are two problems here:

  1. What sequence of events led to this problem?
  2. How do we fix it?

You're probably mainly interested in  2  but I'm more interested in 1 :-)

If the problem occurred while you were playing with just one particular question, then that would likely be the culprit. Edit that question again and check if it's customised with an advanced customisation panel like the above, defining a "new" Question type "octave_function". If so, you should be able to fix the problem just by deleting that question. Which solves your problem (2) but not mine (1).

If you're not sure of the history, check all questions modified recently (i.e. since the last time the question type was working correctly).

It's also possible that this isn't something you did at all - a sysadmin might have created a duplicate in the System context, which you can't see. If that were the case, the question type would be broken site-wide but if the duplicate is in your course, only that course would be affected. Do you have access to any other courses on the server to check?

In reply to Richard Lobb

Re: Changed the prototype octave_function and want to reinstall original version

by Yusri Yusup -

Thank you for the feedback!

Yes, I did the below. "New question types are defined by clicking the customise checkbox and then, in Advanced customisation, setting up a user-defined prototype."

I am not sure of the version of the coderunner installed but it did not have this warning.

However, now it seems that all of my octave questions do not work. I didn't edit the question below but when I try to edit it, it says that the octave_function type cannot be found. This happens to all questions. But I just found that it only affects one course, so I would have to delete the original question that initiated this problem, and check if the other works. I will keep you posted.

error1

In reply to Yusri Yusup

Re: Changed the prototype octave_function and want to reinstall original version

by Yusri Yusup -

After deleting the offending question the other octave questions work! Thanks Richard!