Marking fails throwing perl error

Added by Matthew Leingang about 6 years ago

Hi, I am using a new installation of AMC (1.3.0+hg2017-10-25) and having an issue marking my quiz. When I press Mark on the Marking tab and watch the log, I can see each sheet being compiled through TeX. But then shortly after, and before any scoring happens, I get this error:

Can't call method "set_type" on an undefined value at /opt/local/lib/perl5/vendor_perl/5.26/AMC/Scoring.pm line 183.

Then the marking stops with no marks recorded.

That line is in the middle of this method:

#######################################################
# small methods to relay to embedded ScoringEnv object

sub set_type {
  my ($self,$type)=@_;
  return($self->{env}->set_type($type));
}

So env isn't getting set for some reason. What am I doing wrong?

I'm attaching the log file in case it helps. Thanks in advance.


Replies (30)

RE: Marking fails throwing perl error - Added by Matthew Leingang about 6 years ago

It seems I forgot to attach the log. Here it is.

AMC-DEBUG-kFVSwYQs.log.save - Log file (91.8 kB)

RE: Marking fails throwing perl error - Added by Alexis Bienvenüe about 6 years ago

Can you post your source file?

RE: Marking fails throwing perl error - Added by Alexis Bienvenüe about 6 years ago

It looks like subject version 1 has no questions at all: is this the case?

RE: Marking fails throwing perl error - Added by Matthew Leingang about 6 years ago

Here is the source file.

source.tex (5.1 kB)

RE: Marking fails throwing perl error - Added by Alexis Bienvenüe about 6 years ago

You did'nt have errors while preparing documents?
With my setup your source file is not compiling: \AMCboxDimensions has to be called after \begin{document}.

RE: Marking fails throwing perl error - Added by Matthew Leingang about 6 years ago

That is strange. All of my AMC .tex files in the past have had \AMCboxDimensions before \begin{document} (that was before I installed AMC-1.3) . And if I move it after, I get the same error.

I will keep searching.

RE: Marking fails throwing perl error - Added by Matthew Leingang about 6 years ago

I have reproduced the error on the simple example from the documentation.

test-amc.tex (1.4 kB)

RE: Marking fails throwing perl error - Added by Alexis Bienvenüe about 6 years ago

It seems that \AMCboxDimensions has to be called after \begin{document} since the storebox package option has been added, between versions 1.2.1 and 1.3.0.
Can you try a full test cycle with your source file with this correction, and report the issues?

RE: Marking fails throwing perl error - Added by Alexis Bienvenüe about 6 years ago

I have reproduced the error on the simple example from the documentation.

Ok. Can you run a full test cycle (new project, etc.) in debugging mode with this sample and post the produced log file?

RE: Marking fails throwing perl error - Added by Matthew Leingang about 6 years ago

I uninstalled AMC and reinstalled AMC like this:

$ sudo port uninstall auto-multiple-choice
$ sudo port selfupdate
$ sudo port upgrade outdated
$ sude port install auto-multiple-choice

Then I re-ran the marking process on my test-amc.tex file. I got the same error—debug log is attached.

There were a few hundred thousand lines of this:

GLib-WARNING **: poll(2) failed due to: Bad file descriptor. at /opt/local/lib/perl5/vendor_perl/5.26/Gtk3.pm line 546.

That wasn't happening before. I cut all but two of them out of the log file to keep the size down.

Then I noticed you wanted a debug log starting from new project. So I tried that. This time when I got to the marking stage, the program hung up and the log file kept filling up with those same GLib warnings. I shut it down when the log file grew beyond 3 GB.

I'm leaving work now but I'll look more into this later. I may need to reinstall an older version of AMC for the time being.

RE: Marking fails throwing perl error - Added by Matthew Leingang about 6 years ago

So I have installed the from macports Portfile prior to the 1.3.0 tag (03ba81b942565a3a4812c7c9c4ce8331527edf94), and I was able to get it working again. Just like before, I had to replace the use encoding "utf8" lines with use utf8, but after that it works just before I upgraded to 1.3.

RE: Marking fails throwing perl error - Added by Alexis Bienvenüe about 6 years ago

from macports Portfile prior to the 1.3.0 tag

Which revision is working exactly?

RE: Marking fails throwing perl error - Added by Alexis Bienvenüe about 6 years ago

GLib-WARNING **: poll(2) failed

Maybe this is related to notification. Is Edit/Preferences/Display/Notifications/Desktop notifications checked? If yes, can you try the same with this option unchecked to see if the poll(2) failed lines disappear? However this does not seem related with your problem, so I'm afraid this won't fix it.

RE: Marking fails throwing perl error - Added by Alexis Bienvenüe about 6 years ago

In the Data capture tab, do you have a message that counts some unrecognized scans? If so, click Look at scans, and then Preprocess, and post a screenshot of the window.

RE: Marking fails throwing perl error - Added by Matthew Leingang about 6 years ago

<quote>
Which revision is working exactly?
</quote>

I'm not quite sure how to answer that question. I followed the instructions from MacPorts on how to install an older Portfile . I checked out the macports repository with the Portfile just prior to the one labeled as 1.3.0:

https://github.com/macports/macports-ports/blob/a82a684b671a52c83fe6608c4f530ddf82fe8e5f/x11/auto-multiple-choice/Portfile

That one has version 1.2.1 and revision 8 in it. I don't know what revision of AMC's repository that refers to, though. Browsing the repo I couldn't find any connection to the version/revision in the Portfile.

I have quizzes to administer/grade today and tomorrow. Later this week I will reinstall the up-to-date Portfile and run the other checks you requested.

RE: Marking fails throwing perl error - Added by Alexis Bienvenüe about 6 years ago

That one has version 1.2.1 and revision 8 in it. I don't know what revision of AMC's repository that refers to, though

OK. That's 1.2.1 (hg:cb5cf75697e1).

RE: Marking fails throwing perl error - Added by Philippe LAMARRE about 6 years ago

Hi !

I also experimented this nightmare,

Matthew Leingang wrote:

There were a few hundred thousand lines of this:
GLib-WARNING **: poll(2) failed due to: Bad file descriptor. at /opt/local/lib/perl5/vendor_perl/5.26/Gtk3.pm line 546.
That wasn't happening before. I cut all but two of them out of the log file to keep the size down.

Today, simply updating port solved the problem:
$ sudo port selfupdate
$ sudo port upgrade outdated

:-)

Philippe

RE: Marking fails throwing perl error - Added by Akim Demaille almost 6 years ago

I also face the << Can't call method "set_type... >> problem, and so far, I don't know how I'm supposed to fix the problem. I have added the AMCBoxDimensions after the begin{document}, but it does not fix the issue. I have also removed the occurrence before the begin{document}, but it fixed nothing.

I'm fully up-to-date on MacPorts.

The exam was made, I have the scans, and I'm very afraid to lose the compiled documents... What am I supposed to do? I can provide logs, but I doubt they would defer.

RE: Marking fails throwing perl error - Added by Matthew Leingang almost 6 years ago

I recently updated my macos to High Sierra, and with it updated MacPorts. But I still got this issue. In fact, when I googled the error, I came back to this post of mine, which I had forgotten!

So far the only workaround for me, has been to revert back to 1.2.1.

RE: Marking fails throwing perl error - Added by Alexis Bienvenüe almost 6 years ago

Can you (both) provide your source file, and the log file produced for all steps from preparing documents to marking, in a new project, with one or two scans?

RE: Marking fails throwing perl error - Added by Akim Demaille almost 6 years ago

@Matthew: Thanks, I managed to install and run the previous version of AMC and complete my grading (Alexis, thanks for not having changed the file formats!):

cd /tmp
git clone --single-branch https://github.com/macports/macports-ports.git
cd macports-ports
git co a82a684b671a52c83fe6608c4f530ddf82fe8e5f
cd x11/auto-multiple-choice
sudo port deactivate auto-multiple-choice
sudo port -n install  # -n to avoid updating opencv, which fails today
sudo perl -pi -e "s{use encoding .utf-?8.;}{use utf8;}" /opt/local/lib/AMC/perl/*.pl

@Alexis: Can't do that right now (my tex file runs many usepackage that I would need to compile first), but I will try to provide something asap.

RE: Marking fails throwing perl error - Added by Matthew Leingang almost 6 years ago

I am still stuck on this error in AMC 1.3. I've created a small project using the simple example from the documentation. The compressed project, with the debug log included, is in a zip file. I tried to upload it but it seems too big; I'll try to share it with this link: [[https://nyu.box.com/s/duzb7to6ursn66p2fqsjvisaaymzd89f]].

RE: Marking fails throwing perl error - Added by Alexis Bienvenüe almost 6 years ago

Matthew: what is the version of /Users/matthew/Library/texmf/tex/latex/AMC/automultiplechoice.sty (you can find it at the beginning of the file)?

RE: Marking fails throwing perl error - Added by Matthew Leingang almost 6 years ago

1.2.1, I guess? Here is the file header.

I saw a warning that I should use the up-to-date style file. Where is that normally installed?

%%
%% This is file `automultiplechoice.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% automultiplechoice.dtx  (with options: `package')
%% 
%% Copyright (C) 2008-2013 Alexis Bienvenue
%% 
%% This file is part of Auto-Multiple-Choice
%% 
%% Auto-Multiple-Choice is free software: you can redistribute it
%% and/or modify it under the terms of the GNU General Public License
%% as published by the Free Software Foundation, either version 2 of
%% the License, or (at your option) any later version.
%% 
%% Auto-Multiple-Choice is distributed in the hope that it will be
%% useful, but WITHOUT ANY WARRANTY; without even the implied warranty
%% of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
%% General Public License for more details.
%% 
%% You should have received a copy of the GNU General Public License
%% along with Auto-Multiple-Choice.  If not, see
%% <http://www.gnu.org/licenses/>.
%% 
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{automultiplechoice}
\RequirePackage{xcolor} % \fcolorbox to fill (or not) a box
\RequirePackage{fancyhdr} % \pagestyle{empty}
\RequirePackage{bophook} % \AtBeginPage
\RequirePackage{xkeyval} % \setkeys
\RequirePackage{rotating} % \rotatebox
\def\AMC@VERSION{AMC 1.2.1 svn:1403 with style $Revision: 431 $}

RE: Marking fails throwing perl error - Added by Alexis Bienvenüe almost 6 years ago

I saw a warning that I should use the up-to-date style file.

Yes!

Where is that normally installed?

With MacPorts… I don't know exactly. Can you try the following command (although I'm not sure if the locate command is installed on macosx)?

locate automultiplechoice.sty

1 2 Next » (1-25/30)