-1

如何解决提交错误:

curl: (6) Couldn't resolve host 'www-origin.coursera.org'
m =  15
error] submission with curl() was not successful

!! Submission failed: Grader sent no response



Function: submitWithConfiguration>validateResponse
FileName: C:\Users\admin\Desktop\ex7\lib\submitWithConfiguration.m
LineNumber: 158 
4

3 回答 3

0

此错误可能是因为您的计算机目前无法连接到 Internet。这是从在线评分器收集数据背后的功能。

    function response = validateResponse(resp)
  % test if the response is json or an HTML page
  isJson = length(resp) > 0 && resp(1) == '{';
  isHtml = findstr(lower(resp), '<html');

  if (isJson)
    response = resp;
  elseif (isHtml)
    % the response is html, so its probably an error message
    printHTMLContents(resp);
    error('Grader response is an HTML message');
  else
    error('Grader sent no response');
  end
end

现在,当响应为空时,将打印语句:“Grader sent no response”。并且在未连接计算机时响应可以为空。希望这是您错误背后的原因,如果不是,请告诉我。

于 2018-10-04T03:31:30.340 回答
0

MATLAB?

此步骤可能会有所帮助:

打开文件: submitWithConfiguration.m ;和:转到第 131 和 134 行;

然后改变:

line131: json_command = sprintf('echo jsonBody=%s | curl -k -X POST -d @- %s', body, url);

line134: json_command = sprintf('echo ''jsonBody=%s'' | curl -k -X POST -d @- %s', body, url);

至:

line131: json_command = sprintf('echo jsonBody=%s | curl -k -X POST -s -d @- %s', body, url);

line134: json_command = sprintf('echo ''jsonBody=%s'' | curl -k -X POST -s -d @- %s', body, url);

(都加-s)

于 2020-07-25T02:10:21.633 回答
-1

看起来代码很好,问题是您的计算机无法连接到互联网。您可以使用 VPN 轻松解决此问题。祝你好运!

于 2020-12-17T16:24:22.410 回答