@@ -1433,7 +1433,7 @@ function assignmentInfo() {
14331433 $ ( "#nopause" ) . val ( assignmentData . nopause ) ;
14341434 $ ( "#nofeedback" ) . val ( assignmentData . nofeedback ) ;
14351435 $ ( "#assign_is_peer" ) . val ( assignmentData . is_peer ) ;
1436- $ ( "#peer_async_visible" ) . val ( assignmentData . peer_async_visible ) ;
1436+ $ ( "#peer_async_visible" ) . val ( assignmentData . peer_async_visible ) ;
14371437 if ( assignmentData . visible === true ) {
14381438 $ ( "#assign_visible" ) . prop ( "checked" , true ) ;
14391439 } else {
@@ -1897,6 +1897,11 @@ async function renderRunestoneComponent(componentSrc, whereDiv, moreOpts) {
18971897 if ( typeof moreOpts === "undefined" ) {
18981898 moreOpts = { } ;
18991899 }
1900+ var author = null ;
1901+ if ( "author" in moreOpts ) {
1902+ author = moreOpts . author ;
1903+ delete moreOpts . author ;
1904+ }
19001905 patt = / ..\/ _ i m a g e s / g;
19011906 componentSrc = componentSrc . replace (
19021907 patt ,
@@ -1911,7 +1916,7 @@ async function renderRunestoneComponent(componentSrc, whereDiv, moreOpts) {
19111916 let componentKind = $ ( $ ( `#${ whereDiv } [data-component]` ) [ 0 ] ) . data ( "component" ) ;
19121917 // webwork problems do not have a data-component attribute so we have to try to figure it out.
19131918 //
1914- if ( ! componentKind &&
1919+ if ( ! componentKind &&
19151920 ( componentSrc . indexOf ( "handleWW" ) >= 0 ) || ( componentSrc . indexOf ( "webwork" ) >= 0 ) ) {
19161921 componentKind = "webwork" ;
19171922 }
@@ -1963,6 +1968,11 @@ async function renderRunestoneComponent(componentSrc, whereDiv, moreOpts) {
19631968 "orig_divid" ,
19641969 opt . acid || moreOpts . acid || opt . orig . id
19651970 ) ; // save the original divid
1971+ if ( author ) {
1972+ let authorInfo = document . createElement ( "p" ) ;
1973+ authorInfo . innerHTML = `Written by: ${ author } `
1974+ $ ( `#${ whereDiv } ` ) . append ( authorInfo ) ;
1975+ }
19661976 let editButton = document . createElement ( "button" ) ;
19671977 let constrainbc = document . getElementById ( "qbankform" ) . constrainbc . checked ;
19681978 $ ( editButton ) . text ( "Edit Question" ) ;
@@ -2038,6 +2048,7 @@ function questionBank(form) {
20382048 var cbc = form . constrainbc . checked ;
20392049 var obj = new XMLHttpRequest ( ) ;
20402050 var url = "/runestone/admin/questionBank" ;
2051+ var qlanguage = form . language . value ;
20412052 var data = {
20422053 variable : "variable" ,
20432054 chapter : chapter ,
@@ -2049,6 +2060,7 @@ function questionBank(form) {
20492060 term : term ,
20502061 competency : competency ,
20512062 isprim : isprim ,
2063+ language : qlanguage ,
20522064 } ;
20532065 jQuery . post ( url , data , function ( resp , textStatus , whatever ) {
20542066 if ( resp == "Error" ) {
@@ -2135,6 +2147,7 @@ function getQuestionInfo() {
21352147
21362148 await renderRunestoneComponent ( data . htmlsrc , "component-preview" , {
21372149 acid : question_name ,
2150+ author : data . author ,
21382151 } ) ;
21392152
21402153 var q_author = document . getElementById ( "q_author" ) ;
0 commit comments