-
-
Notifications
You must be signed in to change notification settings - Fork 434
Expand file tree
/
Copy pathcomparacion_decimales.pg
More file actions
88 lines (73 loc) · 1.97 KB
/
comparacion_decimales.pg
File metadata and controls
88 lines (73 loc) · 1.97 KB
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
# DESCRIPTION
#
# Tipo: falso/cierto
# Compara dos decimales
#
# Problema WebWork escrito por Edwin Florez,
# <edwin.florez (at) upr (dot) edu>
#
# Adaptado desde el sistema quiz.uprm.edu del archivo
# pedro_prebasica/decimales/comparacion_decimales.db
#
# ENDDESCRIPTION
## DBsubject(Prebasica)
## DBchapter(Decimales)
## DBsection(Comparacion)
## Level(1)
## KEYWORDS('decimales','comparar')
## Author(Edwin Florez)
## Institution(UPRM)
## Language(es)
DOCUMENT();
loadMacros(
"PGstandard.pl",
"MathObjects.pl",
"AnswerFormatHelp.pl",
"PGchoicemacros.pl"
);
$showPartialCorrectAnswers = 0;
Context("Numeric");
$n = random(1,4,1);
@powers = (10,100,1000,10000);
$tenPower = random(0,3);
$a = random(1,100)/$powers[$tenPower];
$b = random(1,10)/($powers[$tenPower]*10) + $a/10;
@arrayRelacion = ("mayor", "menor");
$index = random(0,1,1);
if ($index == 0){
if ($a > $b){
$answer = "C";
$answer2 = "derecha";
}else{
$answer = "F";
$answer2 = "izquierda";
}
}else{
if ($a < $b){
$answer = "C";
$answer2 = "izquierda";
}else{
$answer = "F";
$answer2 = "derecha";
}
}
## Set up a true-false list by creating a new select list object.
## $tf_list_ptr points to a new select list object.
$tf_list_ptr = new_select_list();
## Now assign to the true-false list object an array of
## "question", "answer" pairs from which a subset will be selected.
##
$tf_list_ptr -> qa ("El número $a es $arrayRelacion[$index] que $b.", $answer);
## Choose one of the possible question-answer pairs
$tf_list_ptr -> choose(1);
TEXT(beginproblem());
BEGIN_TEXT
Determine si la siguiente proposición es cierta o falsa. Entre $BBOLD C $EBOLD para cierta o $BBOLD F $EBOLD para falsa.
\{ $tf_list_ptr -> print_q \}
END_TEXT
## Provide the answer string
ANS( str_cmp( $tf_list_ptr->ra_correct_ans ) ) ;
SOLUTION(EV3(<<'END_SOLUTION'));
Ya que $a se encuentra a la $answer2 de $b en la recta numérica, entonces la respuesta es $BBOLD $answer $EBOLD.
END_SOLUTION
ENDDOCUMENT();