[system] / trunk / webwork2 / courses.dist / modelCourse / templates / setOrientation / prob06.pg Repository:
ViewVC logotype

View of /trunk/webwork2/courses.dist/modelCourse/templates/setOrientation/prob06.pg

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6431 - (download) (annotate)
Wed Sep 15 18:09:44 2010 UTC (2 years, 8 months ago) by gage
File size: 4121 byte(s)
add () after beginproblem


    1 DOCUMENT();        # This should be the first executable line in the problem.
    2 
    3 loadMacros(
    4   "PGstandard.pl",
    5   "MathObjects.pl",
    6   "PGunion.pl",
    7   "parserOrientation.pl",
    8   "PGcourse.pl",
    9 );
   10 
   11 
   12 $showPartialCorrectAnswers = 1;
   13 
   14 Context("Numeric")->variables->are(y=>'Real'); $y = Formula('y');
   15 Context("Numeric")->variables->are(x=>'Real'); $x = Formula('x');
   16 Context()->flags->set(limits=>[0,2]);
   17 
   18 TEXT(beginproblem());
   19 Title("Using Parentheses Effectively");
   20 
   21 ##############################################
   22 
   23 BEGIN_TEXT
   24 
   25 One of the hardest parts about using parentheses is making sure that
   26 they match up correctly.  Here are a couple of hints to help you with
   27 this:
   28 
   29 $PAR
   30 END_TEXT
   31 
   32 $BRACES =  HTML('{}','\char123\char125');
   33 
   34 BEGIN_TEXT
   35 
   36 \{BeginParList("UL")\}
   37 
   38 $ITEM
   39 Several types of parentheses are allowed: \{student "()"\},
   40 \{student "[]"\}, and \{student $BRACES\}.  When you need to nest
   41 parentheses inside other parentheses, try using a different type for
   42 each so that you can see more easily which ones match up.
   43 $ITEMSEP
   44 
   45 $ITEM
   46 When you type a left parenthesis, type the corresponding right
   47 parenthesis at the same time, then position your cursor between them and
   48 type the expression that goes inside.  This can save you a
   49 lot of time hunting for mismatched parentheses.
   50 $ITEMSEP
   51 
   52 $ITEM
   53 When you have a complicated answer, type a template for
   54 the structure of your result first.  For example, suppose that you are
   55 planning to enter the fraction
   56 \[\frac{2x^2-5}{(x+1)(3x^{3x} - 22)}.\]
   57 A good way to start would be to type in \{student "()/[()*()]"\}.
   58 This shows a template of one number divided by the product of two
   59 other numbers.  (Note that \{student "()/()*()"\} would not be a good
   60 way to start; do you see why?)  Now when you fill in the expressions, you
   61 will be sure your parentheses balance correctly.
   62 $PAR
   63 
   64 Although $WW understands that numbers written next to each other are
   65 meant to be multiplied (so you do not have to use \{student "*"\} to
   66 indicate multiplication if you don't want to), it is often useful for
   67 you to include the \{student "*"\} anyway, as it helps you keep track
   68 of the structure of your answer.
   69 $PAR
   70 
   71 $ITEM
   72 To see how $WW is interpreting what you type, enter your answer and
   73 then click the ${LQ}Preview Answers$RQ button, which is next to the
   74 ${LQ}Submit Answers$RQ button below.  $WW will show you what it thinks
   75 you entered (the preview appears in your answer area at the top of the
   76 page). Previewing your answer does not submit it for credit; that only
   77 happens when you press the ${LQ}Submit Answers$RQ button.
   78 $ITEMSEP
   79 
   80 $ITEM
   81 When division or exponentiation are involved, it is a good idea to
   82 use parentheses even in simple situations, rather than relying on the
   83 order of operations. For example, 1/2x and (1/2)x both mean the same
   84 thing (first divide 1 by 2, then multiply the result by x), but the
   85 second makes it easier to see what is going on. Likewise, use
   86 parentheses to clarify expressions involving exponentiation.  Type
   87 \{student "(e${CARET}x)${CARET}2"\} if you mean \((e^x)^2\), and type
   88 \{student "e${CARET}(x${CARET}2)"\} if you mean \(e^{(x^2)}\).
   89 
   90 \{EndParList("UL")\}
   91 
   92 $PAR
   93 $HR
   94 $PAR
   95 
   96 Now enter the following functions:
   97 
   98 $BBLOCKQUOTE
   99 
  100 \{@ExampleDefaults = (ans_rule_len => 50, ans_rule_height => 1);
  101   BeginExamples\}
  102 
  103 \{BeginExample(QA(($x**(2*$x-1))/(($x**2-$x)*(3*$x+5))))\}
  104 Start with the template \{student "[x${CARET}()]/[()*()]"\}.
  105 \{EndExample\}
  106 \{ExampleRule\}
  107 
  108 \{BeginExample(QA((($y+3)*($y**3+$y+1))/((2*$y**2-2)*(5*$y+4))))\}
  109 Start by putting in an appropriate template. This means that you
  110 should begin by looking at the function and thinking about how many
  111 pieces are used to construct it and how those pieces are related.
  112 Once you have entered your answer, try using the ${LQ}Preview$RQ button
  113 to see how $WW is interpreting your answer.
  114 \{EndExample\}
  115 \{ExampleRule\}
  116 
  117 \{BeginExample(QA((($x+1)/($x-2))**4))\}
  118 Start by putting in an appropriate template.
  119 \{EndExample\}
  120 
  121 \{EndExamples\}
  122 
  123 $EBLOCKQUOTE
  124 
  125 END_TEXT
  126 
  127 ##############################################
  128 
  129 ENDDOCUMENT();        # This should be the last executable line in the problem.

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9