Skip to content

Adding content from URPM #1283

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# DESCRIPTION
#
# Tipo: respuesta corta
# Problema que pregunta por la coordenadas
# de un punto en el plano cartesiano dada
# su representacion gráfica.
#
# Problema WebWork escrito por Edwin Florez,
# <edwin.florez (at) upr (dot) edu>
#
# Adaptado desde el sistema quiz.uprm.edu del archivo
# pedro_prebasica/coordenadas_cartesianas/Hallar_Coordenadas_de_un_Punto.db
#
# ENDDESCRIPTION

## DBsubject(Prebasica)
## DBchapter(Plano cartesiano)
## DBsection(Representacion de puntos)
## Level(1)
## KEYWORDS('grafica', 'puntos','plano','coordenadas')
## Author(Edwin Florez)
## Institution(UPRM)
## Language(es)

DOCUMENT();

loadMacros(
"PGstandard.pl",
"MathObjects.pl",
"PGgraphmacros.pl",
"AnswerFormatHelp.pl"
);

TEXT(beginproblem());

$refreshCachedImages=1;

Context("Point");
$a = random(-9,9,1);
$b = random(-9,9,1);
$p = Point($a,$b);

@direccion = ("unidad(es) a la derecha del","unidad(es) a la izquierda del","unidad(es) arriba del","unidad(es) debajo del",,"sobre el eje");

if ($a == 0 || $b == 0){
$indexX = 4;
$indexY = 4;
}elsif($a*$b > 0){
if ($a > 0){
$indexX = 0;
$indexY = 2;
}else{
$indexX = 1;
$indexY = 3;
}
}else{
if ($a > 0){
$indexX = 0;
$indexY = 3;
}else{
$indexX = 1;
$indexY = 2;
}
}

$gr = init_graph(-10,-10,10,10,axes=>[0,0],grid=>[10,10],size=>[450,450]);

# adicionando un punto
$gr->stamps( closed_circle($a,$b,'blue') );

# adicionandole una etiqueta al punto
$gr->lb(new Label($a+0.1,$b+.6,'(a,b)','black','center','middle'));

BEGIN_TEXT
$BCENTER
\{ image(insertGraph($gr),width=>200,height=>200,tex_size=>450 ) \}
$BR
$BR
(Click en la gráfica para agrandar)
$ECENTER
$BR
¿Cuáles son las coordenadas del punto \((a,b)\) mostrado en la gráfica anterior?
$BR
$BR
\((a,b)=\) \{ans_rule(30)\} \{ AnswerFormatHelp("points") \}
END_TEXT

ANS( $p->cmp());

Context()->texStrings;
SOLUTION(EV3(<<'END_SOLUTION'));
$BBOLD Identificar la ubicación del punto$EBOLD:
$PAR
El punto se encuentra \(\{abs($a)\}\) $direccion[$indexX] eje \(y\) y \(\{abs($b)\}\) $direccion[$indexY] eje \(x\).
$PAR
Por lo tanto las coordenadas del punto son: \($p\).
END_SOLUTION
Context()->normalStrings;

ENDDOCUMENT();
99 changes: 99 additions & 0 deletions Contrib/UPRM/Prebasica/coordenadas_cartesianas/Punto_Medio_A.pg
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# DESCRIPTION
#
# Tipo: respuesta corta
# Problema que pregunta por la coordenadas x o y
# del punto medio del segmento representado
# en el plano cartesiano por dos puntos dados
#
# Problema WebWork escrito por Edwin Florez,
# <edwin.florez (at) upr (dot) edu>
#
# Adaptado desde el sistema quiz.uprm.edu del archivo
# pedro_prebasica/coordenadas_cartesianas/Punto_Medio.db
#
# ENDDESCRIPTION

## DBsubject(Prebasica)
## DBchapter(Plano cartesiano)
## DBsection(Punto medio)
## Level(1)
## KEYWORDS('grafica', 'puntos','plano','coordenadas','segmento', 'punto medio')
## Author(Edwin Florez)
## Institution(UPRM)
## Language(es)

DOCUMENT();

loadMacros(
"PGstandard.pl",
"MathObjects.pl",
"PGgraphmacros.pl",
"AnswerFormatHelp.pl"
);

TEXT(beginproblem());

$refreshCachedImages=1;

@eje = ("\(x\)", "\(y\)");
$index = random(0,1,1);

Context("Point");
$A = Point(random(-9,9,1),random(-9,9,1));
$B = Point(random(-9,9,1),random(-9,9,1));
$Pm = ($A+$B)/2;

#Extrayendo coordenadas de A, B y Pm
($aA, $bA) = $A->value;
($aB, $bB) = $B->value;
($Xm, $Ym) = $Pm->value;

if ($index==0){
$answer = $Xm;
}else{
$answer = $Ym;
}

$gr = init_graph(-10,-10,10,10,axes=>[0,0],grid=>[10,10],size=>[450,450]);

# adicionando los dos puntos
$gr->stamps( closed_circle($aA, $bA, 'blue') );
$gr->stamps( closed_circle($aB, $bB, 'red') );

# adicionandole etiquetas a los puntos
$gr->lb(new Label($aA+0.1,$bA+.6,'A','blue','center','middle'));
$gr->lb(new Label($aB+0.1,$bB+.6,'B','red','center','middle'));

Context()->texStrings;
BEGIN_TEXT
$BCENTER
\{ image(insertGraph($gr),width=>200,height=>200,tex_size=>450 ) \}
$BR
$BR
(Click en la gráfica para agrandar)
$ECENTER
$BR
Encuentre la coordenada $eje[$index] del punto medio del segmento de recta que une los puntos \(A\) y \(B\) mostrados en la gráfica anterior.
$BR
$BR
$eje[$index] = \{ans_rule(30)\} \{ AnswerFormatHelp("numbers") \}
END_TEXT
Context()->normalStrings;

ANS( $answer->cmp() );

Context()->texStrings;
SOLUTION(EV3(<<'END_SOLUTION'));
$BBOLD Paso 1:$EBOLD Identificar los puntos: \(A = $A\) y \(B = $B\).
$PAR
$BBOLD Paso 2:$EBOLD Calcular el promedio de \(x\) y \(y\).
$PAR
\(\phantom{blablabla}\) el promedio de \(x\) es: \(\frac{$aA+$aB}{2}=$Xm\)
$PAR
\(\phantom{blablabla}\) el promedio de \(y\) es: \(\frac{$bA+$bB}{2}=$Ym\)
$PAR
Por lo tanto el valor de la coordenada de $eje[$index] es: $answer.
END_SOLUTION
Context()->normalStrings;

ENDDOCUMENT();
78 changes: 78 additions & 0 deletions Contrib/UPRM/Prebasica/coordenadas_cartesianas/Punto_Medio_B.pg
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# DESCRIPTION
#
# Tipo: respuesta corta
# Problema que pregunta por la coordenadas
# del punto medio entre dos puntos dados
#
# Problema WebWork escrito por Edwin Florez,
# <edwin.florez (at) upr (dot) edu>
#
# Adaptado desde el sistema quiz.uprm.edu del archivo
# pedro_prebasica/coordenadas_cartesianas/Punto_Medio.db
#
# ENDDESCRIPTION

## DBsubject(Prebasica)
## DBchapter(Plano cartesiano)
## DBsection(Punto medio)
## Level(1)
## KEYWORDS('grafica', 'puntos','plano','coordenadas','segmento', 'punto medio')
## Author(Edwin Florez)
## Institution(UPRM)
## Language(es)

DOCUMENT();

loadMacros(
"PGstandard.pl",
"MathObjects.pl",
"AnswerFormatHelp.pl"
);

TEXT(beginproblem());

$refreshCachedImages=1;

@eje = ("\(a\)", "\(b\)");
$index = random(0,1,1);

Context("Point");
$A = Point(random(-50,50,1),random(-50,50,1));
$B = Point(random(-50,50,1),random(-50,50,1));
$Pm = ($A+$B)/2;

#Extrayendo coordenadas de Pm
($aA,$bA) = $A->value;
($aB,$bB) = $B->value;
($a, $b) = $Pm->value;

if ($index==0){
$answer = $a;
}else{
$answer = $b;
}

BEGIN_TEXT
Sea \((a,b)\) el punto medio entre \($A\) y \($B\). Calcular el valor de $eje[$index].
$BR
$BR
$eje[$index] = \{ans_rule(30)\} \{ AnswerFormatHelp("numbers") \}
END_TEXT

ANS( $answer->cmp() );

Context()->texStrings;
SOLUTION(EV3(<<'END_SOLUTION'));
$BBOLD Paso 1:$EBOLD Identificar los puntos: \(A = $A\) y \(B = $B\).
$PAR
$BBOLD Paso 2:$EBOLD Calcular el promedio de \(x\) y \(y\).
$PAR
\(\phantom{blablabla}\) el promedio de \(x\) es: \(\frac{$aA+$aB}{2}=$a\)
$PAR
\(\phantom{blablabla}\) el promedio de \(y\) es: \(\frac{$bA+$bB}{2}=$b\)
$PAR
Por lo tanto el valor de $eje[$index] es: $answer
END_SOLUTION
Context()->normalStrings;

ENDDOCUMENT();
88 changes: 88 additions & 0 deletions Contrib/UPRM/Prebasica/decimales/comparacion_decimales.pg
Original file line number Diff line number Diff line change
@@ -0,0 +1,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();
Loading