/    Sign up×
Community /Pin to ProfileBookmark

Need your help

I am working on a timed exam and it is graded at the same time. I cannot get it to work. Can some one help me out. Here is what I have below.

<script type=”text/javascript” src=”functions.js”></script>

<script type=”text/javascript”>

function runClock() {
var seconds = 0 + 1 ;
var clockld =
}

function startClock(){
showQuiz(questions);
runclock()
setInterval(clockld, 1000);
}

function stopClock(){
clearInterval(runClock() )
gradeQuiz(correctAns)

}
</script>
</head>

<body>
<form id=”quiz” name=”quiz” action=””>

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@MrNobodyJan 18.2009 — First, this is not valid:
[CODE]clearInterval( runClock() )[/CODE]
That should be more like this:
[CODE]if (timer) clearInterval(timer);[/CODE]
Where does [B]timer[/B] come from? It should be a global variable and this:
[CODE]setInterval(clockld, 1000);[/CODE]
should be this:
[CODE]timer = setInterval(clockld, 1000);[/CODE]
×

Success!

Help @cbj148 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...