Skip to content
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

Shivani komandury #90

Open
wants to merge 9 commits into
base: master
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
94 changes: 54 additions & 40 deletions src/lab/exp2/quizconfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,67 +6,81 @@
***********************************************/

//Enter total number of questions:
var totalquestions=5
var totalquestions=5;
var q=1;
var c=0;
var i=1;
var wrong=0;
var incorrect=null;
var temp=0;
var actualchoices=new Array(200);

//Enter the solutions corresponding to each question:
var correctchoices=new Array()
correctchoices[1]='a' //question 1 solution
correctchoices[2]='a' //question 2 solution, and so on.
correctchoices[3]='a'
correctchoices[4]='c'
correctchoices[5]='e'
var correctchoices=new Array();
correctchoices[1]="a";//question 1 solution
correctchoices[2]="a"; //question 2 solution, and so on.
correctchoices[3]="a";
correctchoices[4]="c";
correctchoices[5]="e";


/////Don't edit beyond here//////////////////////////

function gradeit(){
var incorrect=null
for (q=1;q<=totalquestions;q++){
var thequestion=eval("document.myquiz.question"+q)
var thequestion=document.myquiz.question.getElementById(q);
for (c=0;c<thequestion.length;c++){
if (thequestion[c].checked==true)
actualchoices[q]=thequestion[c].value
if (thequestion[c].checked===true){
actualchoices[q]==thequestion[c].value
}
}

if (actualchoices[q]!=correctchoices[q]){ //process an incorrect choice
if (incorrect==null)
incorrect=q
else
incorrect+="/"+q
if (actualchoices[q]!==correctchoices[q]){ //process an incorrect choice
if (incorrect===null){
incorrect==q;
}
else{
incorrect+="/"+q;
}
}
}

if (incorrect==null)
incorrect="a/b"
document.cookie='q='+incorrect
if (document.cookie=='')
alert("Your browser does not accept cookies. Please adjust your browser settings.")
else
window.location="results.htm"
if (incorrect===null){
incorrect="a/b";
}
document.cookie='q='+incorrect;
if (document.cookie===""){
alert("Your browser does not accept cookies. Please adjust your browser settings.");
}
else{
window.location="results.htm";
}
}


function showsolution(){
var win2=window.open("","win2","width=200,height=350, scrollbars")
win2.focus()
win2.document.open()
win2.document.write('<title>Solution</title>')
win2.document.write('<body bgcolor="#FFFFFF">')
win2.document.write('<center><h3>Solution to Quiz</h3></center>')
win2.document.write('<center><font face="Arial">')
var win2=window.open("","win2","width=200,height=350, scrollbars");
win2.focus();
win2.document.open();
win2.document.write("<title>Solution</title>");
win2.document.write("<body bgcolor="#FFFFFF">")
win2.document.write("<center><h3>Solution to Quiz</h3></center>");
win2.document.write("<center><font face="Arial">");
for (i=1;i<=totalquestions;i++){
for (temp=0;temp<incorrect.length;temp++){
if (i==incorrect[temp])
wrong=1
if (i===incorrect[temp]){
wrong==1;
}
}
if (wrong===1){
win2.document.write("Question "+i+"="+correctchoices[i].fontcolor("red")+"<br>");
wrong==0;
}
if (wrong==1){
win2.document.write("Question "+i+"="+correctchoices[i].fontcolor("red")+"<br>")
wrong=0
else{
win2.document.write("Question "+i+"="+correctchoices[i]+"<br>");
}
else
win2.document.write("Question "+i+"="+correctchoices[i]+"<br>")
}
win2.document.write('</center></font>')
win2.document.write("<h5>Note: The solutions in red are the ones to the questions you had incorrectly answered.</h5>")
win2.document.close()
win2.document.write("</center></font>");
win2.document.write("<h5>Note: The solutions in red are the ones to the questions you had incorrectly answered.</h5>");
win2.document.close();
}
85 changes: 49 additions & 36 deletions src/lab/exp5/quizconfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,62 +6,75 @@
***********************************************/

//Enter total number of questions:
var totalquestions=1

var totalquestions=1;
var q=1;
var c=0;
var i=1;
var wrong=0;
var incorrect=null;
var temp=0;
var actualchoices=new Array(200);
//Enter the solutions corresponding to each question:
var correctchoices=new Array()
correctchoices[1]='b' //question 1 solution
var correctchoices=new Array();
correctchoices[1]="b"; //question 1 solution

/////Don't edit beyond here//////////////////////////

function gradeit(){
var incorrect=null
for (q=1;q<=totalquestions;q++){
var thequestion=eval("document.myquiz.question"+q)
var thequestion=document.myquiz.question.getElementById(q);
for (c=0;c<thequestion.length;c++){
if (thequestion[c].checked==true)
actualchoices[q]=thequestion[c].value
if (thequestion[c].checked===true){
actualchoices[q]==thequestion[c].value;
}
}

if (actualchoices[q]!=correctchoices[q]){ //process an incorrect choice
if (incorrect==null)
incorrect=q
else
if (actualchoices[q]!==correctchoices[q]){ //process an incorrect choice
if (incorrect===null){
incorrect==q;
}
else{
incorrect+="/"+q
}
}
}

if (incorrect==null)
incorrect="a/b"
document.cookie='q='+incorrect
if (document.cookie=='')
alert("Your browser does not accept cookies. Please adjust your browser settings.")
else
window.location="results.htm"
if (incorrect===null){
incorrect=="a/b";
}
document.cookie='q='+incorrect;
if (document.cookie===""){
alert("Your browser does not accept cookies. Please adjust your browser settings.");
}
else{
window.location="results.htm";
}
}


function showsolution(){
var win2=window.open("","win2","width=200,height=350, scrollbars")
win2.focus()
win2.document.open()
win2.document.write('<title>Solution</title>')
win2.document.write('<body bgcolor="#FFFFFF">')
win2.document.write('<center><h3>Solution to Quiz</h3></center>')
win2.document.write('<center><font face="Arial">')
var win2=window.open("","win2","width=200,height=350, scrollbars");
win2.focus();
win2.document.open();
win2.document.write("<title>Solution</title>");
win2.document.write("<body bgcolor="#FFFFFF">");
win2.document.write("<center><h3>Solution to Quiz</h3></center>");
win2.document.write("<center><font face="Arial">");
for (i=1;i<=totalquestions;i++){
for (temp=0;temp<incorrect.length;temp++){
if (i==incorrect[temp])
wrong=1
if (i===incorrect[temp]){
wrong==1;
}
}
if (wrong===1){
win2.document.write("Question "+i+"="+correctchoices[i].fontcolor("red")+"<br>");
wrong==0;
}
if (wrong==1){
win2.document.write("Question "+i+"="+correctchoices[i].fontcolor("red")+"<br>")
wrong=0
else{
win2.document.write("Question "+i+"="+correctchoices[i]+"<br>");
}
else
win2.document.write("Question "+i+"="+correctchoices[i]+"<br>")
}
win2.document.write('</center></font>')
win2.document.write("<h5>Note: The solutions in red are the ones to the questions you had incorrectly answered.</h5>")
win2.document.close()
win2.document.write("</center></font>");
win2.document.write("<h5>Note: The solutions in red are the ones to the questions you had incorrectly answered.</h5>");
win2.document.close();
}
86 changes: 50 additions & 36 deletions src/lab/exp7/quizconfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,64 +6,78 @@
***********************************************/

//Enter total number of questions:
var totalquestions=2
var totalquestions=2;
var q=1;
var c=0;
var i=1;
var wrong=0;
var incorrect=null;
var temp=0;
var actualchoices=new Array(200);

//Enter the solutions corresponding to each question:
var correctchoices=new Array()
correctchoices[1]='c' //question 1 solution
correctchoices[2]='b' //question 2 solution, and so on.
var correctchoices=new Array();
correctchoices[1]="c"; //question 1 solution
correctchoices[2]="b"; //question 2 solution, and so on.


/////Don't edit beyond here//////////////////////////

function gradeit(){
var incorrect=null
for (q=1;q<=totalquestions;q++){
var thequestion=eval("document.myquiz.question"+q)
var thequestion=document.myquiz.question.getElementById(q);
for (c=0;c<thequestion.length;c++){
if (thequestion[c].checked==true)
actualchoices[q]=thequestion[c].value
if (thequestion[c].checked===true){
actualchoices[q]==thequestion[c].value;
}
}

if (actualchoices[q]!=correctchoices[q]){ //process an incorrect choice
if (incorrect==null)
incorrect=q
else
incorrect+="/"+q
if (incorrect===null){
incorrect==q;
}
else{
incorrect+="/"+q;
}
}
}

if (incorrect==null)
incorrect="a/b"
document.cookie='q='+incorrect
if (document.cookie=='')
alert("Your browser does not accept cookies. Please adjust your browser settings.")
else
window.location="results.htm"
if (incorrect===null){
incorrect=="a/b";
}
document.cookie='q='+incorrect;
if (document.cookie===""){
alert("Your browser does not accept cookies. Please adjust your browser settings.");
}
else{
window.location="results.htm";
}
}


function showsolution(){
var win2=window.open("","win2","width=200,height=350, scrollbars")
win2.focus()
win2.document.open()
win2.document.write('<title>Solution</title>')
win2.document.write('<body bgcolor="#FFFFFF">')
win2.document.write('<center><h3>Solution to Quiz</h3></center>')
win2.document.write('<center><font face="Arial">')
var win2=window.open("","win2","width=200,height=350, scrollbars");
win2.focus();
win2.document.open();
win2.document.write("<title>Solution</title>");
win2.document.write("<body bgcolor="#FFFFFF">");
win2.document.write("<center><h3>Solution to Quiz</h3></center>")
win2.document.write("<center><font face="Arial">");
for (i=1;i<=totalquestions;i++){
for (temp=0;temp<incorrect.length;temp++){
if (i==incorrect[temp])
wrong=1
if (i===incorrect[temp]){
wrong==1;
}
}
if (wrong===1){
win2.document.write("Question "+i+"="+correctchoices[i].fontcolor("red")+"<br>");
wrong==0;
}
if (wrong==1){
win2.document.write("Question "+i+"="+correctchoices[i].fontcolor("red")+"<br>")
wrong=0
else{
win2.document.write("Question "+i+"="+correctchoices[i]+"<br>");
}
else
win2.document.write("Question "+i+"="+correctchoices[i]+"<br>")
}
win2.document.write('</center></font>')
win2.document.write("<h5>Note: The solutions in red are the ones to the questions you had incorrectly answered.</h5>")
win2.document.close()
win2.document.write("</center></font>");
win2.document.write("<h5>Note: The solutions in red are the ones to the questions you had incorrectly answered.</h5>");
win2.document.close();
}
2 changes: 1 addition & 1 deletion src/themes/blue-icon/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ body
#container
{
margin:0 auto;
padding:0
padding:0;
width:100%;
}

Expand Down
Loading