forked from tsugitools/gift
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsample.php
114 lines (95 loc) · 3.39 KB
/
sample.php
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<?php
function getSampleGIFT ()
{
return
"// true/false
::Q1 T/F:: 1+1=2 {T}
// multiple choice
::Q2 MA:: One of these are right and three are wrong
{
=Right
~Wrong
~Incorrect
~Not right
}
// multiple choice with multiple right and wrong
::Q3 MA:: Two of these are right and two are wrong
{ =Right =Correct ~Wrong ~Incorrect }
// fill-in-the-blank (only right answers)
::Q4 Short Answer:: Two plus {=two =2} equals four.
";
/*
// multiple choice with specified feedback for right and wrong answers
::Q2 MC:: Plaintext test < > & ; ' \" < > <b> (answer is <)
{ =< # right; good! ~> # wrong, it's < ~& # wrong, it's < }
// multiple choice with multiple right and wrong
::Q3 MA:: Two of these are \\{right\\} and two are wrong
and GIFT escape character test
{ =Right \{1\} =Right \= 2 ~Wrong \~ 1 ~Wrong \ 2}
// fill-in-the-blank (only right answers)
::Q4 Short Answer:: Two plus {=two =2} equals four.
// matching (All right answers with -> )
::Q5 Matching:: Which animal eats which food?
{ =cat -> cat food =dog -> dog food }
// math range question
::Q6 Range colon:: What is a number from 1 to 5? {#3:2}
// math range specified with interval end points
::Q7 Range ..:: What is a number from 1 to 5? {#1..5}
// multiple numeric answers with partial credit and feedback
::Q8 Partial Credit Numeric:: When was Ulysses S. Grant born? {#
=1822:0 # Correct! Full credit.
=%50%1822:2 # He was born in 1822. Half credit for being close.
}
// essay
::Q9 Essay:: How are you? {}
// HTML with pre tags html code style
::Q10 HTML::[html]The next two lines are in a pre tag.<br/>
<pre>
Here is a less-than <
and an ampersand &
</pre>
An some non-pre text after the pre section is done.
{ =yellow # right; good! ~red # wrong, it's yellow ~blue # wrong, it's yellow }
// HTML with pre tags python code style
::Q11 HTML Python::[html]Some code in a pre block<br/>
<pre>
if x < 10 :
print \"too low\"
else :
print \"just right\"
</pre>
An some HTML after the end of the pre block
{ =yellow # right; good! ~red # wrong, it's yellow ~blue # wrong, it's yellow }
// Make sure < and > make it through in plaintext questions
::Q12 Plaintext:: In a plaintext question, does the <b> bold tag 'show'
\"with\" less than's and greater than's instead of turning stuff bold.
{ =Do we see a < less than ~Do we see a > greater than
~Do we see a ' single quote ~Do we see a \" double quote}
// HTML with formatting
::Q11 HTML with formatting::[html]In an HTML question, <b>bold</b> should simply appear as bold?
{ =yellow # right; good! ~red # wrong, it's yellow ~blue # wrong, it's yellow }
::Q12::[html] What is true about the following HMTL?
<pre>
<a href=\"http://www.dr-chuck.com/page2.htm\">Second Page</a>
</pre>
{
=The reference is an absolute reference
~The reference is a relative reference
~The HTML is improperly formed and will be a syntax error
~The text \"Second Page\" is improperly placed and will not be seen
}
::Q13::[html] For the following HTML, what does the \"style=\" attribute
achieve?
<pre>
<p style=\"color: red;\">
</pre>
{
=It allows the application of CSS rules to the contents of the tag
~It is an HTML syntax error and will be ignored
~It changes the background color of the paragreaph to red
~It contains JavaScript to be executed when the ofer hovers over the paragraph
~It changes the color of the tab for this page in the borwser to be red
}
";
*/
}