@@ -34,11 +34,14 @@ function MultipleChoice (opts) {
3434 }
3535}
3636
37+ MultipleChoice . prototype = new RunestoneBase ( ) ;
38+
3739/*===================================
3840=== Setting MC variables ===
3941===================================*/
4042
4143MultipleChoice . prototype . init = function ( opts ) {
44+ RunestoneBase . apply ( this , arguments ) ;
4245 var orig = opts . orig ; // entire <ul> element
4346 this . origElem = orig ;
4447
@@ -198,8 +201,11 @@ MultipleChoice.prototype.renderMCFormOpts = function () {
198201
199202 // Create the label for the input
200203 var label = document . createElement ( "label" ) ;
201- $ ( label ) . attr ( "for" , optid ) ;
202- $ ( label ) . text ( this . answerList [ k ] . content ) ;
204+ var labelspan = document . createElement ( "span" ) ;
205+ label . appendChild ( input ) ;
206+ label . appendChild ( labelspan ) ;
207+ //$(label).attr("for", optid);
208+ $ ( labelspan ) . text ( this . answerList [ k ] . content ) ;
203209
204210 // create the object to store in optionArray
205211 var optObj = {
@@ -209,7 +215,6 @@ MultipleChoice.prototype.renderMCFormOpts = function () {
209215 this . optionArray . push ( optObj ) ;
210216
211217 // add the option to the form
212- this . optsForm . appendChild ( input ) ;
213218 this . optsForm . appendChild ( label ) ;
214219 this . optsForm . appendChild ( document . createElement ( "br" ) ) ;
215220
@@ -392,7 +397,7 @@ MultipleChoice.prototype.populateMCMALocalStorage = function () {
392397
393398MultipleChoice . prototype . logMCMAsubmission = function ( ) {
394399 var answerInfo = "answer:" + this . givenlog . substring ( 0 , this . givenlog . length - 1 ) + ":" + ( this . correctCount == this . correctList . length ? "correct" : "no" ) ;
395- logBookEvent ( { "event" : "mChoice" , "act" : answerInfo , "div_id" : this . divid } ) ;
400+ this . logBookEvent ( { "event" : "mChoice" , "act" : answerInfo , "div_id" : this . divid } ) ;
396401} ;
397402
398403
@@ -444,7 +449,7 @@ MultipleChoice.prototype.populateMCMFLocalStorage = function () {
444449
445450MultipleChoice . prototype . logMCMFsubmission = function ( ) {
446451 var answerInfo = "answer:" + this . givenArray [ 0 ] + ":" + ( this . givenArray [ 0 ] == this . correctIndexList [ 0 ] ? "correct" : "no" ) ;
447- logBookEvent ( { "event" : "mChoice" , "act" : answerInfo , "div_id" : this . divid } ) ;
452+ this . logBookEvent ( { "event" : "mChoice" , "act" : answerInfo , "div_id" : this . divid } ) ;
448453} ;
449454
450455MultipleChoice . prototype . renderMCMFFeedback = function ( correct , feedbackText ) {
0 commit comments