Skip to content

Commit 0cf5795

Browse files
authored
Merge pull request #1073 from Robin-Cruz/UpdateScientificNotation
Update to PGML. Solutions added.
2 parents 22c026c + 42ea85d commit 0cf5795

7 files changed

+93
-134
lines changed

OpenProblemLibrary/CollegeOfIdaho/setAlgebra_01_07_ScientificNotation/17IntAlg_01_ScientificNot.pg

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,18 @@
1616
## Section1('1.7')
1717
## Problem1('')
1818
## KEYWORDS('Scientific Notation')
19-
## Date: 2007/09
19+
## Date: 2007/09 updated 2023/07--rac
20+
21+
DOCUMENT();
2022

21-
DOCUMENT(); # This should be the first executable line in the problem.
2223
loadMacros(
2324
"PGstandard.pl",
24-
"MathObjects.pl",
25+
"PGML.pl",
2526
"contextScientificNotation.pl",
2627
"contextLimitedNumeric.pl",
2728
"PGcourse.pl"
2829
);
2930

30-
TEXT(beginproblem());
31-
3231
######################################
3332
# Setup
3433

@@ -37,29 +36,25 @@ $exp = random(1,4,1);
3736
$a = $num * 10**$exp;
3837

3938
Context("ScientificNotation");
40-
$display = ScientificNotation($a);
39+
$sna = ScientificNotation($a);
40+
41+
Context("LimitedNumeric");
42+
$answer = Real($a);
4143

4244
######################################
4345
# Main text
4446

45-
BEGIN_TEXT
47+
BEGIN_PGML
4648
Write in decimal notation without the use of exponents:
47-
$PAR
48-
\( \{$display->TeX\} \) = \{ ans_rule(20) \}
49-
END_TEXT
50-
51-
######################################
52-
# Answers
53-
54-
Context("LimitedNumeric");
55-
56-
$answer = Real($a);
57-
ANS($answer->cmp);
5849

59-
$showPartialCorrectAnswers = 1;
50+
[``[$sna] = ``] [_]{$a}{20}
51+
END_PGML
6052

6153
######################################
54+
# Solution
6255

56+
BEGIN_PGML_SOLUTION
57+
In decimal notation, [`[$sna] = [$a]`].
58+
END_PGML_SOLUTION
6359

64-
;
6560
ENDDOCUMENT();

OpenProblemLibrary/CollegeOfIdaho/setAlgebra_01_07_ScientificNotation/17IntAlg_02_ScientificNot.pg

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,17 @@
1616
## Section1('1.7')
1717
## Problem1('')
1818
## KEYWORDS('Scientific Notation')
19-
## Date: 2007/09
19+
## Date: 2007/09 updated 2023/07 --rac
2020

21-
DOCUMENT(); # This should be the first executable line in the problem.
21+
DOCUMENT();
2222
loadMacros(
2323
"PGstandard.pl",
24-
"MathObjects.pl",
24+
"PGML.pl",
2525
"contextScientificNotation.pl",
2626
"contextLimitedNumeric.pl",
2727
"PGcourse.pl"
2828
);
2929

30-
TEXT(beginproblem());
31-
3230
######################################
3331
# Setup
3432

@@ -37,29 +35,25 @@ $exp = random(-4,-1,1);
3735
$a = $num * 10**$exp;
3836

3937
Context("ScientificNotation");
40-
$display = ScientificNotation($a);
38+
$sna = ScientificNotation($a);
39+
40+
Context("LimitedNumeric");
41+
$ans = Real($a);
4142

4243
######################################
4344
# Main text
4445

45-
BEGIN_TEXT
46+
BEGIN_PGML
4647
Write in decimal notation without the use of exponents:
47-
$PAR
48-
\( \{$display->TeX\} \) = \{ ans_rule(20) \}
49-
END_TEXT
50-
51-
######################################
52-
# Answers
53-
54-
Context("LimitedNumeric");
55-
56-
$answer = Real($a);
57-
ANS($answer->cmp);
5848

59-
$showPartialCorrectAnswers = 1;
49+
[``[$sna] =``] [_]{$ans}{20}
50+
END_PGML
6051

6152
######################################
53+
# Solution
6254

55+
BEGIN_PGML_SOLUTION
56+
In decimal notation, [``[$sna] = [$a]``].
57+
END_PGML_SOLUTION
6358

64-
;
6559
ENDDOCUMENT();

OpenProblemLibrary/CollegeOfIdaho/setAlgebra_01_07_ScientificNotation/17IntAlg_03_ScientificNot.pg

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,44 +16,39 @@
1616
## Section1('1.7')
1717
## Problem1('')
1818
## KEYWORDS('Scientific Notation')
19-
## Date: 2007/09
19+
## Date: 2007/09 updated 2023/-7 --rac
20+
21+
DOCUMENT();
2022

21-
DOCUMENT(); # This should be the first executable line in the problem.
2223
loadMacros(
2324
"PGstandard.pl",
24-
"MathObjects.pl",
25-
"contextScientificNotation.pl",
25+
"PGML.pl",
2626
"contextLimitedNumeric.pl",
2727
"PGcourse.pl"
2828
);
2929

30-
TEXT(beginproblem());
31-
3230
######################################
3331
# Setup
3432

3533
$num = random(1.1,9,.1);
3634

35+
Context("LimitedNumeric");
36+
$ans = Real($num);
37+
3738
######################################
3839
# Main text
3940

40-
BEGIN_TEXT
41+
BEGIN_PGML
4142
Write in decimal notation without the use of exponents:
42-
$PAR
43-
\( $num \times 10^0\) = \{ ans_rule(20) \}
44-
END_TEXT
45-
46-
######################################
47-
# Answers
48-
49-
Context("LimitedNumeric");
5043

51-
$answer = Real($num);
52-
ANS($answer->cmp);
53-
54-
$showPartialCorrectAnswers = 1;
44+
[``[$num] \times 10^0 = ``] [_]{$ans}{20}
45+
END_PGML
5546

5647
######################################
48+
# Solution
49+
50+
BEGIN_PGML_SOLUTION
51+
In decimal notation, [``[$num] \times 10^0 = [$ans]``].
52+
END_PGML_SOLUTION
5753

58-
;
5954
ENDDOCUMENT();

OpenProblemLibrary/CollegeOfIdaho/setAlgebra_01_07_ScientificNotation/17IntAlg_04_ScientificNot.pg

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,15 @@
1818
## KEYWORDS('Scientific Notation')
1919
## Date: 2007/09
2020

21-
DOCUMENT(); # This should be the first executable line in the problem.
21+
DOCUMENT();
2222
loadMacros(
2323
"PGstandard.pl",
24-
"MathObjects.pl",
24+
"PGML.pl",
2525
"contextScientificNotation.pl",
2626
"contextLimitedNumeric.pl",
2727
"PGcourse.pl"
2828
);
2929

30-
TEXT(beginproblem());
31-
3230
######################################
3331
# Setup
3432

@@ -37,29 +35,25 @@ $exp = random(3,10,1);
3735
$a = $num * 10**$exp;
3836

3937
Context(ScientificNotation);
40-
$display = ScientificNotation($a);
38+
$sna = ScientificNotation($a);
39+
40+
Context("LimitedNumeric");
41+
$ans = Real($a);
4142

4243
######################################
4344
# Main text
4445

45-
BEGIN_TEXT
46+
BEGIN_PGML
4647
Write in decimal notation without the use of exponents:
47-
$PAR
48-
\( \{$display->TeX\}\) = \{ ans_rule(20) \}
49-
END_TEXT
50-
51-
######################################
52-
# Answers
53-
54-
Context("LimitedNumeric");
55-
56-
$answer = Real($a);
57-
ANS($answer->cmp);
5848

59-
$showPartialCorrectAnswers = 1;
49+
[``[$sna] = ``] [_]{$ans}{20}
50+
END_PGML
6051

6152
######################################
53+
# Solution
6254

55+
BEGIN_PGML_SOLUTION
56+
In decimal notation, [``[$sna] = [$a]``].
57+
END_PGML_SOLUTION
6358

64-
;
6559
ENDDOCUMENT();

OpenProblemLibrary/CollegeOfIdaho/setAlgebra_01_07_ScientificNotation/17IntAlg_06_ScientificNot.pg

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,46 +16,40 @@
1616
## Section1('1.7')
1717
## Problem1('')
1818
## KEYWORDS('Scientific Notation')
19-
## Date: 2007/09
19+
## Date: 2007/09 updated 2023/07 --rac
2020

21-
DOCUMENT(); # This should be the first executable line in the problem.
21+
DOCUMENT();
2222
loadMacros(
2323
"PGstandard.pl",
24-
"MathObjects.pl",
24+
"PGML.pl",
2525
"contextScientificNotation.pl",
2626
"PGcourse.pl"
2727
);
2828

29-
TEXT(beginproblem());
30-
3129
######################################
3230
# Setup
3331

3432
$num = random(1.01,9,.001);
3533
$exp = random(3,7,1);
3634
$decimalNumber = $num * 10 ** $exp;
3735

36+
Context("ScientificNotation");
37+
$ans = ScientificNotation($decimalNumber);
38+
3839
######################################
3940
# Main text
4041

41-
BEGIN_TEXT
42+
BEGIN_PGML
4243
Write the number in scientific notation:
43-
$PAR
44-
\( $decimalNumber \) = \{ ans_rule(20) \}
45-
END_TEXT
46-
47-
######################################
48-
# Answers
49-
50-
Context("ScientificNotation");
51-
52-
$answer = ScientificNotation($decimalNumber);
53-
ANS($answer->cmp);
5444

55-
$showPartialCorrectAnswers = 1;
45+
[``[$decimalNumber] = ``] [_]{$ans}{20}
46+
END_PGML
5647

5748
######################################
49+
# Solution
5850

51+
BEGIN_PGML_SOLUTION
52+
In scientific notation, [``[$decimalNumber] = [$ans]``].
53+
END_PGML_SOLUTION
5954

60-
;
6155
ENDDOCUMENT();

OpenProblemLibrary/CollegeOfIdaho/setAlgebra_01_07_ScientificNotation/17IntAlg_07_ScientificNot.pg

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,41 +21,35 @@
2121
DOCUMENT(); # This should be the first executable line in the problem.
2222
loadMacros(
2323
"PGstandard.pl",
24-
"MathObjects.pl",
24+
"PGML.pl",
2525
"contextScientificNotation.pl",
2626
"PGcourse.pl"
2727
);
2828

29-
TEXT(beginproblem());
30-
3129
######################################
3230
# Setup
3331

3432
$num = random(1.01,9,.001);
3533
$exp = random(-5,-2,1);
3634
$decimalNumber = $num * 10 ** $exp;
3735

36+
Context("ScientificNotation");
37+
$ans = ScientificNotation($decimalNumber);
38+
3839
######################################
3940
# Main text
4041

41-
BEGIN_TEXT
42+
BEGIN_PGML
4243
Write the number in scientific notation:
43-
$PAR
44-
\( $decimalNumber \) = \{ ans_rule(20) \}
45-
END_TEXT
46-
47-
######################################
48-
# Answers
49-
50-
Context("ScientificNotation");
51-
52-
$answer = ScientificNotation($decimalNumber);
53-
ANS($answer->cmp);
5444

55-
$showPartialCorrectAnswers = 1;
45+
[``[$decimalNumber] = ``] [_]{$ans}{20}
46+
END_PGML
5647

5748
######################################
49+
# Solution
5850

51+
BEGIN_PGML_SOLUTION
52+
In scientific notation, [``[$decimalNumber] = [$ans]``].
53+
END_PGML_SOLUTION
5954

60-
;
6155
ENDDOCUMENT();

0 commit comments

Comments
 (0)