Skip to content
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
44 changes: 20 additions & 24 deletions Contrib/LaTech/DiscreteMath/ch1s1_propositions/ifthen1.pg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## DESCRIPTION
## Gives the if-then statement "If you strike me down, then I become more powerful."
## and asks for its propositional variations from a popup menu of statements.
## and asks for its propositional variations from a popup menu of statements.
## ENDDESCRIPTION

## DBsubject(Discrete Math)
Expand All @@ -11,36 +11,32 @@
## Author(Jason Terry)
## KEYWORDS('discrete math','logic','propositional logic','converse','contrapositive')


DOCUMENT();

## Load libraries
loadMacros(
"PGstandard.pl",
"parserPopUp.pl",
"PGcourse.pl",
"PGML.pl"
);
loadMacros('PGstandard.pl', 'PGML.pl', 'parserPopUp.pl', 'PGcourse.pl');

Context('Numeric');

## Create an array of possible statement variations
$a = ["You don't strike me down or I become more powerful.",
"You strike me down and I don't become more powerful.",
"If I don't become more powerful, then you don't strike me down.",
"If I become more powerful, then you strike me down.",
"I become more powerful if you strike me down.",
"You strike me down if I become more powerful.",
"I don't become more powerful and you don't strike me down.",
"You strike me down and I become more powerful."];
$a = [
"You don't strike me down or I become more powerful.",
"You strike me down and I don't become more powerful.",
"If I don't become more powerful, then you don't strike me down.",
"If I become more powerful, then you strike me down.",
"I become more powerful if you strike me down.",
"You strike me down if I become more powerful.",
"I don't become more powerful and you don't strike me down.",
"You strike me down and I become more powerful."
];

## Create the popup menus with the correct answers
$pop1 = PopUp(["Choose...",$a], 1);
$pop2 = PopUp(["Choose...",$a], 2);
$pop3 = PopUp(["Choose...",$a], 3);
$pop4 = PopUp(["Choose...",$a], 4);
$pop5 = PopUp(["Choose...",$a], 5);

## Display question
TEXT(beginproblem());
$pop1 = PopUp([ "Choose...", $a ], 1);
$pop2 = PopUp([ "Choose...", $a ], 2);
$pop3 = PopUp([ "Choose...", $a ], 3);
$pop4 = PopUp([ "Choose...", $a ], 4);
$pop5 = PopUp([ "Choose...", $a ], 5);


BEGIN_PGML
Consider the following statement:
Expand Down
43 changes: 19 additions & 24 deletions Contrib/LaTech/DiscreteMath/ch1s1_propositions/ifthen2.pg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## DESCRIPTION
## Gives the if-then statement "If it bleeds, then we can kill it."
## and asks for its propositional variations from a popup menu of statements.
## and asks for its propositional variations from a popup menu of statements.
## ENDDESCRIPTION

## DBsubject(Discrete Math)
Expand All @@ -11,36 +11,31 @@
## Author(Jason Terry)
## KEYWORDS('discrete math','logic','propositional logic','converse','contrapositive')


DOCUMENT();

## Load libraries
loadMacros(
"PGstandard.pl",
"parserPopUp.pl",
"PGcourse.pl",
"PGML.pl"
);
loadMacros('PGstandard.pl', 'PGML.pl', 'parserPopUp.pl', 'PGcourse.pl');

Context('Numeric');

## Create an array of possible statement variations
$a = ["We can kill it or it doesn't bleed.",
"We can't kill it and it bleeds.",
"If we can't kill it, then it doesn't bleed.",
"If we can kill it, then it bleeds.",
"We can kill it if it bleeds.",
"It bleeds if we can kill it.",
"It doesn't bleed and we can't kill it.",
"It bleeds and we can kill it."];
$a = [
"We can kill it or it doesn't bleed.",
"We can't kill it and it bleeds.",
"If we can't kill it, then it doesn't bleed.",
"If we can kill it, then it bleeds.",
"We can kill it if it bleeds.",
"It bleeds if we can kill it.",
"It doesn't bleed and we can't kill it.",
"It bleeds and we can kill it."
];

## Create the popup menus with the correct answers
$pop1 = PopUp(["Choose...",$a], 1);
$pop2 = PopUp(["Choose...",$a], 2);
$pop3 = PopUp(["Choose...",$a], 3);
$pop4 = PopUp(["Choose...",$a], 4);
$pop5 = PopUp(["Choose...",$a], 5);

## Display question
TEXT(beginproblem());
$pop1 = PopUp([ "Choose...", $a ], 1);
$pop2 = PopUp([ "Choose...", $a ], 2);
$pop3 = PopUp([ "Choose...", $a ], 3);
$pop4 = PopUp([ "Choose...", $a ], 4);
$pop5 = PopUp([ "Choose...", $a ], 5);

BEGIN_PGML
Consider the following statement:
Expand Down
23 changes: 8 additions & 15 deletions Contrib/LaTech/DiscreteMath/ch1s1_propositions/prop1.pg
Original file line number Diff line number Diff line change
Expand Up @@ -11,34 +11,27 @@
## Level(2)
## KEYWORDS('discrete math','logic','propositional logic','and','or','implication','negation','true','false')


DOCUMENT();

## Load libraries
loadMacros(
"PGstandard.pl",
"parserPopUp.pl",
"PGcourse.pl",
"PGML.pl"
);
loadMacros('PGstandard.pl', 'PGML.pl', 'parserPopUp.pl', 'PGcourse.pl');

Context('Numeric');

## Do not reveal partial solutions for True/False questions.
$showPartialCorrectAnswers = 0;

## Create random parameters for a false statement
$a = random(-5,-1,1);
$b = random(1,5,1);
$a = random(-5, -1, 1);
$b = random( 1, 5, 1);

## Create random parameters for a true statement
$n = random(2,5,1);
$n = random(2, 5, 1);
$nf = fact($n);

## Create the popup menus with the correct answers
$popTrue = PopUp(["Choose...","T","F"], 1);
$popFalse = PopUp(["Choose...","T","F"], 2);

## Display question
TEXT(beginproblem());
$popTrue = PopUp([ "Choose...", "T", "F" ], 1);
$popFalse = PopUp([ "Choose...", "T", "F" ], 2);

BEGIN_PGML
Determine the truth value of the following statements. *To discourage random guessing, you must answer all problems correctly to receive credit.*
Expand Down
18 changes: 4 additions & 14 deletions Contrib/LaTech/DiscreteMath/ch1s2_statements/truthtable1.pg
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,18 @@
## Author(Jason Terry)
## KEYWORDS('discrete math','logic','truth table')


DOCUMENT();

## Load libraries
loadMacros(
"PGstandard.pl",
"parserPopUp.pl",
"niceTables.pl",
"PGcourse.pl",
"PGML.pl"
);
loadMacros('PGstandard.pl', 'PGML.pl', 'parserPopUp.pl', 'PGcourse.pl');

Context('Numeric');
## Do not reveal partial solutions for True/False questions.
$showPartialCorrectAnswers = 0;

## Create the popup menus with the correct answers
$popTrue = PopUp(["Choose...","T","F"], 1);
$popFalse = PopUp(["Choose...","T","F"], 2);

## Display question
TEXT(beginproblem());
$popTrue = PopUp([ "Choose...", "T", "F" ], 1);
$popFalse = PopUp([ "Choose...", "T", "F" ], 2);

BEGIN_PGML
Complete the following truth table.
Expand All @@ -48,7 +39,6 @@ midrules => 1, align => '| c | c |'
END_PGML

BEGIN_PGML_SOLUTION
Solution:

[@
DataTable([
Expand Down
19 changes: 5 additions & 14 deletions Contrib/LaTech/DiscreteMath/ch1s2_statements/truthtable2.pg
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,19 @@
## Author(Jason Terry)
## KEYWORDS('discrete math','logic','truth table')


DOCUMENT();

## Load libraries
loadMacros(
"PGstandard.pl",
"parserPopUp.pl",
"niceTables.pl",
"PGcourse.pl",
"PGML.pl"
);
loadMacros('PGstandard.pl', 'PGML.pl', 'parserPopUp.pl', 'PGcourse.pl');

Context('Numeric');

## Do not reveal partial solutions for True/False questions.
$showPartialCorrectAnswers = 0;

## Create the popup menus with the correct answers
$popTrue = PopUp(["Choose...","T","F"], 1);
$popFalse = PopUp(["Choose...","T","F"], 2);

## Display question
TEXT(beginproblem());
$popTrue = PopUp([ "Choose...", "T", "F" ], 1);
$popFalse = PopUp([ "Choose...", "T", "F" ], 2);

BEGIN_PGML
Complete the following truth table.
Expand All @@ -48,7 +40,6 @@ midrules => 1, align => '| c | c |'
END_PGML

BEGIN_PGML_SOLUTION
Solution:

[@
DataTable([
Expand Down
19 changes: 5 additions & 14 deletions Contrib/LaTech/DiscreteMath/ch1s2_statements/truthtable3.pg
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,19 @@
## Author(Jason Terry)
## KEYWORDS('discrete math','logic','truth table')


DOCUMENT();

## Load libraries
loadMacros(
"PGstandard.pl",
"parserPopUp.pl",
"niceTables.pl",
"PGcourse.pl",
"PGML.pl"
);
loadMacros('PGstandard.pl', 'PGML.pl', 'parserPopUp.pl', 'PGcourse.pl');

Context('Numeric');

## Do not reveal partial solutions for True/False questions.
$showPartialCorrectAnswers = 0;

## Create the popup menus with the correct answers
$popTrue = PopUp(["Choose...","T","F"], 1);
$popFalse = PopUp(["Choose...","T","F"], 2);

## Display question
TEXT(beginproblem());
$popTrue = PopUp([ "Choose...", "T", "F" ], 1);
$popFalse = PopUp([ "Choose...", "T", "F" ], 2);

BEGIN_PGML
Complete the following truth table.
Expand All @@ -50,7 +42,6 @@ midrules => 1, align => '| c | c | c | c |'
END_PGML

BEGIN_PGML_SOLUTION
Solution:

[@
DataTable([
Expand Down
19 changes: 5 additions & 14 deletions Contrib/LaTech/DiscreteMath/ch1s2_statements/truthtable4.pg
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,19 @@
## Author(Jason Terry)
## KEYWORDS('discrete math','logic','truth table')


DOCUMENT();

## Load libraries
loadMacros(
"PGstandard.pl",
"parserPopUp.pl",
"niceTables.pl",
"PGcourse.pl",
"PGML.pl"
);
loadMacros('PGstandard.pl', 'PGML.pl', 'parserPopUp.pl', 'PGcourse.pl');

Context('Numeric');

## Do not reveal partial solutions for True/False questions.
$showPartialCorrectAnswers = 0;

## Create the popup menus with the correct answers
$popTrue = PopUp(["Choose...","T","F"], 1);
$popFalse = PopUp(["Choose...","T","F"], 2);

## Display question
TEXT(beginproblem());
$popTrue = PopUp([ "Choose...", "T", "F" ], 1);
$popFalse = PopUp([ "Choose...", "T", "F" ], 2);

BEGIN_PGML
Complete the following truth table.
Expand All @@ -50,7 +42,6 @@ midrules => 1, align => '| c | c | c | c | c | c | c |'
END_PGML

BEGIN_PGML_SOLUTION
Solution:

[@
DataTable([
Expand Down
19 changes: 5 additions & 14 deletions Contrib/LaTech/DiscreteMath/ch1s2_statements/truthtable5.pg
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,19 @@
## Author(Jason Terry)
## KEYWORDS('discrete math','logic','truth table')


DOCUMENT();

## Load libraries
loadMacros(
"PGstandard.pl",
"parserPopUp.pl",
"niceTables.pl",
"PGcourse.pl",
"PGML.pl"
);
loadMacros('PGstandard.pl', 'PGML.pl', 'parserPopUp.pl', 'PGcourse.pl');

Context('Numeric');

## Do not reveal partial solutions for True/False questions.
$showPartialCorrectAnswers = 0;

## Create the popup menus with the correct answers
$popTrue = PopUp(["Choose...","T","F"], 1);
$popFalse = PopUp(["Choose...","T","F"], 2);

## Display question
TEXT(beginproblem());
$popTrue = PopUp([ "Choose...", "T", "F" ], 1);
$popFalse = PopUp([ "Choose...", "T", "F" ], 2);

BEGIN_PGML
Complete the following truth table.
Expand All @@ -50,7 +42,6 @@ midrules => 1, align => '| c | c | c | c | c | c | c |'
END_PGML

BEGIN_PGML_SOLUTION
Solution:

[@
DataTable([
Expand Down
Loading