This repository was archived by the owner on Jun 7, 2023. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ export default class SelectOne extends RunestoneBase {
3737 this . not_seen_ever = $ ( opts . orig ) . data ( "not_seen_ever" ) ;
3838 this . selector_id = $ ( opts . orig ) . first ( ) . attr ( "id" ) ;
3939 this . primaryOnly = $ ( opts . orig ) . data ( "primary" ) ;
40+ this . isAB = $ ( opts . orig ) . data ( "ab" ) ;
4041 opts . orig . id = this . selector_id ;
4142 }
4243 /**
@@ -72,6 +73,9 @@ export default class SelectOne extends RunestoneBase {
7273 if ( this . primaryOnly ) {
7374 data . primary = this . primaryOnly ;
7475 }
76+ if ( this . isAB ) {
77+ data . AB = this . isAB ;
78+ }
7579 let opts = this . origOpts ;
7680 let selectorId = this . selector_id ;
7781 let request = new Request ( "/runestone/ajax/get_question_source" , {
Original file line number Diff line number Diff line change 3333# ----------------------------------
3434from docutils import nodes
3535from docutils .parsers .rst import directives
36- from sqlalchemy import Table
3736
3837# local imports
3938# -------------
4039from runestone .server .componentdb import (
41- addAssignmentQuestionToDB ,
4240 addQuestionToDB ,
4341 addHTMLToDB ,
44- get_engine_meta ,
4542 maybeAddToAssignment ,
4643)
4744from runestone .common .runestonedirective import (
4845 RunestoneIdDirective ,
49- RunestoneNode ,
50- add_i18n_js ,
5146)
5247
5348
5449TEMPLATE = """
5550<div class="runestone alert alert-warning">
56- <div data-component="selectquestion" id={component_id} {selector} {points} {proficiency} {min_difficulty} {max_difficulty} {autogradable} {not_seen_ever} {primary}>
51+ <div data-component="selectquestion" id={component_id} {selector} {points} {proficiency} {min_difficulty} {max_difficulty} {autogradable} {not_seen_ever} {primary} {AB} >
5752 <p>Loading ...</p>
5853</div>
5954</div>
@@ -96,6 +91,7 @@ class SelectQuestion(RunestoneIdDirective):
9691 "autogradable" : directives .flag ,
9792 "not_seen_ever" : directives .flag ,
9893 "primary" : directives .flag ,
94+ "ab" : directives .flag ,
9995 }
10096 )
10197
@@ -170,6 +166,11 @@ def run(self):
170166 else :
171167 self .options ["primary" ] = ""
172168
169+ if "ab" in self .options :
170+ self .options ["AB" ] = "data-ab=true"
171+ else :
172+ self .options ["AB" ] = ""
173+
173174 maybeAddToAssignment (self )
174175
175176 res = TEMPLATE .format (** self .options )
You can’t perform that action at this time.
0 commit comments