Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error using Octave 4.0.2 to submit Coursera assignments

Tags:

octave

This is the error:

   curl: (1) Protocol "https" not supported or disabled in libcurl
    !! Submission failed: unexpected error: input file does not exist
    !! Please try again later.

I am using Windows 10.

I see a possibly relevant answer here, but I don't know where this code would be added within Octave.

like image 230
Antoni Parellada Avatar asked May 20 '16 11:05

Antoni Parellada


2 Answers

The URL is changed. Use the new one in submissionUrl() function in lib/submitWithConfiguration.m file.

function submissionUrl = submissionUrl()
  %submissionUrl = 'https://www-origin.coursera.org/api/onDemandProgrammingImmediateFormSubmissions.v1';
  submissionUrl = 'https://www.coursera.org/api/onDemandProgrammingImmediateFormSubmissions.v1';
end

For check URL you can use curl in terminal.

curl -k 'https://www.coursera.org/api/onDemandProgrammingImmediateFormSubmissions.v1'

You must get something like {"message":"","statusCode":404}

With wrong URL you dose't get anything.

like image 111
Iman Avatar answered Sep 18 '22 18:09

Iman


Try to use the patch that changes following lines in the response function of submitWithConfiguration.m:

params = {'jsonBody', body};
%responseBody = urlread(submissionUrl, 'post', params); OLD CODE
[code, responseBody] = system(sprintf('echo jsonBody=%s | curl -k -X POST -d @- %s', body, submissionUrl));

d @- takes data in a file on the current stdin (the echo fills in).
-k allows curl to perform "insecure" SSL
(see curl --help)
HTH

==================
your code is the one i have, but i'm W7.
Do another try by setting quotes around the url in :
function submissionUrl = submissionUrl()
submissionUrl =
'"https://www-origin.coursera.org/api/onDemandProgrammingImmediateFormSubmissions.v1"'; end

(caution use : ' " and " ' that will quote the "https://.." on the command line.)

If it doesn't work, do a direct call to coursera with a command line (cmd) :

curl -k "https://www-origin.coursera.org/api/onDemandProgrammingImmediateFormSubmissions.v1"

This will call coursera and, as there is no sent form , the site will respond with an html page with near the end ... Action not found ....

if this works, the pb is probably not inside curl, but somewhere else. let us know.

like image 40
pirela Avatar answered Sep 19 '22 18:09

pirela