File: test.pl

package info (click to toggle)
auto-multiple-choice 1.7.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 92,612 kB
  • sloc: perl: 26,752; xml: 24,889; cpp: 1,997; python: 895; makefile: 569; sh: 233; ansic: 195
file content (120 lines) | stat: -rwxr-xr-x 3,074 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#! /usr/bin/env perl
#
# Copyright (C) 2021-2025 Alexis Bienvenüe <paamc@passoire.fr>
#
# 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/>.

require "./AMC/Test.pm";

my $t = AMC::Test->new(
    dir             => __FILE__,
    tex_engine      => 'pdflatex',
    multiple        => 1,
    code            => 'id*1',
    list_key        => 'id',
    export_columns  => 'student.name',
    export_full_csv => [
        {
            -name     => 'Xeo',
            -question => 'unit',
            -score    => 1
        },
        {
            -name     => 'Xeo',
            -question => 'ten',
            -score    => 10
        },
        {
            -name     => 'Xeo',
            -question => 'hundred',
            -score    => 100
        },
        {
            -name     => 'Laura',
            -question => 'unit',
            -score    => 2
        },
        {
            -name     => 'Laura',
            -question => 'ten',
            -score    => 20
        },
        {
            -name     => 'Laura',
            -question => 'hundred',
            -score    => 200
        },
        {
            -name     => 'Berndt',
            -question => 'unit',
            -score    => 3
        },
        {
            -name     => 'Berndt',
            -question => 'ten',
            -score    => 30
        },
        {
            -name     => 'Berndt',
            -question => 'hundred',
            -score    => 300
        },
        {
            -name     => 'Alfonso',
            -question => 'unit',
            -score    => 4
        },
        {
            -name     => 'Alfonso',
            -question => 'ten',
            -score    => 40
        },
        {
            -name     => 'Alfonso',
            -question => 'hundred',
            -score    => 400
        },
        {
            -name     => 'King',
            -question => 'unit',
            -score    => 5
        },
        {
            -name     => 'King',
            -question => 'ten',
            -score    => 50
        },
        {
            -name     => 'King',
            -question => 'hundred',
            -score    => 500
        },
    ]
);

$t->prepare;
$t->defects;
$t->analyse( directory => 'rempli1', pre_allocate => 1 );
$t->gather_multicode;
$t->analyse( directory => 'rempli2', pre_allocate => 10 );
$t->gather_multicode;
$t->note;
$t->assoc;
$t->get_marks;
$t->check_export;

$t->ok;